View source: R/splitChannels.R
splitChannels | R Documentation |
split a multichannel antsImage into a list of scalar antsImages
splitChannels(image)
image |
a multichannel antsImage to split |
list of scalar antsImages
Duda, JT
r <- floor(seq(1:(64 * 64)) / (64 * 64) * 255)
dim(r) <- c(64, 64)
r <- as.antsImage(r)
g <- r * 0
b <- r * 0
testthat::expect_error(splitChannels(r))
rgbImage <- mergeChannels(list(r, g, b))
imgList <- splitChannels(rgbImage)
testthat::expect_length(imgList, 3)
sapply(imgList, function(x) {
testthat::expect_s4_class(x, class = "antsImage")
})
testthat::expect_error(splitChannels("hey"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.