regressionMatchImage: Image intensity normalization using linear regression.

View source: R/regressionMatchImage.R

regressionMatchImageR Documentation

Image intensity normalization using linear regression.

Description

Image intensity normalization by regressing the image intensities of the reference image with the source image.

Usage

regressionMatchImage(
  sourceImage,
  referenceImage,
  mask = NULL,
  polyOrder = 1,
  truncate = TRUE
)

Arguments

sourceImage

image whose intensities we will match to the referenceImage intensities.

referenceImage

defines the reference intensity function.

mask

Defines voxels for regression modeling.

polyOrder

of polynomial fit. Default is 1 (linear fit).

truncate

boolean which turns on/off the clipping of intensities.

Value

the sourceImage matched to the referenceImage.

Author(s)

Avants BB

Examples

library(ANTsRCore)
sourceImage <- antsImageRead( getANTsRData( "r16" ) )
referenceImage <- antsImageRead( getANTsRData( "r64" ) )
matchedImage <- regressionMatchImage( sourceImage, referenceImage )
bad_source = sourceImage[1:200, 1:200]
testthat::expect_error(regressionMatchImage( bad_source, referenceImage ))

ANTsX/ANTsRNet documentation built on Nov. 21, 2024, 4:07 a.m.