Segmentation Editor

Description

This project is the implementation of a 2½D segmentation editor. This editor allows selecting a region of interest on a 2D orthoslice from a 3D volume and stacking the result in a new 3D volume. The result is a segmentation of the 3D volume on a slice-by slice basis.

Working Principle

The Segmentation Editor uses several 3D Masks, which store individual regions of interest. Each of the masks is stored as a BYTE Node_Data entry with the same dimensions as the input field. Each of the masks contains a either the value it represents or 0 as the NULL value for each voxel. The 3D masks can either be applied to the input field or added as new node data entries.

If the mask is applied to the input field the input node data is transferred to the output field for all voxels which are selected by any of the 3D masks. Voxels which are not selected by any of the masks are assigned a NULL value which is determined from the input data.

If the mask is added to the input field, all the Node_Data entries of the input field are taken over into the output field as they are and the mask Node_Data entries are attached as additional entities.

Creating the Masks

The user is generally creating the mask on a 2D slice which is generated using orthoslice. The Mask can be created by drawing individual points, lines ore using more advanced techniques such as 2D region growing or thresholding. A 3D region growing is provided which takes the selected seed point and takes the segmentation into 3D space. Once the 2D mask is created it is inserted in the 3D mask in the location of the original orthoslice. The mask is shown semi-transparent inside the 2D viewer used for t

Input window of the Segmentation Editor

User Macros

The Segmentation Editor is provided in two different user macros: SegmentationEditor and SegmentationWizard

Segmentation Editor

Segmentation Editor User interface

Segmentation Editor User interface

Segmentation Editor Input Window

Segmentation Editor Input Window

Segmentation Editor Output Window

Segmentation Editor Output Window

To be able to use the Segmentation Editor the user needs a 2D scene window that is used to draw the masks and select seed points. This scene should be connected to the mask_obj to provide the context for the drawn mask. The user also needs the User Interface to select the segmentation tasks to perform. The Segmentation Editor also provides outputs for the 3D mask and the segmented volume which will be helpful to perform segmentation tasks.

The User interface is split into several parts. The first two sliders (axis and plane) define the slice which is used for the 2D task. This slice is shown in the Draw Mask Input view. All other tasks relate to this slice.

Segmentation Editor User Interface
Draw Mask

The Draw Mask frame is the central part of the Segmentation Editor user interface. This frame enables and disables other user interfaces and functionality of the Segmentation Editor in general. The frame uses a number of radio-buttons which directly control the behaviour of the DrawMask low level module. The user can select from the following options:

Pen

The Pen frame allows the user to select the pen style and pen width he is drawing with. The pen style option allows the user to choose between draw and erase.

The width slider defines the size of the drawn points or lines.

Mask Value

The mask value defines the node data value to be used in the 3D mask for the given entity. If the apply mask user interface (see Section 4.1.1.7) is set to add mask these node data values are added to the output node data that they can later be used to identify an object. The input box underneath the slider allows the user to set the node data label to something meaningful rather then the default "Segment ". The "Edit Entities" button opens a new panel in the user interface (see Section 4.1.1.9)

2D Region Growing

The 2D region growing allows the user to use a "Magic Wand" tool as known from image processing tools. The user selects the "seed point" on the slice and a region is grown from this point as long as the differences between the data values of the neighbouring points fulfil the region growing condition. The region growing condition can be influenced using the user interface.

The delta slider sets the maximum difference between two points to continue the region growing.

The increment toggle button defines how difference limit is applied. If the increment toggle is set the difference is calculated between the values of the two neighbouring points. Otherwise the difference is calculated between the value of the seed point and the value of the point to grow to.

The Radio buttons "Add to Mask" and "Replace Mask" permit the user to select several parts on the 2D slice and combine them in one entity. The "Add to Mask" option merges the new region with the previous mask. This previous mask could also have been obtained using other mask drawing facilities. The "Replace Mask" option clears the mask before inserting the new region.

The "Run with Previous Seed Point" button allows the user to grow a region around the same seed point on a different slice. This is useful if the user has selected an object which he wants to grow without having to target the same object for every slice.

3D Region Growing

The 3D region growing takes the Segmentation Editor into the third dimension. It allows the user to select a "seed point" using two coordinates from the picked point on the slice and the third coordinate from the slice value. This 3D seed point is then used to grow a region as long as the differences between the data values of the neighbouring points (3D) fulfil the region growing condition. The region growing condition can be influenced using the user interface.

The delta slider sets the maximum difference between two points to continue the region growing.

The increment toggle button defines how difference limit is applied. If the increment toggle is set the difference is calculated between the values of the two neighbouring points. Otherwise the difference is calculated between the value of the seed point and the value of the point to grow to.

The Radio buttons "Add to Mask" and "Replace Mask" permit the user to select several objects in the volume and combine them in one entity. The "Add to Mask" option merges the new region with the previous mask. The previous mask could also have been obtained using other mask drawing facilities. The "Replace Mask" option clears the mask before inserting the new region.

There are some risks using the 3D region growing, as it can add a 3D mask that changes the previously carefully segmented slices in the output. To avoid loosing segmented entities it is recommended to perform 3D region growing in a new entity rather than overwriting manual segmentation.

Thresholding

The threshold function allows the user to create a mask using a simple value threshold. The mask value is set if the node data value is in the range between the minimum and maximum threshold value.

The Radio buttons "Add to Mask" and "Replace Mask" permit the user to apply several masks to the 2D slice and combine them in one entity. The "Add to Mask" option merges the new and the previous masks. This previous mask could also have been obtained using other mask drawing facilities. The "Replace Mask" option clears the mask before inserting the new mask.

Apply Mask

The Apply Mask frame allows the user to select how the output of the Segmentation Editor is formed.

If Apply Mask user interface is set to "Add Mask" the user is provided with an additional frame (see Section 4.1.1.8) to select which masks should be shown in the output window (output of the obj port of the Segmentation Editor).

Output Segments

The Output Segments frame lists all the entities used. The user can select which entities should be shown in the output window (output of the obj port of the Segmentation Editor). The entities are listed by the name given in the Mask Value frame (see Section 4.1.1.3).

The Selection in this frame has no influence on the Node_Data components written to the output field. The output field always contains all components.

Edit Entities

The Edit Entities frame allows the user to combine or delete individual 3D masks (entities). It provides a list or all the entities currently used in the 3D mask on the left hand side and three buttons on the right. The user can select any number of entities before clicking on the Combine or Delete button.

When the user clicks on the Delete button all the entities selected will be removed from the 3D mask.

When the user clicks on the Combine button all the entities selected will be combined into the first entity selected. The Node_Data values of the combined entities are changed to the resulting value. The name is kept from the first entity selected.

The newly generated mask is applied immediately to create the new output data.

The close frame button hides the Edit Entities frame.

Save 3D Mask

The Save 3D Mask frame provides a simple user interface as most of the AVS/Express data output modules. The user can input a filename or toggle a file browser to input the output file name. The write button triggers the write process to store all entities in the 3D mask into a HDF5 file with the given name. The HDF5 file is stored using the internal compression of the WriteHDF5 module which is part of AVS/Express.

Load 3D Mask

The Load 3D Mask frame provides a user interface that allows the user to restore a mask from a HDF5 file which was stored with the Save 3D Mask function. The loading of the 3D mask happens in two steps which are represented by the two parts of the user interface.

The first step (on the left) is to provide a filename to the ReadHDF5 module. The user can input the filename either directly into the input box (top left) or trough the file browser provided by clicking the "Browse…" button.

Once the user has provided the filename the Entities frame is filled with the entities stored in the HDF5 file. The user can now select the entities which should be read from the file in the Read Entities frame. Pressing the Read button the 3D mask is replaced by the entities selected from the file.

The mask which was created before the Load 3D mask will be lost after reading from the file.

Segmentation Editor Parameters
Input Ports:
Output Ports

Segmentation Wizard

The SegmentationWizard is a wrapper for the SegmentationEditor which includes a 4 View Window dialogue that provides the 4 main views that help using the SegmentationEditor as well as the full user interface. The four scenes show the input view (top left), the 2D mask on its own (top right), the 3D mask (bottom left) and the output view (bottom right).

The input view contains the selected orthoslice and mask in a 2D scene. The user can draw in this window using the right mouse button to modify the mask. Seed point selections for the region growing are also done using the right mouse button in this window.

The 2D mask view shows the currently used 2D mask on its own. This can help if the opacity of the 2D mask on top of the 2D orthoslice makes it hard to identify the positioning of the 2D mask.

The 3D mask view shows the currently edited 3D mask and bounding boxes for the 3D volume and the selected orthoslice. The orthoslice bounding box helps to relate the position of the slice to the volume.

The output view shows the directly renderable object written to the obj port of the SegmentationWizard. This view is dependent on the apply mask radio buttons (see Section 4.1).

Dialog provided by the SegmentationWizard User Macro
Dialog provided by the SegmentationWizard User Macro

Input Ports:
Output Ports

Authors

Tobias Schiebeck
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL