Hello freesurfer experts:
I am doing the following steps in the script below:
(1) Use recon -all to calculate the freesurfer T1 anatomical which requires a single DICOM file to be calculated from each subject.
(2) Use the functional Bold time series data originally derived from DICOM files for that subject and preprocess them: correct for slice timing and do regular AFNI registration of the images using the first volume as reference but do not spatially smooth.
(3) We then use this Bold series after preprocessing by converting AFNI to NifTi by using 3dAFNItoNIFTI and inputing it into bbregister which computes a spatial registration matrix between the bold image and the T1 anatomical.
(4) We now compute a coregistration using mri_cvs_register from the individual brain to a template brain for the volumetric non-linear morphing. It requires an anatomical scan of the subject that has been processed in freesurfer as in step (1). In our case we will use the standard brain cvs_avg35_inMNI152 as the target/template.
(5) Next, we move the bold image from the individual space into the standard or template space. We use the command mri_vol2vol where we input the AFNI Bold image converted to NifTi and the bbregister matrix and template in (4) above to obtain the Bold in this template space.
The script that does this is given below:
# FreeSurfer commands
nmr-std-env
setenv SUBJECTS_DIR <path to the directory where all MRI data for this study reside>
setenv SUBJECT <my subject code>
cd $SUBJECTS_DIR
# First, run FS recon-all on the T1 (MEMPRAGE) anatomical as usual.
recon-all -subjid $SUBJECT -i temp_${SUBJECT}/001.mgz -all -openmp 4
# Second, do co-registration at the individual level between the hires anatomical and the bold (functional) image. # In the below example the already motion corrected (and otherwise preprocessed) bold data for run 005 are in # $SUBJECTS_DIR/$SUBJECT/bold/005/005.mc.nii # Use boundary-based registration (bbregister) - this by far the most accurate tool. # Note: This is rigid 6 DOF. It is almost always best to use rigid DOF 6 for within-subject registration.
bbregister --mov $SUBJECT/bold/005/005.mc.nii --frame 0 --bold --s $SUBJECT --init-fsl --reg boldregister.dat --fslmat ${SUBJECT}_anat2bold.mat
# Just in case, let us make FSL type coregistration matrices as well.
convert_xfm -omat ${SUBJECT}_bold2anat.mat -inverse ${SUBJECT}_anat2bold.mat
# Now, we will compute a group-level coregistration from the individual brain to a template brain for both volumetric non-linear morphing. # We will use the standard brain cvs_avg35_inMNI152 as the target/template.
mri_cvs_register --mov $SUBJECT --mni --outdir $SUBJECT/cvs_CVS35MNI152 --openmp 8
# Finally, we can move the bold image from the individual spac into the standard space:
mri_vol2vol \ --mov $SUBJECT/bold/005/005.mc.nii \ --targ $FREESURFER_HOME/subjects/cvs_avg35_inMNI152/mri/norm.mgz \ --o Grand_Average/${SUBJECT}_CVS35MNI152_005.mc.nii \ --m3z $SUBJECT/cvs_CVS35MNI152/final_CVSmorph_tocvs_avg35_inMNI152.m3z \ --noDefM3zPath \ --interp nearest \ --reg $SUBJECT/bold/boldregister.dat \ --no-save-reg \
We have successfully run the script but the result: /${SUBJECT}_CVS35MNI152_005.mc.nii is too large (47 gigs) to run on our computers using four runs for the next step which is AFNI 3dDeconvolve. We would like to down sample this Bold aligned to the template image file to the resolution and FOV of the original Bold image file in step (2) above. I believe freesurfer converts everything to freesurfer space (1mm^3 256^3) but instead we want the matrix to be 128X130X32 or downsized. How would you do this?
Thanks!
freesurfer@nmr.mgh.harvard.edu