-
Notifications
You must be signed in to change notification settings - Fork 18
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
T77 off by one error #174
T77 off by one error #174
Conversation
else: | ||
det_elements = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should catch the case where a user defines 0 detector elements and throw an Error instead of giving it a detector position
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, in general we should catch the case where number_detector_elements <= 0
as this doesn't make sense. At the moment the else
case is only required if number_detector_elements == 1
to set the one detector element into central position.
Fixes #77 by adding a 0.5 pixel offset to the sensor positions in x direction to make them and the delays to their position symmetric (left most and right most pixels of a centred volume should have the same delay to the detector elements). In y direction the correction in the acoustic simulation was removed which solves the off-by-one error. Please check if this correction is still necessary (in my test case it was not necessary), then we might have to find an other solution.
I've also slightly changed the image dimension computation to reduce rounding issues and mitigate large offset errors by distributing them equally. I've written tests for some cases of this function but we could certainly add even more test cases.