Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkTumorInvasionClassification.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef TumorInvasionAnalysis_H
14 #define TumorInvasionAnalysis_H
15 
16 // MITK
17 #include "mitkCommon.h"
18 #include <MitkTumorInvasionAnalysisExports.h>
19 // DATA
20 #include <mitkDataCollection.h>
21 // FORESTS
23 
24 namespace mitk
25 {
37  class MITKTUMORINVASIONANALYSIS_EXPORT TumorInvasionClassification
38  {
39  public:
56  void SelectTrainingSamples(DataCollection *collection, unsigned int mode = 0);
57 
69  void PrepareResponseSamples(DataCollection *collection);
70 
81  void LearnProgressionFeatures(DataCollection *collection,
82  std::vector<std::string> modalitiesList,
83  size_t forestSize = 300,
84  size_t treeDepth = 10);
85 
90  void PredictInvasion(DataCollection *collection, std::vector<std::string> modalitiesList);
91 
99  void SanitizeResults(DataCollection *collection, std::string resultID = "RESULT");
100 
101  void SetTrainMargin(size_t dil2d, size_t dil3d)
102  {
103  m_TargetDil2D = dil2d;
104  m_TargetDil3D = dil3d;
105  }
106 
116  void SetClassRatio(ScalarType ratio) { m_ClassRatio = ratio; }
117  void SetGlobalsStatsFile(std::string fn) { m_GlobalStatsFile = fn; }
123  void SamplesWeightingActivated(bool isActive) { m_WeightSamples = isActive; }
128  void SetTargetID(std::string targetID = "TARGET") { m_TargetID = targetID; }
133  void SetTumorID(std::string tumorID = "GTV") { m_TumorID = tumorID; }
138  void SetMaskID(std::string maskID = "BRAINMASK") { m_MaskID = maskID; }
143  void SetResultID(std::string resultID = "RESULT") { m_ResultID = resultID; }
148  void UseRandomizedTrees(bool useRandom) { m_Randomize = useRandom; }
154  void DescriptionToLogFile(DataCollection *collection, std::string outputFile);
155 
160  void SaveRandomForest(std::string filename);
161 
166  void LoadRandomForest(std::string);
167 
168  protected:
169  private:
170  // DATA
172  unsigned int m_TargetDil2D;
173  unsigned int m_TargetDil3D;
174 
175  ScalarType m_ClassRatio;
176 
177  std::string m_GlobalStatsFile;
178 
179  std::string m_TargetID;
180  std::string m_TumorID;
181  std::string m_MaskID;
182  std::string m_ResultID;
183 
184  bool m_Randomize;
185  bool m_WeightSamples;
186  };
187 } // end namespace
188 #endif
void SamplesWeightingActivated(bool isActive)
SamplesWeightingActivated If activated a weighted mask for the samples is calculated, weighting samples according to their location and ratio.
double ScalarType
void UseRandomizedTrees(bool useRandom)
UseRandomizedTrees - use random splits to build up forest.
DataCollection - Class to facilitate loading/accessing structured data.
void SetTrainMargin(vcl_size_t dil2d, vcl_size_t dil3d)
void SetMaskID(std::string maskID="BRAINMASK")
SetMaskID sets binary mask denoting area that is evluated/included in training.
void SetResultID(std::string resultID="RESULT")
SetResultID sets data item name in which prediction results are stored.
The TumorInvasionAnalysis class - Classifies Tumor progression using RF and predicts on new cases...
void SetClassRatio(ScalarType ratio)
SetClassRatio - set ratio of tumor voxels to healthy voxels that is to be used for training...
void SetTumorID(std::string tumorID="GTV")
SetTumorID sets binary mask denoting current tumor area.
void SetTargetID(std::string targetID="TARGET")
SetTargetID sets binary mask denoting future tumor area.