Table Of Contents

Previous topic

modalities.fmri.filters

Next topic

modalities.fmri.fmristat.delay

This Page

modalities.fmri.fmri

Module: modalities.fmri.fmri

Inheritance diagram for nipy.modalities.fmri.fmri:

Class

FmriImageList

class nipy.modalities.fmri.fmri.FmriImageList(images=None, volume_start_times=None, slice_times=None)

Bases: nipy.core.image.image_list.ImageList

Class to implement image list interface for FMRI time series

Allows metadata such as volume and slice times

__init__()

A lightweight implementation of an fMRI image as in ImageList

Parameters:

images: a sliceable object whose items are meant to be images, :

this is checked by asserting that each has a coordmap attribute

volume_start_times: start time of each frame. It can be specified :

either as an ndarray with len(images) elements or as a single float, the TR. Defaults to arange(len(images)).astype(np.float)

slice_times: ndarray specifying offset for each slice of each frame :

Functions

nipy.modalities.fmri.fmri.fmri_generator(data, iterable=None)

This function takes an iterable object and returns a generator for

[numpy.asarray(data)[:,item] for item in iterator]

This is used to get time series out of a 4d fMRI image.

Note that if data is an FmriImageList instance, there is more overhead involved in calling numpy.asarray(data) than if data is in Image instance.

If iterables is None, it defaults to range(data.shape[0])

nipy.modalities.fmri.fmri.fromimage(fourdimage, volume_start_times=None, slice_times=None)

Create an FmriImageList from a 4D Image.

Load an image from the file specified by url and datasource.

Note this assumes that the 4d Affine mapping is such that it can be made into a list of 3d Affine mappings

Parameters:

fourdimage: a 4D Image :

volume_start_times: start time of each frame. It can be specified :

either as an ndarray with len(images) elements or as a single float, the TR. Defaults to the diagonal entry of slowest moving dimension of Affine transform

slice_times: ndarray specifying offset for each slice of each frame :

TODO: watch out for reordering the output coordinates to (x,y,z,t) :