17 #ifndef __itkWatershedSegmenter_h
18 #define __itkWatershedSegmenter_h
21 #pragma warning ( disable : 4786 )
89 template <
class TInputImage>
99 itkStaticConstMacro(ImageDimension,
unsigned int,
100 TInputImage::ImageDimension);
128 itkStaticConstMacro(NULL_LABEL,
unsigned long, 0);
131 itkStaticConstMacro(NULL_FLOW,
short, -1);
183 if (reg == m_LargestPossibleRegion)
return;
184 m_LargestPossibleRegion = reg;
188 {
return m_LargestPossibleRegion; }
192 static void RelabelImage(OutputImageTypePointer,
197 virtual DataObjectPointer MakeOutput(
unsigned int idx);
201 itkSetMacro(CurrentLabel,
unsigned long);
202 itkGetConstMacro(CurrentLabel,
unsigned long);
214 itkSetClampMacro(Threshold,
double, 0.0, 1.0);
215 itkGetConstMacro(Threshold,
double);
220 itkSetMacro(DoBoundaryAnalysis,
bool);
221 itkGetConstMacro(DoBoundaryAnalysis,
bool);
227 itkGetConstMacro(SortEdgeLists,
bool);
228 itkSetMacro(SortEdgeLists,
bool);
267 void PrintSelf(std::ostream& os,
Indent indent)
const;
272 virtual void GenerateConnectivity();
277 void GenerateInputRequestedRegion();
278 void GenerateOutputRequestedRegion(
DataObject *output);
279 void UpdateOutputInformation();
283 void InitializeBoundary();
288 void AnalyzeBoundaryFlow(InputImageTypePointer,
289 flat_region_table_t &,
295 void BuildRetainingWall(InputImageTypePointer,
296 ImageRegionType, InputPixelType);
300 void LabelMinima(InputImageTypePointer,
301 ImageRegionType, flat_region_table_t &,
307 void GradientDescent(InputImageTypePointer, ImageRegionType);
311 void DescendFlatRegions(flat_region_table_t &, ImageRegionType);
315 void UpdateSegmentTable(InputImageTypePointer, ImageRegionType);
320 void CollectBoundaryInformation(flat_region_table_t &);
327 static void Threshold(InputImageTypePointer destination,
328 InputImageTypePointer source,
329 const ImageRegionType source_region,
330 const ImageRegionType destination_region,
331 InputPixelType threshold);
334 static void MinMax(InputImageTypePointer img,
335 ImageRegionType region,
337 InputPixelType &max);
343 static void SetInputImageValues(InputImageTypePointer img,
344 const ImageRegionType region,
345 InputPixelType value);
347 static void SetOutputImageValues(OutputImageTypePointer img,
348 const ImageRegionType region,
349 unsigned long value);
377 #ifndef ITK_MANUAL_INSTANTIATION