Differences between revisions 3 and 4
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= High Resolution Data Recon = = Processing high resolution data with an isotropic resolution other than 1mm³ with Freesurfer (Version 5.1+) =
Line 5: Line 5:

Processing high resolution data with an isotropic resolution other than 1mm³ with Freesurfer (Version 5.1)
Line 11: Line 9:
  * _This will be the name of your subject_   * This will be the name of your subject
Line 13: Line 11:
  * _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 [[http://www.freesurfer.net/fswiki/FsTutorial/Talairach][manual talairach registration]] in the wiki of Freesurfer._
  * 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 [[http://www.freesurfer.net/fswiki/FsTutorial/Talairach][manual talairach registration]] in the wiki of Freesurfer.
Line 19: Line 17:
  * _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._   * 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.
Line 21: Line 19:
  * _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:
   * 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
Line 30: Line 28:
  * _This will be the name of your subject_   * This will be the name of your subject
Line 32: Line 30:
  * _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 [[http://www.freesurfer.net/fswiki/FsTutorial/Talairach][manual talairach registration]] in the wiki of Freesurfer._
  * 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 [[http://www.freesurfer.net/fswiki/FsTutorial/Talairach][manual talairach registration]] in the wiki of Freesurfer.
Line 38: Line 36:
  * _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._   * 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.
Line 41: Line 39:
  * _This upsamples the aseg.auto_noCCseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data._   * This upsamples the aseg.auto_noCCseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
Line 43: Line 41:
  * _This upsamples the aseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data._   * This upsamples the aseg.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
Line 45: Line 43:
  * _This upsamples the brainmask.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data._   * This upsamples the brainmask.mgz of the formerly downsampled dataset and places it in the according folder of the high resolution data.
Line 47: Line 45:
  * _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._   * 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.
Line 53: Line 51:
  * _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._   * 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.
Line 56: Line 54:
  * _This is just a poor work-around as the stage "fix" of recon-all might take weeks to finish..._   * This is just a poor work-around as the stage "fix" of recon-all might take weeks to finish...
Line 59: Line 57:
  * _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._   * 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.

Processing high resolution data with an isotropic resolution other than 1mm³ with Freesurfer (Version 5.1+)

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.


For best results I advise to do an inhomogeneity correction by division before processing the data. 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 http://www.freesurfer.net/fswiki/FsTutorial/Talairach][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 -skulstrip -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
  • 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 http://www.freesurfer.net/fswiki/FsTutorial/Talairach][manual talairach registration in the wiki of Freesurfer.

  • mri_nu_correct.mni --cm --i $SUBJECT_DIR/$SUBJECT/mri/orig.mgz --o $SUBJECT_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.

HiResRecon (last edited 2016-08-16 17:00:02 by AllisonMoreau)