
fsaverage/mri.2mm

These are volumes sampled into a 2mm space. The primary purpose of
these is to support volume-based fMRI analysis as performed in
FS-FAST. This 2mm space is the space that is used by default in
FS-FAST to perform "talairach" group analysis (ie, in the mni305
space). The raw functional data are sampled into this space when
preproc-sess is run with the -mni305 flag. When a group analysis is
done (starting with isxconcat-sess), the output space will be this 2mm
space. It is possible to use a 1mm space, but this can create huge
files.

These files can be used to render the statistical results on a volume
(though this is not really necessary as they can be rendered directly
on the 1mm volumes). Also, the aseg.mgz created can be used to
generate labels/masks of subcortical structures directly in the group
average space. These can be used with mri_volcluster.

These files were created with the following commands:

# Resample each of these volumes using trilin
foreach vol (orig brain brainmask mni305.cor T1)
  mri_vol2vol --mov ../mri/$vol.mgz --s fsaverage --tal \
  --o $vol.mgz --no-save-reg
end

# Resample the aseg 
mri_label2vol --seg ../mri/aseg.mgz --temp orig.mgz \
  --regheader ../mri/orig.mgz --o aseg.mgz

Note: we don't want to do aparc+aseg because the surface-based 
labels should really be used in a surface-based analysis.

# checks
tkmedit -f T1.mgz -aux brain.mgz -seg ./aseg.mgz
tkregister2 --mov ./orig.mgz --s fsaverage --regheader --reg junk

#-----------------------------------------------------------

Creation of subcortical mask. The mask is created based on
mri/subcort.prob.mgz which was created with
make_average_subcort. subcort.prob.mgz is the raw probability of a
voxel being in a subcortical gray matter structure based on the
Buckner40. Inevitably, this mask will include more than
just subcortial gray matter structures, but we would rather
have the mask be too big than too small.

# Resample into 2mm space
mri_vol2vol --mov ../mri/subcort.prob.mgz \
  --s fsaverage --tal --o subcort.prob.mgz \
  --no-save-reg

Threshold at .05 (meaning that at least 5% of the subjects at 
a voxel must have a subcortical label). Also dilate by 2 to
expand the mask.

mri_binarize --i subcort.prob.mgz --min .05 \
  --dilate 2 --o subcort.mask2.mgz

Erode by 1. The net result of dilating by 2 then eroding
by 1 is that holes are filled in and the edges are 
a little smoother.

mri_binarize --i subcort.mask2.mgz --min .5 \
  --erode 1 --o subcort.mask.mgz

rm subcort.mask2.mgz
