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
Methods
| from_image | |
| next |
A lightweight implementation of an fMRI image as in ImageList
| Parameters: | images: a sliceable object whose items are meant to be images, :
volume_start_times: start time of each frame. It can be specified :
slice_times: ndarray specifying offset for each slice of each frame : |
|---|
See also
nipy.core.image_list.ImageList
Examples
>>> from numpy import asarray
>>> from nipy.testing import funcfile
>>> from nipy.io.api import load_image
>>> # fmrilist and ilist represent the same data
>>> funcim = load_image(funcfile)
>>> fmrilist = FmriImageList.from_image(funcim)
>>> ilist = FmriImageList(funcim)
>>> print asarray(ilist).shape
(20, 2, 20, 20)
>>> print asarray(ilist[4]).shape
(2, 20, 20)
Create an FmriImageList from a 4D Image by extracting 3d images along the ‘t’ axis.
| Parameters: | fourdimage: a 4D Image : volume_start_times: start time of each frame. It can be specified :
slice_times: ndarray specifying offset for each slice of each frame : |
|---|
This function takes an iterable object and returns a generator that looks like:
[numpy.asarray(data)[:,item] for item in iterator]
This can be used to get time series out of a 4d fMRI image, if and only if time varies across axis 0.
| Parameters: | data : array-like
iterable : None or sequence
|
|---|
Notes
If data is an FmriImageList instance, there is more overhead involved in calling numpy.asarray(data) than if data is an Image instance or an array.