checkAntsInput: Determine type of variable passed by user

View source: R/checkAntsInput.R

checkAntsInputR Documentation

Determine type of variable passed by user

Description

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.

Usage

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.

Author(s)

Dorian Pustina

Examples

## Not run: 
        files = Sys.glob('/data/jag/nifti/*.nii.gz')
         myimagelist = imageFileNames2ImageList(files)
         checkAntsInput(myimagelist) # returns 'antsImageList'
         checkAntsInput(antsFiles) # returns 'antsFiles'
         checkAntsInput(myimagelist[[1]]) # returns 'antsImage'
         
## End(Not run)

dorianps/LESYMAP documentation built on June 1, 2024, 2:12 a.m.