NIPY logo

Site Navigation

NIPY Community

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, 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 :

Represents a transform that goes from the reference image to the moving image. It should have either an apply method, or an as_affine method.

reference : None or nipy-like image, optional

Image to which to resample. The reference image defines the image dimensions and xyz affine to which to resample. 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