Registration Module#
Module: pyradise.process.registration
General#
The registration module provides functionality for inter-subject and intra-subject registration of subject images.
Class Overview#
The following classes are provided by the registration module:
Class |
Description |
|---|---|
Parameterization class for the |
|
Filter for intra-subject registration. |
|
Parameterization class for the |
|
Filter for inter-subject registration. |
|
Enum class for registration types. |
Details#
- class IntraSubjectRegistrationFilterParams(reference_modality, registration_type=RegistrationType.RIGID, number_of_histogram_bins=200, learning_rate=1.0, step_size=0.001, number_of_iterations=1500, relaxation_factor=0.5, shrink_factors=(2, 2, 1), smoothing_sigmas=(2, 1, 0), sampling_percentage=0.2, deterministic=True)[source]#
Bases:
FilterParamsA filter parameter class for the
IntraSubjectRegistrationFilterclass.- Parameters:
reference_modality (Union[Modality, str]) – The reference modality.
registration_type (RegistrationType) – The type of registration (default: RegistrationType.RIGID).
number_of_histogram_bins (int) – The number of histogram bins for registration (default: 200).
learning_rate (float) – The learning rate of the optimizer (default: 1.0).
step_size (float) – The step size of the optimizer (default: 0.001).
number_of_iterations (int) – The maximal number of optimization iterations (default: 1500).
relaxation_factor (float) – The relaxation factor (default: 0.5).
shrink_factors (Tuple[int, ...) – The shrink factors for the image pyramid (default: (2, 2, 1))).
smoothing_sigmas (Tuple[float, ...]) – The smoothing sigmas (default: (2, 1, 0))).
sampling_percentage (float) – The sampling percentage of the voxels to incorporate into the optimization (default: 0.2).
deterministic (bool) – Deterministic processing with a fixed seed and a single thread (default: True).
- class IntraSubjectRegistrationFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterAn invertible intra-subject registration filter class which registers all
IntensityImageinstances to a referenceIntensityImageinstance.Important
This filter assumes that the
SegmentationImageinstances are already registered to the referenceIntensityImageinstance. No transformation will be applied to theSegmentationImageinstances.Warning
The inverse registration 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.- static is_invertible()[source]#
Return whether the filter is invertible or not.
- Returns:
True because the registration filter is invertible.
- Return type:
bool
- execute(subject, params)[source]#
Execute the intra-subject registration procedure.
- Parameters:
params (IntraSubjectRegistrationFilterParams) – The filter parameters.
- Returns:
The
Subjectinstance with registeredIntensityImageinstances.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Execute the inverse of the intra-subject registration 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 unregisteredIntensityImageinstances.- Return type:
- class InterSubjectRegistrationFilterParams(reference_subject, reference_modality, subject_modality=None, registration_type=RegistrationType.RIGID, number_of_histogram_bins=200, learning_rate=1.0, step_size=0.001, number_of_iterations=1500, relaxation_factor=0.5, shrink_factors=(2, 2, 1), smoothing_sigmas=(2, 1, 0), sampling_percentage=0.2, deterministic=True)[source]#
Bases:
FilterParamsA filter parameter class for the
InterSubjectRegistrationFilterclass.- Parameters:
reference_subject (Subject) – The reference subject to which the subject will be registered.
reference_modality (Union[Modality, str]) – The modality of the reference image (fixed image) to be used for registration.
subject_modality (Optional[Union[Modality, str]]) – The modality of the subject image (moving image) to be used for registration. If
None, the same modality as the reference image will be used (default: None).registration_type (RegistrationType) – The type of registration (default: RegistrationType.RIGID).
number_of_histogram_bins (int) – The number of histogram bins for registration (default: 200).
learning_rate (float) – The learning rate of the optimizer (default: 1.0).
step_size (float) – The step size of the optimizer (default: 0.001).
number_of_iterations (int) – The maximal number of optimization iterations (default: 1500).
relaxation_factor (float) – The relaxation factor (default: 0.5).
shrink_factors (Tuple[int, ...) – The shrink factors for the image pyramid (default: (2, 2, 1))).
smoothing_sigmas (Tuple[float, ...]) – The smoothing sigmas (default: (2, 1, 0))).
sampling_percentage (float) – The sampling percentage of the voxels to incorporate into the optimization (default: 0.2).
deterministic (bool) – Deterministic processing with a fixed seed and a single thread (default: True).
- class InterSubjectRegistrationFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterAn invertible inter-subject registration filter class which registers all
IntensityImageinstances of the providedSubjectto a referenceIntensityImageinstance of anotherSubject.Important
This filter assumes that all
Imageinstances of the providedSubjectare co-registered such that theSegmentationImageinstances do not require special treatment.Warning
The inverse registration 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.- static is_invertible()[source]#
Return whether the filter is invertible.
- Returns:
True because the inter-subject registration is invertible.
- Return type:
bool
- execute(subject, params)[source]#
Executes the inter-subject registration procedure.
- Parameters:
params (InterSubjectRegistrationFilterParams) – The filter parameters.
- Returns:
The
Subjectinstance with allIntensityImageinstances registered to the reference subjectIntensityImageinstance.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Execute the inverse of the inter-subject registration 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 unregisteredIntensityImageinstances.- Return type:
- class IntraInterSubjectRegistrationFilterParams(reference_subject, reference_modality, subject_inter_modality=None, subject_intra_modalities=None, registration_type=RegistrationType.RIGID, number_of_histogram_bins=200, learning_rate=1.0, step_size=0.001, number_of_iterations=1500, relaxation_factor=0.5, shrink_factors=(2, 2, 1), smoothing_sigmas=(2, 1, 0), sampling_percentage=0.2, deterministic=True)[source]#
Bases:
FilterParamsA filter parameter class for the
IntraInterSubjectRegistrationFilterclass.- Parameters:
reference_subject (Subject) – The reference subject to which the subject will be registered.
reference_modality (Union[Modality, str]) – The modality of the reference image (fixed image) to be used for registration.
subject_inter_modality (Optional[Union[Modality, str]]) – The modality of the subject image (moving image) to be used for the inter-subject registration. None is not an option here (default: None).
subject_intra_modalities (Optional[Tuple[Union[Modality, str], ...]]) – The modalities of the subject images to be registered to the subject_inter_modality. If
None, all modalities of the subject will be registered to the subject_inter_modality (default: None).registration_type (RegistrationType) – The type of registration (default: RegistrationType.RIGID).
number_of_histogram_bins (int) – The number of histogram bins for registration (default: 200).
learning_rate (float) – The learning rate of the optimizer (default: 1.0).
step_size (float) – The step size of the optimizer (default: 0.001).
number_of_iterations (int) – The maximal number of optimization iterations (default: 1500).
relaxation_factor (float) – The relaxation factor (default: 0.5).
shrink_factors (Tuple[int, ...) – The shrink factors for the image pyramid (default: (2, 2, 1))).
smoothing_sigmas (Tuple[float, ...]) – The smoothing sigmas (default: (2, 1, 0))).
sampling_percentage (float) – The sampling percentage of the voxels to incorporate into the optimization (default: 0.2).
resampling_interpolator (int) – The interpolator to use for resampling the image.
deterministic (bool) – Deterministic processing with a fixed seed and a single thread (default: True).
- class IntraInterSubjectRegistrationFilter(warning_on_non_invertible=False)[source]#
Bases:
FilterAn invertible intra-inter-subject registration filter class - inter-registration of a defined subject sequence to a reference subject (presumably atlas) - intra-registration of subject images to the previously registered subject sequence
Important
This filter assumes that all
Imageinstances of the providedSubjectare co-registered such that theSegmentationImageinstances do not require special treatment.Warning
The inverse registration 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.- static is_invertible()[source]#
Return whether the filter is invertible.
- Returns:
True because the inter-subject registration is invertible.
- Return type:
bool
- execute(subject, params)[source]#
Executes the inter-subject registration procedure.
- Parameters:
params (InterSubjectRegistrationFilterParams) – The filter parameters.
- Returns:
The
Subjectinstance with allIntensityImageinstances registered to the reference subjectIntensityImageinstance.- Return type:
- execute_inverse(subject, transform_info, target_image=None)[source]#
Execute the inverse of the inter-subject registration 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 unregisteredIntensityImageinstances.- Return type: