tests/test.R

###################################
## Tests for AnalyzeFMRI package ##
###################################

library(AnalyzeFMRI)

## Test that reading of examples works

a1 <- f.read.analyze.volume(system.file("example.img", package="AnalyzeFMRI"))

a1[30:40, 30:40, 10, 1]


## Test that writing of examples works

a2 <- array(1:1000, dim = c(10, 10, 10, 1))
f.write.analyze(a2, file = "test.array", size = "float")

a3 <- f.read.analyze.volume(file = "test.array.img")

sum(a2 != a3) ## should return 0

Try the AnalyzeFMRI package in your browser

Any scripts or data that you put into this service are public.

AnalyzeFMRI documentation built on Oct. 5, 2021, 5:06 p.m.