AllenCellModeling / aicspylibczi

Python module utilizing libCZI for reading Zeiss CZI files.
https://allencellmodeling.github.io/aicspylibczi
GNU General Public License v3.0
36 stars 8 forks source link

Support for CZI attachments #40

Open ChiliJohnson opened 4 years ago

ChiliJohnson commented 4 years ago

Is there any planned support for retrieving CZI attachments / is it within the scope of this library to provide access to CZI attachments?

Just being able to retrieve raw attachment bytes would be very helpful. After a cursory glance it appears libczi supports reading raw attachment bytes

evamaxfield commented 4 years ago

@heeler Would have more insight. I would assume it's probably in the scope of this package personally but wait for his response.

heeler commented 4 years ago

I'm aware of attachments in the subblocks but I'm not entirely sure what is in them. I believe I could implement something much like the subblock metadata access and pull out attachments. I haven't seen any attachment examples in our institute. Can you explain the use case and do you have an example file you'd be willing to share? Thanks!

ChiliJohnson commented 4 years ago

Of course! I have some CZI slide scans produced with a Zeiss Axio Scan.Z1 which, in addition to the pixels stored in the body of the CZI, also attaches two additional images: one "preview" image of the entire slide, and one "label" image of the slide label area (where we attach barcodes). Both of these (but the preview image most of all) are useful in determining the identity of the samples which were imaged.

It appears that these attachments live in the ZISRAWATTACH segments, with the names SlidePreview, and Label, and are CZI images themselves. Here's an example image which contains both of these attachments.

I should note that this image contains other attachments in various formats that might be useful to others, but the two that I mentioned are just the two I care about for my use case.

Let me know if you'd like any more context, I'd be happy to discuss!