display {EBImage}R Documentation

Image Display

Description

Displays images using an interactive JavaScript viewer or R's built-in graphics capabilities.

Usage

display(x, title = deparse(substitute(x), width.cutoff = 500L, nlines = 1), method = c("browser", "raster"), frame, all = FALSE)

Arguments

x

an Image object or an array.

title

a character string used as a window title.

method

the method used to display images: either browser (default) for viewing images in a WWW browser, or raster for viewing them as raster graphics using R's native functions.

frame

a numeric indicating the frame number; only works in conjunction with method = "raster" and all = FALSE.

all

should all frames of a stacked image be displayed, or just a single frame?

Details

By default (method = "browser") images are displayed in a WWW browser using a JavaScript based image browser. Multiple windows or tabs can be opened in this way. Pressing H displays a list of available features along with corresponding mouse and keyboard actions.

If method = "raster" images are displayed using R's built-in rasterImage function. By default only the first frame of a stacked image is rendered; a different frame can be specified using frame. When all = TRUE all frames are rendered side by side and automatically positioned in a grid.

Value

Invisible NULL.

Note

For viewing images in a WWW browser a compatible browser with JavaScript enabled is required (e.g. Mozilla Firefox).

Author(s)

Andrzej Oles, andrzej.oles@embl.de, 2012

References

Mozilla Firefox

Examples

  ## Display a single image
  x = readImage(system.file("images", "lena-color.png", package="EBImage"))
  if (interactive()) {
    display(x, "Lena")
    display(x, method = "raster")
  }

  ## Display a thresholded sequence ...
  y = readImage(system.file("images", "lena.png", package="EBImage"))
  yt = list()
  for (t in seq(0.1, 5, len=9)) yt=c(yt, list(gblur(y, s=t)))
  yt = combine(yt)

  ## ... using the browser viewer ...
  if (interactive()) display(yt, "Blurred Lenas")

  ## ... or using R's build-in raster functions
  if (interactive()) display(resize(yt, 256, 256), method = "raster", all = TRUE)

  ## Display the last frame 
  if (interactive()) display(yt, method = "raster", frame = getNumberOfFrames(yt, type = "render"))

[Package EBImage version 4.4.0 Index]