AnalyzeFMRIThere are no translations available.
R Package - AnalyzeFMRI INTRODUCTION 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 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 INSTALLATION 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 R CMD INSTALL AnalyzeFMRI 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 library(AnalyzeFMRI,lib.loc="/path/to/LIB") or library(AnalyzeFMRI) (if you installed the package into the default R library tree) 6. Use the EXAMPLES section to see how the functions work. FUNCTIONS The package contains the following functions f.analyze.file.summary prints summary of .img file contents EXAMPLES 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 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 >f.analyze.file.summary("./example.img") 4. Read in the data from the .img file into an array using >A<-f.read.analyze.volume("./example.img") 5. Check the dimensions of the array >dim(A) [1] 64 64 21 1 6. Print out a slice of the dataset using >image(A[,,10,1]) 7. Read in a specific slice >B<-f.read.analyze.slice("./example.img",slice=5,tpt=1) and plot it using >image(B) 8. Read in a time series from a given location >f.read.analyze.ts("./example.img",x=30,y=30,z=10) 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 >a<-array(rnorm(20*30*40*3),dim=c(20,30,40,3)) 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 (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. PROBLEMS/SUGGESTIONS 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
TeachingLinksAdvertisingTools (french)
|