18 #ifndef __itkWatershedSegmenter_h
19 #define __itkWatershedSegmenter_h
87 template<
class TInputImage >
97 itkStaticConstMacro(ImageDimension,
unsigned int,
98 TInputImage::ImageDimension);
135 return itkDynamicCastInDebugMode< InputImageType * >
146 return itkDynamicCastInDebugMode< OutputImageType * >
157 return itkDynamicCastInDebugMode< SegmentTableType * >
168 return itkDynamicCastInDebugMode< BoundaryType * >
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 void PrintSelf(std::ostream & os,
Indent indent)
const;
282 virtual void GenerateConnectivity();
287 void GenerateInputRequestedRegion();
289 void GenerateOutputRequestedRegion(
DataObject *output);
291 void UpdateOutputInformation();
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);
355 static void SetInputImageValues(InputImageTypePointer img,
356 const ImageRegionType region,
357 InputPixelType value);
359 static void SetOutputImageValues(OutputImageTypePointer img,
360 const ImageRegionType region,
388 #ifndef ITK_MANUAL_INSTANTIATION
389 #include "itkWatershedSegmenter.hxx"