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 Improve masks returned by get_roi_masks and correctly split into left/right hemispheres #504

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

mvdoc
Copy link
Contributor

@mvdoc mvdoc commented Nov 3, 2023

When loading an ROI mask or a set of vertices within an ROI, the code previously returned only vertices on the flatmap. This is fine in general, but if the ROI spans a cut, then those vertices won't be included and the ROI mask will ignore some voxels.

This PR fixes this issue by including the neighboring vertices that are not present in the flatmap.

Example: before/after for get_roi_verts.

Before
verts_before

After
verts_after

Example: before/after for get_roi_masks.

Before
mask_before

After
mask_after

@mvdoc mvdoc changed the title FIX Include vertices that are along a cut if they happen to be within an ROI FIX Include vertices to an ROI even if they are along a cut Nov 3, 2023
@mvdoc
Copy link
Contributor Author

mvdoc commented Nov 3, 2023

Pinging @marklescroart to double check if there are some edge cases I haven't thought about that would fail miserably here.

@mvdoc
Copy link
Contributor Author

mvdoc commented Nov 4, 2023

b5f0f76 fixes an additional bug with split_lr.

Before:

image

After:

image

@mvdoc mvdoc changed the title FIX Include vertices to an ROI even if they are along a cut FIX Improve masks returned by get_roi_masks and correctly split into left/right hemispheres Nov 4, 2023
@mvdoc mvdoc merged commit 0a2b422 into gallantlab:main Nov 7, 2023
7 checks passed
@mvdoc mvdoc deleted the fix/roiverts branch November 7, 2023 21:39
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.

1 participant