@auto_tlrc Error - Problem Resampling

I appear to get an error converting anatomical data to MNI space. My old command used to use MNI152_T1_2009c+tlrc from a shared folder and this worked. The old working code was:

@auto_tlrc -base /usr/share/afni/atlases//MNI152_T1_2009c+tlrc. -input $sid.anat+orig.

However, in order to run my script through multiple servers and not risk two servers trying to access the same template file at the same time, I decided to copy the shared MNI152 template into my own folder with different names per subject using these lines:

cp /usr/share/afni/atlases/MNI152_T1_2009c+tlrc.HEAD $HomePath/MNI152_T1_2009c_$sid+tlrc.HEAD
cp /usr/share/afni/atlases/MNI152_T1_2009c+tlrc.BRIK.gz $HomePath/MNI152_T1_2009c_$sid+tlrc.BRIK.gz

Then, I changed my @auto_tlrc command as follows:

@auto_tlrc -base $Templates/MNI152_T1_2009c_$sid+tlrc. -input $sid.anat+orig.

However, this no longer creates a tlrc version of my anatomy file. Instead I get the following error:

[b]*********** Warning *************
Dataset centers are 54.027475 mm
apart. If registration fails, or if
parts of the original anatomy gets
cropped, try adding option
-init_xform AUTO_CENTER
to your @auto_tlrc command.


Padding …
++ 3dZeropad: AFNI version=AFNI_18.2.15 (Aug 28 2018) [64-bit]
++ output dataset: ./__ats_tmp__ref_MNI152_T1_2009c_CI_001_M4_40pad+tlrc.BRIK
Skull Stripping …
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 84, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 96, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 108, avoid_vent -1
Warning 3dSkullStrip:****************
Surface self intersecting! trying again:
smoothing of 120, avoid_vent -1
Warning 3dSkullStrip: Stubborn intersection remaining at smoothing of 120. Ignoring it.The intensity in the output dataset is a modified version
of the intensity in the input volume.
To obtain a masked version of the input with identical values inside
the brain, you can either use 3dSkullStrip’s -orig_vol option
or run the following command:
3dcalc -a ./CI_001_M4.anat+orig -b ./CI_001_M4.anat_ns+orig -expr ‘a*step(b)’
-prefix ./CI_001_M4.anat_ns_orig_vol
to generate a new masked version of the input.
Resampling …
invalid master dataset <__ats_tmp__ref_MNI152_T1_2009c_CI_001_M4_40pad+tlrc>
Failed to resample[/b]

I am confused because I thought I had copied everything correctly and the only thing I really changed was the parent auto_tlrc file, which should be an exact copy of what I used to use. What am I doing wrong and how can I fix it?

I am running:
Ubuntu version 14.04, AFNI Precompiled binary linux_openmp_64: Aug 28 2018 (Version AFNI_18.2.15)

Thanks!

Did you set $Templates to point to the right directory? I don’t think you really need to copy the base dataset over to another directory. We often use a single template with many simultaneous @auto_tlrc operations, so I don’t think this is necessary.

The Templates does point to the correct directory. I copied it over, simply because I want to run my script on multiple servers. So for instance if I have 4 servers and 4 subjects, I want to run one subject per terminal. I was concerned that if I just copied from the base dataset directly, that there may be an error if more than one server is trying to access the same base dataset (I am not sure if that is true, but I have run into errors with trying to run scripts across multiple servers before). So I wanted to make a copy of the base template per subject, so that each server would be looking at their own base template for @auto_tlrc.

Thanks!

I added the -init_xform AUTO_CENTER to see if that would help.

Interestingly I am now seeing that for some of them the warping does converge. But for many of them they do not.

Thanks

Centering your datasets with that option or with @Align_Centers is often useful. I prefer the @Align_Centers method, but both work. I also set -maxite to somehting like 50 and -OK_maxite to continue if 3dWarpDrive is wavering between two equally okay solutions. I’m not sure any of this has anything to do with copying your base datasets to a new directory though. Also consider auto_warp.py for nonlinear warping and the @SSwarper script for skullstripping and aligning to some select base templates like the MNI 2009 template.

It appears that adding the -OK_maxite option has done the trick!

Thank you very much!