abpN4.Rd
Truncate outlier intensities and bias correct with the N4 algorithm.
abpN4(
img,
intensityTruncation = c(0.025, 0.975, 256),
mask,
usen3 = FALSE,
...
)
image to be bias corrected
quantiles for image truncation.
optional antsImage mask
Use N3 algorithm instead of N4
additional arguments to pass to
n4BiasFieldCorrection
outputs a bias corrected image. 1 indicates failure.
img <- antsImageRead(getANTsRData("r16"))
img2 <- abpN4(img)
img3 <- abpN4(img)
testthat::expect_equal(mean(img2), 82.6, tolerance = 1e-2)
testthat::expect_equal(img2, img3)