Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef TumorInvasionAnalysis_H
18 #define TumorInvasionAnalysis_H
19 
20 // MITK
21 #include "mitkCommon.h"
22 #include <MitkTumorInvasionAnalysisExports.h>
23 // DATA
24 #include <mitkDataCollection.h>
25 // FORESTS
27 
28 namespace mitk
29 {
41  class MITKTUMORINVASIONANALYSIS_EXPORT TumorInvasionClassification
42  {
43  public:
60  void SelectTrainingSamples(DataCollection *collection, unsigned int mode = 0);
61 
73  void PrepareResponseSamples(DataCollection *collection);
74 
85  void LearnProgressionFeatures(DataCollection *collection,
86  std::vector<std::string> modalitiesList,
87  size_t forestSize = 300,
88  size_t treeDepth = 10);
89 
94  void PredictInvasion(DataCollection *collection, std::vector<std::string> modalitiesList);
95 
103  void SanitizeResults(DataCollection *collection, std::string resultID = "RESULT");
104 
105  void SetTrainMargin(size_t dil2d, size_t dil3d)
106  {
107  m_TargetDil2D = dil2d;
108  m_TargetDil3D = dil3d;
109  }
110 
120  void SetClassRatio(ScalarType ratio) { m_ClassRatio = ratio; }
121  void SetGlobalsStatsFile(std::string fn) { m_GlobalStatsFile = fn; }
127  void SamplesWeightingActivated(bool isActive) { m_WeightSamples = isActive; }
132  void SetTargetID(std::string targetID = "TARGET") { m_TargetID = targetID; }
137  void SetTumorID(std::string tumorID = "GTV") { m_TumorID = tumorID; }
142  void SetMaskID(std::string maskID = "BRAINMASK") { m_MaskID = maskID; }
147  void SetResultID(std::string resultID = "RESULT") { m_ResultID = resultID; }
152  void UseRandomizedTrees(bool useRandom) { m_Randomize = useRandom; }
158  void DescriptionToLogFile(DataCollection *collection, std::string outputFile);
159 
164  void SaveRandomForest(std::string filename);
165 
170  void LoadRandomForest(std::string);
171 
172  protected:
173  private:
174  // DATA
176  unsigned int m_TargetDil2D;
177  unsigned int m_TargetDil3D;
178 
179  ScalarType m_ClassRatio;
180 
181  std::string m_GlobalStatsFile;
182 
183  std::string m_TargetID;
184  std::string m_TumorID;
185  std::string m_MaskID;
186  std::string m_ResultID;
187 
188  bool m_Randomize;
189  bool m_WeightSamples;
190  };
191 } // end namespace
192 #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.
static const std::string filename
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.