read.fmridata {BHMSMAfMRI}R Documentation

Read fMRI data from fMRI image files.

Description

Reads fMRI data from fMRI image files into a 4D array.

Usage

read.fmridata( directory, format, prefix, nimages, dim.image, nii=TRUE )

Arguments

directory

Location of the directory where the fMRI image files are stored. Insert within quotations ("").

format

The format of the data file. One of "Analyze" (.img/.hdr files), "Nifti" (.img/.hdr files or .nii files) or "Afni" (.HEAD/.BRIK files).

prefix

If format is "Analyze" or "Nifti", then the part of the fMRI image file name appearing before the image number. The image number is assumed to have four digit representation, that is, the lowest number is 0001 and the highest possible number is 9999. If format is "Afni", then the file name. Insert within quotations("").

nimages

If format is "Analyze", number of images to be read beginning from the first image. If format is "Afni", not necessary.

dim.image

Size of the 3D fMRI image. A vector with three elements.

nii

Necessary only for "Nifti" format. nii=TRUE (default) indicates the image files are in .nii files . nii=FALSE indicates the image files are .img/.hdr files.

Details

The function uses package 'oro.nifti' for reading from fMRI data files. For details, check oro.nifti package help.

Value

A list containing the following:

fmridata

An array of dimension (dim.image, nimages), containing the image data for all images/time-points.

Author(s)

Nilotpal Sanyal <nsanyal@stanford.edu>, Marco Ferreira <marf@vt.edu>

See Also

readANALYZE, readNIfTI, readAFNI

Examples

# See package vignette.

[Package BHMSMAfMRI version 1.3 Index]