#include <itkWatershedImageFilter.h>
Inheritance diagram for itk::WatershedImageFilter:
Public Types | |
typedef WatershedImageFilter | Self |
typedef TInputImage | InputImageType |
typedef Image< unsigned long, itkGetStaticConstMacro(ImageDimension) | OutputImageType ) |
typedef InputImageType::RegionType | RegionType |
typedef InputImageType::SizeType | SizeType |
typedef InputImageType::IndexType | IndexType |
typedef ImageToImageFilter< InputImageType, OutputImageType > | Superclass |
typedef InputImageType::PixelType | ScalarType |
typedef SmartPointer< Self > | Pointer |
Public Methods | |
itkStaticConstMacro (ImageDimension, unsigned int, TInputImage::ImageDimension) | |
virtual const char * | GetClassName () const |
void | GenerateData () |
virtual void | SetInput (unsigned int i, const TInputImage *image) |
watershed::Segmenter< InputImageType >::OutputImageType * | GetBasicSegmentation () |
watershed::SegmentTreeGenerator< ScalarType >::SegmentTreeType * | GetSegmentTree () |
void | EnlargeOutputRequestedRegion (DataObject *data) |
void | SetInput (const InputImageType *input) |
void | SetThreshold (double) |
virtual double | GetThreshold () |
void | SetLevel (double) |
virtual double | GetLevel () |
Static Public Methods | |
Pointer | New () |
Protected Methods | |
WatershedImageFilter () | |
virtual | ~WatershedImageFilter () |
WatershedImageFilter (const Self &) | |
void | operator= (const Self &) |
void | PrintSelf (std::ostream &os, Indent indent) const |
This filter implements a non-streaming version of an image segmentation algorithm commonly known as ``watershed segmentation''. Watershed segmentation gets its name from the manner in which the algorithm segments regions into catchment basins. If a function is a continuous height function defined over an image domain, then a catchment basin is defined as the set of points whose paths of steepest descent terminate at the same local minimum of .
The choice of height function (input) depends on the application, and the basic watershed algorithm operates independently of that choice. For intensity-based image data, you might typically use some sort of gradient magnitude calculation as input. (see itk::GradientMagnitudeImageFilter)
The watershed algorithm proceeds in several steps. First, an initial classification of all points into catchment basin regions is done by tracing each point down its path of steepest descent to a local minima. Next, neighboring regions and the boundaries between them are analyzed according to some saliency measure (such as minimum boundary height) to produce a tree of merges among adjacent regions. These merges occur at different maximum saliency values. The collective set of all possible merges up to a specified saliency ``flood level'' is referred to in this documentation as a ``merge tree''. Metaphorically, the flood level is a value that reflects the amount of precipitation that is rained into the catchment basins. As the flood level rises, boundaries between adjacent segments erode and those segments merge. The minimum value of the flood level is zero and the maximum value is the difference between the highest and lowest values in the input image.
Note that once the initial analysis and segmentation is done to produce the merge tree, it is trivial to produce a hierarchy of labeled images in constant time. The complexity of the algorithm is in the computation of the merge tree. Once that tree has been created, the initial segmented image can be relabeled to reflect any maximum saliency value found in the tree by simply identifying a subset of segment merges from the tree.
The recommended pre-processing for scalar image input to this algorithm is to use one of the itk::AnisotropicDiffusionImageFilter subclasses to smooth the original image and then perform some sort of edge calculation based on gradients or curvature.
Threshold is used to set the absolute minimum height value used during processing. Raising this threshold percentage effectively decreases the number of local minima in the input, resulting in an initial segmentation with fewer regions. The assumption is that the shallow regions that thresholding removes are of of less interest.
The Level parameter controls the depth of metaphorical flooding of the image. That is, it sets the maximum saliency value of interest in the result. Raising and lowering the Level influences the number of segments in the basic segmentation that are merged to produce the final output. A level of 1.0 is analogous to flooding the image up to a depth that is 100 percent of the maximum value in the image. A level of 0.0 produces the basic segmentation, which will typically be very oversegmented. Level values of interest are typically low (i.e. less than about 0.40 or 40% ), since higher values quickly start to undersegment the image.
The Level parameter can be used to create a hierarchy of output images in constant time once an initial segmentation is done. A typical scenario might go like this: For the initial execution of the filter, set the Level to the maximum saliency value that you anticipate might be of interest. Once the initial Update() of this process object has finished, the Level can be manipulated anywhere below the initial setting without triggering a full update of the segmentation mini-pipeline. All that is now be required to produce the new output is a simple relabeling of the output image.
Threshold and Level parameters are controlled through the class' Get/SetThreshold() and Get/SetLevel() methods.
Definition at line 152 of file itkWatershedImageFilter.h.
|
Definition at line 173 of file itkWatershedImageFilter.h. |
|
The type of input image. Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 161 of file itkWatershedImageFilter.h. |
|
The type of output image. Definition at line 168 of file itkWatershedImageFilter.h. |
|
Smart pointer typedef support Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 182 of file itkWatershedImageFilter.h. |
|
Other convenient typedefs Definition at line 171 of file itkWatershedImageFilter.h. |
|
Typedef support for the input image scalar value type. Definition at line 179 of file itkWatershedImageFilter.h. |
|
Standard "Self" typedef. Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 158 of file itkWatershedImageFilter.h. |
|
Definition at line 172 of file itkWatershedImageFilter.h. |
|
Standard super class typedef support. Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 176 of file itkWatershedImageFilter.h. |
|
|
|
Definition at line 243 of file itkWatershedImageFilter.h. References HardConnectedComponentImageFilter::PrintSelf(). |
|
Definition at line 244 of file itkWatershedImageFilter.h. |
|
|
|
Standard process object method. This filter is not multithreaded. |
|
Get the basic segmentation from the Segmenter member filter. Definition at line 226 of file itkWatershedImageFilter.h. |
|
Run-time type information (and related methods) Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. |
|
Set/Get the flood level for generating the merge tree from the initial segmentation |
|
Get the segmentation tree from from the TreeGenerator member filter. Definition at line 233 of file itkWatershedImageFilter.h. |
|
Set/Get the input thresholding parameter. Units are a percentage of the maximum depth in the image. |
|
Dimension of the input and output images. Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. |
|
Method for creation through the object factory. Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 245 of file itkWatershedImageFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. |
|
Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 205 of file itkWatershedImageFilter.h. References itkExceptionMacro. |
|
Overloaded to link the input to this filter with the input of the mini-pipeline Reimplemented from itk::ImageToImageFilter< TInputImage, Image< unsigned long,::itk::GetImageDimension< TInputImage >::ImageDimension > >. Definition at line 195 of file itkWatershedImageFilter.h. References HardConnectedComponentImageFilter::InputImageType. |
|
Set/Get the flood level for generating the merge tree from the initial segmentation |
|
Set/Get the input thresholding parameter. Units are a percentage of the maximum depth in the image. |