FreesurferGoodies/batchcreateRegistrationFiles - MRC CBU Imaging Wiki
CbuImaging: FreesurferGoodies/batchcreateRegistrationFiles

#
# edit to your needs and save as batchcreateRegistrationFiles.csh in your favorite path location and run
# > sh batchcreateRegistrationFiles.csh

## variables

## Freesurfer directory
thePath='/imaging/yourusername/yourproject/subjects'

subjects=(
'CBUXXXXXX' \  
'CBUYYYYYY' \ 
)

## Processing:

nsubjects=${#subjects[*]}
lastsubj=`expr $nsubjects - 1`

for m in `seq 0 ${lastsubj}`
do
        echo "======================================================="
        echo " "
        echo " Creating register.dat and v2r.dat files"
        echo " "
        echo "======================================================="
        
cd ${thePath}/${subjects[m]}/whereMySPMfilesAre
echo "the current directory is `pwd`"
tkregister2 \
 --mov ${thePath}/${subjects[m]}/whereMySPMfilesAre/mean*.nii \
 --s ${subjects[m]} \
 --regheader \
 --noedit \
 --reg register.dat 

mri_info ${thePath}/${subjects[m]}/whereMySPMfilesAre/mean*.nii --vox2ras-tkr --o v2r.dat
done # subjects

CbuImaging: FreesurferGoodies/batchcreateRegistrationFiles (last edited 2013-03-07 21:24:03 by localhost)