18 #ifndef itkVoronoiSegmentationImageFilterBase_h
19 #define itkVoronoiSegmentationImageFilterBase_h
58 template <
typename TInputImage,
typename TOutputImage,
typename TBinaryPriorImage = Image<
unsigned char, 2>>
77 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
114 itkSetMacro(NumberOfSeeds,
int);
115 itkGetConstMacro(NumberOfSeeds,
int);
125 itkSetMacro(Steps,
int);
126 itkGetConstMacro(Steps,
int);
130 itkGetConstMacro(LastStepSeeds,
int);
133 itkGetConstMacro(NumberOfSeedsToAdded,
int);
136 itkSetMacro(UseBackgroundInAPrior,
bool);
137 itkGetConstMacro(UseBackgroundInAPrior,
bool);
141 itkSetMacro(OutputBoundary,
bool);
142 itkGetConstMacro(OutputBoundary,
bool);
147 itkSetMacro(InteractiveSegmentation,
bool);
148 itkGetConstMacro(InteractiveSegmentation,
bool);
149 itkBooleanMacro(InteractiveSegmentation);
153 itkSetMacro(MeanDeviation,
double);
154 itkGetConstMacro(MeanDeviation,
double);
178 MakeSegmentBoundary();
190 #if !defined(ITK_WRAPPING_PARSER) // generates invalid iterator instantiation
198 m_NumberOfSeeds = num;
199 m_WorkingVD->SetSeeds(num, begin);
211 m_NumberOfSeeds = seeds.size();
212 auto it = seeds.begin();
213 m_WorkingVD->SetSeeds(m_NumberOfSeeds, it);
221 return m_WorkingVD->GetSeed(SeedID);
226 DrawDiagram(VDImagePointer result,
unsigned char incolor,
unsigned char outcolor,
unsigned char boundcolor);
234 GenerateInputRequestedRegion()
override;
239 EnlargeOutputRequestedRegion(
DataObject * output)
override;
245 PrintSelf(std::ostream & os,
Indent indent)
const override;
248 GenerateData()
override;
251 int m_NumberOfSeeds{ 200 };
254 int m_LastStepSeeds{ 0 };
255 int m_NumberOfSeedsToAdded{ 0 };
256 int m_NumberOfBoundary{ 0 };
258 std::vector<SizeValueType> m_NumberOfPixels{};
259 std::vector<unsigned char> m_Label{};
261 double m_MeanDeviation{ 0.8 };
262 bool m_UseBackgroundInAPrior{
false };
263 bool m_OutputBoundary{
false };
265 bool m_InteractiveSegmentation{
false };
271 std::vector<PointType> m_SeedsToAdded{};
280 GenerateAddingSeeds();
284 GetPixelIndexFromPolygon(PointTypeDeque vertlist, IndexList * PixelPool);
293 FillPolygon(PointTypeDeque vertlist, OutputPixelType color = 1);
305 #ifndef ITK_MANUAL_INSTANTIATION
306 # include "itkVoronoiSegmentationImageFilterBase.hxx"