ITK
5.0.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 constexpr unsigned int | ImageDimension = TInputImage::ImageDimension |
static constexpr short | NULL_FLOW = -1 |
static constexpr IdentifierType | NULL_LABEL = 0 |
Protected Types | |
using | edge_table_hash_t = itksys::hash_map< IdentifierType, edge_table_t, itksys::hash< IdentifierType > > |
using | edge_table_t = itksys::hash_map< IdentifierType, InputPixelType, itksys::hash< IdentifierType > > |
using | flat_region_table_t = itksys::hash_map< IdentifierType, flat_region_t, itksys::hash< IdentifierType > > |
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 | |
std::atomic< int > | m_ReferenceCount |
Private Attributes | |
IdentifierType | m_CurrentLabel |
bool | m_DoBoundaryAnalysis |
ImageRegionType | m_LargestPossibleRegion |
double | m_MaximumFloodLevel |
bool | m_SortEdgeLists |
double | m_Threshold |
using | Superclass = ProcessObject |
using | Pointer = SmartPointer< Self > |
using | ConstPointer = SmartPointer< const Self > |
static Pointer | New () |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const char * | GetNameOfClass () const |
using itk::watershed::Segmenter< TInputImage >::BoundaryFlatHashValueType = typename BoundaryType::FlatHashValueType |
Definition at line 106 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryIndexType = typename BoundaryType::IndexType |
Definition at line 105 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryType = Boundary< InputPixelType, Self::ImageDimension > |
Definition at line 104 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryTypePointer = typename BoundaryType::Pointer |
Definition at line 123 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::ConstPointer = SmartPointer< const Self > |
Methods to implement smart pointers and work with the itk object factory
Definition at line 114 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::DataObjectPointer = DataObject::Pointer |
Definition at line 108 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType |
Standard itk::ProcessObject subclass method.
Definition at line 201 of file itkWatershedSegmenter.h.
|
protected |
Definition at line 267 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 265 of file itkWatershedSegmenter.h.
|
protected |
Table for storing flat region information.
Definition at line 253 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::ImageRegionType = typename InputImageType::RegionType |
Definition at line 101 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::InputImageType = TInputImage |
Define image types and dimensionality
Definition at line 96 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::InputImageTypePointer = typename InputImageType::Pointer |
Typedefs necessary on microsoft VC++ to avoid internal compiler errors
Definition at line 120 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::InputPixelType = typename InputImageType::PixelType |
Definition at line 102 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::OutputImageType = Image< IdentifierType, Self::ImageDimension > |
Definition at line 100 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::OutputImageTypePointer = typename OutputImageType::Pointer |
Definition at line 121 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::Pointer = SmartPointer< Self > |
Methods to implement smart pointers and work with the itk object factory
Definition at line 113 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::SegmentTableType = SegmentTable< InputPixelType > |
Definition at line 107 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::SegmentTableTypePointer = typename SegmentTableType::Pointer |
Definition at line 122 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::Self = Segmenter |
Standard self type alias
Definition at line 93 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::Superclass = ProcessObject |
Methods to implement smart pointers and work with the itk object factory
Definition at line 112 of file itkWatershedSegmenter.h.
|
protected |
|
inlineprotected |
Definition at line 270 of file itkWatershedSegmenter.h.
|
overrideprotected |
|
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 165 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 132 of file itkWatershedSegmenter.h.
|
inline |
Definition at line 191 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 143 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 154 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 274 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 171 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 138 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 183 of file itkWatershedSegmenter.h.
|
inline |
Definition at line 149 of file itkWatershedSegmenter.h.
|
staticprotected |
|
inline |
Definition at line 160 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 traverses 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 97 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 364 of file itkWatershedSegmenter.h.
|
private |
Definition at line 379 of file itkWatershedSegmenter.h.
|
private |
Definition at line 376 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 373 of file itkWatershedSegmenter.h.
|
private |
Definition at line 378 of file itkWatershedSegmenter.h.
|
private |
Definition at line 375 of file itkWatershedSegmenter.h.
|
private |
Definition at line 377 of file itkWatershedSegmenter.h.
|
static |
A constant used in the labeling algorithm.
Definition at line 129 of file itkWatershedSegmenter.h.
|
static |
A constant used in the labeling algorithm.
Definition at line 126 of file itkWatershedSegmenter.h.