History of AFNI updates  

|
December 13, 2016 08:32AM
Here is a script I have used recently to analyze a lot (198) of datasets. This script was used to warp the Cambridge subset of the FCON-1000 collection. It uses auto_warp.py, since that makes it easy to use the warped results with afni_proc.py in turn. The script below takes on the command line one argument, the subject ID; e.g, the command
tcsh warper.csh sub00156
will work on dataset anat_sub00156.nii.gz. I then submitted 198 runs of this script to the NIH Linux cluster.

The base.nii dataset to which the anat dataset is aligned was a 3dUnifize-d version of the MNI152_T1_2009c+tlrc.HEAD that is supplied with AFNI. This dataset is a nonlinearly registered version of the MNI template, and was created by MNI, not by the AFNI empire. This dataset was created with the command
3dUnifize -prefix base.nii -input MNI152_T1_2009c+tlrc -GM

I wrote this script partly because the default parameters to 3dSkullStrip didn't work well with these datasets, which have had part of the face region simply zero-ed out, which caused funny things to happen in some cases. The 3dSkullStrip parameters used below worked well for these cases, but of course you should check your results!

Note: running to minpatch=11 (as set at the top of the script) will take longer than the default 25 -- probably about twice as long. As I recall (this was months ago), each subject took about 2 hours to run -- which is why learning to use a cluster is handy, so the jobs can run in parallel.
#!/bin/tcsh

# set the subject ID and the minimum warp patch size

set sub  = $argv[1]
set minp = 11

# go to data directory

set topdir = /data/NIMH_SSCC/fcon1000.perm.test/Cambridge

cd $topdir/anat_orig

# create final output directory if needed

mkdir -p $topdir/anat_warped

# create temporary directory to hold the work, and copy data there

mkdir -p temp_$sub
cp anat_$sub.nii.gz base.nii temp_$sub
cd temp_$sub

# uniformize the T1 intensity

3dUnifize -prefix anatU_$sub.nii -input anat_$sub.nii.gz -GM

# strip skull

3dSkullStrip -input  anatU_$sub.nii  \
             -prefix anatS_$sub.nii  \
             -ld 33 -niter 777 -shrink_fac_bot_lim 0.777 -exp_frac 0.0666

# warp to the base dataset

auto_warp.py                    \
   -base base.nii               \
   -input anatS_$sub.nii        \
   -skull_strip_base  no        \
   -skull_strip_input no        \
   -unifize_input     no        \
   -qw_opts -noneg -pblur -minpatch $minp -workhard:0:4

# compress output datasets and move to final output directory

\rm awpy/base.nii

gzip awpy/*.nii

mv awpy $topdir/anat_warped/$sub.awpy

# delete the temporary directory

cd ..
\rm -rf temp_$sub

Subject Author Posted

nonlinear tlrc

CD-Dan December 05, 2016 09:51PM

Re: nonlinear tlrc

ptaylor December 06, 2016 12:33AM

Re: nonlinear tlrc

Daniel Glen December 12, 2016 04:29PM

Re: nonlinear tlrc

Bob Cox December 13, 2016 08:32AM