itkwasm_downsample.resample_to_reference

Module Contents

Functions

resample_to_reference

Resample an image onto a reference image’s grid with an optional transform and a selectable interpolator.

API

itkwasm_downsample.resample_to_reference.resample_to_reference(input: itkwasm.Image, reference_image: itkwasm.Image, transform: Optional[itkwasm.TransformList] = None, interpolator: str = 'linear', default_value: float = 0) itkwasm.Image

Resample an image onto a reference image’s grid with an optional transform and a selectable interpolator.

Parameters:
  • input (Image) – The moving image to resample.

  • reference_image (Image) – Reference image whose geometry defines the output grid. Only the geometry (origin, spacing, direction, size) is used; the pixel values are ignored.

  • transform (TransformList) – Optional transform mapping output-grid points into the moving-image space. A multi-entry or composite list is composed with itk::CompositeTransform semantics: the last entry is applied to the point first. Defaults to identity.

  • interpolator (str) – Interpolation method used to sample the moving image.

  • default_value (float) – Pixel value assigned to output samples that map outside the moving image (the background value), cast to the output pixel type. Defaults to 0.

Returns:

The resampled output image.

Return type:

Image