aicspylibczi icon indicating copy to clipboard operation
aicspylibczi copied to clipboard

Unsure if extra scene in file or sub-block attachment

Open evamaxfield opened this issue 3 years ago • 5 comments

System and Software

  • aicspylibczi Version: 3.0.1
  • Python Version: 3.9
  • Operating System: Ubuntu 20.04

Description

A clear description of the bug

Using the test file aicsimageio/tests/resources/variable_scene_shape_first_scene_pyramid.czi -- We can tell this by how it is read in:

from aicspylibczi import CziFile
r = CziFile("aicsimageio/tests/resources/variable_scene_shape_first_scene_pyramid.czi")
r.get_dims_shape()  # returns: [{'X': (0, 2752), 'Y': (0, 2208), 'C': (0, 3), 'M': (0, 9), 'S': (0, 1)}]

The dims shape above shows that aicspylibczi is reading only a single scene, the first of which is mosaic. AND note that this file is also a pyramid and we are reading the highest resolution of the pyramid.

But if we use bfconvert to convert this file to OME-TIFF we can see there are actually two scenes in the file. bfconvert -noflat -stitch aicsimageio/tests/resources/variable_scene_shape_first_scene_pyramid.czi test-convert.ome.tiff

-noflat and -stitch to ensure that this stays a single file and that the scenes stay together.

from aicsimageio.readers.ome_tiff_reader import OmeTiffReader
r = OmeTiffReader("test-convert.ome.tiff")
r.scenes  # returns ('Image:0', 'Image:1')

Expected Behavior

What did you expect to happen instead?

All scene information to be returned from the reader.

evamaxfield avatar May 27 '21 02:05 evamaxfield

I'll have a look at this. I'm still trying to get my head around what might be going on here. Are there 2 images: 1 mosaic, 1 standard, or is it a mosaic with 2 scenes, or is it something else? If it's the first case I can see that going wrong mostly because I haven't ever seen a mixed mosaic/starndard image before so the logic in the library probably goes sideways in that case. Thanks for catching this.

heeler avatar May 31 '21 13:05 heeler

Perhaps bfconvert turns pyramid levels into scenes?

toloudis avatar Jun 21 '21 20:06 toloudis

We think this is related to the fact that FIJI / ImageJ / BioFormats / something expands all available "image-like" objects into images in FIJI. See related: https://github.com/fiji/fiji/issues/280

evamaxfield avatar Jun 21 '21 21:06 evamaxfield

Just guessing, but could it be that this image a has a preview image attached, which is read by BioFormats as an additional series? (sebi06)

zeissmicroscopy avatar Jun 22 '21 16:06 zeissmicroscopy

Yea thats what we thought as well!

evamaxfield avatar Jun 22 '21 16:06 evamaxfield