NIPY logo

Site Navigation

NIPY Community

Github repo

Table Of Contents

Next topic

algorithms.registration.similarity_measures

This Page

algorithms.registration.resample

Module: algorithms.registration.resample

nipy.algorithms.registration.resample.resample(moving, transform=None, reference=None, mov_voxel_coords=False, ref_voxel_coords=False, dtype=None, interp_order=3)

Resample movimg into voxel space of reference using transform

Apply a transformation to the image considered as ‘moving’ to bring it into the same grid as a given reference image. The transformation usually maps world space in reference to world space in movimg, but can also be a voxel to voxel mapping (see parameters below).

This function uses scipy.ndimage except for the case interp_order==3, where a fast cubic spline implementation is used.

Parameters:

moving: nipy-like image :

Image to be resampled.

transform: transform object or None :

Represents a transform that goes from the reference image to the moving image. None means an identity transform. Otherwise, it should have either an apply method, or an as_affine method. By default, transform maps between the output (world) space of reference and the output (world) space of moving. If mov_voxel_coords is True, maps to the voxel space of moving and if ref_vox_coords is True, maps from the voxel space of reference.

reference : None or nipy-like image or tuple, optional

The reference image defines the image dimensions and xyz affine to which to resample. It can be input as a nipy-like image or as a tuple (shape, affine). If None, use movimg to define these.

mov_voxel_coords : boolean, optional

True if the transform maps to voxel coordinates, False if it maps to world coordinates.

ref_voxel_coords : boolean, optional

True if the transform maps from voxel coordinates, False if it maps from world coordinates.

interp_order: int, optional :

Spline interpolation order, defaults to 3.

Returns:

aligned_img : Image

Image resliced to reference with reference-to-movimg transform transform