Processing high resolution data with an isotropic resolution other than 1mm³ with Freesurfer (Version 5.1+)
NOTE- AS OF DEV AUG. 2015 and stable6, THESE MANUAL MODIFICATIONS ARE NO LONGER NECESSARY. THERE IS NOW A -hires FLAG FOR RECON-ALL. SEE SubmillimeterRecon
Notes from Falk Lüsebrink on the modifications to the default recon-all stream necessary to process high-resolution data (< 1mm), used in his paper: Cortical thickness determination of the human brain using high resolution 3T and 7T MRI data.
For best results I advise to do an inhomogeneity correction by division before processing the data. See T1 weighted Brain Images at 7 Tesla Unbiased for Proton Density, T2* contrast and RF Coil Receive B1 Sensitivity with Simultaneous Vessel Visualization. The "corrected by division" image can be generated in SPM by first to aligning the MP-RAGE and the GE by co-registration. Afterwards use the image calculator to do the division using the formula: (i1./i2 .* (i2>20)) .* 100. The value of 20 depends on the image intensity and 100 is simply a scaling facotr (i1= MP-RAGE, i2= GE)
First: downsample high resolution data to 1mm and process completely
- SUBJ=ab11_05mm_downsampled
- This will be the name of your subject
- recon-all -motioncor -talairach -tal-check -i ~/data/ab11_05mm.nii -s $SUBJ
- Adjust the path to your input file accordingly.
- If the talairach registration fails an automated correction is being performed but for whatever reason the result is not being used, try:
- cp $SUBJECTS_DIR/$SUBJ/mri/transforms/talairach.auto.xfm $SUBJECTS_DIR/$SUBJ/mri/transforms/talairach.xfm
- recon-all -tal-check -s $SUBJ
If it still fails try looking at the manual talairach registration in the wiki of Freesurfer.
- mri_nu_correct.mni --i $SUBJECTS_DIR/$SUBJ/mri/orig.mgz --o $SUBJECTS_DIR/$SUBJ/mri/nu.mgz --proto-iters 1000 --distance 15 --fwhm 0.15 --n 1 --uchar $SUBJECTS_DIR/$SUBJ/mri/transforms/talairach.xfm
- N3 Algorithm for inhomogeneity correction with optimized parameters for 7T data. Works well with 1mm and 0.5mm MP-RAGE data and "corrected by division"-MP-RAGE data.
- recon-all -mprage -normalization -skullstrip -s $SUBJ
- Visualize brainmask.mgz before continuing. If skullstripping does not look satisfactory, try:
- mri_watershed -T1 -atlas -h 35 -brain_atlas $FREESURFER_HOME/average/RB_all_withskull_2008-03-26.gca $SUBJECTS_DIR/$SUBJ/mri/transforms/talairach_with_skull.lta $SUBJECTS_DIR/$SUBJ/mri/T1.mgz $SUBJECTS_DIR/$SUBJ/mri/brainmask.auto.mgz
- If small structures are still attached to the brain, try:
- mri_gcut -110 -mult $SUBJECTS_DIR/$SUBJ/mri/brainmask.auto.mgz $SUBJECTS_DIR/$SUBJ/mri/T1.mgz $SUBJECTS_DIR/$SUBJ/mri/brainmask.auto.mgz
- If it looks satisfactory: cp $SUBJECTS_DIR/$SUBJ/mri/brainmask.auto.mgz $SUBJECTS_DIR/$SUBJ/mri/brainmask.mgz
- Visualize brainmask.mgz before continuing. If skullstripping does not look satisfactory, try:
- recon-all -autorecon2 -autorecon3 -mprage -s $SUBJ
Second: process high resolution data and use downsampled data whenever needed
- SUBJECT=ab11_05mm
- This will be the name of your subject
- recon-all -cm -motioncor -talairach -tal-check -i ~/data/ab11_05mm.nii -s $SUBJECT
- Adjust the path to your input file accordingly.
- If the talairach registration fails an automated correction is being performed but for whatever reason the result is not being used, try:
- cp $SUBJECTS_DIR/$SUBJECT/mri/transforms/talairach.auto.xfm $SUBJECTS_DIR/$SUBJECT/mri/transforms/talairach.xfm
- recon-all -tal-check -s $SUBJECT
If it still fails try looking at the manual talairach registration in the wiki of Freesurfer.
- mri_nu_correct.mni --cm --i $SUBJECTS_DIR/$SUBJECT/mri/orig.mgz --o $SUBJECTS_DIR/$SUBJECT/mri/nu.mgz --proto-iters 1000 --distance 15 --fwhm 0.15 --n 1 --uchar $SUBJECTS_DIR/$SUBJECT/mri/transforms/talairach.xfm
- N3 Algorithm for inhomogeneity correction with optimized parameters for 7T data. Works well with 1mm and 0.5mm MP-RAGE data and "corrected by division"-MP-RAGE data.
- recon-all -cm -mprage -normalization -s $SUBJECT
- mri_convert -rl $SUBJECTS_DIR/$SUBJECT/mri/orig.mgz -rt nearest $SUBJECTS_DIR/$SUBJ/mri/aseg.auto_noCCseg.mgz $SUBJECTS_DIR/$SUBJECT/mri/aseg.auto_noCCseg.mgz
- This upsamples the aseg.auto_noCCseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
- mri_convert -rl $SUBJECTS_DIR/$SUBJECT/mri/orig.mgz -rt nearest $SUBJECTS_DIR/$SUBJ/mri/aseg.mgz $SUBJECTS_DIR/$SUBJECT/mri/aseg.mgz
- This upsamples the aseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
- mri_convert -rl $SUBJECTS_DIR/$SUBJECT/mri/orig.mgz -rt nearest $SUBJECTS_DIR/$SUBJ/mri/brain.mgz $SUBJECTS_DIR/$SUBJECT/mri/brainmask.hires.mgz
- This upsamples the brainmask.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
- mri_mask $SUBJECTS_DIR/$SUBJECT/mri/T1.mgz $SUBJECTS_DIR/$SUBJECT/mri/brainmask.hires.mgz $SUBJECTS_DIR/$SUBJECT/mri/brainmask.mgz
- This creates the brainmask.mgz of the high resolution data by masking the high resolution T1.mgz by the upsampled brainmask of the formerly downsampled dataset.
- recon-all -gcareg -canorm -s $SUBJECT
- mri_normalize -mprage -noconform -mask $SUBJECTS_DIR/$SUBJECT/mri/brainmask.mgz $SUBJECTS_DIR/$SUBJECT/mri/norm.mgz $SUBJECTS_DIR/$SUBJECT/mri/brain.mgz
- recon-all -maskbfs -segmentation -fill -tessellate -s $SUBJECT
- recon-all -smooth1 -inflate1 -qsphere -hemi lh -log $SUBJECTS_DIR/$SUBJECT/scripts/recon-all.lh.log -s $SUBJECT
- recon-all -smooth1 -inflate1 -qsphere -hemi rh -log $SUBJECTS_DIR/$SUBJECT/scripts/recon-all.rh.log -s $SUBJECT
- To speed up the processing of the data (which takes quite long) run the two commands above in two seperate terminals by processing each hemisphere individually.
- cp $SUBJECTS_DIR/$SUBJECT/surf/lh.orig.nofix $SUBJECTS_DIR/$SUBJECT/surf/lh.orig
- cp $SUBJECTS_DIR/$SUBJECT/surf/rh.orig.nofix $SUBJECTS_DIR/$SUBJECT/surf/rh.orig
- This is just a poor work-around as the stage "fix" of recon-all might take weeks to finish...
- recon-all -white -smooth2 -inflate2 -autorecon3 -hemi lh -log $SUBJECTS_DIR/$SUBJECT/scripts/recon-all.lh.log -s $SUBJECT
- recon-all -white -smooth2 -inflate2 -autorecon3 -hemi rh -log $SUBJECTS_DIR/$SUBJECT/scripts/recon-all.rh.log -s $SUBJECT
- To speed up the processing of the data (which takes quite long) run the two commands above in two seperate terminals by processing each hemisphere individually.