Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zeiss CZI interleaved RGB images do not read as expected #10

Closed
NHPatterson opened this issue Sep 8, 2021 · 4 comments
Closed

Zeiss CZI interleaved RGB images do not read as expected #10

NHPatterson opened this issue Sep 8, 2021 · 4 comments

Comments

@NHPatterson
Copy link

NHPatterson commented Sep 8, 2021

I was playing around with this library and it's really nice! I tried a few different images with success and found that RGB interleaved images from a Zeiss slide scanner had issues.

data in question:
https://drive.google.com/file/d/1DhnEFMOMvb4Zt5aqUe_2nfE9PrnU5uNE/view?usp=sharing

example

from bfio import BioReader
import napari

data_filepath = "testdata/czi_rgb.czi"
br = BioReader(data_filepath)

tout = br[:]
# tout.shape -> (7662, 15778, 1, 3, 1)

viewer = napari.Viewer()
viewer.add_image(np.squeeze(tout))

expected output (QuPath):

image

BR output in napari:

image
zoom:
image

Thought I'd bring this to your attention.. I tested 2 RGB images from other vendors (Huron(bigTIFF), .scn(Leica)) and the RGB data came out correctly!

@Nicholas-Schaub
Copy link
Contributor

I think we've run into this problem before, and it has to do with not handling interleaved RGB data properly. This is definitely a bug and should be resolved soon.

Thank you for sharing test data and code for reproducing the problem.

@Nicholas-Schaub
Copy link
Contributor

@NHPatterson, I just fixed the problem and tested against your czi file. Could you send links to your other two test files so I can make sure my fix didn't undo what was already working?

@Nicholas-Schaub
Copy link
Contributor

I was able to download a test scn file, and it looks like my change made the scn file load incorrectly. What it looks like is happening is that either czi or Bioformats is reversing the byte order of interleaved channels. I think I have to create a special catch just for czi files, which seems extremely odd to me.

@Nicholas-Schaub
Copy link
Contributor

Resolved by #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants