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

fix bbox planar intersection #609

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

AhmetNSimsek
Copy link
Collaborator

This PR fixes the no intersection issue when the intersection of 2 bounding boxes is planar and hence have volume 0 resulting in None. This meant that while there are some intersections, these were ignored. Also, the edge case, the intersection is just a point, is accounted for.

code to reproduce the issue on current main

import siibra
points = siibra.PointSet(
    [
        [-35.72, -1.87, 35.03],
        [-33.7, -1.87, 36.2],
        [-32.56, -1.87, 34.34],
        [-35.62, -1.87, 35.2],
    ],
    "bigbrain",
)
matched_sections = siibra.features.get(
    points, siibra.features.cellular.CellbodyStainedSection
)
assert len(matched_sections) > 0
voi = points.boundingbox

# this is expected to fetch but fails assuming there is no intersection
patch_1mu = matched_sections[0].fetch(voi=voi, resolution_mm=-1)

This PR fixes the no intersection issue when the intersection of 2 bounding boxes is planar and hence have volume 0 resulting in None. This meant that while there are some intersections, these were ignored.
Also, the edge case, the intersection is just a point, is accounted for.
@xgui3783
Copy link
Member

LGTM, but you should check with @dickscheid to see if volume check is important.

remind me, restrict_space=False is the default for siibra.features.get() right?

This issue does not affect siibra python v2, since there is no volume check.

@AhmetNSimsek
Copy link
Collaborator Author

LGTM, but you should check with @dickscheid to see if volume check is important.

There is a conversation about it here. I thought I remembered all the details but I will make some adjustments to this PR based on Timo's comment.

remind me, restrict_space=False is the default for siibra.features.get() right?

Yes by default it is false, i.e., compares anchors across different spaces.

This issue does not affect siibra python v2, since there is no volume check.

True

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.

2 participants