abpN4: MR image bias correction based on the N4 algorithm.

Description Usage Arguments Value Author(s) Examples

View source: R/abpN4.R

Description

Truncate outlier intensities and bias correct with the N4 algorithm.

Usage

1
2
3
4
5
6
7
abpN4(
  img,
  intensityTruncation = c(0.025, 0.975, 256),
  mask,
  usen3 = FALSE,
  ...
)

Arguments

img

image to be bias corrected

intensityTruncation

quantiles for image truncation.

mask

optional antsImage mask

usen3

Use N3 algorithm instead of N4

...

additional arguments to pass to n4BiasFieldCorrection

Value

outputs a bias corrected image. 1 indicates failure.

Author(s)

Tustison N, Avants BB

Examples

1
2
3
4
5
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 )

neuroconductor-devel/ANTsR documentation built on April 1, 2021, 1:02 p.m.