18 #ifndef itkWatershedSegmenter_h
19 #define itkWatershedSegmenter_h
87 template<
typename TInputImage >
97 itkStaticConstMacro(ImageDimension,
unsigned int,
98 TInputImage::ImageDimension);
130 itkStaticConstMacro(NULL_FLOW,
short, -1);
135 return itkDynamicCastInDebugMode< InputImageType * >
146 return itkDynamicCastInDebugMode< OutputImageType * >
157 return itkDynamicCastInDebugMode< SegmentTableType * >
168 return itkDynamicCastInDebugMode< BoundaryType * >
176 virtual void GenerateData() ITK_OVERRIDE;
186 if ( reg == m_LargestPossibleRegion ) {
return; }
187 m_LargestPossibleRegion = reg;
193 {
return m_LargestPossibleRegion; }
197 static void RelabelImage(OutputImageTypePointer,
203 using Superclass::MakeOutput;
222 itkSetClampMacro(Threshold,
double, 0.0, 1.0);
223 itkGetConstMacro(Threshold,
double);
229 itkSetMacro(DoBoundaryAnalysis,
bool);
230 itkGetConstMacro(DoBoundaryAnalysis,
bool);
237 itkGetConstMacro(SortEdgeLists,
bool);
238 itkSetMacro(SortEdgeLists,
bool);
254 typedef itksys::hash_map< IdentifierType, flat_region_t, itksys::hash< IdentifierType > >
267 typedef itksys::hash_map< IdentifierType, InputPixelType, itksys::hash< IdentifierType >
270 typedef itksys::hash_map< IdentifierType, edge_table_t, itksys::hash< IdentifierType >
276 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
278 void operator=(const
Self &) {}
282 virtual void GenerateConnectivity();
287 virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
289 virtual
void GenerateOutputRequestedRegion(
DataObject *output) ITK_OVERRIDE;
291 virtual
void UpdateOutputInformation() ITK_OVERRIDE;
295 void InitializeBoundary();
300 void AnalyzeBoundaryFlow(InputImageTypePointer,
301 flat_region_table_t &,
307 void BuildRetainingWall(InputImageTypePointer,
308 ImageRegionType, InputPixelType);
312 void LabelMinima(InputImageTypePointer,
313 ImageRegionType, flat_region_table_t &,
319 void GradientDescent(InputImageTypePointer, ImageRegionType);
323 void DescendFlatRegions(flat_region_table_t &, ImageRegionType);
327 void UpdateSegmentTable(InputImageTypePointer, ImageRegionType);
332 void CollectBoundaryInformation(flat_region_table_t &);
339 static
void Threshold(InputImageTypePointer destination,
340 InputImageTypePointer source,
341 const ImageRegionType source_region,
342 const ImageRegionType destination_region,
343 InputPixelType threshold);
346 static
void MinMax(InputImageTypePointer img,
347 ImageRegionType region,
348 InputPixelType & min,
349 InputPixelType & max);
352 static
void MergeFlatRegions(flat_region_table_t &,
EquivalencyTable::Pointer);
355 static
void SetInputImageValues(InputImageTypePointer img,
356 const ImageRegionType region,
357 InputPixelType value);
359 static
void SetOutputImageValues(OutputImageTypePointer img,
360 const ImageRegionType region,
368 connectivity_t m_Connectivity;
377 ImageRegionType m_LargestPossibleRegion;
379 bool m_SortEdgeLists;
380 bool m_DoBoundaryAnalysis;
382 double m_MaximumFloodLevel;
388 #ifndef ITK_MANUAL_INSTANTIATION
389 #include "itkWatershedSegmenter.hxx"
IdentifierType * min_label_ptr
flat_hash_t::value_type FlatHashValueType
OutputImageType * GetOutputImage(void)
InputImageType::OffsetType * direction
itksys::hash_map< IdentifierType, edge_table_t, itksys::hash< IdentifierType > > edge_table_hash_t
Light weight base class for most itk classes.
BoundaryType::FlatHashValueType BoundaryFlatHashValueType
SegmentTableType::Pointer SegmentTableTypePointer
TInputImage InputImageType
ImageRegionType GetLargestPossibleRegion() const
SmartPointer< const Self > ConstPointer
InputPixelType bounds_min
SegmentTable< InputPixelType > SegmentTableType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
void SetOutputImage(OutputImageType *img)
std::pair< unsigned, unsigned > IndexType
InputImageType::Pointer InputImageTypePointer
InputImageType * GetInputImage(void)
InputImageType::PixelType InputPixelType
SegmentTableType * GetSegmentTable(void)
Boundary< InputPixelType, itkGetStaticConstMacro(ImageDimension) > BoundaryType
SizeValueType IdentifierType
DataObject::Pointer DataObjectPointer
Hash table to manage integral label equivalencies.
InputImageType::RegionType ImageRegionType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
SmartPointer< Self > Pointer
itksys::hash_map< IdentifierType, InputPixelType, itksys::hash< IdentifierType > > edge_table_t
BoundaryType::Pointer BoundaryTypePointer
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Image< IdentifierType, itkGetStaticConstMacro(ImageDimension) > OutputImageType
BoundaryType * GetBoundary(void)
void SetSegmentTable(SegmentTableType *s)
OutputImageType::Pointer OutputImageTypePointer
Control indentation during Print() invocation.
itksys::hash_map< IdentifierType, flat_region_t, itksys::hash< IdentifierType > > flat_region_table_t
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
BoundaryType::IndexType BoundaryIndexType
virtual void SetNthOutput(DataObjectPointerArraySizeType num, DataObject *output)
void SetBoundary(BoundaryType *b)
Base class for all data objects in ITK.
Templated n-dimensional image class.
void SetInputImage(InputImageType *img)
DataObject * GetOutput(const DataObjectIdentifierType &key)