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: Fix out-of-range check in glszm C calculation #635

Merged
merged 1 commit into from Sep 18, 2020
Merged

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Sep 5, 2020

When calculating the GLSZM matrix, processed voxel indices are temporarily stored in the processedStack, and the current position in stored in processed_idx. To ensure no overflow errors occur, the processed_idx value is compared to the maximum size of processedStack (=equal to Ns) prior to pushing an index.
This index is used, and then increased, meaning that if it's value = Ns - 1, it is still valid (though the last index to be valid). However, the check compared value + 1 >= Ns, which would fail in this last case. Update the check to allow this value.

Fixes #615 and #617

When calculating the GLSZM matrix, processed voxel indices are temporarily stored in the `processedStack`, and the current position in stored in `processed_idx`. To ensure no overflow errors occur, the `processed_idx` value is compared to the maximum size of `processedStack` (=equal to `Ns`) prior to pushing an index.
This index is used, and then increased, meaning that if it's value = Ns - 1, it is still valid (though the last index to be valid). However, the check compared value + 1 >= Ns, which would fail in this last case. Update the check to allow this value.
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.

Voxel based extraction memory error [FEAT EXTRACTION]
1 participant