afni_proc.py cannot find template

Dear Colleagues,

Hi. I hope everyone is doing well. I’m sure I’m missing something simple, but after reading the relevant sections of the afni_proc.py help information and several tests, any help would be appreciated. After copying

anat.nii
/misc/prog/afni/current.x86_64/TT_N27+tlrc*

and the other necessary files to the working directory, this works.

@auto_tlrc
-dx 2.5
-dy 2.5
-dz 2.4
-suffix _tl
-base TT_N27+tlrc
-input anat.nii

However, this gives me “Error: Template TT_N27+tlrc could not be located.”

afni_proc.py
-blocks align tlrc volreg
-tcat_remove_first_trs 0
-align_opts_aea
-Allineate_opts
-warp shift_rotate
-newgrid 2.0
-epi_base 0
-epi2anat
-giant_move
-anat_has_skull yes
-tlrc_base TT_N27+tlrc
-tlrc_suffix _tl
-tlrc_opts_at
-dx 2.5
-dy 2.5
-dz 2.4
-volreg_align_to first
-volreg_opts_vr
-float
-1Dfile 20170223_0434_motion.1D
-maxdisp1D 20170223_0434_motion_maxdisp.1D
-dsets
…/original_files/20170223_0434.nii
-copy_anat …/original_files/anat.nii
-out_dir ./$subj.results
-subj_id $subj
-script proc.$subj
-scr_overwrite
-verb 1
-execute

This information might also help.

(base) picchionid@raid ~> afni -ver
Precompiled binary linux_openmp_64: Aug 28 2020 (Version AFNI_20.2.15 ‘Aulus Vitellius’)

(base) picchionid@raid ~> which afni
/misc/prog/bin/afni

Sincerely,

Dante

AFNI programs generally look in the AFNI binary directory (~/abin or /misc/prog/bin in your case) for atlases and templates, but you can put these datasets elsewhere if you want. Copying the dataset to your starting directory works for @auto_tlrc because that program does all its processing there in the same directory. afni_proc.py, on the other hand, creates a new directory and does its processing there. You could specify the full path to the base template to work around this difference as in “-tlrc_base /misc/prog/afni/current.x86_64/TT_N27+tlrc”. Alternatively, set an AFNI environment variable to tell AFNI where to look for extra datasets -

“AFNI_GLOBAL_SESSION”
“AFNI_SUPP_ATLAS_DIR”
“AFNI_ATLAS_PATH”
“AFNI_PLUGINPATH”

Consider setting one of these in your .afnirc file in your home directory. The program, @FindAfniDsetPath can be used to check your settings. That program uses the same environment variables.

1 Like

Daniel,

Success. As always, thanks for your patient and competent help.

Sincerely,

Dante

Another option would be to use -copy_files with the template, but that would duplicate the template in every subject directory (which we keep thinking about doing anyway).

EDIT: To summarize, there should be 3 (+1) ways to do it:

  1. Put it in an expected location, as Daniel references.
  2. Pass it with -copy_files.
  3. Use a full path to the file.

(4. Pester Rick into making it work as is.)

  • rick
1 Like