NIPY logo

Site Navigation

NIPY Community

Table Of Contents

Previous topic

fmri.hrf

Next topic

testlib

fmri.io

Module: fmri.io

Input and output for fmri data files

Functions

nitime.fmri.io.nifti_from_time_series(volume, coords, time_series, nifti_path)

Makes a Nifti file out of a time_series object

Parameters :

volume: list (3-d, or 4-d) :

The total size of the nifti image to be created

coords: 3*n_coords array :

The coords into which the time_series will be inserted. These need to be given in the order in which the time_series is organized

time_series: a time-series object :

The time-series to be inserted into the file

nifti_path: the full path to the file name which will be created :

nitime.fmri.io.time_series_from_file(nifti_files, coords, TR, normalize=None, average=False, filter=None, verbose=False)
Make a time series from a Analyze file, provided coordinates into the
file
Parameters :

nifti_files: a string or a list/tuple of strings. :

The full path(s) to the file(s) from which the time-series is (are) extracted

coords: ndarray or list/tuple of ndarray :

x,y,z (inplane,inplane,slice) coordinates of the ROI(s) from which the time-series is (are) derived.

TR: float, optional :

The TR of the fmri measurement

normalize: bool, optional :

Whether to normalize the activity in each voxel, defaults to None, in which case the original fMRI signal is used. Other options are: ‘percent’: the activity in each voxel is converted to percent change, relative to this scan. ‘zscore’: the activity is converted to a zscore relative to the mean and std in this voxel in this scan.

average: bool, optional whether to average the time-series across the :

voxels in the ROI (assumed to be the first dimension). In which case, TS.data will be 1-d

filter: dict, optional :

If provided with a dict of the form:

{‘lb’:float or 0, ‘ub’:float or None, ‘method’:’fourier’,’boxcar’ ‘fir’ or ‘iir’ }

each voxel’s data will be filtered into the frequency range [lb,ub] with nitime.analysis.FilterAnalyzer, using the method chosen here (defaults to ‘fir’)

verbose: Whether to report on ROI and file being read. :

Returns :

time-series object :