CellProfiler / python-bioformats

Read and write life sciences file formats
Other
130 stars 45 forks source link

Error reading file metadata #50

Open ggirelli opened 8 years ago

ggirelli commented 8 years ago

Hello, I am trying to convert an nd2 file containing several field of views with 6 channels each and a variable amount of slides (it is quite big, around 18 GB).

When I read the metadata and get the image count with...

o = bioformats.OMEXML(bioformats.get_omexml_metadata( path='pathToTheFile.nd2'))
print(o.image_count)

...it says that only 1 image is present. Also it detects only one slide per channel. But if I open the file with ImageJ or FIJI, then I see all the images and channels...

Any idea on what might be causing this? Am I missing anything?

Many thanks in advance :)

LeeKamentsky commented 8 years ago

Sorry Gabrielle, I'm out until Thursday. I can only give you limited help.

CellProfiler does not open the file metadata in "group" mode - there are usually auxilliary files that are read for some microscope vendor formats and perhaps ND2 is one of them. In that case, you'd only get metadata for the single file.

If you look at this line here: https://github.com/CellProfiler/python-bioformats/blob/master/bioformats/formatreader.py#L697 and this line here: https://github.com/CellProfiler/python-bioformats/blob/master/bioformats/formatreader.py#L985

you'll see where python-bioformats turns the grouping feature off (once, we had a bug where it was set to "on" by mistake and our cluster brought down our isolon server reading the metadata from hundreds of processes simultaneously).

We'd welcome a pull request that made ImageReader.setGroupFiles configurable or you are free to fork and edit it your way. Perhaps I can find some time to do it myself when I get back but no promises on when.