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 help information and several tests, any help would be appreciated. After copying


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

-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.”
-blocks align tlrc volreg
-tcat_remove_first_trs 0
-warp shift_rotate
-newgrid 2.0
-epi_base 0
-anat_has_skull yes
-tlrc_base TT_N27+tlrc
-tlrc_suffix _tl
-dx 2.5
-dy 2.5
-dz 2.4
-volreg_align_to first
-1Dfile 20170223_0434_motion.1D
-maxdisp1D 20170223_0434_motion_maxdisp.1D
-copy_anat …/original_files/anat.nii
-out_dir ./$subj.results
-subj_id $subj
-script proc.$subj
-verb 1

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



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., 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 -


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


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



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