itk_dreg.elastix.util

Module Contents

Functions

compute_initial_translation

Compute the initial overlap transform as the translation to sample from the center of the target image to the center of the source image.

get_elx_itk_transforms

Convert Elastix registration results to an ITK composite transform stack of known, corresponding types.

get_elx_parameter_maps

Return a series of transform parameter results from Elastix registration.

flatten_composite_transform

Recursively flatten an itk.CompositeTransform that may contain itk.CompositeTransform members so that the output represents a single layer of non-composite transforms.

_flatten_composite_transform_recursive

Internal implementation detail for flattening composite transforms.

Data

API

itk_dreg.elastix.util.logger

‘getLogger(…)’

itk_dreg.elastix.util.ParameterObjectType

None

itk_dreg.elastix.util.ParameterMapType

None

itk_dreg.elastix.util.SerializableParameterMapType

None

itk_dreg.elastix.util.SerializableParameterObjectType

None

itk_dreg.elastix.util.compute_initial_translation(source_image: itk.Image, target_image: itk.Image) itk.TranslationTransform[itk.D, 3]

Compute the initial overlap transform as the translation to sample from the center of the target image to the center of the source image.

Assumes content is centered in source and target images.

Parameters:
  • source_image – The image serving as the starting point for translation. I.e., the “fixed” image to register.

  • target_image – The image serving as the endpoint for translation. I.e., the “moving” image to register.

itk_dreg.elastix.util.get_elx_itk_transforms(registration_method: itk.ElastixRegistrationMethod, itk_transform_types: List[itk.Transform]) itk.CompositeTransform

Convert Elastix registration results to an ITK composite transform stack of known, corresponding types.

Parameters:
  • registration_method – The Elastix registration method previously used for registration computation.

  • itk_transform_types – Ordered list of itk.Transform types corresponding to Elastix transform parameter object outputs. None indicates that the given Nth transform should be ignored, such as in the case where an advanced initial transform is provided to Elastix.

Returns:

An itk.CompositeTransform representing Elastix results mapping from fixed image to moving image space.

itk_dreg.elastix.util.get_elx_parameter_maps(registration_method: itk.ElastixRegistrationMethod) List[itk.ParameterObject]

Return a series of transform parameter results from Elastix registration.

Parameters:

registration_method – The Elastix registration method previously used to compute registration.

Returns:

A list of Elastix transform parameter objects from Elastix registration.

itk_dreg.elastix.util.flatten_composite_transform(transform: itk.Transform) itk.CompositeTransform[itk.D, 3]

Recursively flatten an itk.CompositeTransform that may contain itk.CompositeTransform members so that the output represents a single layer of non-composite transforms.

Parameters:

transform – A transform to flatten. If the transform is not an itk.CompositeTransform then the result will be a simple one-level itk.CompositeTransform wrapping the input transform.

Returns:

An itk.CompositeTransform representation of the input that is guaranteed to not contain any itk.CompositeTransform members.

itk_dreg.elastix.util._flatten_composite_transform_recursive(transform: itk.Transform) List[itk.Transform]

Internal implementation detail for flattening composite transforms.