I am looking for a good (meaning simple and robust) way to read multi-file OME-TIFFs recorded with MicroManager from Python with support for memory mapping. It should support files from both MicroManager 1.x and 2.x.
The OME-TIFF stacks consist of >60 files with 4.3 GB each, so memory mapping is a must. The axis-order is
'STCZYX' with shape
(32, 480, 2, 1, 2048, 2048) (see also below)
Overall, trying to get this to work is turning out to be much more painful than anticipated, so I would really appreciate, if anyone could help me or comment on options to get this working.
Possible options I have tried/found so far:
- I have seen that there is the python-bioformats library. I tried installing this from bioconda (following instructions here), but got the error, that it only supports Python 2.x (although reading this thread it seems, like it coudl/should be supported(?!)):
UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment: Specifications: - python-bioformats -> python[version='<3'] Your python: python=3.7
- The tifffile library, which I have already used and like. It supports memory mapping and runs, but I am having trouble using it. See my support thread here.
- pycromanager: I am not sure, if this can do what I need (and I have not yet tried it). It seems that this is primarily targeted at controlling MicroManager through a wrapper, but it seems that likely would also supports reading files written by MicroManager(?).
aicsimageio: This seems to correctly load the images using this example code from the Github page:
But it is extremely slow to load (on the order of minutes with significant CPU load) and for some reason
>>> img = AICSImage('/path/to/first_ome_multifile.ome.tif') >>> img.dims 'STCZYX' >>> img.shape (32, 480, 2, 1, 2048, 2048) # these are the expected dimension! >>> lazy_s0t0 = img.get_image_dask_data("CZYX", S=0, T=0) # returns 4D CZYX dask array >>> s0t0 = lazy_s0t0.compute() # returns 4D CZYX numpy array
s0t0is empty even though
img.dimsreports expected dimensions.
Best regards and thanks,