checkImages: Check Paired Microscopic Images

View source: R/checkImages.R

checkImagesR Documentation

Check Paired Microscopic Images

Description

Check validity of paired DNA and a fluorescent images appropriate for parseImages().

Usage

checkImages(
  source,
  type = "tiff",
  which.images = c(1, 2, 2),
  pattern = NULL,
  method = c("none", "raster", "browser"),
  ask = TRUE,
  separate = FALSE,
  nx = 2
)

Arguments

source

A character vector identifying the source of images. The source can be a directory with subdirectories, each of which contains images organized as specified by which.images. In typical use, each subdirectory is the name of the well from a multi- well dish suchg as A1, C03, d003, etc. Alternatively, the source can be a character string of a .zip file or character vector of image files organized as indicated by which.images.

type

A character string identifying the type of image files to parse ("tif", tiff", jpeg", jpg or png").

which.images

An integer of length 2 or 3 or NULL. The first number indicates the position of the DNA image. The second number indicates the position of "target" image. The optional third number specifies the total number of images for each field. If this is not specified, the maxmimum of which.images[1:2] will be used for this value. If NULL, no order is assumed and no consistency checks are performed. The default of c(1, 2) indicates a DNA image followed by target image. A value of c(2, 1) indicates that the target image is followed by the DNA image in pairs of images. A value of c(1, 2, 4) indicates a DNA image, a target image, and two additional images, which are ignored, in each set of four images.

pattern

Optional grep pattern as character string used by list.files to select image files.

method

Character string specifying the method of displaying images. Default of "none" simply summarizes the images. A value of "raster" uses R raster graphics and "browser" attempts to use a browser. (Unfortunately this seems to be failing with EBImage version 4.22.0.)

ask

Logical value to use par(ask = TRUE) if method = "raster".

separate

Logical value to normalize each frame separately if TRUE. Aplies only if method is "raster" or "browser".

nx

Integer value passed to the display function that specifies the number of images in a column if method is not "none".

Details

If which.images is not NULL, the images specified in source will be evaluated with the same logic in getImages to determine if the proper number of files are present and report on the number and form of the image files. If which.images is NULL, no check will be performed.

Images associated with each multiplicity of infection can be individual files in a single directory where each directory is named for the well such as A1, A2, etc. and the files within are identified as A1/file001.tif, A1/file002.tif, etc. The well identifier can be in upper or lower case and can contain leading zeros such as c0003/file12.tif/ The well identifier also can contain a leading prefix designating the plate such as in 1A2 or Plate_1B6.

Alternatively, each group of images associated with a given moi can be a multi-layered tiff file where the sequence of images in the file is specified by the argument which.images.

If 'source' is one or more zip files, files in the temporary directory (tempdir) will be deleted in order to receive the compressed files.

Value

An invisible character vector of image files, diagnostic messages are printed on the console with the option to display normalized image pairs.

Examples

# Example with data organized by folder or well
  path.by.folder <- system.file("extdata", "by_folder", package = "virustiter")
  checkImages(path.by.folder)


ornelles/virustiter documentation built on March 15, 2024, 9:28 a.m.