scifio / scifio-bf-compat

SCIFIO (@scifio/scifio) plug-in allowing use of Bio-Formats readers.
http://scif.io/
BSD 2-Clause "Simplified" License
3 stars 5 forks source link

Make use of Memoizer to cache metadata for subsequent reads #20

Open imagejan opened 3 years ago

imagejan commented 3 years ago

Any SCIFIO format wrapping around Bio-Formats should ideally make use of loci.formats.Memoizer to speed up subsequent reads of the same file/dataset.

Having a default reader plugin with this functionality for all file formats supported by Bio-Formats would greatly benefit the community. See also this discussion on the image.sc forum.

@hinerm, @ctrueden would you have pointers how to best approach this?

imagesc-bot commented 3 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/speeding-up-metamorph-file-reading-with-bioformats/42532/25

ctrueden commented 3 years ago

I agree that it makes sense to tackle this as part of #12. I do not have insight into how to begin, without digging into the code myself, which I will not have time to do before next year, sorry.

imagejan commented 2 years ago

As #12 (splitting into separate readers/writers per file format) seems more involved, an immediate option might be to change this line:

https://github.com/scifio/scifio-bf-compat/blob/59303c255e662ed46a61b33bd307f7894360491e/src/main/java/io/scif/bf/BioFormatsFormat.java#L461

... to something like:

meta.setReader(new Memoizer(reader));

... and see whether it works. 🤷 🙂

Will try when I find the time.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-should-use-bioformats-memoizer-to-speed-up-opening-of-large-files/66923/2