18 #ifndef itkVoronoiSegmentationImageFilterBase_h
19 #define itkVoronoiSegmentationImageFilterBase_h
58 template<
typename TInputImage,
typename TOutputImage,
typename TBinaryPriorImage = Image<
unsigned char, 2 > >
78 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
115 itkSetMacro(NumberOfSeeds,
int);
116 itkGetConstMacro(NumberOfSeeds,
int);
126 itkSetMacro(Steps,
int);
127 itkGetConstMacro(Steps,
int);
131 itkGetConstMacro(LastStepSeeds,
int);
134 itkGetConstMacro(NumberOfSeedsToAdded,
int);
137 itkSetMacro(UseBackgroundInAPrior,
bool);
138 itkGetConstMacro(UseBackgroundInAPrior,
bool);
142 itkSetMacro(OutputBoundary,
bool);
143 itkGetConstMacro(OutputBoundary,
bool);
148 itkSetMacro(InteractiveSegmentation,
bool);
149 itkGetConstMacro(InteractiveSegmentation,
bool);
150 itkBooleanMacro(InteractiveSegmentation);
154 itkSetMacro(MeanDeviation,
double);
155 itkGetConstMacro(MeanDeviation,
double);
171 void RunSegmentOneStep();
174 virtual void MakeSegmentBoundary();
176 virtual void MakeSegmentObject();
180 {
return m_WorkingVD; }
182 #if !defined( ITK_WRAPPING_PARSER ) // generates invalid iterator instantiation
189 m_NumberOfSeeds = num;
190 m_WorkingVD->SetSeeds(num, begin);
201 m_NumberOfSeeds = seeds.size();
202 auto it = seeds.begin();
203 m_WorkingVD->SetSeeds(m_NumberOfSeeds, it);
209 {
return m_WorkingVD->GetSeed(SeedID); }
212 void DrawDiagram(VDImagePointer result,
unsigned char incolor,
213 unsigned char outcolor,
unsigned char boundcolor);
215 void BeforeNextStep();
219 void GenerateInputRequestedRegion()
override;
223 void EnlargeOutputRequestedRegion(
DataObject *output)
override;
228 void PrintSelf(std::ostream & os,
Indent indent)
const override;
230 void GenerateData()
override;
233 int m_NumberOfSeeds{200};
236 int m_LastStepSeeds{0};
237 int m_NumberOfSeedsToAdded{0};
238 int m_NumberOfBoundary{0};
243 double m_MeanDeviation{0.8};
244 bool m_UseBackgroundInAPrior{
false};
245 bool m_OutputBoundary{
false};
247 bool m_InteractiveSegmentation{
false};
257 virtual void ClassifyDiagram();
260 virtual void GenerateAddingSeeds();
268 void FillPolygon(PointTypeDeque vertlist, OutputPixelType color = 1);
274 void drawVDline(VDImagePointer result,
PointType p1,
PointType p2,
unsigned char color);
278 #ifndef ITK_MANUAL_INSTANTIATION
279 #include "itkVoronoiSegmentationImageFilterBase.hxx"
Base class for VoronoiSegmentationImageFilter.
typename CellType::PointIdIterator PointIdIterator
typename VoronoiDiagram::CellType CellType
void SetSeeds(int num, SeedsIterator begin)
unsigned long SizeValueType
typename TInputImage::IndexType IndexType
typename Superclass::CellType CellType
typename VoronoiDiagram::Pointer VoronoiPointer
std::vector< PointType > SeedsType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename Superclass::CellAutoPointer CellAutoPointer
typename VDImage::Pointer VDImagePointer
Implements the 2-Dimensional Voronoi Diagram.
VoronoiDiagramGenerator::Pointer m_VDGenerator
Base class for all process objects that output image data.
std::vector< unsigned char > m_Label
TInputImage InputImageType
PointType GetSeed(int SeedID)
typename TInputImage::PixelType PixelType
std::vector< PointType > PointTypeVector
typename VoronoiDiagram::VoronoiEdge EdgeInfo
typename VoronoiDiagram::PointType PointType
std::vector< IndexType > IndexList
void SetSeeds(SeedsType &seeds)
typename InputImageType::Pointer InputImagePointer
typename VoronoiDiagram::SeedsType SeedsType
ImageBaseType::SizeType SizeType
typename VoronoiDiagram::VoronoiEdgeIterator EdgeIterator
ImageBaseType::IndexType IndexType
virtual void TakeAPrior(const BinaryObjectImage *)
TOutputImage OutputImageType
virtual bool TestHomogeneity(IndexList &)
Represent a n-dimensional size (bounds) of a n-dimensional image.
typename VoronoiDiagram::CellAutoPointer CellAutoPointer
std::vector< PointType > m_SeedsToAdded
typename TInputImage::RegionType RegionType
VoronoiPointer GetVoronoiDiagram()
VoronoiDiagram::Pointer m_WorkingVD
typename TInputImage::SizeType SizeType
Base class for filters that take an image as input and produce an image as output.
std::vector< SizeValueType > m_NumberOfPixels
Implement the Sweep Line Algorithm for the construction of the 2D Voronoi Diagram.
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
typename VoronoiDiagram::SeedsIterator SeedsIterator
typename VoronoiDiagram::NeighborIdIterator NeighborIdIterator
typename BinaryObjectImage::Pointer BinaryObjectImagePointer
std::deque< PointType > PointTypeDeque
typename std::vector< VoronoiEdge >::iterator VoronoiEdgeIterator
ImageBaseType::RegionType RegionType
typename INTvector::iterator NeighborIdIterator
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.
typename SeedsType::iterator SeedsIterator
Templated n-dimensional image class.
typename TOutputImage::PixelType OutputPixelType