Table Of Contents

Previous topic

algorithms.kernel_smooth

Next topic

algorithms.statistics.classification

This Page

algorithms.resample

Module: algorithms.resample

Some simple examples and utility functions for resampling.

nipy.algorithms.resample.resample(image, target, mapping, shape, order=3)

Resample an image to a target CoordinateMap with a “world-to-world” mapping and spline interpolation of a given order.

Here, “world-to-world” refers to the fact that mapping should be a callable that takes a physical coordinate in “target” and gives a physical coordinate in “image”.

Parameters:

image : Image instance that is to be resampled

target :target CoordinateMap for output image :

mapping : transformation from target.output_coords

to image.coordmap.output_coords, i.e. ‘world-to-world mapping’ Can be specified in three ways: a callable, a tuple (A, b) representing the mapping y=dot(A,x)+b or a representation of this in homogeneous coordinates.

shape : shape of output array, in target.input_coords

order : what order of interpolation to use in scipy.ndimage

Returns:

output : Image instance with interpolated data and output.coordmap == target