FSL Tissue Segmentation Question

Hi all! I am a student at Rutgers University working on an independent project to delve into bioinformatics and neuroimaging. For this project, I used FSL FAST to segment nifti MRI images into grey matter and white matter. When looping through the individual voxels, the possible values they take on are {0.0, 1.0, 2.0, 3.0, 4.0, 5.0}. Which kinds of tissue do each of these numbers correspond to? i.e. are 0 and 1 CSF, are 4 and 5 white matter?

The current goal is to write a script that can calculate/estimate the volume of each kind of tissue from the segmented MRI image.

1 Like

Have you looked at fslstats?



Assuming you’ve got an extracted brain image called T1_brain.nii.gz:

$ fast -b -B -o T1_brain T1_brain

will give you (in addition to the bias corrected brain and the bias field):

  • T1_brain_pve_I: the Partial Volume Estimates (PVE) for CSF (I=0), Gray Matter (I=1) and White Matter (I=2), i.e. FAST’s estimated fraction of each tissue present in that voxel;
  • T1_brain_mixeltype: an image with an additional three classes of “mixels”, voxels that FAST reckons are mixtures of tissues. Here, the integer values reported in each voxel are the three pure tissues (as above), plus I=3 CSF-GM boundary tissue, I=4 CSF-WM boundary tissue, and I=5 GM-WM boundary tissue. (Is this the image you’ve been looking at?)

The FAQ @JarodRoland has pointed you to has the commands to extract the total volumes from the PVE estimates (which should be all you need), but if you’re also interested in the pure and boundary tissue estimates you could use fslmaths to create masks of each, e.g. for pure White Matter:

fslmaths T1_brain_mixeltype -thr 1.5 -uthr 2.5 -bin T1_brain_WM_pure -odt in

Cheers, Tom