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

Description Usage Arguments Details Value Examples

View source: R/class_constructors.R

Description

This is for interoperability with the the EBImage package.

Usage

1
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.

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".

Value

An EBImage::Image.

Examples

1
2
3
4
5
if (rlang::is_installed("EBImage")) {
  img <- read_tif(system.file("img", "Rlogo.tif", package = "ijtiff"))
  str(img)
  str(as_EBImage(img))
}

ijtiff documentation built on June 28, 2021, 9:07 a.m.