ITK
6.0.0
Insight 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 89 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 val) |
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 = std::unordered_map< IdentifierType, edge_table_t > |
using | edge_table_t = std::map< IdentifierType, InputPixelType > |
using | flat_region_table_t = std::unordered_map< IdentifierType, flat_region_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) |
Static Protected Member Functions inherited from itk::ProcessObject | |
template<typename TSourceObject > | |
static void | MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs) |
static constexpr float | progressFixedToFloat (uint32_t fixed) |
static uint32_t | progressFloatToFixed (float f) |
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 () |
const char * | GetNameOfClass () const override |
using itk::watershed::Segmenter< TInputImage >::BoundaryFlatHashValueType = typename BoundaryType::FlatHashValueType |
Definition at line 105 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryIndexType = typename BoundaryType::IndexType |
Definition at line 104 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryType = Boundary<InputPixelType, Self::ImageDimension> |
Definition at line 103 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::BoundaryTypePointer = typename BoundaryType::Pointer |
Definition at line 122 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 113 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::DataObjectPointer = DataObject::Pointer |
Definition at line 107 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType |
Standard itk::ProcessObject subclass method.
Definition at line 218 of file itkWatershedSegmenter.h.
|
protected |
Definition at line 287 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 285 of file itkWatershedSegmenter.h.
|
protected |
Table for storing flat region information.
Definition at line 272 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 97 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 119 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 120 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 112 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::SegmentTableType = SegmentTable<InputPixelType> |
Definition at line 106 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::SegmentTableTypePointer = typename SegmentTableType::Pointer |
Definition at line 121 of file itkWatershedSegmenter.h.
using itk::watershed::Segmenter< TInputImage >::Self = Segmenter |
Standard self type alias
Definition at line 94 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 111 of file itkWatershedSegmenter.h.
|
protected |
|
inlineprotected |
Definition at line 290 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.
|
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 appropriately.
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 174 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 208 of file itkWatershedSegmenter.h.
|
overridevirtual |
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 146 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 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 \( L = min + T * (max - min) \), where \( max, min \) are the maximum, minimum values in the image and \( T \) is the threshold parameter value. Values in the image less than \( L \) are raised to \( L \). 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 296 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 180 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 196 of file itkWatershedSegmenter.h.
|
inline |
Definition at line 152 of file itkWatershedSegmenter.h.
|
staticprotected |
|
inline |
Definition at line 166 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 \( L = min + T * (max - min) \), where \( max, min \) are the maximum, minimum values in the image and \( T \) is the threshold parameter value. Values in the image less than \( L \) are raised to \( L \). 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.
|
staticconstexpr |
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 389 of file itkWatershedSegmenter.h.
|
private |
Definition at line 404 of file itkWatershedSegmenter.h.
|
private |
Definition at line 401 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 398 of file itkWatershedSegmenter.h.
|
private |
Definition at line 403 of file itkWatershedSegmenter.h.
|
private |
Definition at line 400 of file itkWatershedSegmenter.h.
|
private |
Definition at line 402 of file itkWatershedSegmenter.h.
|
staticconstexpr |
A constant used in the labeling algorithm.
Definition at line 128 of file itkWatershedSegmenter.h.
|
staticconstexpr |
A constant used in the labeling algorithm.
Definition at line 125 of file itkWatershedSegmenter.h.