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
129 template<
typename TInputImage,
130 typename TMembershipFunction >
187 itkSetMacro(Threshold,
double);
190 itkGetConstMacro(Threshold,
double);
193 itkSetMacro(OffsetAdd,
double);
196 itkGetConstMacro(OffsetAdd,
double);
199 itkSetMacro(OffsetMultiply,
double);
202 itkGetConstMacro(OffsetMultiply,
double);
205 itkSetMacro(MaxSplitAttempts,
int);
208 itkGetConstMacro(MaxSplitAttempts,
int);
216 void PrintSelf(std::ostream & os,
Indent indent)
const override;
219 void GenerateData()
override;
225 void PrintKmeansAlgorithmResults();
234 void EstimateModels()
override;
236 void EstimateKmeansModelParameters();
243 void Reallocate(
int oldSize,
int newSize);
246 int WithCodebookUseGLA();
248 int WithoutCodebookUseLBG();
250 void NearestNeighborSearchBasic(
double *distortion);
252 void SplitCodewords(
int currentSize,
256 void Perturb(
double *oldCodeword,
258 double *newCodeword);
285 #ifndef ITK_MANUAL_INSTANTIATION
286 #include "itkImageKmeansModelEstimator.hxx"
typename TInputImage::ConstPointer InputImageConstPointer
double m_OutputDistortion
Base class for ImageKmeansModelEstimator object.
Light weight base class for most itk classes.
vnl_matrix< int > CodebookMatrixOfIntegerType
TInputImage InputImageType
typename TInputImage::SizeType ImageSizeType
unsigned long SizeValueType
SizeValueType m_CurrentNumberOfCodewords
typename TInputImage::PixelType::VectorType InputImageVectorType
CodebookMatrixOfDoubleType GetOutCodebook()
CodebookMatrixOfIntegerType m_CodewordHistogram
CodebookMatrixOfDoubleType GetKmeansResults()
typename TInputImage::PixelType::VectorType InputPixelVectorType
Base class for model estimation from images used for classification.
typename TInputImage::PixelType InputImagePixelType
CodebookMatrixOfDoubleType m_Codebook
SizeValueType m_VectorDimension
vnl_matrix< double > CodebookMatrixOfDoubleType
ImageBaseType::SizeType SizeType
typename TInputImage::Pointer InputImagePointer
A multi-dimensional iterator templated over image type that walks a region of pixels.
CodebookMatrixOfDoubleType m_CodewordDistortion
typename TMembershipFunction::Pointer MembershipFunctionPointer
Control indentation during Print() invocation.
Base class for most ITK classes.
ImageBaseType::SpacingType VectorType
SizeValueType m_NumberOfCodewords
A multi-dimensional iterator templated over image type that walks a region of pixels.
CodebookMatrixOfDoubleType m_Centroid
int m_OutputNumberOfEmptyCells