ITK
4.13.0
Insight Segmentation and Registration Toolkit
|
#include <itkWatershedSegmenter.h>
This filter implements the first step in the N-d watershed segmentation algorithm. It produces a segmented, labeled image from a scalar-valued image input. This filter is used in conjunction with WatershedSegmentTreeGenerator and WatershedRelabeler to produce a final segmented image volume. See itk::WatershedImageFilter for an overview of the entire algorithm and notes on the terminology used in describing it.
Definition at line 88 of file itkWatershedSegmenter.h.
Classes | |
struct | connectivity_t |
struct | flat_region_t |
Static Public Member Functions | |
static void | RelabelImage (OutputImageTypePointer, ImageRegionType, EquivalencyTable::Pointer) |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | ImageDimension = TInputImage::ImageDimension |
static const short | NULL_FLOW = -1 |
static const IdentifierType | NULL_LABEL = 0 |
Protected Types | |
typedef itksys::hash_map < IdentifierType, edge_table_t, itksys::hash< IdentifierType > > | edge_table_hash_t |
typedef itksys::hash_map < IdentifierType, InputPixelType, itksys::hash < IdentifierType > > | edge_table_t |
typedef itksys::hash_map < IdentifierType, flat_region_t, itksys::hash < IdentifierType > > | flat_region_table_t |
Static Protected Member Functions | |
static void | MergeFlatRegions (flat_region_table_t &, EquivalencyTable::Pointer) |
static void | MinMax (InputImageTypePointer img, ImageRegionType region, InputPixelType &min, InputPixelType &max) |
static void | SetInputImageValues (InputImageTypePointer img, const ImageRegionType region, InputPixelType value) |
static void | SetOutputImageValues (OutputImageTypePointer img, const ImageRegionType region, IdentifierType value) |
static void | Threshold (InputImageTypePointer destination, InputImageTypePointer source, const ImageRegionType source_region, const ImageRegionType destination_region, InputPixelType threshold) |
Protected Attributes | |
connectivity_t | m_Connectivity |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
AtomicInt< int > | m_ReferenceCount |
Private Attributes | |
IdentifierType | m_CurrentLabel |
bool | m_DoBoundaryAnalysis |
ImageRegionType | m_LargestPossibleRegion |
double | m_MaximumFloodLevel |
bool | m_SortEdgeLists |
double | m_Threshold |
typedef ProcessObject | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
static Pointer | New () |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const char * | GetNameOfClass () const |
typedef BoundaryType::FlatHashValueType itk::watershed::Segmenter< TInputImage >::BoundaryFlatHashValueType |
Definition at line 107 of file itkWatershedSegmenter.h.
typedef BoundaryType::IndexType itk::watershed::Segmenter< TInputImage >::BoundaryIndexType |
Definition at line 106 of file itkWatershedSegmenter.h.
typedef Boundary< InputPixelType, itkGetStaticConstMacro(ImageDimension) > itk::watershed::Segmenter< TInputImage >::BoundaryType |
Definition at line 105 of file itkWatershedSegmenter.h.
typedef BoundaryType::Pointer itk::watershed::Segmenter< TInputImage >::BoundaryTypePointer |
Definition at line 124 of file itkWatershedSegmenter.h.
typedef SmartPointer< const Self > itk::watershed::Segmenter< TInputImage >::ConstPointer |
Methods to implement smart pointers and work with the itk object factory
Definition at line 115 of file itkWatershedSegmenter.h.
typedef DataObject::Pointer itk::watershed::Segmenter< TInputImage >::DataObjectPointer |
Definition at line 109 of file itkWatershedSegmenter.h.
typedef ProcessObject::DataObjectPointerArraySizeType itk::watershed::Segmenter< TInputImage >::DataObjectPointerArraySizeType |
Standard itk::ProcessObject subclass method.
Definition at line 202 of file itkWatershedSegmenter.h.
|
protected |
Definition at line 271 of file itkWatershedSegmenter.h.
|
protected |
Table for storing tables of edges. This is convenient in generating the segment table, even though the edge tables are stored as ordered lists. An "edge" in this context is synonymous with a segment "adjacency".
Definition at line 268 of file itkWatershedSegmenter.h.
|
protected |
Table for storing flat region information.
Definition at line 255 of file itkWatershedSegmenter.h.
typedef InputImageType::RegionType itk::watershed::Segmenter< TInputImage >::ImageRegionType |
Definition at line 102 of file itkWatershedSegmenter.h.
typedef TInputImage itk::watershed::Segmenter< TInputImage >::InputImageType |
Define image types and dimensionality
Definition at line 96 of file itkWatershedSegmenter.h.
typedef InputImageType::Pointer itk::watershed::Segmenter< TInputImage >::InputImageTypePointer |
Typedefs necessary on microsoft VC++ to avoid internal compiler errors
Definition at line 117 of file itkWatershedSegmenter.h.
typedef InputImageType::PixelType itk::watershed::Segmenter< TInputImage >::InputPixelType |
Definition at line 103 of file itkWatershedSegmenter.h.
typedef Image< IdentifierType, itkGetStaticConstMacro(ImageDimension) > itk::watershed::Segmenter< TInputImage >::OutputImageType |
Definition at line 101 of file itkWatershedSegmenter.h.
typedef OutputImageType::Pointer itk::watershed::Segmenter< TInputImage >::OutputImageTypePointer |
Definition at line 122 of file itkWatershedSegmenter.h.
typedef SmartPointer< Self > itk::watershed::Segmenter< TInputImage >::Pointer |
Methods to implement smart pointers and work with the itk object factory
Definition at line 114 of file itkWatershedSegmenter.h.
typedef SegmentTable< InputPixelType > itk::watershed::Segmenter< TInputImage >::SegmentTableType |
Definition at line 108 of file itkWatershedSegmenter.h.
typedef SegmentTableType::Pointer itk::watershed::Segmenter< TInputImage >::SegmentTableTypePointer |
Definition at line 123 of file itkWatershedSegmenter.h.
typedef Segmenter itk::watershed::Segmenter< TInputImage >::Self |
Standard self typedefs
Definition at line 93 of file itkWatershedSegmenter.h.
typedef ProcessObject itk::watershed::Segmenter< TInputImage >::Superclass |
Methods to implement smart pointers and work with the itk object factory
Definition at line 113 of file itkWatershedSegmenter.h.
|
protected |
|
inlineprotected |
Definition at line 274 of file itkWatershedSegmenter.h.
|
overrideprotectedvirtual |
|
protected |
Performs a gradient descent connected component analysis at the boundaries of the images that border other image chunks. Useful only in data streaming applications.
|
protected |
Fills boundary pixels with a specified value. Used by labeling methods to build a very high "wall" around the image so that gradient descent does not need to watch boundaries.
|
protected |
Traverses each boundary and fills in the data needed for joining streamed chunks of an image volume. Only necessary for streaming applications.
|
virtual |
Methods to implement smart pointers and work with the itk object factory
Reimplemented from itk::Object.
|
protected |
Associates each flat region with a local minimum and relabels accordingly.
|
protectedvirtual |
Constructs the connectivity list and the corresponding set of directional Offset indices.
|
overridevirtual |
Standard non-threaded pipeline execution method.
Reimplemented from itk::ProcessObject.
|
overrideprotectedvirtual |
This method asks for an image region that is one pixel larger at each boundary than the region being processed. This single pixel expansion represents an overlap with adjacent image chunks
Reimplemented from itk::ProcessObject.
|
overrideprotectedvirtual |
Given one output whose requested region has been set, how should the requested regions for the remaining outputs of the process object be set? By default, all the outputs are set to the same requested region. If a filter needs to produce different requested regions for each output, for instance an image processing filter producing several outputs at different resolutions, then that filter may override this method and set the requested regions appropriatedly.
Note that a filter producing multiple outputs of different types is required to override this method. The default implementation can only correctly handle multiple outputs of the same type.
Reimplemented from itk::ProcessObject.
|
inline |
Returns the boundary information data necessary only for data streaming applications.
Definition at line 166 of file itkWatershedSegmenter.h.
|
virtual |
Gets/Sets the initial label (IdentifierType integer value) used by the labeling algorithm. Only necessary for streaming applications.
|
virtual |
Turns on special labeling of the boundaries for streaming applications. The default value is FALSE, meaning that boundary analysis is turned off.
|
inline |
Get/Set the input image.
Definition at line 133 of file itkWatershedSegmenter.h.
|
inline |
Definition at line 192 of file itkWatershedSegmenter.h.
|
virtual |
Methods to implement smart pointers and work with the itk object factory
Reimplemented from itk::ProcessObject.
|
inline |
Get/Set the labeled output image. The output image is always of IdentifierType integers.
Definition at line 144 of file itkWatershedSegmenter.h.
|
inline |
Get/Set the segment table. The segment table is a table of segmentation information identifying each region produced by the labeling algorithm.
Definition at line 155 of file itkWatershedSegmenter.h.
|
virtual |
Determines whether the algorithm will sort the adjacencies in its SegmentTable before returning. Default is true. This is an option only useful for streaming applications where the sorting only needs to be done after all iterations have taken place.
|
virtual |
Gets/Sets the input threshold. Threshold is specified as a percentage (0.0 - 1.0) of the maximum height of the image. This filter thresholds the input image to remove all values below , where are the maximum, minimum values in the image and is the threshold parameter value. Values in the image less than are raised to . Thresholding minimum values in the image decreases the number of local minima in the image and produces an initial segmentation with fewer segments. The assumption is that the "shallow" regions that this thresholding eliminates are generally not of interest.
|
protected |
Follows each unlabeled pixel in the image down its path of steepest descent. Each pixel along that path is identified with the local minima already labeled at the end of the path.
|
protected |
Allocates boundary structure information and sets the boundary data to null values.
|
protected |
Labels all the local minima in the image. Also identifies and labels connected "flat" regions.
|
overridevirtual |
Make a DataObject of the correct type to used as the specified output.
Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a itkSmartPointer to a DataObject. ImageSource and MeshSource override this method to create the correct type of image and mesh respectively. If a filter has multiple outputs of different types, then that filter must provide an implementation of MakeOutput().
Reimplemented from itk::ProcessObject.
|
staticprotected |
Helper function. Finds the minimum and maximum values in an image.
|
staticprotected |
Helper function. Finds the minimum and maximum values in an image.
|
static |
Methods to implement smart pointers and work with the itk object factory
|
inlineprotected |
Definition at line 278 of file itkWatershedSegmenter.h.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ProcessObject.
|
static |
Helper function. Other classes may have occasion to use this. Relabels an image according to a table of equivalencies.
|
inline |
Definition at line 172 of file itkWatershedSegmenter.h.
|
virtual |
Gets/Sets the initial label (IdentifierType integer value) used by the labeling algorithm. Only necessary for streaming applications.
|
virtual |
Turns on special labeling of the boundaries for streaming applications. The default value is FALSE, meaning that boundary analysis is turned off.
|
inline |
Definition at line 139 of file itkWatershedSegmenter.h.
|
staticprotected |
Helper functions for filling in regions with values
|
inline |
This method is necessary until the streaming mechanisms of the Itk pipeline are full fleshed out. It is only used for streaming applications. Calling this method gets/sets the image size of the complete volume being streamed. The member variables controlled by this method will not be modified by the Itk pipeline and are necessary for analysis of boundaries.
Definition at line 184 of file itkWatershedSegmenter.h.
|
inline |
Definition at line 150 of file itkWatershedSegmenter.h.
|
staticprotected |
|
inline |
Definition at line 161 of file itkWatershedSegmenter.h.
|
virtual |
Determines whether the algorithm will sort the adjacencies in its SegmentTable before returning. Default is true. This is an option only useful for streaming applications where the sorting only needs to be done after all iterations have taken place.
|
virtual |
Gets/Sets the input threshold. Threshold is specified as a percentage (0.0 - 1.0) of the maximum height of the image. This filter thresholds the input image to remove all values below , where are the maximum, minimum values in the image and is the threshold parameter value. Values in the image less than are raised to . Thresholding minimum values in the image decreases the number of local minima in the image and produces an initial segmentation with fewer segments. The assumption is that the "shallow" regions that this thresholding eliminates are generally not of interest.
|
staticprotected |
Helper function. Thresholds low values and copies values from one image into another. The source and destination regions must match in size (not enforced). For integral types, the dynamic range of the image is adjusted such that the maximum value in the image is always at least one less than the maximum value allowed for that data type.
|
overrideprotectedvirtual |
Update the information describing the output data.
This method transverses up the pipeline gathering modified time information. On the way back down the pipeline, this method calls GenerateOutputInformation() to set any necessary information about the output data objects. For instance, a filter that shrinks an image will need to provide an implementation for GenerateOutputInformation() that changes the spacing of the pixels. Such filters should call their superclass' implementation of GenerateOutputInformation prior to changing the information values they need (i.e. GenerateOutputInformation() should call Superclass::GenerateOutputInformation() prior to changing the information.
Reimplemented from itk::ProcessObject.
|
protected |
Adds entries to the output segment table for all labeled segments in the image.
|
static |
Definition at line 98 of file itkWatershedSegmenter.h.
|
protected |
This is a debugging method. Will be removed. 11/14/01 jc Holds generalized connectivity information for connected component labeling and gradient descent analysis in pixel neighborhoods.
Definition at line 368 of file itkWatershedSegmenter.h.
|
private |
Definition at line 383 of file itkWatershedSegmenter.h.
|
private |
Definition at line 380 of file itkWatershedSegmenter.h.
|
private |
Helper, debug method. This is the actual data set size. The pipeline will alter its LargestPossibleRegion, so we need to preserve it here explicitly for streaming applications
Definition at line 377 of file itkWatershedSegmenter.h.
|
private |
Definition at line 382 of file itkWatershedSegmenter.h.
|
private |
Definition at line 379 of file itkWatershedSegmenter.h.
|
private |
Definition at line 381 of file itkWatershedSegmenter.h.
|
static |
A constant used in the labeling algorithm.
Definition at line 130 of file itkWatershedSegmenter.h.
|
static |
A constant used in the labeling algorithm.
Definition at line 127 of file itkWatershedSegmenter.h.