Skip to content

36. Quick sheet about Freesurfer reconstructions

Fa-Hsuan Lin edited this page Jun 23, 2023 · 8 revisions

file structure

An environment variable $SUBJECTS_DIR should be set first. Within the subject folder, files are organized as the following:


SUBJECTS_DIR

  • subject 0001
    • mri
      • transforms
      • orig
    • surf
    • label
    • bem
    • stats
    • scripts
    • tmp
    • trash
    • touch
  • subject 0002
  • subject 0003

file formats

Freesurfer reconstructions use different file formats for different purposes

  • .mgz, .mgh: brain volume images (3D); typically within mri folder
  • lh.xxxx, rh.xxxx: brain surface models and information; typically within surf folder

Some details for each folder

NOTE: useful page here.

NOTE: You can use freeview for visualizing brain volumes and surfaces as shown below.

  • mri

    • orig.mgz: the MRI used for reconstructing everything
    • T1.mgz: the MRI after intensity normalization (and other correction)
    • brain.mgz: brain volume after skull stripping
    • wm.mgz: white matter volume
    • aseg.mgz: brain segmentation labels
    • orig.mgz: the input MRI volume for FreeSurfer reconstruction
  • surf

    • ?h.pial: pial surface model
    • ?h.smoothwm: white-gray matter boundary surface model
    • ?h.inflated: inflated brain surface model
    • ?h.sphere: spherical brain surface model
    • ?h.curv: local cortex curvature
    • ?h.thickness: local cortex thickness
  • label

    • ?h.aparc.annot: ROIs for cortical parcellation
  • stats

    • brainvol.stats: brain volume information
  • bem This folder is typically used in EEG/MEG source modeling to store Boundary Element Model data.

NOTE: All vertices are consistent across brain surface models. This means that vertex #1 in lh.pial, for example, is the same vertex #1 in lh.inflated. The difference is the vertex coordinates in different models. The (x,y,z) of vertex #1 in lh.pial is different from (x,y,z) of vertex #1 in lh.smoothwm. Surface triangulations are the same but their 3D coordinates are different across models.

Visualization in Matlab

  1. Cortical thickness (in mm).
val=inverse_read_curv_new('lh.thickness'); hist(val,100); %show the histogram of left hemisphere cortical thickness

  1. Show brain surface model
[vv, ff] = read_surf('lh.smoothwm'); %matlab routine in $FREESURFER_HOME/matlab/read_surf.m
figure; patch('vertices',vv,'faces',ff+1,'edgecolor','none','facecolor',[1 1 0].*0.7); lighting phong; camlight; axis vis3d equal;

  1. Show brain surface model with cortical thickness
val=inverse_read_curv_new('lh.thickness');

[vv, ff] = read_surf('lh.smoothwm');

fvdata=repmat([1 1 1],[size(vv,1),1]);
    
c_idx=find(val(:)>=1.5);
overlay_cmap=autumn(80); %overlay colormap;
fvdata(c_idx,:)=inverse_get_color(overlay_cmap,val(c_idx),3,1.5); %get color for vertices with thickness > 1.5 mm; the color is saturated at 3 mm
    

figure; 

patch('vertices',vv,'faces',ff+1,'edgecolor','none','FaceVertexCData',fvdata,'CDataMapping','direct','facecolor','interp','edgecolor','none');   

lighting phong; camlight; axis vis3d equal;

  1. Show brain volume
v=MRIread('brain.mgz');
fmri_mont(v.vol);

Clone this wiki locally