I/O Functions

Description

Read fMRI data from ANALYZE file(s).

Usage

1
2
read.ANALYZE(prefix = "", numbered = FALSE, postfix = "",
             picstart = 1, numbpic = 1, level = 0.75,setmask=TRUE)

Arguments

prefix

string(s). part of the file name before the number or vector of strings for filename (if numbered is FALSE)

numbered

logical. if FALSE only prefix is taken as file name (default).

postfix

string. part of the file name after the number

picstart

number of the first image to be read.

numbpic

number of images to be read

level

Quantile level defining the mask

setmask

Logical (default TRUE), whether to define a suitable mask based on level

Details

This function reads fMRI data files in ANALYZE format. If numbered is FALSE, only the vector of strings in prefix is used for file name (default).

If numbered is TRUE, it takes the first string in prefix and postfix and a number of the form "007" in between to create the file name.

The number is assumed to be 3 digits (including leading zeros). First number is given in picstart, while numbpic defines the total number of images to be read. Data in multiple files will be combined into a four dimensional datacube.

Value

Object of class "fmridata" with the following list entries:

ttt

raw vector (numeric size 4) containing the four dimensional data cube (the first three dimensions are voxel dimensions, the fourth dimension denotes the time).

header

header information of the data

format

data source. string "ANALYZE"

delta

voxel size in mm

origin

position of the datacube origin

orient

data orientation code

dim

dimension of the datacube

weights

weights vector coding the relative voxel sizes in x, y, z-direction

mask

head mask

Note

Since numbering and naming of ANALYZE files widely vary, this function may not meet your personal needs. See Details section above for a description.

Author(s)

Karsten Tabelow tabelow@wias-berlin.de

References

Biomedical Imaging Resource (2001). Analyze Program. Mayo Foundation.

Polzehl, J. and Tabelow, K. (2007) fmri: A Package for Analyzing fmri Data, R News, 7:13-17 .

See Also

write.ANALYZE, read.AFNI

Examples

1
 ## Not run: analyze <- read.ANALYZE("analyze",TRUE,"file",31,107)