Home > BrainVoyager > Volume Space > Segmentation: Automatic, Cortex

Segmentation: Automatic, Cortex

Automatic Segmentation

We start the procedure from the corresponding button on the “Segmentation” tab of the “3D Volume Tools”. More details regarding the automatic segmentation can be found in the Getting Started Guide, as well as the BrainVoyager User's Guide.

Automatic segmentation result before inhomogeneity correction:

Automatic segmentation result after inhomogeneity correction:

From inspecting the smoothed intensity histograms, it becomes clear that the distribution of intensities in the data are much easier to separate by using a single intensity threshold after using the inhomogeneity correction. The global intensity values may still not be optimal (so the whole distribution may be shifted a little bit to the right), but let’s first inspect the resulting surface reconstructions. Keep in mind that BV will automatically create different surface reconstructions, e.g. a mesh reconstructing the outer border of the white matter and a mesh reconstructing the smoothing white-grey matter boundary (Recosm). Here, we load the Recosm surface for the right left hemisphere.

Resulting surfaces:

After inhomogeneity correction

The surface reconstruction can be inspected in different ways: First of all, one can rotate and zoom every surface and check for local or global problems. The handling of surface meshes has been slightly changed in BV QX 1.9.9. To switch back to the old mode of rotation etc., you can change the settings of the Surface tab in the Preference menu.

I personally prefer the so called “Old” style due to the massive “switching costs” (because of some years of experience) in my case. When you start using the surface module/ BrainVoyager, you are free to choose between the old and new style.

On the other hand, it is very important to check the anatomical acuity of the segmentation, i.e. how well does the surface represent the boundary between grey and white matter?

To do this, we can use a specific option in the Meshes menu, namely the “Spatial Transformations” dialog.

Clicking the Mesh->VMR button button, the boundary of the current surface reconstruction will be back-projected into the linked VMR project. Now, we can browse the project and inspect areas where e.g. parts of the white matter are left out or parts of the grey matter are erroneously included.

We can e.g. see clearly that erroneously, parts of the cerebellum have been included in the segmentation.

 

 

Manual postcorrection of the automatic segmentation result

In most cases, the automatic surface reconstruction will be already quite good (of course depending on the original quality of the data as well as the preprocessing in BrainVoyager) but not perfect. So normally, one has to add more or less steps of manual correction to gain an improved result. We will describe the steps of manual correction in this part.

First of all, we have to load a VMR project that is resulting from the automatic segmentation procedure. The most important message is that we don’t correct the surface mesh, but the VMR created during the segmentation (representing the grey-white matter boundary) and create a new mesh afterwards.

If we have performed a bridge removal during automatic segmentation, we open the VMR file that ends with BL2 (BL stands for “bridgeless”).

To observe the correspondence between this segmentation result and the original VMR; we again use the “Load Secondary VMR” entry in the “File” menu and choose the Talairach VMR that was the starting point of the segmentation.

First, nothing seems to happen. From the Tab displaying the filename, we can already see there is more than meets the eye (two files are linked, but just one is visualized).

To visualize (blend) both files at the same time, we can use the “F9” button.

There are actually two modes of blending: one with filled and one with non-filled BL2 vmr. To cycle through the modes, we can repeatedly press the F9 button.

To be able to correct flaws in the segmentation result, we first have to find them. We can do this either by browsing the VMRs or by loading the surface reconstruction and to use the link between the surface mesh and the corresponding (original) VMR.

We load the surface reconstruction of the left hemisphere (Recosm_LH) and choose the “Tile” mode in the “Window” menu to show both mesh and VMR at the same time.

To get rid of the Open GL axis visualized in the surface, one can press the A button twice.

To switch to the VMR area that corresponds to a vertex of the surface mesh, we have to activate another mode of the surface tool, namely the “select vertex” mode.

After choosing this mode, the function of the mouse changes. A click on the surface reconstruction will now automatically transfer the crosshair in the VMR to the corresponding position.

Let’s assume we have just clicked on the wrongly selected cerebellar part of the surface reconstruction.

Now, the crosshair shows us where in the VMR this problem is located.

In this case, we could have also easily located the problem by just checking the cerebellum in the VMR right away, but there are more subtle problems in the surface reconstruction that can better be localized in the VMR by using the “select vertex” mode.

For correcting the erroneous segmentation, we need to activate the drawing mode of BrainVoyager. We can find it on the Segmentation tab of the 3D volume tools.

Depending on the size of the “to be corrected” area, we can adapt the mouse size. There is also an option to draw either in 2D or 3D mode. Personally, I prefer to draw what I can see, so I stay in 2D (in-plane) mode. But there may be cases where 3D drawing is just easier.

We open a visualisation of the dataset that makes drawing a little easier by zooming into the sagittal plane (CTRL + right-click).

