ANIMA  4.0
animaGaussianREMEstimator.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "itkProcessObject.h"
5 
6 namespace anima
7 {
8 
18 template <typename TInputImage, typename TMaskImage>
19 class GaussianREMEstimator : public GaussianEMEstimator<TInputImage,TMaskImage>
20 {
21 public:
22 
25  typedef itk::ProcessObject Superclass;
26  typedef itk::SmartPointer <Self> Pointer;
27  typedef itk::SmartPointer <const Self> ConstPointer;
28 
30  itkNewMacro(Self);
31 
33  itkTypeMacro(GaussianREMEstimator, itk::ProcessObject);
34 
35  typedef double NumericType;
36  typedef itk::VariableSizeMatrix< NumericType >::InternalMatrixType DoubleVariableSizeMatrixVnlType;
37 
38  typedef double Ocurrences;
39  typedef unsigned short MeasureType;
40  typedef std::vector<MeasureType> Intensities;
41  typedef std::map< Intensities, std::vector<Ocurrences> > GenericContainer;
42  typedef std::map<Intensities,Ocurrences> Histogram;
43  typedef std::map<double,std::vector<unsigned short> > ResidualMap;
44 
45  typedef itk::VariableLengthVector<double> MeasurementVectorType;
46  typedef itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > GaussianFunctionType;
47 
48  virtual void Update() ITK_OVERRIDE;
49 
50  virtual bool concentration();
51 
52  int PrintSolution(std::vector<double> alphas, std::vector<GaussianFunctionType::Pointer> model);
53 
54 
59 
60  itkSetMacro(RejectionRatio, double);
61  itkGetMacro(RejectionRatio, double);
62 
63  itkSetMacro(MaxIterationsConc, int);
64  itkGetMacro(MaxIterationsConc, int);
65 
66  itkSetMacro(StremMode, bool);
67  itkGetMacro(StremMode, bool);
68 
69 
70 protected:
71 
72  GaussianREMEstimator(const Self&); //purposely not implemented
73  void operator=(const Self&); //purposely not implemented
74 
75  GaussianREMEstimator(): GaussianEMEstimator<TInputImage,TMaskImage>()
76  {
77  this->m_ModelMinDistance = 1e-4;
78  this->m_MaxIterations = 100;
79 
80  this->m_MaxIterationsConc = 1;
81  this->m_StremMode=false;
82  }
83 
85 
91 
95 
99 
104 
105 };
106 
107 }
108 
itk::SmartPointer< const Self > ConstPointer
Gaussian Model estimator Class performing expectation-maximation algorithm.
std::map< Intensities, Ocurrences > Histogram
Histogram m_JointHistogram
joint histogram The points stored here will be used for estimate de model
bool m_StremMode
doing as STREM => first a complete EM before concentration. It may be useful if initializations are n...
STL namespace.
Class performing a robust expectation-maximation (REM) algorithm. Allow finding the 3-classes NABT mo...
std::vector< MeasureType > Intensities
itk::VariableSizeMatrix< NumericType >::InternalMatrixType DoubleVariableSizeMatrixVnlType
int PrintSolution(std::vector< double > alphas, std::vector< GaussianFunctionType::Pointer > model)
itk::VariableLengthVector< double > MeasurementVectorType
Histogram m_OriginalJointHistogram
input joint histogram, it will never be modified
void operator=(const Self &)
double m_RejectionRatio
ratio of rejection This is the ratio of samples that will be trimmed to calculate the estimation Valu...
itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > GaussianFunctionType
int m_MaxIterationsConc
max number of iterations between to concentration steps
virtual void Update() ITK_OVERRIDE
std::map< double, std::vector< unsigned short > > ResidualMap
std::map< Intensities, std::vector< Ocurrences > > GenericContainer
itk::SmartPointer< Self > Pointer
Histogram GetConcentrationJointHistogram()
Get the "concentrated" joint histogram This joint histogram is the original without the samples consi...