ITK  5.0.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes | List of all members
itk::watershed::Segmenter< TInputImage > Class Template Reference

#include <itkWatershedSegmenter.h>

+ Inheritance diagram for itk::watershed::Segmenter< TInputImage >:
+ Collaboration diagram for itk::watershed::Segmenter< TInputImage >:

Detailed Description

template<typename TInputImage>
class itk::watershed::Segmenter< TInputImage >

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.

The filter is designed to operate in streaming or non-streaming mode. For more information, see the itk::WatershedImageFilter documentation.
Input
There is one input to this algorithm, a real-valued (scalar) itk::Image of arbitrary dimension. The input is assumed to represents a height function, such as a gradient magnitude edge image. The filter can process an image of any dimension. Note that the terms "pixel'' and ``voxel" are interchangeable in this and other watershed component class documentation.
Outputs
There are three potential outputs of this algorithm described below.
The first output is a labeled image of IdentifierType integers. This is an initial segmentation and labeling that is fed into successive components of the watershed algorithm.
The second output is a table of segment information, itk::watershed::SegmentTable. This table is a record of each segment numbered in the initial segmentation (output number one) with relevant information needed in successive stages of the algorithm.
The third output is a data structure containing boundary pixel information, itk::watershed::Boundary. This data is only generated if the flag DoBoundaryAnalysis is set to true and is only useful in streaming applications.
Parameters
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.
See Also
WatershedImageFilter

Definition at line 88 of file itkWatershedSegmenter.h.

Classes

struct  connectivity_t
 
struct  flat_region_t
 

Public Types

using BoundaryFlatHashValueType = typename BoundaryType::FlatHashValueType
 
using BoundaryIndexType = typename BoundaryType::IndexType
 
using BoundaryType = Boundary< InputPixelType, Self::ImageDimension >
 
using BoundaryTypePointer = typename BoundaryType::Pointer
 
using DataObjectPointer = DataObject::Pointer
 
using DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType
 
using ImageRegionType = typename InputImageType::RegionType
 
using InputImageType = TInputImage
 
using InputImageTypePointer = typename InputImageType::Pointer
 
using InputPixelType = typename InputImageType::PixelType
 
using OutputImageType = Image< IdentifierType, Self::ImageDimension >
 
using OutputImageTypePointer = typename OutputImageType::Pointer
 
using SegmentTableType = SegmentTable< InputPixelType >
 
using SegmentTableTypePointer = typename SegmentTableType::Pointer
 
using Self = Segmenter
 
- Public Types inherited from itk::ProcessObject
using ConstPointer = SmartPointer< const Self >
 
using DataObjectIdentifierType = DataObject::DataObjectIdentifierType
 
using DataObjectPointer = DataObject::Pointer
 
using DataObjectPointerArray = std::vector< DataObjectPointer >
 
using DataObjectPointerArraySizeType = DataObjectPointerArray::size_type
 
using MultiThreaderType = MultiThreaderBase
 
using NameArray = std::vector< DataObjectIdentifierType >
 
using Pointer = SmartPointer< Self >
 
using Self = ProcessObject
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

void GenerateData () override
 
BoundaryTypeGetBoundary ()
 
InputImageTypeGetInputImage ()
 
ImageRegionType GetLargestPossibleRegion () const
 
OutputImageTypeGetOutputImage ()
 
SegmentTableTypeGetSegmentTable ()
 
DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
void SetBoundary (BoundaryType *b)
 
void SetInputImage (InputImageType *img)
 
void SetOutputImage (OutputImageType *img)
 
void SetSegmentTable (SegmentTableType *s)
 
void SetLargestPossibleRegion (ImageRegionType reg)
 
virtual void SetCurrentLabel (IdentifierType _arg)
 
virtual IdentifierType GetCurrentLabel () const
 
virtual void SetThreshold (double _arg)
 
virtual double GetThreshold () const
 
virtual void SetDoBoundaryAnalysis (bool _arg)
 
virtual bool GetDoBoundaryAnalysis () const
 
virtual bool GetSortEdgeLists () const
 
virtual void SetSortEdgeLists (bool _arg)
 
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
 
