glencoesoftware / raw2ometiff

Raw format to OME-TIFF converter
GNU General Public License v2.0
46 stars 20 forks source link

Fix progress bars for multiple planes #106

Closed melissalinkert closed 1 year ago

melissalinkert commented 1 year ago

Noticed while looking at #104.

Using bioformats2raw 0.7.0, convert any dataset with multiple planes, e.g. bioformats2raw -p "test&sizeX=50000&sizeY=50000&sizeC=10.fake" plane-test.zarr. Using the output of bioformats2raw with raw2ometiff -p plane-test.zarr plane-test.ome.tiff, compare the progress bars shown with and without this PR.

Without this PR, the initial progress bar size is expected to match the number of tiles per plane, not the total tiles per resolution. After the first plane is converted, the progress bar's tile count will increase, but will show 100% complete while the remaining 9 planes are converted.

With this PR, the progress bar size should match the total number of tiles per resolution, and accurately reflect the progress of each resolution without being resized.

melissalinkert commented 1 year ago

Should be fixed with 9e9ab1e. That switches to one ThreadPoolExecutor per resolution (similar to bioformats2raw), instead of per series. The executor will then wait for each resolution to finish before proceeding to the next one, which means that the progress bars can no longer get into a weird state where a few tiles are in-progress for one resolution but the progress bar has advanced to the next resolution (so the previous resolution's bar can no longer be updated).