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

Feature: Identify object "families" using segmentation data #398

Open
wants to merge 5 commits into
base: RC_v1.5.x
Choose a base branch
from

Conversation

freemansw1
Copy link
Member

This is a long-promised feature to identify object families/systems by identifying where segmented objects touch.

I think this could probably use some more documentation beyond the docstring, but I wanted to get the feature in PR form first.

  • Have you followed our guidelines in CONTRIBUTING.md?
  • Have you self-reviewed your code and corrected any misspellings?
  • Have you written documentation that is easy to understand?
  • Have you written descriptive commit messages?
  • Have you added NumPy docstrings for newly added functions?
  • Have you formatted your code using black?
  • If you have introduced a new functionality, have you added adequate unit tests?
  • Have all tests passed in your local clone?
  • If you have introduced a new functionality, have you added an example notebook?
  • Have you kept your pull request small and limited so that it is easy to review?
  • Have the newest changes from this branch been merged?

@freemansw1 freemansw1 added the enhancement Addition of new features, or improved functionality of existing features label Jan 17, 2024
Copy link

Linting results by Pylint:

Your code has been rated at 8.72/10 (previous run: 8.72/10, +0.00)
The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the RC_v1.5.x branch.
A decrease usually indicates your new code does not fully meet style guidelines or has potential errors.

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (2e4c9d0) 56.91% compared to head (95063e7) 57.18%.

Files Patch % Lines
tobac/utils/general.py 92.30% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.5.x     #398      +/-   ##
=============================================
+ Coverage      56.91%   57.18%   +0.26%     
=============================================
  Files             20       20              
  Lines           3440     3466      +26     
=============================================
+ Hits            1958     1982      +24     
- Misses          1482     1484       +2     
Flag Coverage Δ
unittests 57.18% <92.30%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@w-k-jones w-k-jones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this feature! I've added some suggestions in the review. Further thoughts:

  1. this acts similar to a merge method, does it fit better in the merge/split module?
  2. Can we add a complimentary feature to merge tracks where the segmented features are merged together?
  3. Could we add an option to erode labels or require a minimum number of adjacent pixels to merge features? This may break the current approach using regionprops

]
seg_family_dict[seg_area.label] = seg_family

out_families[time_index] = segmented_arr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
out_families[time_index] = segmented_arr
out_families[time_index] = family_labeled_data

Currently output grid is all ones for segmented area.

Comment on lines +984 to +986
family_labeled_data = skimage.measure.label(
segmented_arr,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should offset the value of these labels by the previous highest feature family so that the families are unique over time

@w-k-jones
Copy link
Member

Naming suggestion: "cluster" for a collection of features at one time step

@JuliaKukulies JuliaKukulies added this to the Version 1.5.4 milestone Mar 22, 2024
@freemansw1 freemansw1 modified the milestones: Version 1.5.4, Version 1.6 May 17, 2024
@fsenf fsenf modified the milestones: Version 1.6, Beyond v1.6 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Addition of new features, or improved functionality of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants