This function calls fslstats
fslstats(file, opts = "", verbose = TRUE, ts = FALSE, ...)
(character) filename of image to be checked
(character) operation passed to fslstats
(logical) print out command before running
(logical) is the series a timeseries (4D), invoking -t
option
options passed to checkimg
Result of fslstats command
if (have.fsl()){
system.time({
x = array(rnorm(1e6), dim = c(100, 100, 100))
img = nifti(x, dim= c(100, 100, 100),
datatype = convert.datatype()$FLOAT32, cal.min = min(x),
cal.max = max(x), pixdim = rep(1, 4))
entropy = fslstats(img, opts='-E')
})
}
#> fslstats "/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/RtmpKzob0N/file85752b99fa7d.nii.gz" -E
#> user system elapsed
#> 0.514 0.024 0.540