Pierre Lafaye de Micheaux
Français  English 


There are no translations available.

Jonathan Marchini a écrit les premières versions du package AnalyzeFMRI. J'ai pris la relève depuis le 18 octobre 2007.

[ICO]NameLast modifiedSizeDescription

[   ] AnalyzeFMRI_1.0-6.tar.gz 28-Mar-2002 14:39 259K
[   ] AnalyzeFMRI_1.0-7.tar.gz 26-Apr-2002 11:48 259K
[   ] AnalyzeFMRI_1.0-8.tar.gz 09-Sep-2002 08:53 262K
[   ] AnalyzeFMRI_1.1-0.tar.gz 11-Jun-2004 09:43 297K
[   ] AnalyzeFMRI_1.1-0.zip 10-Jun-2004 10:55 432K
[   ] AnalyzeFMRI_1.1-1.tar.gz 23-Dec-2004 17:44 300K
[   ] AnalyzeFMRI_1.1-2.tar.gz 11-Apr-2005 20:38 303K
[   ] AnalyzeFMRI_1.1-3.tar.gz 17-Jun-2005 21:42 300K
[   ] AnalyzeFMRI_1.1-4.tar.gz 04-Oct-2005 21:20 301K
[TXT] README.html 15-Aug-2001 10:31 9.6K
[   ] fmri.null.dataset.tar.gz 30-Aug-2001 16:20 23M
[TXT] ica.screenshots.html 16-Sep-2002 08:52 822

R Package - AnalyzeFMRI


This file explains how to install the R package AnalyzeFMRI. I assume that you have a basic knowledge of UNIX/LINUX and that you already
have R installed on your machine.

AnalyzeFMRI contains functions that allow ANALYZE image format .img and .hdr files to be read into R and written from R automatically

If you have any problems/suggestions using this package, please email me on This e-mail address is being protected from spambots. You need JavaScript enabled to view it


1. Download the g-zipped tar archive AnalyzeFMRI_1.0-0.tar.gz (or a newer version if available from the web-site)

2. Unzip the file using gunzip AnalyzeFMRI_1.0-0.tar.gz

3. Unpack the archive using tar -xvf AnalyzeFMRI_1.0-0.tar

This will create a directory called AnalyzeFMRI and the files example.img and example.hdr (see EXAMPLES)

4. Install the package using R CMD INSTALL -l /path/to/LIB AnalyzeFMRI

/path/to/LIB should be the library directory where you wish to put the package.

If you have root access to your machine then use


and the package will be put into the default R library tree.

5. You can then start an R session and load the package using




(if you installed the package into the default R library tree)

6. Use the EXAMPLES section to see how the functions work.


The package contains the following functions
The functions come with help files

f.analyze.file.summary prints summary of .img file contents
f.analyzeFMRI.gui starts AnalyzeFMRI GUI
f.basic.hdr.list.create creates basic .hdr list
f.ica.fmri Applies Spatial ICA (Independent Component Analysis) to fMRI datasets
f.ica.fmri.gui tcltk GUI to apply ICA to fMRI datasets
f.plot.ica.fmri Plots a specified component from the output of f.ica.fmri
f.read.analyze.header read Analyze header file
f.read.analyze.slice read one slice from a .img file
f.read.analyze.slice.at.all.timepoints reads a slice at all time points from a .img file
f.read.analyze.ts read in one voxel time series
f.read.analyze.volume read whole .img file
f.spectral.summary plots graphical summary of spectral properties of an fMRI dataset
f.write.analyze writes an array to a .img/.hdr pair
f.write.array.to.img.2bytes write array of 2 byte integers
f.write.array.to.img.float write array of 4 byte floats
f.write.list.to.hdr writes a .hdr file


During the installation the two file example.img and example.hdr will have been unpacked. These are required for the following examples.

The file example.img is a 4D fMRI dataset. There are 21 axial slices each consisting of a 64x64 grid of 4mmx4mmx6mm voxels. There is only
one time point.

For the purpose of this example I assume you have put them in the same directory in which you started an R session.

1. Load the package AnalyzeFMRI (as described above).

3. Get a summary of the data stored in the .img file using

[1] File name:./example.img
[1] Data Dimension: 4-D
[1] X dimension: 64
[1] Y dimension: 64
[1] Z dimension: 21
[1] Time dimension: 1 time points
[1] Voxel dimensions: 4mmx4mmx6mm
[1] Data type: signed short (16 bits per voxel)

4. Read in the data from the .img file into an array using


5. Check the dimensions of the array

>dim(A) [1] 64 64 21 1

6. Print out a slice of the dataset using


7. Read in a specific slice


and plot it using


8. Read in a time series from a given location


NB. Because example.img consists of only one time point this will only return one value

9. Create an array and save it in a file of 4 byte floats


10. The GUI can be started using

>f.analyzeFMRI.gui() NB. This depends on tcltk package

(a) Navigate to a .img file using the Select File button.

(b) Select on of the options

(i) File Summary - prints a summary of the files contents
(ii) Plot Time Series - plots a time series at a given location (x,y,z)
(iii) Plot Periodogram - plots the periodogram of a time series at a given location (x,y,z)
(iv) Image Slice - plots a slice (z,t)
(v) Image Volume - plots an entire volume (t)
(vi) Movie - iteratively plots a movie through time of a given slice (z)
(vii) Spectral Summary - provides a graphical view of the spectral properties of an fMRI dataset (see R function f.spectral.summary for details)

(c) Enter the required arguements for your option selection (see in brackets above)

(d) Press OK.

(e) You will be able to repeat if you want or press quit to stop the GUI.


If you have any problems/suggestions using this package, please email me on This e-mail address is being protected from spambots. You need JavaScript enabled to view it