Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkImpurityLoss.h
Go to the documentation of this file.
1 #ifndef mitkImpurityLoss_h
2 #define mitkImpurityLoss_h
3 
4 #include <vigra/multi_array.hxx>
5 #include <vigra/random_forest.hxx>
6 
7 namespace mitk
8 {
9  template <class TLossFunction = vigra::GiniCriterion, class TLabelContainer = vigra::MultiArrayView<2, int>, class TWeightContainer = vigra::MultiArrayView<2, double> >
11  {
12  public:
13  typedef TLabelContainer LabelContainerType;
14  typedef TWeightContainer WeightContainerType;
15 
16  template <class T>
17  ImpurityLoss(TLabelContainer const &labels,
18  vigra::ProblemSpec<T> const &ext);
19 
20  void Reset();
21 
22  template <class TDataIterator>
23  double Increment(TDataIterator begin, TDataIterator end);
24 
25  template <class TDataIterator>
26  double Decrement(TDataIterator begin, TDataIterator end);
27 
28  template <class TArray>
29  double Init(TArray initCounts);
30 
31  vigra::ArrayVector<double> const& Response();
32 
33  void UsePointWeights(bool useWeights);
34  bool IsUsingPointWeights();
35 
36  void SetPointWeights(TWeightContainer weight);
37  WeightContainerType GetPointWeights();
38 
39  private:
40  bool m_UsePointWeights;
41  TWeightContainer m_PointWeights;
42 
43  //Variable of origin
44  TLabelContainer const& m_Labels;
45  vigra::ArrayVector<double> m_Counts;
46  vigra::ArrayVector<double> m_ClassWeights;
47  double m_TotalCount;
48  TLossFunction m_LossFunction;
49  };
50 
51 }
52 
53 #include <../src/Splitter/mitkImpurityLoss.cpp>
54 
55 #endif //mitkImpurityLoss_h
void UsePointWeights(bool useWeights)
TLabelContainer LabelContainerType
DataCollection - Class to facilitate loading/accessing structured data.
void SetPointWeights(TWeightContainer weight)
double Decrement(TDataIterator begin, TDataIterator end)
vigra::ArrayVector< double > const & Response()
ImpurityLoss(TLabelContainer const &labels, vigra::ProblemSpec< T > const &ext)
double Increment(TDataIterator begin, TDataIterator end)
WeightContainerType GetPointWeights()
double Init(TArray initCounts)
TWeightContainer WeightContainerType