checkImageList: Check headers of list of antsImages

Description Usage Arguments Value Author(s) Examples

View source: R/checkImageList.R

Description

Function to check that all antsImages in a list have the same orientation, origin, and resolution. The function stops with an error if one of the images has unusual headers. This behavior can be overcome by setting showError=F, and using the returned status (True=pass, False=fail) to make decisions outside this function.

Usage

1
checkImageList(imgList, showError = T, binaryCheck = F)

Arguments

imgList

list of antsImages

showError

boolean indicating whether to show the exact error and interrupt the function (TRUE, default), or don't show the error and return the check status (FALSE). The returned values when showError=F are T=passed or F=Failed.

binaryCheck

boolean, check if images are binary (0/1 values). Useful when checking masks or lesions. This check slows the output of the function.

Value

True if list has images with same headers, otherwise False.

Author(s)

Dorian Pustina

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
files = Sys.glob('/data/jag/nifti/*.nii.gz')
myimagelist = imageFileNames2ImageList(files)
checkImageList(myimagelist) # no value returned
checkImageList(lesions, showError=F) # True returned
myimagelist[[4]] = cropIndices(myimagelist[[4]], c(1,1,1), c(20,20,20))
checkImageList(myimagelist) # error on image 4

## End(Not run)

neuroconductor/LESYMAP documentation built on May 28, 2020, 7:27 p.m.