18 #ifndef itkRGBGibbsPriorFilter_h
19 #define itkRGBGibbsPriorFilter_h
21 #include "vnl/vnl_vector.h"
22 #include "vnl/vnl_matrix.h"
55 template <
typename TInputImage,
typename TClassifiedImage>
74 using typename Superclass::InputImagePixelType;
75 using typename Superclass::InputImageRegionConstIterator;
76 using typename Superclass::InputImageRegionIterator;
77 using typename Superclass::LabelledImageRegionIterator;
78 using typename Superclass::LabelledImagePixelType;
125 return m_LabelledImage;
136 itkDebugMacro(
"setting NumberOfClasses to " << numberOfClasses);
137 if (this->m_NumberOfClasses != numberOfClasses)
139 this->m_NumberOfClasses = numberOfClasses;
149 return this->m_NumberOfClasses;
157 itkDebugMacro(
"setting MaximumNumberOfIterations to " << numberOfIterations);
158 if (this->m_MaximumNumberOfIterations != numberOfIterations)
160 this->m_MaximumNumberOfIterations = numberOfIterations;
171 return this->m_MaximumNumberOfIterations;
175 itkSetMacro(ClusterSize,
unsigned int);
176 itkGetConstMacro(ClusterSize,
unsigned int);
180 itkSetMacro(ObjectLabel, LabelType);
181 itkGetConstMacro(ObjectLabel, LabelType);
185 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
190 itkSetMacro(BoundaryGradient,
unsigned int);
191 itkGetConstMacro(BoundaryGradient,
unsigned int);
193 itkSetMacro(ObjectThreshold,
double);
194 itkGetConstMacro(ObjectThreshold,
double);
197 itkSetMacro(CliqueWeight_1,
double);
198 itkGetConstMacro(CliqueWeight_1,
double);
199 itkSetMacro(CliqueWeight_2,
double);
200 itkGetConstMacro(CliqueWeight_2,
double);
201 itkSetMacro(CliqueWeight_3,
double);
202 itkGetConstMacro(CliqueWeight_3,
double);
203 itkSetMacro(CliqueWeight_4,
double);
204 itkGetConstMacro(CliqueWeight_4,
double);
205 itkSetMacro(CliqueWeight_5,
double);
206 itkGetConstMacro(CliqueWeight_5,
double);
207 itkSetMacro(CliqueWeight_6,
double);
208 itkGetConstMacro(CliqueWeight_6,
double);
218 PrintSelf(std::ostream & os,
Indent indent)
const override;
225 MinimizeFunctional()
override;
228 GenerateData()
override;
231 ApplyGibbsLabeller();
234 ApplyGPImageFilter();
236 #ifdef ITK_USE_CONCEPT_CHECKING
258 unsigned int m_NumberOfClasses{ 0 };
261 unsigned int m_MaximumNumberOfIterations{ 10 };
266 unsigned int m_BoundaryGradient{ 7 };
269 double m_BoundaryWeight{ 1 };
272 double m_GibbsPriorWeight{ 1 };
275 int m_StartRadius{ 10 };
278 int m_RecursiveNumber{ 0 };
281 std::unique_ptr<LabelType[]> m_LabelStatus{
nullptr };
287 unsigned int m_Temp{ 0 };
293 unsigned int m_ImageWidth{ 0 };
296 unsigned int m_ImageHeight{ 0 };
299 unsigned int m_ImageDepth{ 0 };
302 unsigned int m_ClusterSize{ 10 };
308 unsigned int m_VecDim{ 0 };
314 std::unique_ptr<unsigned short[]> m_Region{
nullptr };
317 std::unique_ptr<unsigned short[]> m_RegionCount{
nullptr };
322 double m_CliqueWeight_1{ 0.0 };
325 double m_CliqueWeight_2{ 0.0 };
328 double m_CliqueWeight_3{ 0.0 };
331 double m_CliqueWeight_4{ 0.0 };
334 double m_CliqueWeight_5{ 0.0 };
337 double m_CliqueWeight_6{ 0.0 };
342 GibbsTotalEnergy(
int i);
346 GibbsEnergy(
unsigned int i,
unsigned int k,
unsigned int k1);
354 LabelRegion(
int i,
int l,
int change);
363 GenerateMediumImage();
368 GreyScalarBoundary(LabelledImageIndexType Index3D);
370 double m_ObjectThreshold{ 5.0 };
373 #ifndef ITK_MANUAL_INSTANTIATION
374 # include "itkRGBGibbsPriorFilter.hxx"