afni_proc.py refuses to run on a copy of a tlrc nonlinear warp

Hi all,

I am seeing what seems to a very weird problem with afni_proc.py. Maybe I am making a mistake which I fail to see, but I can’t really see one.

I should also say that I have a good workaround, so if no one wants to look at this, it’s fine. I am just curious what’s going on, and if there is my mistake I would like to learn about it. In the future there may be no workaround

The background is that I am experimenting with template alignment in afni_proc.py, basically comparing the standard epi-anat-template alignment to epi-anat2-anat-template. Anat-template has been done externally. This is an NHP dataset, the pipeline is based on MACAQUE_DEMO_REST but modified in several ways. Daniel and Paul may recognize the project, I have been bothering them with questions about it before. I had to put it aside for some time, now I am back on it.

Because the alignment between two anats is affine, I am not touching the non-linear part of the anat-template alignment. I am just passing it to afni_proc.py via -tlrc_NL_warped_dsets, along with the linear part, which is a catenation of the linear part of anat-template with fully affine anat2-anat.

Too keep things tidy, I copy the non-linear warp to another folder and I give it a different name. This seems to throw off afni_proc, even though I am confirming that both copies of the file are identical.

Here are relevant steps (I am pasting echos not scripts so that the picture is not obscured by variables).

Thanks in advance for any insights.

#copy anat-template nonlinear transform to another directory and another name
cd /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/
cp /media/sf_FC_SATIETY/ANALYSIS/data_01_aw/subjDX7R/subjDX7R_anat_shft_WARP.nii.gz subjDX7R.sess01.MDEFT_TMPLT_nonlin.nii.gz

attempt afni_proc.py which includes

-tlrc_NL_warped_dsets /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_alTMPL_nsu+tlrc /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_lin.1D /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_nonlin.nii.gz

afni_proc.py refuses to run with this message

** dataset ‘/media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_nonlin.nii.gz’ is used as non-linear warp, but does not appear to be one
** invalid block : tlrc

attempt afni_proc.py which includes

-tlrc_NL_warped_dsets /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_alTMPL_nsu+tlrc /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_lin.1D /media/sf_FC_SATIETY/ANALYSIS/data_01_aw/subjDX7R/subjDX7R_anat_shft_WARP.nii.gz

afni_proc.py runs

the two files appear identical

diff -s /media/sf_FC_SATIETY/ANALYSIS/data_01_aw/subjDX7R/subjDX7R_anat_shft_WARP.nii.gz /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_nonlin.nii.gz
Files /media/sf_FC_SATIETY/ANALYSIS/data_01_aw/subjDX7R/subjDX7R_anat_shft_WARP.nii.gz and /media/sf_FC_SATIETY/ANALYSIS/data_015_md/subjDX7R/sess01/subjDX7R.sess01.MDEFT_TMPLT_nonlin.nii.gz are identical

I will put a little more detail there, but to prevent what was a common mistake in passing the warps, afni_proc.py current expects the name to terminate with the @SSwarper trailer _WARP.nii (and maybe .gz).

  • rick

Thank you, this solved the problem!

May I suggest adding this information to the error message and/or to afni_proc’s help under -tlrc_NL_warped_dsets? Unless it is thought that this would lead to people making the mistake and “fixing” it by renaming the file instead of correcting the actual mistake.

Already added to the error message, thanks! :slight_smile:

  • rick

Thanks and sorry that I missed that you said that before :slight_smile: