tools Package

Elastix Module

class WORC.tools.Elastix.Elastix[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'WORC.tools.Elastix', '__init__': <function Elastix.__init__>, 'getparametermap': <function Elastix.getparametermap>, 'create_network': <function Elastix.create_network>, 'addchangeorder': <function Elastix.addchangeorder>, 'create_bbox': <function Elastix.create_bbox>, 'execute': <function Elastix.execute>, '__dict__': <attribute '__dict__' of 'Elastix' objects>, '__weakref__': <attribute '__weakref__' of 'Elastix' objects>, '__doc__': None, '__annotations__': {}})
__init__()[source]
__module__ = 'WORC.tools.Elastix'
__weakref__

list of weak references to the object (if defined)

addchangeorder()[source]
create_bbox(seg, pad=[2, 25, 25])[source]

Create a bounding box around an input segmentation with a certain padding

create_network(nettype)[source]
execute()[source]
getparametermap(model='affine', size=(512, 512, 128))[source]

Evaluate Module

class WORC.tools.Evaluate.Evaluate(label_type, modus='binary_classification', scores='percentages', ensemble_method='top_N', ensemble_size=100, parent=None, features=None, fastr_plugin='LinearExecution', name='Example')[source]

Bases: object

Build a network that evaluates the performance of an estimator.

__dict__ = mappingproxy({'__module__': 'WORC.tools.Evaluate', '__doc__': 'Build a network that evaluates the performance of an estimator.', '__init__': <function Evaluate.__init__>, 'create_network': <function Evaluate.create_network>, 'create_links_Standalone': <function Evaluate.create_links_Standalone>, 'create_links_Addon': <function Evaluate.create_links_Addon>, 'set': <function Evaluate.set>, 'execute': <function Evaluate.execute>, '__dict__': <attribute '__dict__' of 'Evaluate' objects>, '__weakref__': <attribute '__weakref__' of 'Evaluate' objects>, '__annotations__': {}})
__init__(label_type, modus='binary_classification', scores='percentages', ensemble_method='top_N', ensemble_size=100, parent=None, features=None, fastr_plugin='LinearExecution', name='Example')[source]

Initialize object.

Parameters

network: fastr network, default None

If you input a network, the evaluate network is added to the existing network.

__module__ = 'WORC.tools.Evaluate'
__weakref__

list of weak references to the object (if defined)

Create links in network between nodes when adding Evaluate to WORC.

Create links in network between nodes when using standalone.

create_network()[source]

Add evaluate components to network.

execute()[source]

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

set(estimator=None, pinfo=None, images=None, segmentations=None, config=None, features=None, sink_data={})[source]

Set the sources and sinks based on the provided attributes.

Inference Module

class WORC.tools.Inference.Inference(fastr_plugin='LinearExecution', name='Example')[source]

Bases: object

Build a network that can use an existing model for inference.

__dict__ = mappingproxy({'__module__': 'WORC.tools.Inference', '__doc__': 'Build a network that can use an existing model for inference.', '__init__': <function Inference.__init__>, 'create_network': <function Inference.create_network>, '__dict__': <attribute '__dict__' of 'Inference' objects>, '__weakref__': <attribute '__weakref__' of 'Inference' objects>, '__annotations__': {}})
__init__(fastr_plugin='LinearExecution', name='Example')[source]

Initialize object.

Parameters

network: fastr network, default None

If you input a network, the evaluate network is added to the existing network.

__module__ = 'WORC.tools.Inference'
__weakref__

list of weak references to the object (if defined)

create_network()[source]

Add evaluate components to network.

Slicer Module

class WORC.tools.Slicer.Slicer(images=None, segmentations=None, network=None, fastr_plugin='ProcessPoolExecution', name='Example')[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'WORC.tools.Slicer', '__init__': <function Slicer.__init__>, 'create_network': <function Slicer.create_network>, 'set': <function Slicer.set>, 'execute': <function Slicer.execute>, '__dict__': <attribute '__dict__' of 'Slicer' objects>, '__weakref__': <attribute '__weakref__' of 'Slicer' objects>, '__doc__': None, '__annotations__': {}})
__init__(images=None, segmentations=None, network=None, fastr_plugin='ProcessPoolExecution', name='Example')[source]

Build a network that evaluates the performance of an estimator.

Parameters

network: fastr network, default None

If you input a network, the evaluate network is added to the existing network.

__module__ = 'WORC.tools.Slicer'
__weakref__

list of weak references to the object (if defined)

create_network()[source]

Add evaluate components to network.

execute()[source]

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

set(images=None, segmentations=None, sink_data={})[source]

Set the sources and sinks based on the provided attributes.

Transformix Module

class WORC.tools.Transformix.Transformix[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'WORC.tools.Transformix', '__init__': <function Transformix.__init__>, 'create_network': <function Transformix.create_network>, 'execute': <function Transformix.execute>, '__dict__': <attribute '__dict__' of 'Transformix' objects>, '__weakref__': <attribute '__weakref__' of 'Transformix' objects>, '__doc__': None, '__annotations__': {}})
__init__()[source]
__module__ = 'WORC.tools.Transformix'
__weakref__

list of weak references to the object (if defined)

create_network()[source]
execute()[source]

createfixedsplits Module

WORC.tools.createfixedsplits.createfixedsplits(label_file=None, label_type=None, patient_IDs=None, stratify=True, test_size=0.2, N_iterations=1, modus='singlelabel', output=None)[source]

Create fixed splits for a random-split cross-validation.

label_filefilepath

CSV file containing the labels of the patients.

label_type: list of strings

labels to extracted from the label file, e.g. [‘label1’]

patient_IDs: list of strings

names of patients to take into account. If None, take all

stratify: Boolean

If True, splits are stratified. In this case, you need to provide label data.

test_size: float

Percentage of patients in test set per iteration.

N_iterations: integer

Number of cross-validation iterations

modus: str

singlelabel or regression. Multilabel not implemented yet.

output: filepath

csv filename to save output to.

df: pandas Dataframe

Fixed splits created.

WORC.tools.createfixedsplits.test()[source]

fingerprinting Module

class WORC.tools.fingerprinting.Fingerprinter[source]

Bases: object

Fingerprinting object for WORC configuration.

__dict__ = mappingproxy({'__module__': 'WORC.tools.fingerprinting', '__doc__': 'Fingerprinting object for WORC configuration.', '__init__': <function Fingerprinter.__init__>, 'execute': <function Fingerprinter.execute>, '__dict__': <attribute '__dict__' of 'Fingerprinter' objects>, '__weakref__': <attribute '__weakref__' of 'Fingerprinter' objects>, '__annotations__': {}})
__init__()[source]

Initialize object.

__module__ = 'WORC.tools.fingerprinting'
__weakref__

list of weak references to the object (if defined)

execute()[source]

Determine fingerprint of dataset.

Parameters

worcobject: WORC object

WORC object to fingerprint