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

BUG: Force dType of discretized image array to int. #501

Merged
merged 1 commit into from Jun 26, 2019

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Jun 26, 2019

If input image array has a dType with max-value smaller than the number of bins, an overflow can occur, causing invalid values and subsequent faillure of texture matrix calculation (e.g. values of '0' or negative values can be present, causing index errors).
To prevent this, ensure the output datatype is 'int', which has a large enough dynamic range to prevent overflow (if number of bins is larger than INT_MAX, the extraction will most likely fail anyway, due to size/memory issues).

If input image array has a dType with max-value smaller than the number of bins, an overflow can occur, causing invalid values and subsequent faillure of texture matrix calculation (e.g. values of '0' or negative values can be present, causing index errors).
To prevent this, ensure the output datatype is 'int', which has a large enough dynamic range to prevent overflow (if number of bins is larger than INT_MAX, the extraction will most likely fail anyway, due to size/memory issues).
@JoostJM JoostJM merged commit add4de0 into AIM-Harvard:master Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant