17 #ifndef mitkVigraRandomForestClassifier_h
18 #define mitkVigraRandomForestClassifier_h
20 #include <MitkCLVigraRandomForestExports.h>
24 #include <vigra/random_forest.hxx>
35 itkFactorylessNewMacro(
Self)
42 void Train(
const Eigen::MatrixXd &X,
const Eigen::MatrixXi &Y);
43 void OnlineTrain(
const Eigen::MatrixXd &X,
const Eigen::MatrixXi &Y);
44 Eigen::MatrixXi Predict(
const Eigen::MatrixXd &X);
45 Eigen::MatrixXi PredictWeighted(
const Eigen::MatrixXd &X);
48 bool SupportsPointWiseWeight();
49 bool SupportsPointWiseProbability();
50 void ConvertParameter();
52 void SetRandomForest(
const vigra::RandomForest<int> & rf);
53 const vigra::RandomForest<int> & GetRandomForest()
const;
55 void UsePointWiseWeight(
bool);
56 void SetMaximumTreeDepth(
int);
57 void SetMinimumSplitNodeSize(
int);
58 void SetPrecision(
double);
59 void SetSamplesPerTree(
double);
60 void UseSampleWithReplacement(
bool);
61 void SetTreeCount(
int);
62 void SetWeightLambda(
double);
64 void SetTreeWeights(Eigen::MatrixXd weights);
65 void SetTreeWeight(
int treeId,
double weight);
66 Eigen::MatrixXd GetTreeWeights()
const;
68 void PrintParameter(std::ostream &str = std::cout);
77 struct PredictionData;
78 struct EigenToVigraTransform;
81 Eigen::MatrixXd m_TreeWeights;
83 Parameter * m_Parameter;
84 vigra::RandomForest<int> m_RandomForest;
86 static ITK_THREAD_RETURN_TYPE TrainTreesCallback(
void *);
87 static ITK_THREAD_RETURN_TYPE PredictCallback(
void *);
88 static ITK_THREAD_RETURN_TYPE PredictWeightedCallback(
void *);
89 static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P);
93 #endif //mitkVigraRandomForestClassifier_h
Base of all data objects.
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)