Skip to content

Exporting an Image Causes All Values to Become Binary #72

@DarioS

Description

@DarioS

The reason I ask is because as.is = TRUE is said to be essential by a particular protocol that I am reading.

To correctly read in 16-bit images, the as.is = TRUE parameter needs to be set.

Basically,

library(EBImage)
image <- Image(matrix(sample(0:99), ncol = 10)) # Range of different numbers.
writeImage(image, "/tmp/test.tiff")
imported <- readImage("/tmp/test.tiff")
> range(imported) # All of the numbers become binary.
  0 1

The above code is a minimal reproducible example. Below is experimental data, which I will use for cell segmentation.

image <- readTIFF('139La_139La_panCK.ome.tiff', info = TRUE) # Cytokeratin protein. Imaging mass cytometry assay.
> attr(image, "bits.per.sample")
  16
> attr(image, "sample.format")
  "uint"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions