atlab / scanreader

Python TIFF Stack Reader for ScanImage 5 scans (including multiROI).
MIT License
9 stars 11 forks source link

Avoid loading entire pages when dealing with multiROI scans #6

Open ecobost opened 5 years ago

ecobost commented 5 years ago

ScanImage saves each scanning depth as a different tiff page; for multiROI scans (such as mesoscope scans) this means that there would often be more than one field in the same page (they appear stacked on below each other). Our main use cases load scans field by field, however, tifffile only allows us to load entire pages so we load the entire page and discard the parts that we are not interested in. This is wasteful, it reads (and transmits over the network if the file is not local) way more data than what we actually need.

We should rewrite tifffile to receive in addition to the list of pages---which it does now---, the starting row and the number of rows we want to read. Similar to #5, this would require modifications to the tifffile library---which is actually a single .py file; we could use this opportunity to create our own tiff reading library tailored to scanimage files which will hopefully produce a cleaner, more efficient implementation.