Invertibility Module#

Module: pyradise.process.invertibility

General#

The invertibility module provides functionality to playback the Filter s of a processing pipeline, if they are invertible. The given feature is helpful if the processing modified the spatial properties of the input data that need to be restored (e.g. registration of the input data to an atlas before DL-model inference).

Class Overview#

The following classes are provided by the invertibility module:

Class

Description

PlaybackTransformTapeFilterParams

Parameterization class for the PlaybackTransformTapeFilter.

PlaybackTransformTapeFilter

Filter to playback the filter operations applied to a Subject instance.

Details#

class PlaybackTransformTapeFilterParams(modalities=None, organ_annotator_combinations=None)[source]#

Bases: FilterParams

A filter parameter class for the PlaybackTransformTapeFilter class.

Parameters:
  • modalities (Optional[Tuple[Union[str, Modality], ...]]) – A tuple of modalities for which the transform tape should be played back. If None, the transform tape will be played back for all modalities (default: None).

  • organ_annotator_combinations (Optional[Tuple[Union[Tuple[str, str], OrganRaterCombination], ...]]) – A tuple of organ-annotator combinations for which the transform tape should be played back. If None, the transform tape will be played back for all organ-annotator combinations (default: None).

class PlaybackTransformTapeFilter(warning_on_non_invertible=False)[source]#

Bases: Filter

A filter class for playing back the transform tape of specific or all Image instances of the provided Subject instance.

This filter is helpful for restoring the spatial properties of the loaded data such that the output data of the processing pipeline has identical spatial properties as the input data.

static is_invertible()[source]#

Return False because the filter is not invertible.

Returns:

False.

Return type:

bool

execute(subject, params=None)[source]#

Execute the filter on the provided Subject instance.

Parameters:
Returns:

The Subject instance with played back images.

Return type:

Subject

execute_inverse(subject, transform_info, target_image=None)[source]#

Return the provided Subject instance without any processing because TransformTape playback is not invertible.

Parameters:
Returns:

The provided Subject instance.

Return type:

Subject