ijtiff (version 2.0.2)

as_EBImage: Convert an ijtiff_img to an EBImage::Image.

Description

This is for interoperability with the the EBImage package.

Usage

as_EBImage(img, colormode = NULL, scale = TRUE, force = TRUE)

Arguments

img

An ijtiff_img object (or something coercible to one).

colormode

A numeric or a character string containing the color mode which can be either "Grayscale" or "Color". If not specified, a guess is made. See 'Details'.

scale

Scale values in an integer image to the range [0, 1]? Has no effect on floating-point images.

force

This function is designed to take ijtiff_imgs as input. To force any old array through this function, use force = TRUE, but take care to check that the result is what you'd like it to be.

Value

An EBImage::Image.

Details

The guess for the colormode is made as follows: * If img has an attribute color_space with value "RGB", then colormode is set to "Color". * Else if img has 3 or 4 channels, then colormode is set to "Color". * Else colormode is set to "Grayscale".

Examples

Run this code
# NOT RUN {
if (require(EBImage)) {
  img <- read_tif(system.file("img", "Rlogo.tif", package = "ijtiff"))
  str(img)
  str(as_EBImage(img))
  img <- read_tif(system.file("img", "2ch_ij.tif", package = "ijtiff"))
  str(img)
  str(as_EBImage(img))
}
# }

Run the code above in your browser using DataCamp Workspace