smoothImage | R Documentation |
Smooth image or multi-channel image
smoothImage(
inimg,
sigma,
sigmaInPhysicalCoordinates = TRUE,
FWHM = FALSE,
max_kernel_width = 70
)
inimg |
Image to smooth |
sigma |
Smoothing factor. Can be scalar, in which case the same sigma
is applied to each dimension, or a vector of length |
sigmaInPhysicalCoordinates |
If true, the smoothing factor is in millimeters; if false, it is in pixels. |
FWHM |
If true, sigma is interpreted as the full-width-half-max (FWHM) of the filter, not the sigma of a Gaussian kernel. |
max_kernel_width |
Maximum kernel width |
antsImage smoothed image
Kandel BM, Avants BB
set.seed(1234)
img <- makeImage(c(5, 5), rnorm(25))
simg <- smoothImage(img, c(1.2, 1.5))
testthat::expect_equal(sum(simg), -5.59352651424706)
testthat::expect_error(smoothImage(img, c(1.2, 1.5, 3)))
simg2 <- smoothImage(img, c(1.2, 1.5), FWHM = TRUE)
multi <- antsImageRead(getANTsRData("multi_component_image"))
smulti <- smoothImage(multi, c(1.2, 1.5))
means <- sapply(splitChannels(smulti), mean)
testthat::expect_equal(means, c(86.0794883092244, 81.913664855957, 85.519760093689))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.