Low frequency, spatial varying simulated random bias field using random points and B-spline fitting.

simulateBiasField(
  domainImage,
  numberOfPoints = 10,
  sdBiasField = 1,
  numberOfFittingLevels = 4,
  meshSize = 1
)

Arguments

domainImage

image to define the spatial domain of the bias field.

numberOfPoints

number of randomly defined points to define the bias field (default = 10).

sdBiasField

characterize the standard deviation of the amplitude (default = 1).

numberOfFittingLevels

B-spline fitting parameter.

meshSize

B-spline fitting parameter (scalar or vector of size image dimension).

Value

simulated bias field

Author

Tustison NJ

Examples


library( ANTsR )
image <- antsImageRead( getANTsRData( "r16" ) )
logField <- simulateBiasField(image, numberOfPoints = 10, sdBiasField = 1.0,
   numberOfFittingLevels = 2, meshSize = 10 ) %>% iMath( "Normalize" )
logField <- ( exp( logField ) )^4
image <- image * logField
rm(image); gc()
#>            used  (Mb) gc trigger  (Mb) limit (Mb) max used  (Mb)
#> Ncells  4266676 227.9    7574517 404.6         NA  7574517 404.6
#> Vcells 12474032  95.2   27422428 209.3     102400 27422428 209.3
rm(logField); gc()
#>            used  (Mb) gc trigger  (Mb) limit (Mb) max used  (Mb)
#> Ncells  4265903 227.9    7574517 404.6         NA  7574517 404.6
#> Vcells 12472788  95.2   27422428 209.3     102400 27422428 209.3