Function to check a variable whether is composed of an antsImage, list of antsImages, or simply filenames. If none of the above, an error is returned.

checkAntsInput(input, checkHeaders = FALSE)

Arguments

input

the variable to be checked

checkHeaders

make sure all images have the same headers

Value

Type of variable (antsImage, antsImageList, antsFiles) or error if variable cannot be established.

Examples

if (FALSE) { files = Sys.glob('/data/jag/nifti/*.nii.gz') myimagelist = imageFileNames2ImageList(files) checkAntsInput(myimagelist) # returns 'antsImageList' checkAntsInput(antsFiles) # returns 'antsFiles' checkAntsInput(myimagelist[[1]]) # returns 'antsImage' }