My raw data is already in tlrc space : -- applying input view as +tlrc


I am kinda confused on something odd.

I am running a script on two datasets :                                                                \
             -subj_id $h                                                      \
             -blocks despike tshift align tlrc volreg mask combine \
             -copy_anat anat.nii.gz                                     \
             -echo_times 9.1 25 39.6 54.3                          \
             -reg_echo 2                                                     \
             -dsets_me_run   ECHO*.nii.gz                        \
             -tcat_remove_first_trs 2                                  \
             -volreg_align_to MIN_OUTLIER                     \
             -volreg_tlrc_warp                                            \
             -align_epi_strip_method 3dSkullStrip             \
             -align_opts_aea -giant_move                         \
             -cmass cmass+a                                            \
             -combine_method m_tedana_OC                  \
             -mask_epi_anat yes                                  

but it runns into several erros, on names, because the programs considers my data as being tlrc data. I don’t know how or why, as they have only been converted form dicom through dcm2niix_afni.

How can I change the view or space it is considered to be into ?

Thanks for any help

What is the output from:
nifti_tool -disp_hdr -field sform_code -field qform_code -infiles ECHO*.nii.gz anat.nii.gz

I expect that it will show a code of 2, which became ambiguous a while back (between as to whether it was in standard space or simply aligned to something). But it would be odd for dcm2niix[_afni] to make the xform codes something other than 1. I don’t see that behavior.

Anyway, assuming they are 2 and you are in the ambiguous case, try setting AFNI_NIFTI_VIEW to “orig” (maybe in your .afnirc file).

1 Like


From typing the command you proposed, I have this output :
N-1 header file ‘./BHsequence1/ECHO1/ECHO1orig.nii’, num_fields = 2
name offset nvals values

sform_code 254 1 2
qform_code 252 1 1

N-1 header file ‘./anat/anat.nii.gz’, num_fields = 2
name offset nvals values

sform_code 254 1 1
qform_code 252 1 1

So s-form for the EPI is 2 indeed.
I’ll try to change the nifti view, I don’t wee the file .afnirc, bu i’ll have a look on internet.


Hi @ztn . It is strange for the qform and sform codes to be different.
Anyway, if you do not have a $HOME/.afnirc file, you can copy the AFNI.afnirc file out of the abin directory (the directory where ‘afni’ is sitting) into the appropriate location ($HOME/.afnirc). See:
which afni
Then just add a line:
Does that seem reasonable?

P.S. Since the sform/qform codes differ, it might be worth verifying whether those transformation matrices are different. Use nifti_tool -disp_nim for that, and see whether the resulting qto_xyz and sto_xyz matrices are the same.

nifti_tool -disp_nim -infile BHsequence1/ECHO1/ECHO1orig.nii