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

cannot request rectangles consisting of one single point #231

Closed
paulhfu opened this issue Apr 26, 2019 · 5 comments
Closed

cannot request rectangles consisting of one single point #231

paulhfu opened this issue Apr 26, 2019 · 5 comments

Comments

@paulhfu
Copy link
Contributor

paulhfu commented Apr 26, 2019

Describe the bug

In Volumina, patchAccessor.getPatchesForRect returns the right patches only if the respective rect intersects at least two tiles. If it is intersecting with one tile only, no patches are returned. Also sometimes getPatchesForRect is called with non-nomralized rects and rects of negative topleft corners. In that case the rect is clipped to the bounds of the scene. The clipping does not handle all possible variations of rectangles correctly.

Expected behavior

There should always be at least one patch-number returned if the respective rect is valid and has at least one point in the given scene.

To Reproduce

call patchAccessor.getPatchesForRect with a rect consisting of a single point. It returns an empty list.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04

ilastik ilastik/ilastik@29d6a33
lazyflow ilastik/lazyflow@8c2d40b
volumina 2b6551d

@m-novikov
Copy link
Contributor

Can you provide some examples for invalid clipping of rectangles?

@paulhfu
Copy link
Contributor Author

paulhfu commented May 7, 2019

This is concerned with single valued rects that are multiples of the tilesize. So for example set the tilesize to 128 and call getPatchesForRect(128, 128, 128, 128).
The patches at the boundary are larger, if the image sizes are no multiples of the tilesize. This is also not handled by this function. For example having an image with (400,400) and a tilesize of 128 requesting any rect within 384 and 399 returns an empty list. E.g. call getPatchesForRect(384, 10, 398, 41)

@paulhfu
Copy link
Contributor Author

paulhfu commented May 7, 2019

Included a fix here #229

@m-novikov
Copy link
Contributor

Please check #233 I added some tests.
Problem with inclusive ranges in my opinion that it breaks expectation from ranges (where end is not inclusive).
Maybe we should always query [x, y, x + 1, y + 1] for point.

@paulhfu
Copy link
Contributor Author

paulhfu commented May 7, 2019

cool! #233 fixes it. Exclusive end-points make sense.

@paulhfu paulhfu closed this as completed May 8, 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

No branches or pull requests

2 participants