Flatten the data of a particular channel for an AFM image. You can use an appropriate method to flatten the image. The default flatten is a plane fit to the full dataset. This, however, does not work well for samples that have 2 levels, for example. You can also select lineByLine method to fit each line separately, you can check this approach with `AFM.flattenCheck()` and if some lines need to be excluded, then use `AFM.flattenLine()` to return the slope for each line of the image. Use this dataset with (m,b) values to subtract the slope manually with the slope method.

It is possible to offset the data with a shift using the `zShift` parameter.

AFM.flatten(
  obj,
  no = 1,
  method = c("plane", "lineByLine", "slope"),
  zShift = 0,
  slope = NULL,
  verbose = FALSE,
  ...
)

Arguments

obj

AFMdata object

no

channel number

method

use the method to flatten the image:

  • "plane"`Default`: Fit a flat plane to the entire image and subtract

  • "lineByLine"Fit each line and substract a linear fit

  • "slope"Remove given slopes from each line, must provide `slope` parameter

zShift

vertical offset in the same units as the channel units

slope

data.frame obtained from `AFM.flattenLine()`

verbose

output fitting parameters

...

additional arguments for method, such as tau_lower

Value

AFMdata object

See also

[AFM.flattenLine()]

Author

Thomas Gredig

Examples

d = AFM.import(AFM.getSampleImages(type='ibw'))
d2 = AFM.flatten(d)
plot(d2,graphType=2)
#> Graphing: HeightRetrace