algorithms.registration.scripting

Module: algorithms.registration.scripting

A scripting wrapper around 4D registration (SpaceTimeRealign)

Functions

nipy.algorithms.registration.scripting.aff2euler(affine)

Compute Euler angles from 4 x 4 affine

Parameters:

affine : 4 by 4 array

An affine transformation matrix

Returns:

The Euler angles associated with the affine

nipy.algorithms.registration.scripting.aff2rot_zooms(affine)

Compute a rotation matrix and zooms from 4 x 4 affine

Parameters:

affine : 4 by 4 array

An affine transformation matrix

Returns:

R: 3 by 3 array

A rotation matrix in 3D

zooms: length 3 1-d array

Vector with voxel sizes.

nipy.algorithms.registration.scripting.space_time_realign(input, tr, slice_order='descending', slice_dim=2, slice_dir=1, apply=True, make_figure=False, out_name=None)

This is a scripting interface to nipy.algorithms.registration.SpaceTimeRealign

Parameters:

input : str or list

A full path to a file-name (4D nifti time-series) , or to a directory containing 4D nifti time-series, or a list of full-paths to files.

tr : float

The repetition time

slice_order : str (optional)

This is the order of slice-times in the acquisition. This is used as a key into the SLICETIME_FUNCTIONS dictionary from nipy.algorithms.slicetiming.timefuncs. Default: ‘descending’.

slice_dim : int (optional)

Denotes the axis in images that is the slice axis. In a 4D image, this will often be axis = 2 (default).

slice_dir : int (optional)

1 if the slices were acquired slice 0 first (default), slice -1 last, or -1 if acquire slice -1 first, slice 0 last.

apply : bool (optional)

Whether to apply the transformation and produce an output. Default: True.

make_figure : bool (optional)

Whether to generate a .png figure with the parameters across scans.

out_name : bool (optional)

Specify an output location (full path) for the files that are generated. Default: generate files in the path of the inputs (with an _mc suffix added to the file-names.

Returns:

transforms : ndarray

An (n_times_points,) shaped array containing

nipy.algorithms.registration.affine.Rigid class instances for each time

point in the time-series. These can be used as affine transforms by referring to their .as_affine attribute.