FreesurferGoodies/convertToNifti - MRC CBU Imaging Wiki
location: FreesurferGoodies / convertToNifti

# this is an example of a script that will convert the freeSurfer orig.mgz high resolution, 
# to a nifti format (anat.nii) that will be readable by spm. This will allow coregistration 
# of the freeSurfer reference anatomical (anat.nii) to the source image (spm native space 
# anatomical image) and any other image of your choice (e.g. mean*.nii)

## variables

## Freesurfer directory


## Processing:

lastsubj=`expr $nsubjects - 1`

for m in `seq 0 ${lastsubj}`
        echo "======================================================="
        echo " "
        echo " converting high resolution T1 image from .mgz to .nii"
        echo " "
        echo "======================================================="  

cd ${thePath}/${subjects[m]}/mri/
echo "the current directory is `pwd`"

mri_convert \
 orig.mgz \
done # converting .mgz to nifti format

CbuImaging: FreesurferGoodies/convertToNifti (last edited 2013-06-25 10:22:20 by IanCharest)