eReg

ereg.registration

class ereg.registration.RegistrationClass(configuration: str | dict | None = None, **kwargs)

Bases: object

property configuration: dict
register(target_image: str | Image, moving_image: str | Image, output_image: str, transform_file: str | None = None, log_file: str | None = None, **kwargs) None

Register the moving image to the target image.

Parameters:
  • logger (logging.Logger) – The logger to use.

  • target_image (Union[str, sitk.Image]) – The target image.

  • moving_image (Union[str, sitk.Image]) – The moving image.

  • output_image (str) – The output image.

  • transform_file (str, optional) – The transform file. Defaults to None.

resample_image(target_image: str | Image, moving_image: str | Image, output_image: str, transform_file: str | None = None, log_file: str | None = None, **kwargs) float

Resample the moving image to the target image.

Parameters:
  • target_image (Union[str, sitk.Image]) – The target image.

  • moving_image (Union[str, sitk.Image]) – The moving image.

  • output_image (str) – The output image.

  • transform_file (str, optional) – The transform file. Defaults to None.

update_parameters(configuration: str | dict)

Update the parameters for the registration.

Parameters:

config_file (Union[str, dict]) – The tring path pointing to a .yml configuration file or configuration dictionary.

ereg.functional

ereg.functional.registration_function(target_image: str | Image, moving_image: str | Image, output_image: str, configuration: str | dict | None = None, transform_file: str | None = None, log_file: str | None = None, **kwargs) float

This is a functional wrapper for the registration class.

Parameters:
  • target_image (Union[str, sitk.Image]) – The target image.

  • moving_image (Union[str, sitk.Image]) – The moving image.

  • output_image (str) – The output image.

  • configuration (Union[str, dict], optional) – The configuration file or dictionary. Defaults to None.

  • transform_file (str, optional) – The transform file. Defaults to None.

Returns:

The structural similarity index.

Return type:

float

ereg.functional.resample_function(target_image: str | Image, moving_image: str | Image, output_image: str, transform_file: str, configuration: str | dict | None = None, log_file: str | None = None, **kwargs) float

Resample the moving image onto the space of the target image using a given transformation.

Parameters:
  • target_image (Union[str, sitk.Image]) – The target image onto which the moving image will be resampled.

  • moving_image (Union[str, sitk.Image]) – The image to be resampled.

  • output_image (str) – The filename or path where the resampled image will be saved.

  • transform_file (str) – The file containing the transformation to be applied.

  • configuration (Union[str, dict], optional) – The configuration file or dictionary. Defaults to None.

  • log_file (str, optional) – The file to log progress and details of the resampling process. Defaults to None.

  • **kwargs – Additional keyword arguments to be passed to the resampling function.

Returns:

The structural similarity index (SSIM) between the resampled image and the target image.

Return type:

float