itkwasm_downsample.resample¶

Module Contents¶

Functions¶

resample

Resample an image onto an explicitly parameterized output grid with an optional transform and a selectable interpolator.

API¶

itkwasm_downsample.resample.resample(input: itkwasm.Image, size: Optional[List[int]] = None, output_spacing: Optional[List[float]] = None, output_origin: Optional[List[float]] = None, output_direction: Optional[List[float]] = None, transform: Optional[itkwasm.TransformList] = None, interpolator: str = 'linear', default_value: float = 0) itkwasm.Image¶

Resample an image onto an explicitly parameterized output grid with an optional transform and a selectable interpolator.

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

  • size (int) – Output size in pixels per axis. Defaults to the input size; when –output-spacing is given without –size, the size is auto-computed to preserve the input’s physical extent at the new spacing.

  • output_spacing (float) – Output spacing per axis in physical units. Defaults to the input spacing.

  • output_origin (float) – Output origin, the physical coordinates of the first pixel, per axis. Defaults to the input origin.

  • output_direction (float) – Output direction as the D-by-D orientation matrix, flattened row-major (D values per row). Defaults to the input direction.

  • 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