virtual void AbortGenerateDataOn ()
 
virtual void EnlargeOutputRequestedRegion (DataObject *)
 
virtual const bool & GetAbortGenerateData () const
 
DataObjectPointerArray GetIndexedInputs ()
 
DataObjectPointerArray GetIndexedOutputs ()
 
NameArray GetInputNames () const
 
DataObjectPointerArray GetInputs ()
 
MultiThreaderTypeGetMultiThreader () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
 
DataObjectPointerArraySizeType GetNumberOfInputs () const
 
DataObjectPointerArraySizeType GetNumberOfOutputs () const
 
virtual
DataObjectPointerArraySizeType 
GetNumberOfValidRequiredInputs () const
 
NameArray GetOutputNames () const
 
DataObjectPointerArray GetOutputs ()
 
virtual const float & GetProgress () const
 
NameArray GetRequiredInputNames () const
 
bool HasInput (const DataObjectIdentifierType &key) const
 
bool HasOutput (const DataObjectIdentifierType &key) const
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
 
virtual void PrepareOutputs ()
 
virtual void PropagateRequestedRegion (DataObject *output)
 
virtual void ResetPipeline ()
 
virtual void SetAbortGenerateData (bool _arg)
 
void SetMultiThreader (MultiThreaderType *threader)
 
virtual void Update ()
 
virtual void UpdateLargestPossibleRegion ()
 
virtual void UpdateOutputData (DataObject *output)
 
void UpdateProgress (float progress)
 
virtual void SetReleaseDataFlag (bool flag)
 
virtual bool GetReleaseDataFlag () const
 
void ReleaseDataFlagOn ()
 
void ReleaseDataFlagOff ()
 
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
 
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
 
virtual void ReleaseDataBeforeUpdateFlagOn ()
 
virtual void ReleaseDataBeforeUpdateFlagOff ()
 
virtual void SetNumberOfWorkUnits (ThreadIdType _arg)
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexceptoverride
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

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 > >
 

Protected Member Functions

void AnalyzeBoundaryFlow (InputImageTypePointer, flat_region_table_t &, InputPixelType)
 
void BuildRetainingWall (InputImageTypePointer, ImageRegionType, InputPixelType)
 
void CollectBoundaryInformation (flat_region_table_t &)
 
void DescendFlatRegions (flat_region_table_t &, ImageRegionType)
 
virtual void GenerateConnectivity ()
 
void GenerateInputRequestedRegion () override
 
void GenerateOutputRequestedRegion (DataObject *output) override
 
void GradientDescent (InputImageTypePointer, ImageRegionType)
 
void InitializeBoundary ()
 
void LabelMinima (InputImageTypePointer, ImageRegionType, flat_region_table_t &, InputPixelType)
 
void operator= (const Self &)
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 Segmenter ()
 
 Segmenter (const Self &)
 
void UpdateOutputInformation () override
 
void UpdateSegmentTable (InputImageTypePointer, ImageRegionType)
 
 ~Segmenter () override
 
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
 
void AddOptionalInputName (const DataObjectIdentifierType &)
 
void AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
virtual void AddOutput (DataObject *output)
 
bool AddRequiredInputName (const DataObjectIdentifierType &)
 
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
virtual void CacheInputReleaseDataFlags ()
 
virtual void GenerateOutputInformation ()
 
DataObjectGetInput (const DataObjectIdentifierType &key)
 
const DataObjectGetInput (const DataObjectIdentifierType &key) const
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredInputs () const
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredOutputs () const
 
bool IsIndexedInputName (const DataObjectIdentifierType &) const
 
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
 
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
 
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
 
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
 
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
 
virtual void PopBackInput ()
 
virtual void PopFrontInput ()
 
 ProcessObject ()
 
virtual void PropagateResetPipeline ()
 
virtual void PushBackInput (const DataObject *input)
 
virtual void PushFrontInput (const DataObject *input)
 
virtual void ReleaseInputs ()
 
virtual void RemoveInput (const DataObjectIdentifierType &key)
 
virtual void RemoveInput (DataObjectPointerArraySizeType)
 
virtual void RemoveOutput (const DataObjectIdentifierType &key)
 
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
 
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
 