Drawing comes in two modes: One can either mark new areas in the VMR or delete already selected areas. To do this, we have to hold down the CTRL button when clicking. To delete something, we have to hold down the “SHIFT” button while drawing.

In the screenshot below, we have deleted the cerebellum selection in the VMR. Of course, we have to repeat this procedure for all the slices that contain this problem.

To shift to the next slice, we use the arrow keys (left).

After deleting the problem on all of the slices, we have to do two things:
1. First of all, we have to click the button called “Prepare” to repair any problems we introduced in the line surrounding the (segmented) white matter.

2. Save the new (adjusted) VMR to keep the change. It is advised to save the corrected VMR with a new name to be able to switch back to the original just in case (or to compare to the original).

To create a new mesh out of the corrected Segmentation result, we have to perform three steps:

a) First of all, we click the F8 button to visualize only the corrected BL2.vmr file.

b) We hold down the “Shift” button and click the Create Mesh button in the surface tools on the right side of the screen:

In the “Create Mesh” dialog that pops up, we click the “Reconstruct” button.

This will create an unsmoothed strange looking surface reconstruction that correctly represents the current segmentation result. 

c) To obtain a more brain-like representation, we perform a smoothing operation. This can be started with a combination of the CTRL button and the “Morph Mesh” icon.

It can be easily seen that the most problems in the cerebellar domain have been solved. Finally, it is advised to save the corrected mesh with a new name, e.g. "CG_MPR_ic_TAL2_LH_RECOSM_mc.srf”.

Manual Segmentation Drawing with 3D Volume tools

Segmentation Dialog

  • In the menu: Volumes > 3D Volume tools
  • Or click on the button on the left of the screen

Before you start

  • Open a VMR
  • Save the VMR with a different name, because there is no “undo” button for drawing.

Range: select all voxels in the value range (here 100-120) and make them blue. Selection can be limited in 3-D space by the bounding box.

"Grow Region" selects voxels in the value range, starting at the cursor position. Voxel selection can be limited in 3-D space by the bounding box.

Expand the existing selection. Click multiple times to expand further. Expansion can be controlled by increasing/decreasing the value range. Expansion can be limited in 3-D space by the bounding box.

Fill the box defined by the bounding box

Reload all: revert to the last saved stage of the VMR. Warning: if you save a VMR with blue voxels on it, they will be saved in the VMR and can’t be reverted to the original VMR data!

Draw 2D/3D. Click the enable box, set the pencil size and use Ctrl + left mouse button to draw. Shift + Left mouse button removes voxels (set value to 0).

Pen colors

 

Example use of the bounding box

  • Segmentation of temporal lobe
  • Look up proper x, y, z dimensions (cursor coordinates are displayed in status bar on the lower left of the screen)
  • Set the bounding box
  • Place cursor in temporal lobe and click grow region

Result

How to fill the ventricles manually

1. To prepare the step, we load a Talairach VMR dataset

2. We open the “Segmentation” tab of the 3D volume tools

3. One possible method: use “region growing” and “expansion”

a) We first explore the intensity in the ventricles, which may – depending on the dataset and the previous processing steps, vary considerably.

b) We select a reasonable value range, choose a starting / seeding point in the ventricles and click the “Grow Region” button.

In this case, the result is not to impressive, but not bad either, because we can use the “Expand” function to nicely select neighbouring voxels in the ventricles.

c) We increase the max value in the intensity range

d) Clicking the “Expand” button multiple times will provide us with a larger selection of venticle voxels. Because the result is still not sufficient and apparently restricted to the left hemisphere ventricle, we have to work a little more.

e) We find that the yet nonselected voxels have e.g. an intensity value of 0, so we adapt the minimum intensity range and use again the “Expand” button.

f) We still have to take care of the right hemisphere ventricle. We click into the right ventricle and use the “Grow Region” button.

g) Now it is advised to evaluate the result in three dimensions, e.g. to slice the data from top to bottom. We find that the posterior part of the left ventricle has not been filled.

h) We can use again the “Expand” option to proceed.

i) After several clicks, a satisfying result is reached.

4. To use the manual ventricle filling, we have to switch off the automatic filling of ventricles in the Automatic Segmentation dialog:

5. Running the segmentation will automatically colorcode the previously marked ventricles quite early in the process.

6. Additional remarks:

The ventricle filling can also be performed on the basis of first using the drawing tool and combining this with expansion later.

To avoid erroneous selection of voxels outside the ventricles, the bounding box can be set around the ventricles. To find the proper coordinates, one has to explore the data with the mouse and note the x-, y-, and z-values.

When a brain peeling has been performed before, it is “dangerous” to use the absolute intensity minimum (0) because the demarcation may easily “spill over” to the regions outside the head.

Because there is no “undo” button available, one will always have to reload all. So it is generally better to be a little careful. Ventricle filling should in most cases not take more than a few minutes.