BARSTOOL Brain Segmentation - dwong263/MAGIQ GitHub Wiki

Overview

This tab allows you to segment the gray matter (GM), white matter (WM), and cerebrospinal fluid (CSF) areas in your skull-stripped reference anatomical images, producing GM, WM, and CSF masks. The interface within this tab is simply a wrapper for FSL FAST command-line program.

Prepare Images

First select the skull-stripped images you'd like to segment into GM, WM, and CSF areas. Click the Select Brain Extracted Image Files button and select your images. If you select multiple images, BARSTOOL will run the same FSL fast command with the same options for all of your selected images.

Select Image Type

Next, identify the "type" (T1-weighted, T2-weighted, or Proton Density weighted) of images you have selected. This is equivalent to setting the -t option for the FSL fast command. Note that BARSTOOL assumes all selected images are of the same type. Click the Confirm Image Type button to lock in your choice.

FSL FAST Settings

You can set additional FSL FAST settings here. Review the FSL FAST Options for more detail about these settings. The settings that you can set in BARSTOOL include:

  • Segmentation Spatial Smoothness:
    • Equivalent to the -H option.
    • MRF beta value for main segmentation phase (increasing this gives spatially smoother segmentations)
  • Number of Iterations During Bias-Field Removal:
    • Equivalent to the -I option.
    • Loop iterations during initial bias-field removal phase
  • Bias Field Smoothing Extent:
    • Equivalent to the -l option.
    • FWHM value in mm.

Click the Confirm FAST Settings button to lock in your parameter values.

Run Brain Segmentation

Run FSL fast with the above settings on all selected images by pressing the Run Partial Volume Segmentation (FSL FAST) button.

Note that this may take a while, and the interface may freeze as FSL fast is running. This is the perfect time to take a coffee break. You can check which image BARSTOOL is currently processing in the console.

For each selected image file, 6 files will be produced:

  • <selected image>_std_brain_mixeltype.nii.gz
  • <selected image>_std_brain_pve_0.nii.gz
  • <selected image>_std_brain_pve_1.nii.gz
  • <selected image>_std_brain_pve_2.nii.gz
  • <selected image>_std_brain_pveseg.nii.gz
  • <selected image>_std_brain_seg.nii.gz

<selected image>_std_brain_pve_0.nii.gz, <selected image>_std_brain_pve_1.nii.gz, and <selected image>_std_brain_pve_2.nii.gz, correspond to the CSF, GM, and WM estimations respectively. You can check these files to see how well FSL FAST performed.

<selected image>_std_brain_seg.nii.gz is a binary segmentation with the CSF, GM, and WM masks contained in one image. In this image file, image voxels of intensity 1, 2, and 3 correspond to voxels identified as CSF, GM, and WM, respectively.

  • This is important because BARSTOOL uses the intensities of the image voxels in this file to determine how much CSF, GM, and WM are within a spectroscopy voxel when calculating absolute concentrations. Thus, if you are using another method of GM, WM, and CSF segmentation, ensure that you produce a binary segmentation with the CSF, GM, and WM masks contained in one image with image voxels of intensity 1, 2, and 3, respectively.