# import simmulated fMRI data from image files provided within this package
fpath <- system.file("extdata", package="BHMSMAfMRI")
untar(paste0(fpath,"/fmridata.tar"), exdir=tempdir())
data <- array(dim=c(3,32,32,9))
for(subject in 1:3)
{
directory <- paste0(tempdir(),"/fmridata","/s0",subject,"/")
a <- readfmridata(directory, format="Analyze", prefix=paste0("s0",subject,"_t"),
nimages=9, dim.image=c(32,32,1))
data[subject,,,] <- a[,,1,]
}
dim(a)
Run the code above in your browser using DataLab