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,
...
)
AFMdata object
channel number
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
vertical offset in the same units as the channel units
data.frame obtained from `AFM.flattenLine()`
output fitting parameters
additional arguments for method, such as tau_lower
AFMdata object
[AFM.flattenLine()]
d = AFM.import(AFM.getSampleImages(type='ibw'))
d2 = AFM.flatten(d)
plot(d2,graphType=2)
#> Graphing: HeightRetrace