# NOT RUN {
img <- antsImageRead(getANTsRData('r16') )
imglist <- list()
nvox <- dim(img)[1] * dim(img)[2]
nsubj <- 50
for(ii in 1:nsubj){
imglist[[ ii ]] <- img + rnorm(nvox, sd=mean(img[img!=0]))
}
mask <- getMask(img) %>% resampleImage( c( 2,2 ) )
imgmat <- imageListToMatrix(imglist, mask)
# }
Run the code above in your browser using DataLab