hypertools.tools.align

hypertools.tools.align(data, align='hyper', normalize=None, ndims=None, method=None, format_data=True)[source]

Aligns a list of arrays

This function takes a list of high dimensional arrays and ‘hyperaligns’ them to a ‘common’ space, or coordinate system following the approach outlined by Haxby et al, 2011. Hyperalignment uses linear transformations (rotation, reflection, translation, scaling) to register a group of arrays to a common space. This can be useful when two or more datasets describe an identical or similar system, but may not be in same coordinate system. For example, consider the example of fMRI recordings (voxels by time) from the visual cortex of a group of subjects watching the same movie: The brain responses should be highly similar, but the coordinates may not be aligned.

Haxby JV, Guntupalli JS, Connolly AC, Halchenko YO, Conroy BR, Gobbini MI, Hanke M, and Ramadge PJ (2011) A common, high-dimensional model of the representational space in human ventral temporal cortex. Neuron 72, 404 – 416. (used to implement hyperalignment, see https://github.com/PyMVPA/PyMVPA)

Brain Imaging Analysis Kit, http://brainiak.org. (used to implement Shared Response Model [SRM], see https://github.com/IntelPNI/brainiak)

Parameters
datanumpy array, pandas df, or list of arrays/dfs

A list of Numpy arrays or Pandas Dataframes

alignstr or dict

If str, either ‘hyper’ or ‘SRM’. If ‘hyper’, alignment algorithm will be hyperalignment. If ‘SRM’, alignment algorithm will be shared response model. You can also pass a dictionary for finer control, where the ‘model’ key is a string that specifies the model and the params key is a dictionary of parameter values (default : ‘hyper’).

format_databool

Whether or not to first call the format_data function (default: True).

normalizeNone

Deprecated argument. Please use new analyze function to perform combinations of transformations

ndimsNone

Deprecated argument. Please use new analyze function to perform combinations of transformations

Returns
alignedlist

An aligned list of numpy arrays