filippocastelli / pyometiff

OME-TIFF IO in python
GNU General Public License v3.0
18 stars 4 forks source link

Writing multi-series OME-TIFF #3

Open arkwave opened 2 years ago

arkwave commented 2 years ago

Hi, I was wondering if it would be possible to implement writing multi-series OME-TIFFs?

The underlying tifffile.TiffWriter class actually supports this natively (example here), and it would be really nice to have this alongside the XML validation that the OMETIFFWriter class does.

Happy to make a PR that does this, if that would help!

filippocastelli commented 2 years ago

It seems a nice feature to add and easy to implement, if you'd like to submit a PR you're more than welcome! Thank you!

arkwave commented 2 years ago

kind of on a related note, can I ask why the call to OMETiffWriter.write saves the metadata as a description, rather than passing it in via the metadata argument to tif.save?

filippocastelli commented 2 years ago

Hello, sorry for the late reply. Providing a JSON-formatted description argument to tif.write is the most direct way to populate ImageDescription tag, passing a dict via metadata would just return it JSON-encoded with no real advantage. https://github.com/cgohlke/tifffile/blob/375d97f62df6482142b51f1b38a49bdd24d18a60/tifffile/tifffile.py#L17646 The implementation is not visually easy to follow but you can easily verify with a debugger https://github.com/cgohlke/tifffile/blob/375d97f62df6482142b51f1b38a49bdd24d18a60/tifffile/tifffile.py#L2350

arkwave commented 2 years ago

Hello, it's me again. Quick question, how does the current implementation of OMETiffWriter handle RGB images, i.e. images with dimension order SYX? I have an RGB image with one single channel, and am having trouble writing it out to an OME-TIFF. Any help would be much appreciated!

If you would like this to be moved to its own topic, please let me know and I can repost.

filippocastelli commented 2 years ago

yeah maybe we should open a new issue just for readability purposes. Could you reproduce the issue in a new thread? it would be easier for me to investigate it

arkwave commented 2 years ago

Done! Opened a new issue here: https://github.com/filippocastelli/pyometiff/issues/5

beniroquai commented 1 year ago

Hey @arkwave and @filippocastelli, I just read this thread when looking for multi-series support. Has there been any update recently? :-) Thanks a lot for the great work1

filippocastelli commented 1 year ago

hi @beniroquai sorry for the slow updates, Ive been working on my phd defense and didn't have much time to spend on this project. Now that it's done I can definitely spare some time to include multi-series support. I just need some time to look into it more closely

beniroquai commented 1 year ago

That would be fabulous! Thanks a lot! I can be a great beta tester ;D

filippocastelli commented 1 year ago

Hi @beniroquai , just wanted to let you know I'm still on it. I'm slow because I don't have much time for dev on personal projects and this is pretty much a one man show at the moment. This repo really needs some contributors who are actively working in photonics / microscopy / lifescience to speed things up.

beniroquai commented 1 year ago

Thanks a lot Filippo! I really appreciate it. I could try helping out, but I'm a very bad coder :D

Message ID: @.***>