Skip to content

Case I: Brainvoyager

Omer Faruk Gulban edited this page Jul 9, 2018 · 41 revisions

Segmentator can be used to fix the overgrown outer gray matter (GM) border in Brainvoyager.

Software

Package Tested version
Brainvoyager 20.2 / QX 3.2
Segmentator 1.2.0

Data:

Siemens 7T scanner, MPRAGE T1-weighted and PD images, 0.7mm isotropic

Problem:

Following the advanced segmentation pipeline in Brainvoyager after intensity inhomogeneity correction, it can be seen that the GM labels are not correct in some areas.

These areas should be fixed for the operations assuming correct GM segmentation such as cortical thickness analysis or cortical depth sampling.

Solution:

Manual editing or grow region tools can be used solve this problem however these methods can be very fiddly depending on the size of the data and the regions of interest.

This work can also be done by using Segmentator, much less laboriously:

  1. Convert Brainvoyager's VMR file to nifti using the nifti plugin.
  2. Load the data to Segmentator: segmentator /path/to/file.nii --percmin 0 --percmax 100 --scale 225
  3. Position the red circular mask in the 2D Histogram (left panel) in a way to leave out the unwanted tissues (e.g vessels and pial surface) in the image browser (right panel). Like in the figure below.
  1. Save the mask (red voxels in the image browser) using Export Nifti button.
  2. Mask the nifti file (TODO: expand, can be done using fslmaths, nibabel + numpy or BV).
  3. Convert the nifti to VMR using the same plugin in Brainvoyager. Make sure that the file you want to convert back is in .nii format (unzipped), not .nii.gz.

After this operation -tighter brain extraction if you wish-, GM will not be overgrown in the advanced segmentation pipeline.


Tip I: Rather than doing the advanced segmentation again, the tight brain mask can also be used on the resulting segmentation (WM-GM).

Tip II: Try using erosion & dilation operations on the mask exported from Segmentator to get rid of the wispy tendril structures. TODO: add a gist here for an example using scipy.ndimage.morphology and nibabel.

Tip III: In step 2, gradient magnitude image can be computed using Deriche filter as an alternative.

Tip IV: V16 files can be converted to nifti to have higher precision than 8-bit unsigned integer precision of VMR files in Brainvoyager.

Tip V: FSL-FAST by itself does a pretty good job on GM too for this data.

Clone this wiki locally