Description Usage Arguments Value Author(s) Examples
View source: R/checkImageList.R
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.
1 | checkImageList(imgList, showError = T, binaryCheck = F)
|
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. |
True if list has images with same headers, otherwise False.
Dorian Pustina
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.