itk_dreg.elastix.register¶

Module Contents¶

Classes¶

ElastixRegistrationResult

Block pair registration result extended with Elastix-specific results.

ElastixDRegBlockPairRegistrationMethod

Data¶

API¶

itk_dreg.elastix.register.logger¶

‘getLogger(…)’

itk_dreg.elastix.register.worker_logger¶

‘getLogger(…)’

class itk_dreg.elastix.register.ElastixRegistrationResult(registration_method: itk.ElastixRegistrationMethod, **kwargs: dict)¶

Bases: itk_dreg.base.image_block_interface.BlockPairRegistrationResult

Block pair registration result extended with Elastix-specific results.

Initialization

Parameters:
  • registration_method – The filter used to run registration.

  • kwargs – Parameters to forward to BlockPairRegistrationResult initialization.

class itk_dreg.elastix.register.ElastixDRegBlockPairRegistrationMethod¶

Bases: itk_dreg.base.registration_interface.BlockPairRegistrationMethod

__call__(fixed_subimage: itk_dreg.base.itk_typing.ImageType, moving_subimage: itk_dreg.base.itk_typing.ImageType, initial_transform: itk_dreg.base.itk_typing.TransformType, block_info: itk_dreg.base.image_block_interface.BlockInfo, log_directory: Optional[str] = None, elx_parameter_object_serial: itk_dreg.elastix.serialize.SerializableParameterObjectType = None, itk_transform_types: List[type] = None, preprocess_initial_transform: bool = False, **kwargs) itk_dreg.base.image_block_interface.BlockPairRegistrationResult¶

Compute a series of ITKElastix transforms mapping from the moving image to the fixed image.

Parameters:
  • fixed_subimage – The padded subimage in the fixed image domain. The subimage requested region indicates the unpadded region of interest.

  • moving_subimage – The padded subimage in the moving image domain. The subimage requested region indicates the unpadded region of interest.

  • initial_transform – The initial fixed-to-moving transform.

  • block_info – Metadata describing the block position in fixed image voxel space.

  • log_directory – The log directory for Elastix outputs, if any.

  • elx_parameter_object_spec – A serializable list of Python dictionaries describing parameter map configurations for ITKElastix registration stages. See generation with itk_dreg.elastix.util.parameter_object_to_list. Note: May be replaced with itk.ParameterObject if the Elastix parameter object wrapping becomes serializable in the future (as of 2023.10.22).

  • itk_transform_types – Ordered list of itk.Transform types corresponding to the order of Elastix transforms to be optimized.

  • preprocess_initial_transform – If True, the initial fixed subimage will be resampled by the initial transform before registration begins. Available as a workaround for limitations regarding the Elastix AdvancedInitialTransform. Setting to True may have severe impact on performance and memory requirements.

Returns:

Registration result with:

  • An optimized fixed-to-moving itk.CompositeTransform for the given stage, which does not include initial_transform. Each stage is an itk.Transform corresponding to an Elastix registration stage as configured via the elx_parameter_object input. Value is None if registration fails.

  • The spatial domain over which the forward transform is valid. Value is None if registration fails.

  • The registration result status.

Raises:

RuntimeError – If the Elastix registration procedure encounters an error.