Difference between revisions of "Modules:FastMarchingSegmentation-Documentation-3.6"

From Slicer Wiki
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 66: Line 66:
 
* ''Play with the fiducial points'' If the segmentation result is not satisfactory, try adding more fiducials. If the region to be segmented has regions of different intensities, put fiducials in each of such regions. If all fails, try to segment separate regions one after another, and use [[Modules:ImageLabelCombine-3.4|ImageLabelCombine]] module to merge them together later.
 
* ''Play with the fiducial points'' If the segmentation result is not satisfactory, try adding more fiducials. If the region to be segmented has regions of different intensities, put fiducials in each of such regions. If all fails, try to segment separate regions one after another, and use [[Modules:ImageLabelCombine-3.4|ImageLabelCombine]] module to merge them together later.
 
* ''Take advantage of volume rendering'' You can quickly see if there are "leaks", without the need to scroll through the slices. However, volume rendering may not show small "leaks".
 
* ''Take advantage of volume rendering'' You can quickly see if there are "leaks", without the need to scroll through the slices. However, volume rendering may not show small "leaks".
 +
 +
'''IMPORTANT: Memory usage warning'''
 +
 +
The code allocates something like
 +
 +
<pre>
 +
16*sizeof(int)*dX*dY*dZ + dX*dY*dZ + (sizeof(int)+2*sizeof(double))*(max_intensity-min_intensity)
 +
</pre>
 +
 +
bytes in RAM. So, depending on what is the size of your image, you may run out of memory, which would cause the problem you describe. Chances of this
 +
happening depend on the size of the image, scalar type, scalar range, OS you use, whether you use 32- or 64- bit system, and how much memory you already have in use.
 +
 +
In order to reduce the chances of running out of memory, you can reduce the size of the required memory as follows:
 +
 +
1) use [[Modules:CropVolume-Documentation-3.6|CropVolume]] module to extract a smaller VOI around the structure you are trying to segment (use resample constant 1.0). This will reduce dimensions of the input image.
 +
 +
2) you can rescale the intensities of your image to a smaller range
 +
 +
3) you can do both 1) and 2)
  
 
== Development ==
 
