-
Notifications
You must be signed in to change notification settings - Fork 326
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(conversion):World to image throws an exception on outside image #302
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
imageCoords[1] >= rows | ||
checkCoordinateSpace && | ||
(imageCoords[0] < 0 || | ||
imageCoords[0] > columns || |
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.
The image coordinates have to be strictly larger than columns,rows as the last pixel is columns-1...columns inclusive.
imageCoords[0] >= columns || | ||
imageCoords[1] < 0 || | ||
imageCoords[1] >= rows | ||
checkCoordinateSpace && |
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.
Only check coordinates if requested to do so - normally that isn't a useful thing to do inside the method, as there are quite a few cases where at least one coordinate can usefully be outside by nearby the image.
Hmmm, looking at it again, I guess it shouldn't throw an error at all. Maybe we just remove that check fully? |
79174d8
to
3f48962
Compare
3f48962
to
e4c1768
Compare
There are lots of cases where world to image should allow producing coordinates outside the image. Make the exception optional.