ITK
4.1.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.
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
Reimplemented from itk::ProcessObject.
Definition at line 115 of file itkWatershedSegmenter.h.
typedef DataObject::Pointer itk::watershed::Segmenter< TInputImage >::DataObjectPointer |
Smart Pointer type to a DataObject.
Reimplemented from itk::ProcessObject.
Definition at line 109 of file itkWatershedSegmenter.h.
typedef ProcessObject::DataObjectPointerArraySizeType itk::watershed::Segmenter< TInputImage >::DataObjectPointerArraySizeType |
Standard itk::ProcessObject subclass method.
Reimplemented from itk::ProcessObject.
Definition at line 202 of file itkWatershedSegmenter.h.
typedef itksys::hash_map< IdentifierType, edge_table_t, itksys::hash< IdentifierType > > itk::watershed::Segmenter< TInputImage >::edge_table_hash_t [protected] |
Definition at line 270 of file itkWatershedSegmenter.h.
typedef itksys::hash_map< IdentifierType, InputPixelType, itksys::hash< IdentifierType > > itk::watershed::Segmenter< TInputImage >::edge_table_t [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 267 of file itkWatershedSegmenter.h.
typedef itksys::hash_map< IdentifierType, flat_region_t, itksys::hash< IdentifierType > > itk::watershed::Segmenter< TInputImage >::flat_region_table_t [protected] |
Table for storing flat region information.
Definition at line 254 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
Reimplemented from itk::ProcessObject.
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
Reimplemented from itk::ProcessObject.
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
Reimplemented from itk::ProcessObject.
Definition at line 113 of file itkWatershedSegmenter.h.
itk::watershed::Segmenter< TInputImage >::Segmenter | ( | ) | [protected] |
itk::watershed::Segmenter< TInputImage >::Segmenter | ( | const Self & | ) | [inline, protected] |
Definition at line 273 of file itkWatershedSegmenter.h.
virtual itk::watershed::Segmenter< TInputImage >::~Segmenter | ( | ) | [protected, virtual] |
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.
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.
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.
virtual::itk::LightObject::Pointer itk::watershed::Segmenter< TInputImage >::CreateAnother | ( | void | ) | const [virtual] |
Methods to implement smart pointers and work with the itk object factory
Reimplemented from itk::Object.
void itk::watershed::Segmenter< TInputImage >::DescendFlatRegions | ( | flat_region_table_t & | , |
ImageRegionType | |||
) | [protected] |
Associates each flat region with a local minimum and relabels accordingly.
virtual void itk::watershed::Segmenter< TInputImage >::GenerateConnectivity | ( | ) | [protected, virtual] |
Constructs the connectivity list and the corresponding set of directional Offset indicies.
void itk::watershed::Segmenter< TInputImage >::GenerateData | ( | ) | [virtual] |
Standard non-threaded pipeline execution method.
Reimplemented from itk::ProcessObject.
void itk::watershed::Segmenter< TInputImage >::GenerateInputRequestedRegion | ( | ) | [protected, virtual] |
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.
void itk::watershed::Segmenter< TInputImage >::GenerateOutputRequestedRegion | ( | DataObject * | output | ) | [protected, virtual] |
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.
BoundaryType* itk::watershed::Segmenter< TInputImage >::GetBoundary | ( | void | ) | [inline] |
Returns the boundary information data necessary only for data streaming applications.
Definition at line 166 of file itkWatershedSegmenter.h.
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.
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.
InputImageType* itk::watershed::Segmenter< TInputImage >::GetInputImage | ( | void | ) | [inline] |
Get/Set the input image.
Definition at line 133 of file itkWatershedSegmenter.h.
ImageRegionType itk::watershed::Segmenter< TInputImage >::GetLargestPossibleRegion | ( | ) | const [inline] |
Definition at line 192 of file itkWatershedSegmenter.h.
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.
OutputImageType* itk::watershed::Segmenter< TInputImage >::GetOutputImage | ( | void | ) | [inline] |
Get/Set the labeled output image. The output image is always of IdentifierType integers.
Definition at line 144 of file itkWatershedSegmenter.h.
SegmentTableType* itk::watershed::Segmenter< TInputImage >::GetSegmentTable | ( | void | ) | [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 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.
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 , 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.
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.
void itk::watershed::Segmenter< TInputImage >::InitializeBoundary | ( | ) | [protected] |
Allocates boundary structure information and sets the boundary data to null values.
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.
virtual DataObjectPointer itk::watershed::Segmenter< TInputImage >::MakeOutput | ( | DataObjectPointerArraySizeType | idx | ) | [virtual] |
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.
static void itk::watershed::Segmenter< TInputImage >::MergeFlatRegions | ( | flat_region_table_t & | , |
EquivalencyTable::Pointer | |||
) | [static, protected] |
Helper function. Finds the minimum and maximum values in an image.
static void itk::watershed::Segmenter< TInputImage >::MinMax | ( | InputImageTypePointer | img, |
ImageRegionType | region, | ||
InputPixelType & | min, | ||
InputPixelType & | max | ||
) | [static, protected] |
Helper function. Finds the minimum and maximum values in an image.
static Pointer itk::watershed::Segmenter< TInputImage >::New | ( | ) | [static] |
Methods to implement smart pointers and work with the itk object factory
Reimplemented from itk::Object.
void itk::watershed::Segmenter< TInputImage >::operator= | ( | const Self & | ) | [inline, protected] |
Time when GenerateOutputInformation was last called.
Reimplemented from itk::ProcessObject.
Definition at line 277 of file itkWatershedSegmenter.h.
void itk::watershed::Segmenter< TInputImage >::PrintSelf | ( | std::ostream & | os, |
Indent | indent | ||
) | const [protected, virtual] |
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 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.
void itk::watershed::Segmenter< TInputImage >::SetBoundary | ( | BoundaryType * | b | ) | [inline] |
Definition at line 172 of file itkWatershedSegmenter.h.
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.
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.
void itk::watershed::Segmenter< TInputImage >::SetInputImage | ( | InputImageType * | img | ) | [inline] |
Definition at line 139 of file itkWatershedSegmenter.h.
static void itk::watershed::Segmenter< TInputImage >::SetInputImageValues | ( | InputImageTypePointer | img, |
const ImageRegionType | region, | ||
InputPixelType | value | ||
) | [static, protected] |
Helper functions for filling in regions with values
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 184 of file itkWatershedSegmenter.h.
void itk::watershed::Segmenter< TInputImage >::SetOutputImage | ( | OutputImageType * | img | ) | [inline] |
Definition at line 150 of file itkWatershedSegmenter.h.
static void itk::watershed::Segmenter< TInputImage >::SetOutputImageValues | ( | OutputImageTypePointer | img, |
const ImageRegionType | region, | ||
IdentifierType | value | ||
) | [static, protected] |
void itk::watershed::Segmenter< TInputImage >::SetSegmentTable | ( | SegmentTableType * | s | ) | [inline] |
Definition at line 161 of file itkWatershedSegmenter.h.
virtual void itk::watershed::Segmenter< TInputImage >::SetSortEdgeLists | ( | bool | _arg | ) | [virtual] |
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 , 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.
static void itk::watershed::Segmenter< TInputImage >::Threshold | ( | InputImageTypePointer | destination, |
InputImageTypePointer | source, | ||
const ImageRegionType | source_region, | ||
const ImageRegionType | destination_region, | ||
InputPixelType | threshold | ||
) | [static, protected] |
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.
void itk::watershed::Segmenter< TInputImage >::UpdateOutputInformation | ( | ) | [protected, virtual] |
Update the information decribing 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.
void itk::watershed::Segmenter< TInputImage >::UpdateSegmentTable | ( | InputImageTypePointer | , |
ImageRegionType | |||
) | [protected] |
Adds entries to the output segment table for all labeled segments in the image.
const unsigned int itk::watershed::Segmenter< TInputImage >::ImageDimension = TInputImage::ImageDimension [static] |
Definition at line 98 of file itkWatershedSegmenter.h.
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 367 of file itkWatershedSegmenter.h.
IdentifierType itk::watershed::Segmenter< TInputImage >::m_CurrentLabel [private] |
Definition at line 382 of file itkWatershedSegmenter.h.
bool itk::watershed::Segmenter< TInputImage >::m_DoBoundaryAnalysis [private] |
Definition at line 379 of file itkWatershedSegmenter.h.
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 376 of file itkWatershedSegmenter.h.
double itk::watershed::Segmenter< TInputImage >::m_MaximumFloodLevel [private] |
Definition at line 381 of file itkWatershedSegmenter.h.
bool itk::watershed::Segmenter< TInputImage >::m_SortEdgeLists [private] |
Definition at line 378 of file itkWatershedSegmenter.h.
double itk::watershed::Segmenter< TInputImage >::m_Threshold [private] |
Definition at line 380 of file itkWatershedSegmenter.h.
short itk::watershed::Segmenter< TInputImage >::NULL_FLOW [static] |
A constant used in the labeling algorithm.
Definition at line 130 of file itkWatershedSegmenter.h.
IdentifierType itk::watershed::Segmenter< TInputImage >::NULL_LABEL [static] |
A constant used in the labeling algorithm.
Definition at line 127 of file itkWatershedSegmenter.h.