18 #ifndef itkImageKmeansModelEstimator_h
19 #define itkImageKmeansModelEstimator_h
25 #include "vnl/vnl_vector.h"
26 #include "vnl/vnl_matrix.h"
28 #include "vnl/algo/vnl_matrix_inverse.h"
36 #define GLA_CONVERGED 1
37 #define GLA_NOT_CONVERGED 2
38 #define LBG_COMPLETED 3
130 template <
typename TInputImage,
typename TMembershipFunction>
191 itkSetMacro(Threshold,
double);
192 itkGetConstMacro(Threshold,
double);
196 itkSetMacro(OffsetAdd,
double);
197 itkGetConstMacro(OffsetAdd,
double);
201 itkSetMacro(OffsetMultiply,
double);
202 itkGetConstMacro(OffsetMultiply,
double);
206 itkSetMacro(MaxSplitAttempts,
int);
207 itkGetConstMacro(MaxSplitAttempts,
int);
211 CodebookMatrixOfDoubleType
221 PrintSelf(std::ostream & os,
Indent indent)
const override;
225 GenerateData()
override;
233 PrintKmeansAlgorithmResults();
245 EstimateModels()
override;
249 EstimateKmeansModelParameters();
258 Reallocate(
int oldSize,
int newSize);
261 WithCodebookUseGLA();
264 WithoutCodebookUseLBG();
267 NearestNeighborSearchBasic(
double * distortion);
270 SplitCodewords(
int currentSize,
int numDesired,
int scale);
273 Perturb(
double * oldCodeword,
int scale,
double * newCodeword);
280 double m_Threshold{};
281 double m_OffsetAdd{};
282 double m_OffsetMultiply{};
283 int m_MaxSplitAttempts{};
285 bool m_ValidInCodebook{};
286 double m_DoubleMaximum{};
287 double m_OutputDistortion{};
288 int m_OutputNumberOfEmptyCells{};
300 #ifndef ITK_MANUAL_INSTANTIATION
301 # include "itkImageKmeansModelEstimator.hxx"