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: Fix images where widthPx x Bytes is not the same as expected width Bytes #90

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

tlambert03
Copy link
Owner

fixes #88 (which was also showing in a couple datasets).

Occasionally, attributes.widthPx will not be the same as attributes.widthBytes // (attributes.componentCount * attributes.bitsPerComponentInMemory // 8), as was the case with @aaristov's dataset in #88.

In those cases both the sdk reader and the native memmap reader result in skewed images (see #88). Oddly enough, the NIS elements viewer is fine with these files, suggesting they don't directly use the SDK reader internally :/

This PR catches those cases, emits a warning, and forces the image width in pixels to be widthBytes // (componentCount * bitsPerComponentInMemory // 8)

@tlambert03 tlambert03 merged commit e95ac76 into main Sep 8, 2022
@tlambert03 tlambert03 deleted the fix-skewed-images branch September 8, 2022 21:07
@tlambert03 tlambert03 added the bug Something isn't working label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some datasets appear skewed in Ubuntu
1 participant