virtual void RestoreInputReleaseDataFlags ()
 
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
 
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
 
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
 
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
 
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
 
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
 
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
 
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
 
virtual void SetPrimaryInput (DataObject *input)
 
virtual void SetPrimaryOutput (DataObject *output)
 
void SetRequiredInputNames (const NameArray &)
 
virtual void VerifyInputInformation () ITKv5_CONST
 
virtual void VerifyPreconditions () ITKv5_CONST
 
 ~ProcessObject () override
 
DataObjectGetInput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryInput ()
 
const DataObjectGetPrimaryInput () const
 
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryInputName () const
 
DataObjectGetOutput (const DataObjectIdentifierType &key)
 
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
 
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryOutputName () const
 
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryOutput ()
 
const DataObjectGetPrimaryOutput () const
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

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
 

Member Typedef Documentation

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::BoundaryFlatHashValueType = typename BoundaryType::FlatHashValueType

Definition at line 106 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::BoundaryIndexType = typename BoundaryType::IndexType

Definition at line 105 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::BoundaryType = Boundary< InputPixelType, Self::ImageDimension >

Definition at line 104 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::BoundaryTypePointer = typename BoundaryType::Pointer

Definition at line 123 of file itkWatershedSegmenter.h.

template<typename TInputImage>
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.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::DataObjectPointer = DataObject::Pointer

Definition at line 108 of file itkWatershedSegmenter.h.

Standard itk::ProcessObject subclass method.

Definition at line 201 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::edge_table_hash_t = itksys::hash_map< IdentifierType, edge_table_t, itksys::hash< IdentifierType > >
protected

Definition at line 267 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::edge_table_t = itksys::hash_map< IdentifierType, InputPixelType, itksys::hash< IdentifierType > >
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.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::flat_region_table_t = itksys::hash_map< IdentifierType, flat_region_t, itksys::hash< IdentifierType > >
protected

Table for storing flat region information.

Definition at line 253 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::ImageRegionType = typename InputImageType::RegionType

Definition at line 101 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::InputImageType = TInputImage

Define image types and dimensionality

Definition at line 96 of file itkWatershedSegmenter.h.

template<typename TInputImage>
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.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::InputPixelType = typename InputImageType::PixelType

Definition at line 102 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::OutputImageType = Image< IdentifierType, Self::ImageDimension >

Definition at line 100 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::OutputImageTypePointer = typename OutputImageType::Pointer

Definition at line 121 of file itkWatershedSegmenter.h.

template<typename TInputImage>
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.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::SegmentTableType = SegmentTable< InputPixelType >

Definition at line 107 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::SegmentTableTypePointer = typename SegmentTableType::Pointer

Definition at line 122 of file itkWatershedSegmenter.h.

template<typename TInputImage>
using itk::watershed::Segmenter< TInputImage >::Self = Segmenter

Standard self type alias

Definition at line 93 of file itkWatershedSegmenter.h.

template<typename TInputImage>
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.

Constructor & Destructor Documentation

template<typename TInputImage>
itk::watershed::Segmenter< TInputImage >::Segmenter ( )
protected
template<typename TInputImage>
itk::watershed::Segmenter< TInputImage >::Segmenter ( const Self )
inlineprotected

Definition at line 270 of file itkWatershedSegmenter.h.

template<typename TInputImage>
itk::watershed::Segmenter< TInputImage >::~Segmenter ( )
overrideprotected

Member Function Documentation

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::AnalyzeBoundaryFlow ( InputImageTypePointer  ,
flat_region_table_t ,
InputPixelType   
)
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::BuildRetainingWall ( InputImageTypePointer  ,
ImageRegionType  ,
InputPixelType   
)
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::CollectBoundaryInformation ( flat_region_table_t )
protected

Traverses each boundary and fills in the data needed for joining streamed chunks of an image volume. Only necessary for streaming applications.

template<typename TInputImage>
virtual::itk::LightObject::Pointer itk::watershed::Segmenter< TInputImage >::CreateAnother ( ) const
virtual

Methods to implement smart pointers and work with the itk object factory

Reimplemented from itk::Object.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::DescendFlatRegions ( flat_region_table_t ,
ImageRegionType   
)
protected

Associates each flat region with a local minimum and relabels accordingly.

template<typename TInputImage>
virtual void itk::watershed::Segmenter< TInputImage >::GenerateConnectivity ( )
protectedvirtual

Constructs the connectivity list and the corresponding set of directional Offset indices.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::GenerateData ( )
overridevirtual

Standard non-threaded pipeline execution method.

Reimplemented from itk::ProcessObject.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::GenerateInputRequestedRegion ( )
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::GenerateOutputRequestedRegion ( DataObject output)
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.

template<typename TInputImage>
BoundaryType* itk::watershed::Segmenter< TInputImage >::GetBoundary ( )
inline

Returns the boundary information data necessary only for data streaming applications.

Definition at line 165 of file itkWatershedSegmenter.h.

template<typename TInputImage>
virtual IdentifierType itk::watershed::Segmenter< TInputImage >::GetCurrentLabel ( ) const
virtual

Gets/Sets the initial label (IdentifierType integer value) used by the labeling algorithm. Only necessary for streaming applications.

template<typename TInputImage>
virtual bool itk::watershed::Segmenter< TInputImage >::GetDoBoundaryAnalysis ( ) const
virtual

Turns on special labeling of the boundaries for streaming applications. The default value is FALSE, meaning that boundary analysis is turned off.

template<typename TInputImage>
InputImageType* itk::watershed::Segmenter< TInputImage >::GetInputImage ( )
inline

Get/Set the input image.

Definition at line 132 of file itkWatershedSegmenter.h.

template<typename TInputImage>
ImageRegionType itk::watershed::Segmenter< TInputImage >::GetLargestPossibleRegion ( ) const
inline

Definition at line 191 of file itkWatershedSegmenter.h.

template<typename TInputImage>
virtual const char* itk::watershed::Segmenter< TInputImage >::GetNameOfClass ( ) const
virtual

Methods to implement smart pointers and work with the itk object factory

Reimplemented from itk::ProcessObject.

template<typename TInputImage>
OutputImageType* itk::watershed::Segmenter< TInputImage >::GetOutputImage ( )
inline

Get/Set the labeled output image. The output image is always of IdentifierType integers.

Definition at line 143 of file itkWatershedSegmenter.h.

template<typename TInputImage>
SegmentTableType* itk::watershed::Segmenter< TInputImage >::GetSegmentTable ( )
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.

template<typename TInputImage>
virtual bool itk::watershed::Segmenter< TInputImage >::GetSortEdgeLists ( ) const
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.

template<typename TInputImage>
virtual double itk::watershed::Segmenter< TInputImage >::GetThreshold ( ) const
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::GradientDescent ( InputImageTypePointer  ,
ImageRegionType   
)
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::InitializeBoundary ( )
protected

Allocates boundary structure information and sets the boundary data to null values.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::LabelMinima ( InputImageTypePointer  ,
ImageRegionType  ,
flat_region_table_t ,
InputPixelType   
)
protected

Labels all the local minima in the image. Also identifies and labels connected "flat" regions.

template<typename TInputImage>
DataObjectPointer itk::watershed::Segmenter< TInputImage >::MakeOutput ( DataObjectPointerArraySizeType  idx)
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.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::MergeFlatRegions ( flat_region_table_t ,
EquivalencyTable::Pointer   
)
staticprotected

Helper function. Finds the minimum and maximum values in an image.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::MinMax ( InputImageTypePointer  img,
ImageRegionType  region,
InputPixelType min,
InputPixelType max 
)
staticprotected

Helper function. Finds the minimum and maximum values in an image.

template<typename TInputImage>
static Pointer itk::watershed::Segmenter< TInputImage >::New ( )
static

Methods to implement smart pointers and work with the itk object factory

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::operator= ( const Self )
inlineprotected

Definition at line 274 of file itkWatershedSegmenter.h.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
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.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::RelabelImage ( OutputImageTypePointer  ,
ImageRegionType  ,
EquivalencyTable::Pointer   
)
static

Helper function. Other classes may have occasion to use this. Relabels an image according to a table of equivalencies.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::SetBoundary ( BoundaryType b)
inline

