-
Notifications
You must be signed in to change notification settings - Fork 10
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
maint: unify centroid computation #610
Conversation
…es.compute_from_image()` docstring
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.
LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
==========================================
- Coverage 51.64% 46.00% -5.64%
==========================================
Files 74 75 +1
Lines 7012 7232 +220
==========================================
- Hits 3621 3327 -294
- Misses 3391 3905 +514 ☔ View full report in Codecov by Sentry. |
This PR fixes #613 by using the robust centroid computation used in
Region.spatial_props()
. Now all centroid computation is done by finding the components of an image withskimage.measure.label.()
and then finding the center of the non-zero values in the voxel space.Also:
volume.ComponentSpatialProperties
is introduced in place ofregion.SpatialPropCmpt
.region.SpatialProp
is removed since it is not used and was only introduced for typing.Not backward compatible:
Instead of using
SpatialProps.components
now the result ofVolume.compute_spatial_props()
is a list ofComponentSpatialProperties
per component. If the image is not split to components then it will return a singleComponentSpatialProperties
.Note: this PR does not address #157. The root cause of this issue is the concaved geometry of the regions.