Resampling Module#
Module: pyradise.process.resampling
General#
The resampling module provides functionality for resampling Image instances.
Class Overview#
The following classes are provided by the resampling module:
Class |
Description |
|---|---|
Parameterization class for the |
|
Filter for resampling |
Details#
- class ResampleFilterParams(output_size, output_spacing, reference_modality=None, transform=<SimpleITK.SimpleITK.AffineTransform; proxy of <Swig Object of type 'itk::simple::AffineTransform *'> >, centering_method='none', rescaling_intensity_images=True)[source]#
Bases:
FilterParamsA filter parameter class for the
ResampleFilterclass.The associated filter provides the following three
centering_methodsfor resampling images:The
nonecentering_method resamples an image such that the output origin and direction does not change.The
referencecentering_method resamples an image such that the output origin and direction is the same as the reference image (identified by the reference images modality).The
label_momentcentering_method resamples an image such that the center of the resampled image is the average between the label center and the gravity center of the reference image. This method is a good approach for resampling data with bilateral and symmetric segmentations. However, it is an experimental method and should be used with caution.
- Parameters:
output_size (Optional[Tuple[int, ...]]) – The output size of the images.
output_spacing (Optional[Tuple[float, ...]]) – The output spacing of the images.
reference_modality (Optional[Union[Modality, str]]) – The reference modality used if
centering_method = 'reference'orcentering_method = 'label_moment'(default: None).transform (sitk.Transform) – The transformation applied during resampling (default: sitk.AffineTransform(3) (identity transform)).
centering_method (str) – The method to center the image (options: ‘none’, ‘reference’, ‘label_moment’) (default: ‘none’).
rescaling_intensity_images (bool) – If True the intensity images will be automatically rescaled to the original intensity range (default: True).
- class ResampleFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterAn invertible filter class for resampling all
IntensityImageandSegmentationImageinstances of aSubjectinstance.Warning
The inverse resampling procedure may not yield the expected results if successive
Filters are applied to the sameImageinstances. Thus, it’s recommended to use the invertibility feature with appropriate caution.Note
Due to the limited precision of floating point numbers, the inverse normalization may not be exact.
- static is_invertible()[source]#
Returns whether the filter is invertible or not.
- Returns:
True because the resampling of images is invertible.
- Return type:
bool
- execute(subject, params)[source]#
Executes the resampling filter procedure.
- Parameters:
params (ResampleFilterParams) – The parameters used for the resampling.
- Returns:
The
Subjectinstance with resampledIntensityImageandSegmentationImageinstances.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Executes the inverse resampling filter procedure.
- 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
Subjectinstance with inversely resampledIntensityImageandSegmentationImageinstances.- Return type: