README 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. fsaverage/mri.2mm
  2. These are volumes sampled into a 2mm space. The primary purpose of
  3. these is to support volume-based fMRI analysis as performed in
  4. FS-FAST. This 2mm space is the space that is used by default in
  5. FS-FAST to perform "talairach" group analysis (ie, in the mni305
  6. space). The raw functional data are sampled into this space when
  7. preproc-sess is run with the -mni305 flag. When a group analysis is
  8. done, the output space will be this 2mm space. It is possible to use a
  9. 1mm space, but this can create huge files.
  10. These files can be used to render the statistical results on a volume
  11. (though this is not really necessary as they can be rendered directly
  12. on the 1mm volumes). Also, the aseg.mgz created can be used to
  13. generate labels/masks of subcortical structures directly in the group
  14. average space. These can be used with mri_volcluster.
  15. These files were created with the following commands:
  16. # Resample each of these volumes using trilin
  17. foreach vol (orig brain brainmask mni305.cor T1)
  18. mri_vol2vol --mov ../mri/$vol.mgz --s fsaverage --tal \
  19. --o $vol.mgz --no-save-reg
  20. end
  21. # Resample the aseg
  22. mri_label2vol --seg ../mri/aseg.mgz --temp orig.mgz \
  23. --regheader ../mri/orig.mgz --o aseg.mgz
  24. Note: we don't want to do aparc+aseg because the surface-based
  25. labels should really be used in a surface-based analysis.
  26. # checks
  27. tkmedit -f T1.mgz -aux brain.mgz -seg ./aseg.mgz
  28. tkregister2 --mov ./orig.mgz --s fsaverage --regheader --reg junk
  29. #-----------------------------------------------------------
  30. Creation of subcortical mask. A challenge for doing analyses in three
  31. ROIs (left hemi, righ hemi, subcortical) is making the ROIs mutally
  32. exclusive while not excluding any voxels. This is particularly hard in
  33. this analysis because a cortical voxel in one subject can map to a
  34. subcortical voxel in another when using the transform to MNI305
  35. space.
  36. A map of the subcortical structures for each of the buckner 40 where
  37. mapped into the mni305 2mm space. A probability map was then
  38. created. This was repeated for the cortical ribbon and for cerebellum
  39. by itself.
  40. 1. An initial mask was created taking voxels with any
  41. subcortical origins in the native space as long as they had fewer than
  42. 80% cortex.
  43. 2. Cerebellum is a special case because it is so close to fusiform
  44. that it is easy to get bleed over. For this case, a mask was made of
  45. any cerebellum voxels that had at least 20% cortex. Any voxels in this
  46. mask were then excluded from the mask from step 1 to create a new
  47. mask.
  48. 3. Little islands were excluded by running connected components and
  49. taking the largest cluster.
  50. 4. This mask was then dialted by one voxel then eroded by one voxel to
  51. remove holes and make the final mask less jagged.
  52. # ----- Below For Version 5 --------------------#
  53. Everything above is for 5.1 and higher.
  54. The mask is created based on mri/subcort.prob.mgz which was created
  55. with make_average_subcort. subcort.prob.mgz is the raw probability of
  56. a voxel being in a subcortical gray matter structure based on the
  57. Buckner40. Inevitably, this mask will include more than just
  58. subcortial gray matter structures, but we would rather have the mask
  59. be too big than too small.
  60. # Resample into 2mm space
  61. mri_vol2vol --mov ../mri/subcort.prob.mgz \
  62. --s fsaverage --tal --o subcort.prob.mgz \
  63. --no-save-reg
  64. Threshold at .05 (meaning that at least 5% of the subjects at
  65. a voxel must have a subcortical label). Also dilate by 2 to
  66. expand the mask.
  67. mri_binarize --i subcort.prob.mgz --min .05 \
  68. --dilate 2 --o subcort.mask2.mgz
  69. Erode by 1. The net result of dilating by 2 then eroding
  70. by 1 is that holes are filled in and the edges are
  71. a little smoother.
  72. mri_binarize --i subcort.mask2.mgz --min .5 \
  73. --erode 1 --o subcort.mask.mgz
  74. rm subcort.mask2.mgz
  75. #-----------------------------------------------------------
  76. Creation of registration matrix between the 2mm fsaverage/mni305 space
  77. and the 2mm mni152 space. This can be used to convert data in the 2mm
  78. fsaverage/mni305 space into the mni152 2mm space.
  79. set d = $SUBJECTS_DIR/fsaverage
  80. # Create registration matrix between the full 256^3, 1mm3
  81. # volume and the 2mm space (simple regheader)
  82. tkregister2 --mov $d/mri.2mm/brain.mgz --targ $d/mri/brain.mgz \
  83. --regheader --reg $d/mri.2mm/reg.2mm.dat --noedit
  84. # Registration between the fsaverage/mni305 subject (full 256^3, 1mm3)
  85. # and the 2mm mni152 space. This was created by hand.
  86. # $FREESURFER_HOME/average/mni152.register.dat
  87. # Compute the registration between the 2mm fsaverage space and the
  88. # mni152 2mm space by concatenating the two matrices above.
  89. mri_matrix_multiply -im $d/mri.2mm/reg.2mm.dat \
  90. -iim $FREESURFER_HOME/average/mni152.register.dat \
  91. -om $d/mri.2mm/reg.2mm.mni152.dat
  92. # Check the registration
  93. tkregister2 --mov $d/mri.2mm/brain.mgz \
  94. --targ $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz \
  95. --reg $d/mri.2mm/reg.2mm.mni152.dat
  96. # To view without reslicing
  97. tkmedit -f $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz \
  98. -overlay sig.nii -reg reg.2mm.mni152.dat
  99. # To do the conversion/reslicing, run something like
  100. mri_vol2vol --mov sig.nii --reg reg.2mm.mni152.dat \
  101. --targ $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz \
  102. --o sig.mni152.nii
  103. # To view with reslicing
  104. tkmedit -f $FSLDIR/data/standard/MNI152_T1_2mm.nii.gz \
  105. -overlay sig.mni152.nii