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: Error in geometry check during resampling #227

Merged
merged 1 commit into from
Mar 28, 2017

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Mar 27, 2017

When checking if the ROI physical space is contained within the image physical space, direction is not taken into account when comparing in the physical space. Therefore, instead of bringing both the ROI and image bounds to the physical space, bring the ROI bounds first to the physical space and then to the image coordinate space. Then, compare those bounds with the minimum (always [-0.5, -0.5, -0.5]) and the maximum (image.GetSize() - 0.5) image bounds.

Additionally, add a tolerance to prevent machine precision errors (set at 1e-3).

When checking if the ROI physical space is contained within the image physical space, direction is not taken into account when comparing in the physical space. Therefore, instead of bringing both the ROI and image bounds to the physical space, bring the ROI bounds first to the physical space and then to the image coordinate space. Then, compare those bounds with the minimum (always [-0.5, -0.5, -0.5]) and the maximum (image.GetSize() - 0.5) image bounds.

Additionally, add a tolerance to prevent machine precision errors (set at 1e-3).
@JoostJM JoostJM merged commit 3f7abee into AIM-Harvard:master Mar 28, 2017
@JoostJM JoostJM deleted the bug-roi-check branch March 28, 2017 07:38
@JoostJM JoostJM added the bug label Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant