checkAntsInput.RdFunction 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)
| input | the variable to be checked |
|---|---|
| checkHeaders | make sure all images have the same headers |
Type of variable (antsImage, antsImageList, antsFiles) or error if variable cannot be established.
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' }