FreesurferGoodies/batchcreateRegistrationFiles - MRC CBU Imaging Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
Type the odd characters out in each group: abz2a 125t7 HhHaHh year.s 5433r21 worl3d

location: 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