Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
The TumorInvasionAnalysis class - Classifies Tumor progression using RF and predicts on new cases. More...
#include <mitkTumorInvasionClassification.h>
Public Member Functions | |
TumorInvasionClassification () | |
~TumorInvasionClassification () | |
void | SelectTrainingSamples (DataCollection *collection, unsigned int mode=0) |
SelectTrainingSamples. More... | |
void | PrepareResponseSamples (DataCollection *collection) |
PrepareResponseSamples. More... | |
void | LearnProgressionFeatures (DataCollection *collection, std::vector< std::string > modalitiesList, vcl_size_t forestSize=300, vcl_size_t treeDepth=10) |
LearnProgressionFeatures. More... | |
void | PredictInvasion (DataCollection *collection, std::vector< std::string > modalitiesList) |
PredictGrowth - Classify voxels into remaining healthy / turning into tumor. More... | |
void | SanitizeResults (DataCollection *collection, std::string resultID="RESULT") |
SanitizeResults - Performs an Opening Operation on tha data to remove isolated misclassifications. More... | |
void | SetTrainMargin (vcl_size_t dil2d, vcl_size_t dil3d) |
void | SetClassRatio (ScalarType ratio) |
SetClassRatio - set ratio of tumor voxels to healthy voxels that is to be used for training. More... | |
void | SetGlobalsStatsFile (std::string fn) |
void | SamplesWeightingActivated (bool isActive) |
SamplesWeightingActivated If activated a weighted mask for the samples is calculated, weighting samples according to their location and ratio. More... | |
void | SetTargetID (std::string targetID="TARGET") |
SetTargetID sets binary mask denoting future tumor area. More... | |
void | SetTumorID (std::string tumorID="GTV") |
SetTumorID sets binary mask denoting current tumor area. More... | |
void | SetMaskID (std::string maskID="BRAINMASK") |
SetMaskID sets binary mask denoting area that is evluated/included in training. More... | |
void | SetResultID (std::string resultID="RESULT") |
SetResultID sets data item name in which prediction results are stored. More... | |
void | UseRandomizedTrees (bool useRandom) |
UseRandomizedTrees - use random splits to build up forest. More... | |
void | DescriptionToLogFile (DataCollection *collection, std::string outputFile) |
DescriptionToLogFile - Append to log file: patient ids and time steps contained in this data collection. More... | |
void | SaveRandomForest (std::string filename) |
SaveRandomForest - Saves a trained random forest. More... | |
void | LoadRandomForest (std::string) |
LoadRandomForest - loads a random forest to be used for classification. More... | |
The TumorInvasionAnalysis class - Classifies Tumor progression using RF and predicts on new cases.
Provides a way to learn tumor progression from examples, and predict the growth using random forests.
Expected Inputs are DataCollections. The Tumor Segmentations (current extent) are expected to be binary (0 - healthy tissue, 1 - tumor tissue), likewise the target extent that is to be learnt.
Definition at line 41 of file mitkTumorInvasionClassification.h.
mitk::TumorInvasionClassification::TumorInvasionClassification | ( | ) |
Definition at line 63 of file mitkTumorInvasionClassification.cpp.
|
inline |
Definition at line 45 of file mitkTumorInvasionClassification.h.
void mitk::TumorInvasionClassification::DescriptionToLogFile | ( | mitk::DataCollection * | collection, |
std::string | outputFile | ||
) |
DescriptionToLogFile - Append to log file: patient ids and time steps contained in this data collection.
collection | |
outputFile |
Definition at line 647 of file mitkTumorInvasionClassification.cpp.
References mitk::DataCollection::GetData(), mitk::DataCollection::GetName(), mitk::DataCollection::IndexToName(), and mitk::DataCollection::Size().
void mitk::TumorInvasionClassification::LearnProgressionFeatures | ( | mitk::DataCollection * | collection, |
std::vector< std::string > | modalitiesList, | ||
vcl_size_t | forestSize = 300 , |
||
vcl_size_t | treeDepth = 10 |
||
) |
LearnProgressionFeatures.
collection | - data collection used for training |
modalitiesList | - modalities (data item names from collection) that are to be used for training |
forestSize | - number of trees that are trained |
treeDepth | - maximal depth for a single tree |
Definition at line 582 of file mitkTumorInvasionClassification.cpp.
References mitk::DCUtilities::DC3dDToMatrixXd(), mitk::DCUtilities::DC3dDToMatrixXi(), and MITK_INFO.
Referenced by main().
void mitk::TumorInvasionClassification::LoadRandomForest | ( | std::string | ) |
LoadRandomForest - loads a random forest to be used for classification.
filename |
Definition at line 672 of file mitkTumorInvasionClassification.cpp.
References MITK_ERROR.
void mitk::TumorInvasionClassification::PredictInvasion | ( | mitk::DataCollection * | collection, |
std::vector< std::string > | modalitiesList | ||
) |
PredictGrowth - Classify voxels into remaining healthy / turning into tumor.
collection |
Definition at line 614 of file mitkTumorInvasionClassification.cpp.
References mitk::DCUtilities::DC3dDToMatrixXd(), mitk::DCUtilities::MatrixToDC3d(), MITK_ERROR, and MITK_INFO.
Referenced by main().
void mitk::TumorInvasionClassification::PrepareResponseSamples | ( | mitk::DataCollection * | collection | ) |
PrepareResponseSamples.
Selects healthy/tumor tissue samples to be included into training, and weights them to achieve a given ratio. This modifies the target data items in the data collection. Afterwards the target data is encoded as follows: 0 - excluded (e.g. out of brainmask) 1 - no involvement (healthy all the time) 2 - formerly healthy, now tumor (rezivid) 3 - formerly tumor, now necroses (responsive)
Definition at line 496 of file mitkTumorInvasionClassification.cpp.
References mitk::CollectionDilation::DilateBinaryByName(), EnsureDataImageInCollection(), mitk::DataCollectionImageIterator< TDataType, ImageDimension >::GetVoxel(), mitk::DataCollectionImageIterator< TDataType, ImageDimension >::IsAtEnd(), MITK_INFO, mitk::DataCollectionImageIterator< TDataType, ImageDimension >::SetVoxel(), and mitk::DataCollectionImageIterator< TDataType, ImageDimension >::ToBegin().
Referenced by main().
|
inline |
SamplesWeightingActivated If activated a weighted mask for the samples is calculated, weighting samples according to their location and ratio.
isActive |
Definition at line 127 of file mitkTumorInvasionClassification.h.
Referenced by main().
void mitk::TumorInvasionClassification::SanitizeResults | ( | mitk::DataCollection * | collection, |
std::string | resultID = "RESULT" |
||
) |
SanitizeResults - Performs an Opening Operation on tha data to remove isolated misclassifications.
RESULTOPEN
collection |
Definition at line 642 of file mitkTumorInvasionClassification.cpp.
References mitk::CollectionGrayOpening::PerformGrayOpening().
Referenced by main().
void mitk::TumorInvasionClassification::SaveRandomForest | ( | std::string | filename | ) |
SaveRandomForest - Saves a trained random forest.
filename |
Definition at line 667 of file mitkTumorInvasionClassification.cpp.
References mitk::IOUtil::Save().
Referenced by main().
void mitk::TumorInvasionClassification::SelectTrainingSamples | ( | mitk::DataCollection * | collection, |
unsigned int | mode = 0 |
||
) |
SelectTrainingSamples.
Selects healthy/tumor tissue samples to be included into training. This modifies the target data items in the data collection. Afterwards the target data is structured as follows: 0 -voxels excluded from training , 1 - healthy sample , 2 - "tuning-into-tumor" sample
collection | |
erodeTrainingMask | - Performs erosion on target such that border voxels of tumor region will not be included into training |
Definition at line 73 of file mitkTumorInvasionClassification.cpp.
References mitk::CollectionDilation::DilateBinaryByName(), EnsureDataImageInCollection(), mitk::CollectionDilation::ErodeBinaryByName(), mitk::DataCollectionImageIterator< TDataType, ImageDimension >::GetVoxel(), mitk::DataCollectionImageIterator< TDataType, ImageDimension >::IsAtEnd(), min(), MITK_INFO, mitk::DataCollectionImageIterator< TDataType, ImageDimension >::SetVoxel(), and mitk::DataCollectionImageIterator< TDataType, ImageDimension >::ToBegin().
Referenced by main().
|
inline |
SetClassRatio - set ratio of tumor voxels to healthy voxels that is to be used for training.
perfect ratio cannot allways be achieved, since by default all tumor voxels are included into training (since they ususally are to rare to be skipped)
ratio |
Definition at line 120 of file mitkTumorInvasionClassification.h.
Referenced by main().
|
inline |
Definition at line 121 of file mitkTumorInvasionClassification.h.
|
inline |
SetMaskID sets binary mask denoting area that is evluated/included in training.
maskID |
Definition at line 142 of file mitkTumorInvasionClassification.h.
|
inline |
SetResultID sets data item name in which prediction results are stored.
resultID |
Definition at line 147 of file mitkTumorInvasionClassification.h.
|
inline |
SetTargetID sets binary mask denoting future tumor area.
targetID |
Definition at line 132 of file mitkTumorInvasionClassification.h.
|
inline |
Definition at line 105 of file mitkTumorInvasionClassification.h.
Referenced by main().
|
inline |
SetTumorID sets binary mask denoting current tumor area.
tumorID |
Definition at line 137 of file mitkTumorInvasionClassification.h.
|
inline |
UseRandomizedTrees - use random splits to build up forest.
useRandom |
Definition at line 152 of file mitkTumorInvasionClassification.h.