Table Of Contents

Previous topic

modalities.fmri.hrf

Next topic

modalities.fmri.protocol

This Page

modalities.fmri.pca

Module: modalities.fmri.pca

Inheritance diagram for nipy.modalities.fmri.pca:

This module provides a class for principal components analysis (PCA).

PCA is an orthonormal, linear transform (i.e., a rotation) that maps the data to a new coordinate system such that the maximal variability of the data lies on the first coordinate (or the first principal component), the second greatest variability is projected onto the second coordinate, and so on. The resulting data has unit covariance (i.e., it is decorrelated). This technique can be used to reduce the dimensionality of the data.

More specifically, the data is projected onto the eigenvectors of the covariance matrix.

PCA

class nipy.modalities.fmri.pca.PCA(image, tol=1.0000000000000001e-05, ext='.img', mask=None, pcatype='cor', design_keep=None, design_resid=None, **keywords)

Bases: object

Compute the PCA of an image (over axis=0). Image coordmap should have a subcoordmap method.

__init__(image, tol=1.0000000000000001e-05, ext='.img', mask=None, pcatype='cor', design_keep=None, design_resid=None, **keywords)
Parameters:
image : Image

The image to be analysed

tol : float

TODO

ext : string

The file extension for the output image

mask : TODO

TODO

pcatype : string

TODO

design_resid : TODO

After projecting onto the column span of design_keep, data is projected off of the column span of this matrix.

design_keep : TODO

Data is projected onto the column span of design_keep.

fit()

Perform the computations needed for the PCA. This stores the covariance/correlation matrix of the data in the attribute ‘C’. The components are stored as the attributes ‘components’, for an fMRI image these are the time series explaining the most variance.

Returns:None
images(which=[, 0], output_base=None)

Output the component images – by default, only output the first principal component.

Parameters:
which : TODO

TODO

output_base : TODO

TODO

Returns:

TODO

project(Y, which='keep')
Parameters:
Y : TODO

TODO

which : string

TODO

Returns:

TODO