# NOT RUN {
dir <- paste(tempdir(), .Platform$file.sep, sep='')
img <- makeImage(c(4,4))
for (ii in 1:6) {
antsImageWrite(img, paste(dir, 'image', ii, '.nii.gz', sep=''))
}
imagenames <- list.files(dir, glob2rx('*.nii.gz'), full.names=TRUE)
images <- imageFileNames2ImageList(imagenames)
# }
Run the code above in your browser using DataLab