NIPY logo

Site Navigation

NIPY Community

Table Of Contents

This Page

neurospin.registration.registration

Module: neurospin.registration.registration

Inheritance diagram for nipy.neurospin.registration.registration:

Class

FmriRealign4d

class nipy.neurospin.registration.registration.FmriRealign4d(images, tr, tr_slices=None, start=0.0, slice_order='ascending', interleaved=False)

Bases: object

__init__(images, tr, tr_slices=None, start=0.0, slice_order='ascending', interleaved=False)
correct_motion(iterations=2, between_loops=None, align_runs=True)
resample(align_runs=True)
Return a list of 4d nibabel-like images corresponding to the resampled runs.

Functions

nipy.neurospin.registration.registration.register(source, target, similarity='cr', interp='pv', subsampling=None, search='affine', graduate_search=False, optimizer='powell')

Three-dimensional affine image registration.

Parameters:

source : nibabel-like image object

Source image

target : nibabel-like image

Target image array

similarity : str or callable

Cost-function for assessing image similarity. If a string, one of ‘cc’, ‘cr’, ‘crl1’, ‘mi’, je’, ‘ce’, ‘nmi’, ‘smi’. ‘cr’ (correlation ratio) is the default. If a callable, it should take a two-dimensional array representing the image joint histogram as an input and return a float. See registration_module.pyx

interp : str

Interpolation method. One of ‘pv’: Partial volume, ‘tri’: Trilinear, ‘rand’: Random interpolation. See iconic.c

subsampling : None or sequence length 3

subsampling of image in voxels, where None (default) results in the subsampling to be automatically adjusted to roughly match a cubic grid of 64**3 voxels

search : str or sequence

If a string, one of ‘affine’, ‘rigid’, ‘similarity’; default ‘affine’ A sequence of strings can be provided to run a graduate search, e.g. by doing first ‘rigid’, then ‘similarity’, then ‘affine’

optimizer : str or sequence

If a string, one of ‘simplex’, ‘powell’, ‘steepest’, ‘cg’, ‘bfgs’ Alternatively, a sequence of such strings can be provided to run several optimizers sequentially. If bot search and optimizer are sequences, then the shorter is filled with its last value to match the longer.

Returns:

T : source-to-target affine transformation

Object that can be casted to a numpy array.

nipy.neurospin.registration.registration.transform(floating, T, reference=None, interp_order=3)