ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
379 stars 241 forks source link

bfconvert ignoring pattern file series specification #3824

Open jil24 opened 2 years ago

jil24 commented 2 years ago

With a pattern file test.pattern: series_<0-1>.tif When i invoke bfconvert test.pattern output.tif

I get a single-page tiff as output when I would like multiple series There is no error, the converter just seems to not increment the series and repeatedly reads the same series0.tif. Only one series/page/image is written Constructing the pattern like this `series<0,1>.tif` has the same result

Specifying z-planes, channels, and timepoints in the pattern file works correctly.

Bioformats 6.9.1

dgault commented 2 years ago

Hi @jil24, how are your files named, are the series marked as part of the filename?

jil24 commented 2 years ago

Yes. In the example they are named series_0.tif and series_1.tif

dgault commented 2 years ago

Thanks, I have been able to reproduce the issue with the latest Bio-Formats 6.9.1, though it looks like this has been an issue going back quite a while (pre 5.5.1 at least). The patternFileReader is returning the correct list of used Files so it looks like this is a bug at the FileStitcher level. I will update this issue once I have confirmed the root cause, we should also be able to add a unit test to reproduce the bug.

dgault commented 2 years ago

My initial attempt to resolve this was to expand out the series block as part of findPatterns so that the selected series would get added and treated as external series in FileStitcher at https://github.com/ome/bioformats/blob/develop/components/formats-bsd/src/loci/formats/FileStitcher.java#L977

However there are also updates required throughtout the FileStitcher API anywhere get/setSeries and resolution are being used. I will try to continue working on this.