ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkVoronoiSegmentationRGBImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkVoronoiSegmentationRGBImageFilter_h
19#define itkVoronoiSegmentationRGBImageFilter_h
20
22
23namespace itk
24{
49template <typename TInputImage, typename TOutputImage>
50class ITK_TEMPLATE_EXPORT VoronoiSegmentationRGBImageFilter
51 : public VoronoiSegmentationImageFilterBase<TInputImage, TOutputImage>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(VoronoiSegmentationRGBImageFilter);
55
61
63 itkOverrideGetNameOfClassMacro(VoronoiSegmentationRGBImageFilter);
64
66 itkNewMacro(Self);
67
69 using typename Superclass::BinaryObjectImage;
70 using typename Superclass::IndexList;
71 using typename Superclass::IndexType;
72 using typename Superclass::RegionType;
73 using typename Superclass::PixelType;
74 using typename Superclass::InputImagePointer;
75 using typename Superclass::InputImageType;
78
80 void
81 SetMeanPercentError(const double x[6]);
82 void
83 SetSTDPercentError(const double x[6]);
84 void
86 {
87 for (int i = 0; i < 6; ++i)
88 {
89 x[i] = m_MeanPercentError[i];
90 }
91 }
92 void
93 GetSTDPercentError(double x[6])
94 {
95 for (int i = 0; i < 6; ++i)
96 {
97 x[i] = m_STDPercentError[i];
98 }
99 }
100 void
101 GetMean(double x[6])
102 {
103 for (int i = 0; i < 6; ++i)
104 {
105 x[i] = m_Mean[i];
106 }
107 }
108 void
109 GetSTD(double x[6])
110 {
111 for (int i = 0; i < 6; ++i)
112 {
113 x[i] = m_STD[i];
114 }
115 }
116 void
117 SetMean(const double x[6])
118 {
119 for (int i = 0; i < 6; ++i)
120 {
121 m_Mean[i] = x[i];
122 }
123 }
124 void
125 SetSTD(const double x[6])
126 {
127 for (int i = 0; i < 6; ++i)
128 {
129 m_STD[i] = x[i];
130 }
131 }
132 void
133 GetMeanTolerance(double x[6])
134 {
135 for (int i = 0; i < 6; ++i)
136 {
137 x[i] = m_MeanTolerance[i];
138 }
139 }
140 void
141 GetSTDTolerance(double x[6])
142 {
143 for (int i = 0; i < 6; ++i)
144 {
145 x[i] = m_STDTolerance[i];
146 }
147 }
148
149
153 itkSetMacro(MaxValueOfRGB, double);
154 itkGetConstMacro(MaxValueOfRGB, double);
156
159 void
160 SetTestMean(unsigned int t1, unsigned int t2, unsigned int t3)
161 {
162 m_TestMean[0] = t1;
163 m_TestMean[1] = t2;
164 m_TestMean[2] = t3;
165 }
166
167 void
168 SetTestSTD(unsigned int t1, unsigned int t2, unsigned int t3)
169 {
170 m_TestSTD[0] = t1;
171 m_TestSTD[1] = t2;
172 m_TestSTD[2] = t3;
173 }
174
175 void
176 GetTestMean(unsigned int x[3])
177 {
178 x[0] = m_TestMean[0];
179 x[1] = m_TestMean[1];
180 x[2] = m_TestMean[2];
181 }
182
183 void
184 GetTestSTD(unsigned int x[3])
185 {
186 x[0] = m_TestSTD[0];
187 x[1] = m_TestSTD[1];
188 x[2] = m_TestSTD[2];
189 }
190
191 void
192 TakeAPrior(const BinaryObjectImage * aprior) override;
193
195 void
196 SetInput(const InputImageType * input) override;
197
198 void
199 SetInput(unsigned int, const InputImageType * input) override;
200
202 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
203 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
204
208
209protected:
212 void
213 PrintSelf(std::ostream & os, Indent indent) const override;
214
215private:
216 double m_Mean[6]{};
217 double m_STD[6]{};
218 double m_MeanTolerance[6]{};
219 double m_STDTolerance[6]{};
221 double m_STDPercentError[6]{};
223 unsigned int m_TestMean[3]{};
224 unsigned int m_TestSTD[3]{};
226
227 bool
228 TestHomogeneity(IndexList & Plist) override;
229};
230} // namespace itk
231
232#ifndef ITK_MANUAL_INSTANTIATION
233# include "itkVoronoiSegmentationRGBImageFilter.hxx"
234#endif
235
236#endif
virtual void SetInput(const InputImageType *input)
Templated n-dimensional image class.
Definition itkImage.h:89
SmartPointer< Self > Pointer
Definition itkImage.h:96
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
void SetTestMean(unsigned int t1, unsigned int t2, unsigned int t3)
void SetInput(unsigned int, const InputImageType *input) override
void SetMeanPercentError(const double x[6])
void SetInput(const InputImageType *input) override
void TakeAPrior(const BinaryObjectImage *aprior) override
void PrintSelf(std::ostream &os, Indent indent) const override
bool TestHomogeneity(IndexList &Plist) override
VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage > Superclass
void SetTestSTD(unsigned int t1, unsigned int t2, unsigned int t3)
void SetSTDPercentError(const double x[6])
~VoronoiSegmentationRGBImageFilter() override=default
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....