inline BGR support
elhuhdron opened this issue · 3 comments
I'm still having trouble with files with channels encoded in the binary data when I build from the new master 893d062. @heeler, for the test sample that I sent you test_with_channels.czi, which is a non-mosaic czi file with BGR channels, a single channel now reads and plots correctly, that is:
czifile = CziFile('test_with_channels.czi', verbose=True)
image, s = czifile.read_image()
works and when I plot the image it appears correct. But if I specify the new flag:
czifile = CziFile('test_with_channels.czi', verbose=True)
image, shape = czifile.read_image(split_bgr=True)
The image returns with channels in the shape (1, 3, 2056, 2464) [('B', 1), ('C', 3), ('Y', 2056), ('X', 2464)]
But the result of print(image.max())
is 0
.
I suppose the problem is in splitChannels
in TypedImage.h
but it's not clear to me how to fix it (at least cleanly).
Thanks for letting me know I'll dig into it tomorrow.
Thanks for posting this. I think I have addressed it. I'll test it again in the morning but then I'll merge it into master. If you want to try it out before then just pip install aicspylibczi==2.2.0
Also, there are minor changes in the API such as split_bgr is no longer an option a BGR image is always split into 3 channel Gray.
Sorry, slow reply. Sounds good. I'll try it out. I think likely I'll close the cziscene branch and make a new branch on top of the existing head, as I think the other changes/fixes that I made in that branch are all now addressed and incorporated.