Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RGB ZCT coordinate calculation #112

Merged

Conversation

melissalinkert
Copy link
Member

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.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was originally concerned this would affect the writing but this would be primarily impacting the notification.

Confirmed that with this PR included, both raw2ometiff --rgb -p against a RGB image as well as raw2ometiff -p against a multi-dimensional image work as expected including the progress bar.

@sbesson sbesson merged commit 4d2a79f into glencoesoftware:master Nov 10, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants