as_EBImage {ijtiff} | R Documentation |
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 |
scale |
Scale values in an integer image to the range |
force |
This function is designed to take ijtiff_imgs as input. To
force any old array through this function, use |
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
if (rlang::is_installed("EBImage")) {
img <- read_tif(system.file("img", "Rlogo.tif", package = "ijtiff"))
str(img)
str(as_EBImage(img))
}