Definition at line 171 of file itkWatershedSegmenter.h.

template<typename TInputImage>
virtual void itk::watershed::Segmenter< TInputImage >::SetCurrentLabel ( IdentifierType  _arg)
virtual

Gets/Sets the initial label (IdentifierType integer value) used by the labeling algorithm. Only necessary for streaming applications.

template<typename TInputImage>
virtual void itk::watershed::Segmenter< TInputImage >::SetDoBoundaryAnalysis ( bool  _arg)
virtual

Turns on special labeling of the boundaries for streaming applications. The default value is FALSE, meaning that boundary analysis is turned off.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::SetInputImage ( InputImageType img)
inline

Definition at line 138 of file itkWatershedSegmenter.h.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::SetInputImageValues ( InputImageTypePointer  img,
const ImageRegionType  region,
InputPixelType  value 
)
staticprotected

Helper functions for filling in regions with values

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::SetLargestPossibleRegion ( ImageRegionType  reg)
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::SetOutputImage ( OutputImageType img)
inline

Definition at line 149 of file itkWatershedSegmenter.h.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::SetOutputImageValues ( OutputImageTypePointer  img,
const ImageRegionType  region,
IdentifierType  value 
)
staticprotected
template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::SetSegmentTable ( SegmentTableType s)
inline

Definition at line 160 of file itkWatershedSegmenter.h.

template<typename TInputImage>
virtual void itk::watershed::Segmenter< TInputImage >::SetSortEdgeLists ( bool  _arg)
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.

template<typename TInputImage>
virtual void itk::watershed::Segmenter< TInputImage >::SetThreshold ( double  _arg)
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.

template<typename TInputImage>
static void itk::watershed::Segmenter< TInputImage >::Threshold ( InputImageTypePointer  destination,
InputImageTypePointer  source,
const ImageRegionType  source_region,
const ImageRegionType  destination_region,
InputPixelType  threshold 
)
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::UpdateOutputInformation ( )
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.

template<typename TInputImage>
void itk::watershed::Segmenter< TInputImage >::UpdateSegmentTable ( InputImageTypePointer  ,
ImageRegionType   
)
protected

Adds entries to the output segment table for all labeled segments in the image.

Member Data Documentation

template<typename TInputImage>
constexpr unsigned int itk::watershed::Segmenter< TInputImage >::ImageDimension = TInputImage::ImageDimension
static

Definition at line 97 of file itkWatershedSegmenter.h.

template<typename TInputImage>
connectivity_t itk::watershed::Segmenter< TInputImage >::m_Connectivity
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.

template<typename TInputImage>
IdentifierType itk::watershed::Segmenter< TInputImage >::m_CurrentLabel
private

Definition at line 379 of file itkWatershedSegmenter.h.

template<typename TInputImage>
bool itk::watershed::Segmenter< TInputImage >::m_DoBoundaryAnalysis
private

Definition at line 376 of file itkWatershedSegmenter.h.

template<typename TInputImage>
ImageRegionType itk::watershed::Segmenter< TInputImage >::m_LargestPossibleRegion
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.

template<typename TInputImage>
double itk::watershed::Segmenter< TInputImage >::m_MaximumFloodLevel
private

Definition at line 378 of file itkWatershedSegmenter.h.

template<typename TInputImage>
bool itk::watershed::Segmenter< TInputImage >::m_SortEdgeLists
private

Definition at line 375 of file itkWatershedSegmenter.h.

template<typename TInputImage>
double itk::watershed::Segmenter< TInputImage >::m_Threshold
private

Definition at line 377 of file itkWatershedSegmenter.h.

template<typename TInputImage>
constexpr short itk::watershed::Segmenter< TInputImage >::NULL_FLOW = -1
static

A constant used in the labeling algorithm.

Definition at line 129 of file itkWatershedSegmenter.h.

template<typename TInputImage>
constexpr IdentifierType itk::watershed::Segmenter< TInputImage >::NULL_LABEL = 0
static

A constant used in the labeling algorithm.

Definition at line 126 of file itkWatershedSegmenter.h.


The documentation for this class was generated from the following file: