Imports and analyzes Atomic Force Microsocpy (AFM) images; currently four types are supported, images from Nanosurf (.nid), Bruker / Veeco Multimode Nanoscope III (.000), Park AFM images (.tiff), and Asylum Research AFM Igor images (.ibw).
This package provides three main advantages:
- Using this data class, a series of images can be analyzed uniformly and quickly within R;
- Access to each data point allows us to integrate mathematical models directly to the original data;
- Part of reproducible data science that processes raw data directly into publishable figures.
Using R
, install the latest release from the GitHub repository:
# install.packages("devtools")
devtools::install_github("thomasgredig/nanoAFMr")
Several new data structures (S3 and S4) are introduced:
AFMdata
- S4 class that contains all AFM images from a fileAFMinfo
- S3 class that contains all parameters of the AFM images, such as vibration frequency, etc.AFMmath
- S3 class that contains computed parameters, such as roughness, etc. about a particular AFM image
There is a complete description for nanoAFMr library functions; examples in the Article Vignettes are also available.
Use this package to generate AFMdata
S4 data objects, which can be used to quickly display AFM data and also process AFM data. Here are some examples:
Creating an AFMdata
data object, then output a graph and output a summary of characteristics:
fileAFM = AFM.getSampleImages('ibw')
d = AFM.import(fileAFM)
class(d)
plot(d)
print(d)
summary(d)
More information on graphing AFM images are found in the AFM Image Graph Type Vignette.
Use the AFMinfo()
function to obtain information about the AFM image. The information depends on the file format, but some items are common for all images, see names(h)
, such as widthPixel
, scanRate.Hz
, etc.; others can be obtained with AFMinfo.item()
.
afmInfo = AFMinfo(AFM.getSampleImages(type='ibw'))
AFMinfo.item(afmInfo, 'ScanSpeed')
The AFM image information can also be exported to a file.
write.csv(afmInfo$data, file='AFMinfo.csv', row.names = FALSE)
Some properties about the image are included in the AFMdata
object, but others - like the roughness - need to be computed. In order to obtain, the computed values, use the AFMmath
object, which is generated from the AFMdata
class.
filename = AFM.getSampleImages(type='ibw')
afmMath = AFM.math.params(AFM.import(filename))
summary(afmMath)
afmMath$Ra
Several functions are available for image analysis, including:
Example to extract image roughness for a series of images:
file.list = AFM.getSampleImages()
Ra = c()
for(filename in file.list) {
Ra = c(Ra, AFM.math.params(AFM.import(filename))$Ra)
}
data.frame(
name = basename(file.list),
Ra
)
Finding AFM images based on quality is integrated with the AFM rating system. A user is shown the image and can assign a rating based on the quality of the image. The rating data is user specific and stored in the AFM SQlite database. Use AFM.readRatings()
and AFM.writeRatings()
to read / write ratings.
This material is based upon work supported by the National Science Foundation under Grant Number 2018653. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation.