18 #ifndef itkWatershedSegmenter_h
19 #define itkWatershedSegmenter_h
88 template <
typename TInputImage>
98 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
115 itkOverrideGetNameOfClassMacro(
Segmenter);
128 static constexpr
short NULL_FLOW = -1;
187 GenerateData()
override;
198 if (reg == m_LargestPossibleRegion)
202 m_LargestPossibleRegion = reg;
210 return m_LargestPossibleRegion;
219 using Superclass::MakeOutput;
239 itkSetClampMacro(Threshold,
double, 0.0, 1.0);
240 itkGetConstMacro(Threshold,
double);
246 itkSetMacro(DoBoundaryAnalysis,
bool);
247 itkGetConstMacro(DoBoundaryAnalysis,
bool);
254 itkGetConstMacro(SortEdgeLists,
bool);
255 itkSetMacro(SortEdgeLists,
bool);
267 bool is_on_boundary{
false };
293 PrintSelf(std::ostream & os,
Indent indent)
const override;
302 GenerateConnectivity();
308 GenerateInputRequestedRegion()
override;
311 GenerateOutputRequestedRegion(
DataObject * output)
override;
314 UpdateOutputInformation()
override;
319 InitializeBoundary();
325 AnalyzeBoundaryFlow(InputImageTypePointer, flat_region_table_t &, InputPixelType);
330 void BuildRetainingWall(InputImageTypePointer, ImageRegionType, InputPixelType);
335 LabelMinima(InputImageTypePointer, ImageRegionType, flat_region_table_t &, InputPixelType);
340 void GradientDescent(InputImageTypePointer, ImageRegionType);
345 DescendFlatRegions(flat_region_table_t &, ImageRegionType);
349 void UpdateSegmentTable(InputImageTypePointer, ImageRegionType);
355 CollectBoundaryInformation(flat_region_table_t &);
363 Threshold(InputImageTypePointer destination,
364 InputImageTypePointer source,
365 const ImageRegionType source_region,
366 const ImageRegionType destination_region,
367 InputPixelType threshold);
371 MinMax(InputImageTypePointer img, ImageRegionType region, InputPixelType & min, InputPixelType & max);
379 SetInputImageValues(InputImageTypePointer img,
const ImageRegionType region, InputPixelType value);
382 SetOutputImageValues(OutputImageTypePointer img,
const ImageRegionType region,
IdentifierType value);
389 connectivity_t m_Connectivity{};
400 bool m_SortEdgeLists{};
401 bool m_DoBoundaryAnalysis{};
402 double m_Threshold{};
403 double m_MaximumFloodLevel{};
409 #ifndef ITK_MANUAL_INSTANTIATION
410 # include "itkWatershedSegmenter.hxx"