== Development ==
Line 72: Line 91:
  
 
This is a scripted Tcl module. The core fast marching algorithm is implemented in VTK classes vtkPichonFastMarching and vtkPichonFastMarchingPDF in [http://viewvc.slicer.org/viewcvs.cgi/trunk/Base/Logic Slicer/Base/Logic].
 
This is a scripted Tcl module. The core fast marching algorithm is implemented in VTK classes vtkPichonFastMarching and vtkPichonFastMarchingPDF in [http://viewvc.slicer.org/viewcvs.cgi/trunk/Base/Logic Slicer/Base/Logic].
 +
 +
In the cases when the range of input intensities exceeds 300, the module internally rescales the input image intensities to be in [0,300]. Perhaps this should be exposed at the user level, or reconsidered.
  
 
===Dependencies===
 
===Dependencies===
Line 79: Line 100:
 
=== Tests ===
 
=== Tests ===
  
[http://viewvc.slicer.org/viewcvs.cgi/trunk/Modules/FastMarchingSegmentation/Testing/vtkPichonFastMarchingTest.cxx vtkPichonFastMarchingTest.cxx]
+
The following tests verify the function of this module on the [http://www.cdash.org/CDash/testOverview.php?project=Slicer3&date= 3D Slicer dashboard]:
 +
 
 +
[http://viewvc.slicer.org/viewcvs.cgi/trunk/Modules/FastMarchingSegmentation/Testing/vtkPichonFastMarchingTest.cxx vtkPichonFastMarchingTest1]: exercise basic functionality of the vtkPichonFastMarching class
 +
 
 +
[http://viewvc.slicer.org/viewcvs.cgi/trunk/Modules/FastMarchingSegmentation/Testing/vtkPichonFastMarchingTest.cxx vtkPichonFastMarchingTest2]: performs segmentation of the test meningioma image from one seed placed inside the tumor
  
 
===Known bugs===
 
===Known bugs===
 +
 +
[http://www.na-mic.org/Bug/view.php?id=835 #835]: Fast marching will usually fail if you try to segment an object with uniform or very close to uniform intesity
 +
 +
[http://www.na-mic.org/Bug/view.php?id=823 #823]: Volume rendering performance in Fast Marching
  
 
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker.
 
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker.

Latest revision as of 16:27, 24 May 2010

Home < Modules:FastMarchingSegmentation-Documentation-3.6

Return to Slicer 3.6 Documentation

Fast Marching Segmentation

FastMarchingSegmentation

Initialization of the algorithm with a single fiducial point
Adjusted segmentation result and volume rendering
Model of the resulting tumor segmentation

General Information

Module Type & Category

Type: Interactive

Category: Segmentation

Authors, Collaborators & Contact

  • Andriy Fedorov, Ron Kikinis (BWH)
  • Eric Pichon
  • Contact: Andriy Fedorov, fedorov at bwh

Module Description

This module implements active contour segmentation based on fast marching method.

Usage

Use Cases, Examples

  • This module is most useful to segment image regions that have similar intensity
  • Initialization is very simple: points within the region to be segmented and expected volume of the segmented structure
  • The segmentation is completed relatively quickly for typical images, facilitating experimentation with the selection of optimum parameters
  • The resulting volume can be adjusted interactively by scrolling through the evolution of the label contour

Tutorials

Not available at this time

Quick Tour of Features and Use

Segmentation workflow of this module consists of the two steps: Initialization and adjustment of the segmentation result.

  • Initialization: The user is required to specify the following items to initialize the segmentation process:
    • Input volume: image that contains the structure to be segmented
    • Input seeds: fiducial list containing fiducials marking points within the region to be segmented.
    • Output volume: output label volume that will keep the segmentation result
    • Target segmented volume: positive number that estimates expected volume of the segmented structure in milliliters (mL)
    • Output label value: value that will be assigned to the non-zero pixels of the segmentation result

Once these items have been specified, push Run Segmentation button to initiate the segmentation process.

  • Adjustment of the segmentation result: The segmentation process can be described on the high level as evolution of contours, that starts from the seed points provided in the initialization step. In the current adjustment step, the user can go back in the evolution of the segmentation contour by changing the current value of the volume for the segmented structure. This process is facilitated by the following controls:
    • Segmented volume selection range: This range slider allows to specify the range of volumes that you want to experiment with in adjusting the result. The maximum range is from 0 to the target segmented volume specified in the previous step.
    • Output segmentation volume: This slider allows to smoothly scroll through the volume values within the selected range. The segmentation contour is interactively updated in the slice view as the slider is moved. Note, that as you lock in to the most desirable segmentation result, you would reduce the selection range to allow for better precision of contour adjustment.
    • Interactive volume rendering of segmentation results: If this checkbox is selected, the volume rendering of the segmented label will be shown in the 3D View window. This allows to quickly assess the accuracy of segmentation, and identify leaks outside the desired region.

Once the satisfactory result is achieved, Accept Segmentation Result button will finalize the segmentation.

Control panel for FastMarching initialization
Control panel for FastMarching result adjustment

Usage tips:

  • Put bigger number as the estimate volume It is better to overestimate the volume of the structure in the initialization, than underestimate. Remember, that you can always scroll back in the contour evolution, but cannot exceed predefined volume limit.
  • Play with the fiducial points If the segmentation result is not satisfactory, try adding more fiducials. If the region to be segmented has regions of different intensities, put fiducials in each of such regions. If all fails, try to segment separate regions one after another, and use ImageLabelCombine module to merge them together later.
  • Take advantage of volume rendering You can quickly see if there are "leaks", without the need to scroll through the slices. However, volume rendering may not show small "leaks".

IMPORTANT: Memory usage warning

The code allocates something like

16*sizeof(int)*dX*dY*dZ + dX*dY*dZ + (sizeof(int)+2*sizeof(double))*(max_intensity-min_intensity) 

bytes in RAM. So, depending on what is the size of your image, you may run out of memory, which would cause the problem you describe. Chances of this happening depend on the size of the image, scalar type, scalar range, OS you use, whether you use 32- or 64- bit system, and how much memory you already have in use.

In order to reduce the chances of running out of memory, you can reduce the size of the required memory as follows:

1) use CropVolume module to extract a smaller VOI around the structure you are trying to segment (use resample constant 1.0). This will reduce dimensions of the input image.

2) you can rescale the intensities of your image to a smaller range

3) you can do both 1) and 2)

Development

Notes from the Developer(s)

This is a scripted Tcl module. The core fast marching algorithm is implemented in VTK classes vtkPichonFastMarching and vtkPichonFastMarchingPDF in Slicer/Base/Logic.

In the cases when the range of input intensities exceeds 300, the module internally rescales the input image intensities to be in [0,300]. Perhaps this should be exposed at the user level, or reconsidered.

Dependencies

Core modules: Fiducials, Volumes

Tests

The following tests verify the function of this module on the 3D Slicer dashboard:

vtkPichonFastMarchingTest1: exercise basic functionality of the vtkPichonFastMarching class

vtkPichonFastMarchingTest2: performs segmentation of the test meningioma image from one seed placed inside the tumor

Known bugs

#835: Fast marching will usually fail if you try to segment an object with uniform or very close to uniform intesity

#823: Volume rendering performance in Fast Marching

Follow this link to the Slicer3 bug tracker.

Usability issues

Follow this link to the Slicer3 bug tracker. Please select the usability issue category when browsing or contributing.

Source code & documentation

Source code can accessed here

Links to documentation generated by doxygen.

More Information

Acknowledgment

Supported by BrainScienceFoundation

References

  • Wikipedia: Fast Marching method
  • The algorithm implemented in this module is described in the following publication: Pichon E, Tannenbaum A, Kikinis R. A statistically based flow for image segmentation. Med Image Anal. 2004 Sep;8(3):267-74. PMID: 15450221. [1]
  • The module has been transferred from Slicer2, legacy documentation from GATech here