View source: R/antsAverageImages.R
antsAverageImages | R Documentation |
Calculate the mean of a list of antsImages
antsAverageImages(imageList, normalize = FALSE, weights, verbose = TRUE)
imageList |
list of antsImages or a character vector of filenames |
normalize |
boolean determines if image is divided by mean before averaging |
weights |
a vector of weights of length equal to imageList |
verbose |
print a progress bar |
Avants BB, Pustina D
f1 <- getANTsRData("r16")
f2 <- getANTsRData("r64")
r16 <- antsImageRead(f1)
r64 <- antsImageRead(f2)
mylist <- list(r16, r64)
antsAverageImages(mylist)
bad <- resampleImage(r16, c(2, 2), useVoxels = FALSE)
antsAverageImages(mylist, normalize = TRUE)
antsAverageImages(c(f1, f2))
testthat::expect_error(antsAverageImages(list(f1, "")))
testthat::expect_error(antsAverageImages(list(r64, bad)))
diff_size <- as.antsImage(r64[1:10, 1:10], ref = r64)
testthat::expect_error(antsAverageImages(list(r64, diff_size)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.