Post-Processing Module#
Module: pyradise.process.postprocess
General#
The postprocess module includes a single component filter class (i.e.
SingleConnectedComponentFilter) which exclusively keeps the largest single
component on the provided SegmentationImage s. Furthermore, this module provides a filter
for alphabetically sorting the subject-associated SegmentationImage s via their
Organ name. This functionality is essential if the Organ s
in a subsequently generated DICOM-RTSS dataset must be sorted.
Class Overview#
The following classes are provided by the postprocess module:
Class |
Description |
|---|---|
Parameterization class for the |
|
Filter to keep the single largest connected component on a |
|
Parameterization class for the |
|
Filter for alphabetic sorting of the |
Details#
- class SingleConnectedComponentFilterParams(excluded_organs=None)[source]#
Bases:
FilterParamsA filter parameter class for the
SingleConnectedComponentFilterclass.- Parameters:
excluded_organs (Optional[Union[Organ, Tuple[Organ, ...]]]) – The organs to be excluded from the connected component filtering. If
NoneallSegmentationImageinstances will be filtered.
- class SingleConnectedComponentFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterA filter class for removing all but the largest connected component from the specified
SegmentationImageinstances in the providedSubjectinstance.- static is_invertible()[source]#
Return whether the filter is invertible or not.
- Returns:
False because the
SingleConnectedComponentFilteris not invertible.- Return type:
bool
- execute(subject, params)[source]#
Execute the single connected component filter procedure.
- Parameters:
params (SingleConnectedComponentFilterParams) – The filters parameters.
- Returns:
The
Subjectinstance with filteredSegmentationImageinstances.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Return the provided
Subjectinstance without any processing because the single connected component filtering procedure is not invertible.- Parameters:
transform_info (TransformInfo) – The transform information.
target_image (Optional[Union[SegmentationImage, IntensityImage]]) – The target image to which the inverse transformation should be applied. If None, the inverse transformation is applied to all images (default: None).
- Returns:
The provided
Subjectinstance.- Return type:
- class AlphabeticOrganSortingFilterParams(ascending=True)[source]#
Bases:
FilterParamsA filter parameter class for the
AlphabeticOrganSortingFilterclass.- Parameters:
ascending (bool) – If the organs should be sorted in ascending order or not (default: True).
- class AlphabeticOrganSortingFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterA filter class performing an alphabetic sorting of the
SegmentationImageinstances according to their assignedOrgannames.Note
This filter is helpful when ordering of the output matters such as for example if constructing a DICOM-RTSS
Datasetinstance.- static is_invertible()[source]#
Return whether the filter is invertible or not.
- Returns:
False because the
AlphabeticOrganSortingFilteris not invertible.- Return type:
bool
- execute(subject, params)[source]#
Execute the alphabetical sorting of the
SegmentationImageinstances according to their associatedOrganinstances.- Parameters:
params (AlphabeticOrganSortingFilterParams) – The filter parameters
- Returns:
The
Subjectinstance with the alphabetically sortedSegmentationImageinstances.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Return the provided image without any processing because the alphabetical sorting procedure is not invertible.
- Parameters:
transform_info (TransformInfo) – The transform information.
target_image (Optional[Union[SegmentationImage, IntensityImage]]) – The target image to which the inverse transformation should be applied. If None, the inverse transformation is applied to all images (default: None).
- Returns:
The provided
Subjectinstance.- Return type: