WORC Package¶
WORC
Package¶
WORC
Module¶
- class WORC.WORC.Tools[source]¶
Bases:
object
Create other pipelines besides the default radiomics executions.
Currently includes: 1. Registration pipeline 2. Evaluation pipeline 3. Slicer pipeline, to create pngs of middle slice of images.
- __dict__ = mappingproxy({'__module__': 'WORC.WORC', '__doc__': '\n Create other pipelines besides the default radiomics executions.\n\n Currently includes:\n 1. Registration pipeline\n 2. Evaluation pipeline\n 3. Slicer pipeline, to create pngs of middle slice of images.\n ', '__init__': <function Tools.__init__>, '__dict__': <attribute '__dict__' of 'Tools' objects>, '__weakref__': <attribute '__weakref__' of 'Tools' objects>, '__annotations__': {}})¶
- __module__ = 'WORC.WORC'¶
- __weakref__¶
list of weak references to the object (if defined)
- class WORC.WORC.WORC(name='test')[source]¶
Bases:
object
Workflow for Optimal Radiomics Classification.
A Workflow for Optimal Radiomics Classification (WORC) object that serves as a pipeline spawner and manager for optimizating radiomics studies. Depending on the attributes set, the object will spawn an appropriate pipeline and manage it.
Note that many attributes are lists and can therefore contain multiple instances. For example, when providing two sequences per patient, the “images” list contains two items. The type of items in the lists is described below.
All objects that serve as source for your network, i.e. refer to actual files to be used, should be formatted as fastr sources suited for one of the fastr plugings, see also http://fastr.readthedocs.io/en/stable/fastr.reference.html#ioplugin-reference The objects should be lists of these fastr sources or dictionaries with the sample ID’s, e.g.
- images_train = [{‘Patient001’: vfs://input/CT001.nii.gz,
‘Patient002’: vfs://input/CT002.nii.gz},
- {‘Patient001’: vfs://input/MR001.nii.gz,
‘Patient002’: vfs://input/MR002.nii.gz}]
- name: String, default ‘WORC’
name of the network.
- configs: list, required
Configuration parameters, either ConfigParser objects created through the defaultconfig function or paths of config .ini files. (list, required)
- labels: list, required
Paths to files containing patient labels (.txt files).
- network: automatically generated
The FASTR network generated through the “build” function.
- images: list, optional
Paths refering to the images used for Radiomics computation. Images should be of the ITK Image type.
- segmentations: list, optional
Paths refering to the segmentations used for Radiomics computation. Segmentations should be of the ITK Image type.
semantics: semantic features per image type (list, optional)
masks: state which pixels of images are valid (list, optional)
features: input Radiomics features for classification (list, optional)
metadata: DICOM headers belonging to images (list, optional)
Elastix_Para: parameter files for Elastix (list, optional)
fastr_plugin: plugin to use for FASTR execution
fastr_tempdir: temporary directory to use for FASTR execution
additions: additional inputs for your network (dict, optional)
source_data: data to use as sources for FASTR (dict)
sink_data: data to use as sinks for FASTR (dict)
- CopyMetadata: Boolean, default True
when using elastix, copy metadata from image to segmentation or not
- __dict__ = mappingproxy({'__module__': 'WORC.WORC', '__doc__': 'Workflow for Optimal Radiomics Classification.\n\n A Workflow for Optimal Radiomics Classification (WORC) object that\n serves as a pipeline spawner and manager for optimizating radiomics\n studies. Depending on the attributes set, the object will spawn an\n appropriate pipeline and manage it.\n\n Note that many attributes are lists and can therefore contain multiple\n instances. For example, when providing two sequences per patient,\n the "images" list contains two items. The type of items in the lists\n is described below.\n\n All objects that serve as source for your network, i.e. refer to\n actual files to be used, should be formatted as fastr sources suited for\n one of the fastr plugings, see also\n http://fastr.readthedocs.io/en/stable/fastr.reference.html#ioplugin-reference\n The objects should be lists of these fastr sources or dictionaries with the\n sample ID\'s, e.g.\n\n images_train = [{\'Patient001\': vfs://input/CT001.nii.gz,\n \'Patient002\': vfs://input/CT002.nii.gz},\n {\'Patient001\': vfs://input/MR001.nii.gz,\n \'Patient002\': vfs://input/MR002.nii.gz}]\n\n Attributes\n ------------------\n name: String, default \'WORC\'\n name of the network.\n\n configs: list, required\n Configuration parameters, either ConfigParser objects\n created through the defaultconfig function or paths of config .ini\n files. (list, required)\n\n labels: list, required\n Paths to files containing patient labels (.txt files).\n\n network: automatically generated\n The FASTR network generated through the "build" function.\n\n images: list, optional\n Paths refering to the images used for Radiomics computation. Images\n should be of the ITK Image type.\n\n segmentations: list, optional\n Paths refering to the segmentations used for Radiomics computation.\n Segmentations should be of the ITK Image type.\n\n semantics: semantic features per image type (list, optional)\n\n masks: state which pixels of images are valid (list, optional)\n\n features: input Radiomics features for classification (list, optional)\n\n metadata: DICOM headers belonging to images (list, optional)\n\n Elastix_Para: parameter files for Elastix (list, optional)\n\n fastr_plugin: plugin to use for FASTR execution\n\n fastr_tempdir: temporary directory to use for FASTR execution\n\n additions: additional inputs for your network (dict, optional)\n\n source_data: data to use as sources for FASTR (dict)\n\n sink_data: data to use as sinks for FASTR (dict)\n\n CopyMetadata: Boolean, default True\n when using elastix, copy metadata from image to segmentation or not\n\n ', '__init__': <function WORC.__init__>, 'defaultconfig': <function WORC.defaultconfig>, 'add_tools': <function WORC.add_tools>, 'build': <function WORC.build>, 'build_training': <function WORC.build_training>, 'add_ComBat': <function WORC.add_ComBat>, 'add_preprocessing': <function WORC.add_preprocessing>, 'add_feature_calculator': <function WORC.add_feature_calculator>, 'add_elastix_sourcesandsinks': <function WORC.add_elastix_sourcesandsinks>, 'add_elastix': <function WORC.add_elastix>, 'add_segmentix': <function WORC.add_segmentix>, 'set': <function WORC.set>, 'execute': <function WORC.execute>, 'add_evaluation': <function WORC.add_evaluation>, 'save_config': <function WORC.save_config>, '__dict__': <attribute '__dict__' of 'WORC' objects>, '__weakref__': <attribute '__weakref__' of 'WORC' objects>, '__annotations__': {}})¶
- __init__(name='test')[source]¶
Initialize WORC object.
Set the initial variables all to None, except for some defaults.
- Arguments:
name: name of the nework (string, optional)
- __module__ = 'WORC.WORC'¶
- __weakref__¶
list of weak references to the object (if defined)
- add_ComBat()[source]¶
Add ComBat harmonization to the network.
Note: applied on all objects, not in a train-test or cross-val setting.
- add_evaluation(label_type, modus='binary_classification')[source]¶
Add branch for evaluation of performance to network.
Note: should be done after build, before set: WORC.build() WORC.add_evaluation(label_type) WORC.set() WORC.execute()
- add_feature_calculator(calcfeat_node, label, nmod)[source]¶
Add a feature calculation node to the network.
- add_preprocessing(preprocess_node, label, nmod)[source]¶
Add nodes required for preprocessing of images.
- build(wtype='training')[source]¶
Build the network based on the given attributes.
- wtype: string, default ‘training’
Specify the WORC execution type. - testing: use if you have a trained classifier and want to
train it on some new images.
training: use if you want to train a classifier from a dataset.
addexceptions
Module¶
This module contains all WORC-related Exceptions
- exception WORC.addexceptions.WORCAssertionError[source]¶
Bases:
WORC.addexceptions.WORCError
,AssertionError
AssertionError in the WORC system
- __module__ = 'WORC.addexceptions'¶
- exception WORC.addexceptions.WORCError[source]¶
Bases:
Exception
This is the base class for all WORC related exceptions. Catching this class of exceptions should ensure a proper execution of WORC.
- __module__ = 'WORC.addexceptions'¶
- __weakref__¶
list of weak references to the object (if defined)
- exception WORC.addexceptions.WORCIOError[source]¶
Bases:
WORC.addexceptions.WORCError
,OSError
IOError in WORC
- __module__ = 'WORC.addexceptions'¶
- __weakref__¶
list of weak references to the object (if defined)
- exception WORC.addexceptions.WORCIndexError[source]¶
Bases:
WORC.addexceptions.WORCError
,IndexError
IndexError in the WORC system
- __module__ = 'WORC.addexceptions'¶
- exception WORC.addexceptions.WORCKeyError[source]¶
Bases:
WORC.addexceptions.WORCError
,KeyError
KeyError in the WORC system
- __module__ = 'WORC.addexceptions'¶
- exception WORC.addexceptions.WORCNotImplementedError[source]¶
Bases:
WORC.addexceptions.WORCError
,NotImplementedError
This function/method has not been implemented on purpose (e.g. should be overwritten in a sub-class)
- __module__ = 'WORC.addexceptions'¶
- exception WORC.addexceptions.WORCTypeError[source]¶
Bases:
WORC.addexceptions.WORCError
,TypeError
TypeError in the WORC system
- __module__ = 'WORC.addexceptions'¶
- exception WORC.addexceptions.WORCValueError[source]¶
Bases:
WORC.addexceptions.WORCError
,ValueError
ValueError in the WORC system
- __module__ = 'WORC.addexceptions'¶
Subpackages¶
- IOparser Package
- classification Package
- detectors Package
- exampledata Package
- facade Package
- fastrconfig Package
- featureprocessing Package
featureprocessing
PackageComBat
ModuleDecomposition
ModuleFeatureConverter
ModuleICCThreshold
ModuleImputer
ModuleOneHotEncoderWrapper
ModulePreprocessor
ModuleRelief
ModuleScalers
ModuleSelectGroups
ModuleSelectIndividuals
ModuleStatisticalTestFeatures
ModuleStatisticalTestThreshold
ModuleVarianceThreshold
Module
- plotting Package
plotting
Packagecompute_CI
Modulelinstretch
Moduleplot_ROC
Moduleplot_barchart
Moduleplot_boxplot_features
Moduleplot_boxplot_performance
Moduleplot_errors
Moduleplot_estimator_performance
Moduleplot_hyperparameters
Moduleplot_images
Moduleplot_pvalues_features
Moduleplot_ranked_scores
Moduleplotminmaxresponse
Modulescatterplot
Module
- processing Package
- resources Package
- statistics Package
- tests Package
- tools Package
- validators Package