glencoesoftware / raw2ometiff

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

Fix RGB ZCT coordinate calculation #112

Closed melissalinkert closed 10 months ago

melissalinkert commented 10 months ago

As reported by @sbesson, a simple conversion with the --rgb flag logs numerous IllegalArgumentExceptions indicating that the ZCT coordinates could not be calculated.

Without this PR, the build passes, indicating that the unit tests that use the --rgb test also pass. However, examining the test output in build/reports/tests/test/classes/ will show similar IllegalArgumentExceptions in the Standard error section of the test report. The ZCT coordinate calculation is only requested in https://github.com/glencoesoftware/raw2ometiff/blob/master/src/main/java/com/glencoesoftware/pyramid/PyramidFromDirectoryWriter.java#L1537, to get the correct plane index for progress notifications. This happens after the tile has already been written; effectively, it is just the progress notification that is failing. This explains why the test does not fail; the actual conversion does in fact succeed and the output file is valid and readable.

With this PR, the IllegalArgumentExceptions should no longer appear in the test report or conversion output. The actual output OME-TIFF with and without this PR should be unchanged.