afm_img: Make image from afm map

Description Usage Arguments Details Value Examples

Description

Make image from afm map

Usage

1
2
afm_img(data = NULL, matrix = NULL, color = "none",
  normalized = TRUE)

Arguments

data

an "afm_scan" data object

matrix

the name of the matrix you want to plot as an image (eg. "Height_Sensor_matrix")

color

the colorscale (see details for options)

normalized

whether the data is normalized to a (0,1) scale

Details

When specifying the afm map that you want to plot as an image, you must use the exact name that appears in data$maps, ie. "Height_Sensor_matrix". By default the data will be plotted in greyscale, but there are several options for colors: "nanoscope" is a dupe of the yellow-tan color palette in the nanoscope software; "distinct_rainbow" and "smooth_rainbow" are rainbow palettes with 10 or 256 levels respectively; all palettes from the viridis line are available, eg. "viridis", "magma", etc. By default the data is normalized to a 0-1 scale, this is because EBImage requires data to be scaled to properly apply colors and display the image. If you set this as FALSE there is a good chance your image will be displayed as junk. This function rotates the EBImage output by -90 degrees because the way that EBImage plots things is weird. The output rotation matches the orientation of the scan direction, such that the image appears as it would in the nanoscope software.

Value

an EBImage image object. This image can be viewed using display()

Examples

1
2
3
load("data/two_um_scan.rda")
img <- afm_img(two_um_scan, matrix = "Height_Sensor_matrix", color = "nanoscope")
EBImage::display(img, method = "raster")

will-r-chase/afmr documentation built on May 9, 2019, 4:11 p.m.