ANIMA  4.0
animaRandomInitializer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "AnimaGraphCutSegmentationExport.h"
5 #include "time.h"
6 
7 namespace anima
8 {
9 
13 class ANIMAGRAPHCUTSEGMENTATION_EXPORT RandomInitializer: public ModelInitializer
14 {
15 public:
16 
19  typedef itk::ProcessObject Superclass;
20  typedef itk::SmartPointer <Self> Pointer;
21  typedef itk::SmartPointer <const Self> ConstPointer;
22 
24  itkNewMacro(Self)
25 
26 
27  itkTypeMacro(RandomInitializer, itk::ProcessObject)
28 
29  typedef itk::VariableLengthVector<double> MeasurementVectorType;
30  typedef itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > GaussianFunctionType;
31 
32  void Update() ITK_OVERRIDE;
33 
36  void SetMinValues(std::vector<double> &min){this->minValues=min;}
37 
40  void SetMaxValues(std::vector<double> &max){this->maxValues=max;}
41 
42  itkSetMacro(NbGaussian, unsigned int)
43  itkGetMacro(NbGaussian, unsigned int)
44 
45  itkSetMacro(DimensionGaussian, unsigned int)
46  itkGetMacro(DimensionGaussian, unsigned int)
47 
48 protected:
49  RandomInitializer(const Self&); //purposely not implemented
50  void operator=(const Self&); //purposely not implemented
51 
53  {
54  srand(time(NULL));
55 
56  m_NbGaussian = 1;
57  m_DimensionGaussian= 1;
58 
59  }
60  virtual ~RandomInitializer(){}
61 
65  itk::Statistics::GaussianMembershipFunction<itk::VariableLengthVector<double> >::Pointer randomDistribution();
66 
67  double randUniform(double min,double max);
68 
69 
72  std::vector<double> minValues;
73 
76  std::vector<double> maxValues;
77 
78  unsigned int m_NbGaussian;
79  unsigned int m_DimensionGaussian;
80 
81 };
82 
83 }
84 
std::vector< double > maxValues
max values
STL namespace.
std::vector< double > minValues
min values
itk::SmartPointer< Self > Pointer
void SetMaxValues(std::vector< double > &max)
Set max values of random means.
Gaussian model initializers Model Initializer represents the processes computing a gaussian model tha...
itk::VariableLengthVector< double > MeasurementVectorType
Class initializing ramdomly a gaussian model.
itk::SmartPointer< Self > Pointer
itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > GaussianFunctionType
itk::SmartPointer< const Self > ConstPointer