Segmentation Methods


Revision as of 22:20, 20 July 2015 by Rjpatruno (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

We use itkGray to segment anatomical (T1) images into gray and white regions. This segmentation is essential for rendering meshes and for making measurements that are restricted to the gray matter.

This page is a detailed walk-through of the itkGray segmentation work-flow. Note that this method guides you through a simple manual segmentation. We have another page on Anatomical_Methods that shows you how to get an initial segmentation automatically using some of the FSL tools. That procedure usually produces a nice starting point from which you can use manual methods to refine the segmentation.

(We used mrGray for many years, but itkGray has superceded that program in our lab).


[edit] Segmenting a T1-anatomy

This outlines the general method used to segment tissue manually. you can use this as a starting point, but you may adjust these methods as you become a more experienced segmenter. (eg. tolerance levels, optimal view, etc.)

T1 anatomicals are typically stored in NIFTI format (compressed) with a name such as t1.nii.gz

[edit] Coarse Segmentation

  • Using the Polygon tool in the saggital view, make a CSF border between the two hemispheres. Check the axial view to ensure that no white matter is overlapped by CSF in the first hemisphere to be segmented.
    NOTE: See below in order to figure out whether you will make two separate NIFTI files for each hemisphere or one file containing both segmentations. If you decide to do both hemispheres on one NIFTI, you will have to make sure no CSF leaks onto gray matter in either hemisphere.
  • Paste and accept into a few slices away from the midline.
    CSF Barrier; Saggital
    CSF Barrier; Axial

  • Set the active drawing label to 'white' with the correct hemisphere.
  • Use the Paintbrush tool to fill in most of the white matter and the ventricles.
    The axial view works well for this; using Floodfill with the 3D brush on at a tolerance of ~5 and/or the square and round brush.
  • It may help to start dorsally and work down, cleaning up the subcortical areas as you progress.
    Coarse Segment

[edit] Fine Segmentation

  • Once you have filled in most of the brain with Floodfill set to 3D brush on, use the Paintbrush tool and go through each of the other two views, doing a more careful, slice by slice segmentation.
    • The saggital view works well to start; using Floodfill with the 3D brush off at a tolerance of ~2-3. (The tolerance may shift depending on individual t1 contrast and quality.)

[edit] Segmenting Difficult Brain Sections

  • Temporal lobe: the best view is the coronal slices, but be sure that it also looks correct in the saggital slices.
    Temporal Lobe; Saggital
    Temporal Lobe; Coronal

  • Occipital lobe: working in the axial slices allows for the best view when trying to distinguish occipital white matter and CSF/sinus. However, occipital segmentation requires that you check all three views carefully.
  • Subcortical Structures:
    • This is the trickiest area to segment; it is done best with 3D brush off because you don't want white matter leakage from the other slices.
    • The best tool for this job (in Kathleen and Alina's opinion) is the Polygon Tool. Since the subcortical areas are not integral to our research, this allows you to fill in large areas neatly and quickly.
    With the Polygon Tool, trace a subcortical area that you want to fill with white matter.
    Fine Segment; Polygon Tool

    • Paste and accept into a few slices down, until the white matter is distinct from the brain stem. (See below for example)
    Fine Segment; Subcortical

  • Kathleen will add more subcortical tips.

[edit] Handle & Hole Checking

  • After you have sufficiently segmented a hemisphere, use the Topology tool to check for handles.
    If you segmented pretty well, the topology check should have less than ~10 handles. If there are considerably more, you may want to go through slice-by-slice again, focusing on the difficult areas.
    • Delete any volumes and fill any cavities, and Update the topology check.
    • When you have relatively few handles, select Find.
      • With the pull down box, you can navigate to each handle and fix it.
      • This work best with the 3D brush off, to avoid creating more handles. However, it may be necessary to check all three views, and to scroll through a few slices on either side to sufficiently delete each handle.
    • Work through each location until the Topology Check Update shows 1 volume, 0 cavities, and 0 handles.

  • Although the Topology tool will find many of the handles, it is not perfect. You also need to manually check the brain for holes.
    • Select Update Mesh to see your segmentation.
      • The 3D trackball tool allows you to rotate and zoom on the segmentation. Left click to rotate; right click and drag to zoom.
      • The 3D navigation tool allows you to move the crosshairs to select a point on the segmentation.
    • Look over the segmentation for any holes or handles the topology check may have missed.
      • It may be helpful to scroll through the slices to precisely locate and position the crosshairs on a hole.
    Manual Hole Check
  • Look at the three views to fix the hole/handle. Again, it may be necessary to check multiple views, and scroll through a few slices on either side of the hole.
  • Select Update Mesh, before moving the segmentation, to make sure the hole is fixed.
    Manual Hole Check; Filled
  • When you have looked carefully over the entire hemisphere for holes, it may be a good idea to update the topology check again.

[edit] Finishing and Saving

  • If you would like to install the .gray and .class file for each hemisphere:
    • Segment each hemisphere separately and save each as a nifti file OR
    • Segment both hemispheres in the same file and save them as a left and right nifti file.
    • Follow these instructions to make the .gray and .class file: Converting NIFTI to mrGray Files
    • Follow these instructions to install the segmentation:
      • To specify the segmentation files for a given session, enabling the gray view, you should select the menu Gray | Gray/White Segmentation | Install or Reinstall Segmentation from the Inplane window, or type installSegmentation;
      • Select the .class and .gray file for each hemisphere when prompted.
  • If you would like to only install the t1_seg.nii.gz (segmentation nifti) without making .class files:
    • Segment both hemispheres in the same file (it will most likely crash if you only have one hemisphere completed in the NIFTI file).
    • Either save a left and right nifti of the file containing both hemispheres OR
    • Make a left and right hemisphere soft-link to the segmentation nifti containing both hemispheres.
    • Follow these instructions to install the segmentation:
      • To specify the segmentation files for a given session, enabling the gray view, you should select the menu Gray | Gray/White Segmentation | Install or Reinstall Segmentation from the Inplane window, or type installSegmentation;
      • Select the .nii.gz file containing the segmentation for one hemisphere. You will not need to install the other hemisphere.

[edit] Checking Gray Matter

There are several ways that you can check the gray matter grown based on your segmentation:

  • If you have saved both hemispheres in one NIFTI file you can use:
    • mrgSaveClassWithGray(nGrayLayers, classFileIn, classFileOut)
    • This function outputs a new NIFTI file which now contains the gray matter grown based on the number of layers that you've specified.
    • You can open this file in itkGray and make sure that your gray matter is to your satisfaction.
  • If your hemispheres are in separate NIFTI files or you have already installed segmentation, you can check your gray layers in mrVista:
    • Go to Volume view (type mrVista 3 in the command window)
    • From the Volume window, go to ROI->Create->Create Gray Roi
Personal tools