Manual Segmentation Tool  

This component of rview permits a user to view a volume image (e.g. MRI) and to create a segmentation or labeling of that volume in a second dataset, where each voxel in that second dataset holds an integer label value (displayed as a colour). The segmentation operations provided are intended for interactive/ semi-interactive and completely manual labeling, aimed at creating visually optimal manual marking of structures in the underlying data.
All operations are allowed in any displayed plane on the computer screen. Multiple labels are permitted and the output volume can be saved directly as an analyze file. A colour overlay and contour display of labels on the original image provide an indication of accuracy as the segmentation proceeds. The various interpolation modes available in rview can be selected to provide an accurate display of the underlying data during the segmentation process. For any point in the display plane, the label value in the segmentation file nearest that point is shown (i.e. the segmentation label values are NOT interpolated in the displays).

The following pages give a step by step introduction to this process:

1. Loading an Image to Segment

To use rview to manually segment an MRI dataset you will first need a copy of the volumetric image data on your computer. (Check File Formats to see if your data is readable by rview). It is suggested that a separate sub directory (folder) is created for each subject/patient. In this sub directory you may choose to have sub directories for Segmentation and MR data files and perhaps a separate sub directory for rview setup files:

filetree

 Subject sub-directory (folders) containing two subjects
each with a directory for MRI data, segmentation data and for additional rview setup files.

For patient confidentiality reasons it may be preferable to use an identification number rather than the patient name for each sub directory.  It is better to organize this layout at the start before proceeding to save rview files, since rview files may reference or record the location of image files that have been registered or viewed.

Having organized the folders, drag the MR image file from a filer/explorer window onto the main display area of rview. This will try and load the MR as the Reference Image. If you have not used this type of data file  with rview before please read the sections on formats and image data problems
 

 

If the data has loaded successfully modify the display controls for the reference image to improve contrast of the MR values. For many common MR images this will require lowering the maximum displayed value to increase the overall brightness and contrast and perhaps slightly increasing the minimum displayed value. This should for example improve gray white contrast in T1 weighted images. It is also possible to vary the gamma of the Reference image display.


2. Select the Manual Segmentation Tool

Now switch rview to a manual segmentation display mode by selecting the manual segmentation view:
 
segmenu
 

This creates and empty segmentation image volume (usually posting a warning error if you have not already got a segmentation file loaded) and displays two rows of three orthogonal slices through the reference MRI (axial, sagittal and coronal). The upper row will be used to display a colour wash of the segmented regions while the lower row will display contours around segmented regions:
 

seg disp

If you have a previous segmentation dataset (image volumes with integer values at each voxel corresponding to a given region label) and want to continue working on, then this should now be loaded by simply dragging the image into one of the segmentation display windows.

3. Select and Apply  a Segmentation mode using the Segmentation Tool (see below).



The Segmentation Tool Window

When selecting the "Segmentation Tool", the segmentation tool window is shown:

 segtool window

This allows control of the overall segmentation process and its display in the rview window. The following sections describe the different options available:

Current Label:

The controls on the right hand side of the segmentation tool determines the 'label' value written into the empty segmentation volume by the current tracing/segmentation operation. Either type the label value (between 0 and 128) into the top right 'Current Label" value, or simply click on the selected colour. Note: The colours corresponding to a given label value >10 are randomized RGB so if the colours are not ideal (i.e. similar colours overlap somewhere in your display), simply select 'New Colours' in the segmentation tool to get a new random set of label colours!

Active Intensity Range:

rir

This controls the intensities in the reference image for which segmentation steps (such as drawing, painting or dilating) are limited to. Using the default range you can paint or draw labels anywhere in the image volume. Limiting the range prevents labels being applied to those voxels outside this intensity range. The range can be reset to the default full range (-99999 to 99999) at any time by setting 'Reset'. The range can be set to a specific pair of values using two methods:

1. Simple manually entering the intensity range to use in the top left range values.

2. Extracting the range from an already labeled region of image voxels:

To do this first mark the region you want the values from:
Use
the marking or drawing options (below) with the intensity range maximized (reset) to label
a region of tissue of interest. Then select the 'From Labels' button to calculate the max and min within that delineated region. Note: The max and min extracted are from all voxels labeled with the currently active of selected label value (see above).
Note: if you start marking and nothing happens in a given region: always check the active intensity range is applicable to the region you are marking.







Interactive Labeling (Basic Painting Tools)

'Draw and Fill ROI mode' allows closed regions in any display plane to be drawn and filled in one action:
 (RECOMMENDED DRAWING MODE!)

1. Select 'Draw and Fill' mode

drawfillmode

2. In the required plane hold the RIGHT mouse button down and drag cursor over the image: This leaves a yellow line trace: 

drim1

3. Release the mouse button to connect the start point to the finish point and fill the region with the current label value.

drim1

As discussed above, the intensity range values set by the numbers in 'Active Intensity Range' allow the painting or drawing to be limited to those underlying voxels having that given range of intensities. This is useful for quickly selecting regions of tissue in an MRI scan without having to follow the tissue boundaries manually.


See here for a step by step example of how to use the active intensity range together with the drawing tool to select tissues quickly.


'Paint Mode'
Mode simply paints colours at the point clicked (using the RIGHT mouse button) with a simple
circular  brush in the plane the mouse was clicked in.




2D Region Grow Tool:

This carries out a simple 2D region growing within the selected intensity range, around the intensity value at the clicked Location:
[Use with caution: Can Fill everywhere!!!....]
Usually I don't use this option much now: I simply rough trace with the intensity range selection (see above)
or use the 3D dilation/erosion tools below.


3D Label Erosion/Dilation Controls

This simply applies a given number of erosions or dilations (in 3D) to the current active label value. The dilation function applies to add voxels that are also within the current active intensity range (for a pure dilate reset the range to maximum). The erosion removes border voxels that are OUTSIDE the current active intensity range (for a pure erosion, set both the max and min to 99999).

See here for a step by step example of using the erosion/dilation tool.



Replace Label Value


This simply replaces all the labels in the entire segmentation volume that have the selected replacement value:

rls

with those defined by the current active label:

lvs

Set the label to replace and hit the 'Apply' button

.
rl

To clear the segmentation: replace the label values in the image with label 0.


'Simple Brain Extract'

This is most useful for doing a quick brain extraction: it allows semi-interactive refinement of parameters used to to extract the surface of interest quickly from the data.  See Here for more info.

(Note 'Use Render View' has been added to use the extracted brain volume to visualize the pattern of labels that have currently been marked with respect to the brain surface: this does not write the extracted volume into the current working segmentation.) It is used to produce displays which allow tracing of new regions viewed together with a brain surface

ISO Surface Tool

This creates a smoothed image volume used for the iso-surface rendering view (see the render tool) from the current set of manually marked labels: it sets all regions marked with any label not zero to have a value in the surface volume of 1000. It then applies a smoothing kernel to the data to create a volume suitable for visualization. Then use the surface rendered display options (below) to visualize tracing with respect to this data.






Saving The Segmentation

This is THE most important tracing function: Use this button regularly!

saveseg


"Save segmentation" prompts the user for a file name and path with which to save the current labeled volume to. (either analyze or gipl format).

Notes:

1. Save the segmentation file in a sub directory in the same tree as your raw image data
(See top of this page for suggested layout of sub directories for raw data and segmentations).

2. Save the display setup: After saving the segmentation file.
    This will allow you to return to the same display of this segmentation later.
By saving this after saving the segmentation file itself, this will ensure that the rview setup file
contains a reference to the filename you gave the segmentation volume.
(You can then keep re-saving the segmentation volume with the same name: but not have to re-save the setup file:
unless you want a new view recorded in the setup file)


Apply Segmentation: Do Calculations on Regions

applyseg

This control area has various options for using the current labeled volume data to do calculations on files. The output of the calculations is displayed in the rview text info window (see options menu to ensure display of this window: You sometimes may need to reduce the size of the rview window to find this text window!) :

1. Region Volumes...
This reports the size of each labeled volume in cubic centimeters, in the text info window (which can then be copied and pasted into other applications): i.e. it simply counts the number of voxels with each label and then multiples this by the volume of each voxel (in mm) and then divides this by 1000 to report in cubic centimeters.

2. Overlaps....
This allows the user to select a second label segmentation file and then calculates the matrix of the number of counts of overlapping voxels with the current segmentation. This provides a complete summary of overlaps and allows for example one observers tracing to be compared to a second observer. The files must be the same physical dimensions!

3. Stats of Region Intensities...
This returns basic statistics of the intensities of the current reference image that fall in each of the currently marked labels.

4. Stats of Region Intensities in File...
This is same as above but allows the user to select a separate intensity image file. 
The selected file must have the same dimensions as the segmentation and reference image currently being segmented. If the selected file is, for example, a tissue segmentation file (i.e. the intensity of each voxel is the probability of the tissue occurring at that voxel), then this function can be used to calculate tissue volumes (you will have to normalize by whatever the probability values are scaled by in the tissue probability map: for example: divide by 100 or 1000).

5. Mask Image Intensities in File
This allows the user to apply the current labeled volume to mask intensities in another image file. The user is first promoted to select an input image file name and then an output image file name. Again the current reference and segmentation files must be of the same physical dimension (number of voxels, voxel size etc) . The option then sets all voxels in the input file that have no labels (label 0), to the current value of ("Intensity Value Outside Mask").



Display Layouts

dlyt

This allows the user to switch between different tracing display modes for viewing the data when manual tracing:
Different options include displaying the labels being traced on one (reference image) and displaying them on multiple data sets (Float Image A and B) to allow tracing to be guided by (for example) by both T1, T2 and proton density weighted images simultaneously.

Rendered views are also available when a surface has been defined for the current image data.

Example views are shown below:

sv1


sv2



sv3




Other Notes on the manual segmentation process.

1.. Zoom and Location: To position or enlarge the display to the region of interest to be segmented, use the slicing and zooming controls.

2. Contrast/Brightness: To brighten the MRI data display to highlight the tissues on interest, modify the displayed range (bottom left) of the reference image.

3. Interpolation: As of version 8.185Beta interpolation selection for the different drawing displays has been implemented (See display interpolation control menu). Nearest neighbour is the default display mode, but now rview allows tracing on tri-linear and cubic interpolated displays. In general the colour overlays are shown only with nearest neighbour interpolation to allow a view of the individual voxels, while the contour displays use the currently selected display mode:


seginterp


4. Slice Orientation: If you want to trace on a reoriented image volume (e.g. AC-PC line horizontal) then you can use the viewtool to select the orientation required and then apply the re-grid function on the view tool to transform the reference image to the new co-ordinate system. The planes of the display and image data will now be consistent so that tracing on the screen window  traces on a plane parallel to the image voxel array axes.