Skip to content

BFArray throwing Invalid tile size: error for lazy operations, e.g. rotate #42

@Artur-man

Description

@Artur-man

When lazy rotation is applied to ome.tiff based BFArray objects. Bioformats throws an error:

img.file <- system.file(
  "extdata",
  "xy_12bit__plant.ome.tiff",
  package = "ImageArray"
)

  # create array
  img <- createImageArray(img.file, series = 1, resolution = 1:2)
  img_rotated <- rotate(img, angle = 180)
  img_rotated[[1]]
Error in .jcall("RBioFormats", "Ljava/lang/Object;", "readPixels", i,  : 
  loci.formats.FormatException: Invalid tile size: x=511, y=511, w=512, h=512

This is due to defining slicing indices in a reverse fashion, which looks like a low level internal BioFormats bug

> RBioFormats::read.image(img.file, resolution = 1, series = 1, subset = list(X=512:1, Y=512:1))
Error in .jcall("RBioFormats", "Ljava/lang/Object;", "readPixels", i,  : 
  loci.formats.FormatException: Invalid tile size: x=511, y=511, w=512, h=512

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions