fitCalibrationModel: Fit a Calibration Curve

View source: R/calibrateFilm.R

fitCalibrationModelR Documentation

Fit a Calibration Curve

Description

Fit a model to calibrate a film from X-ray densitometry.

Usage

fitCalibrationModel(
  grayvalues,
  thickness = stepIncrease(0.24, 7),
  density = 1.2922,
  plot = TRUE,
  ...
)

Arguments

grayvalues

a numeric vector containing the gray values of the steps of the calibration wedge at various thicknesses given by the argument 'thickness'

thickness

a vector specifying the thickness of the calibration wedge at each step.

density

the density of the reference material

plot

if TRUE the calibration model is displayed

...

further arguments to be passed to loess

Value

an object of class 'loess' representing the film calibration

See Also

getSteps

Examples

if (interactive()) {
  # read a sample file
  im <- imRead(file = system.file("img", "AFO1046.1200dpi.png", package = "xRing"))

  # display the image
  imDisplay(im)

  # get the grayvalues from the calibration wedge on the film
  grayvalues <- getSteps(im, 7)

  # calibrate the film by fitting a model:
  calibration <- fitCalibrationModel(grayvalues,
    thickness = stepIncrease(0.24, 7),
    density = 1.2922,
    plot = TRUE
  )
}


xRing documentation built on April 22, 2022, 5:05 p.m.