Module: algorithms.registration.scripting

A scripting wrapper around 4D registration (SpaceTimeRealign)



Compute Euler angles from 4 x 4 affine

affine4 by 4 array

An affine transformation matrix

The Euler angles associated with the affine

Compute a rotation matrix and zooms from 4 x 4 affine

affine4 by 4 array

An affine transformation matrix

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

inputstr 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.


The repetition time

slice_orderstr (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_dimint (optional)

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

slice_dirint (optional)

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

applybool (optional)

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

make_figurebool (optional)

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

out_namebool (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.


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.