It would be useful to see the exact command that produced the error. There are two formats for the affine matrices in AFNI. To convert between the two, use cat_matvec.
The command I used to generate the matrix is:
3dAllineate -prefix anat_within_aligned -base ${subj}_avg_anat+orig -1Dmatrix_save align_to_avg -source anat+orig
And then I used that matrix in afni_proc.py:
afni_proc.py -subj_id $subj.vol
-blocks tshift align volreg scale
-copy_anat ${subj}avg_anat+orig
-dsets run*+orig.HEAD
-tcat_remove_first_trs 0
-align_opts_aea -pre_matrix $top_dir/align_to_avg.aff12.1D -cost lpa -partial_coverage -anat_has_skull ‘no’
-volreg_align_to MIN_OUTLIER
-volreg_align_e2a
-scr_overwrite
-execute
The matrix doesn’t have any problem when I did surface analysis. But when I tried to use the same matrix to do the volume based analysis, it gave me that error.
Sorry, you’re missing one key piece of information. The files that end in “.aff12.1D” should have 12 values per row. If you redirect from another file or otherwise create a text file with 3 rows of 4 values, you should not use the .aff12.1D extension. Just use the .1D extension instead. Here are some example of how to use cat_matvec with these matrices. I start by creating a 4x3 matrix manually on the command line and then swap between the two formats.
% cp test.1D test2.aff12.1D
% cat_matvec test2.aff12.1D
** FATAL ERROR: File ‘test2.aff12.1D’ has 4 values per row, which isn’t 12
** Program compile date = Nov 9 2017
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.