WORC package — WORC 2.1.1 documentation

# WORC package

## Subpackages

- WORC.IOparser package
  - Submodules
  - WORC.IOparser.config_WORC module
  - WORC.IOparser.config_preprocessing module
  - WORC.IOparser.config_segmentix module
  - Module contents
- WORC.processing package
  - Submodules
  - WORC.processing.ExtractNLargestBlobsn module
  - WORC.processing.RTStructReader module
  - WORC.processing.classes module
  - Module contents
- WORC.tools package
  - Submodules
  - WORC.tools.Elastix module
  - WORC.tools.Evaluate module
  - WORC.tools.Transformix module
  - Module contents

## Submodules

## WORC.WORC module

class `WORC.WORC.` `Tools`

  Bases: `object`

  This object can be used to create other pipelines besides the default Radiomics executions. Currently only includes a registratio pipeline.

class `WORC.WORC.` `WORC`(name='WORC')

  Bases: `object`

  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

  `add_tools`()
  `build`(wtype='training')

    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.
  `build_testing`()

    todo

  `build_training`()

    Build the training network based on the given attributes.

  `defaultconfig`()

    Generate a configparser object holding all default configuration values.

    Returns:
      config: configparser configuration file
  `execute`()

    Execute the network through the fastr.network.execute command.

  `set`()

    Set the FASTR source and sink data based on the given attributes.

## WORC.addexceptions module

This module contains all WORC-related Exceptions

exception `WORC.addexceptions.` `WORCError`

  Bases: `exceptions.Exception`

  This is the base class for all WORC related exceptions. Catching this class of exceptions should ensure a proper execution of WORC.

exception `WORC.addexceptions.` `WORCIOError`

  Bases: `WORC.addexceptions.WORCError`, `exceptions.IOError`

  IOError in WORC

exception `WORC.addexceptions.` `WORCNotImplementedError`

  Bases: `WORC.addexceptions.WORCError`, `exceptions.NotImplementedError`

  This function/method has not been implemented on purpose (e.g. should be overwritten in a sub-class)

exception `WORC.addexceptions.` `WORCTypeError`

  Bases: `WORC.addexceptions.WORCError`, `exceptions.TypeError`

  TypeError in the WORC system

## Module contents