simulateBiasField.Rd
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
)
image to define the spatial domain of the bias field.
number of randomly defined points to define the bias field (default = 10).
characterize the standard deviation of the amplitude (default = 1).
B-spline fitting parameter.
B-spline fitting parameter (scalar or vector of size image dimension).
simulated bias field
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 4331032 231.4 6681702 356.9 NA 6681702 356.9
#> Vcells 7325274 55.9 26570242 202.8 102400 26570236 202.8
rm(logField); gc()
#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
#> Ncells 4330679 231.3 6681702 356.9 NA 6681702 356.9
#> Vcells 7324730 55.9 26570242 202.8 102400 26570236 202.8