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

Add pcv.create_labels function #1149

Merged
merged 43 commits into from
May 12, 2023
Merged

Add pcv.create_labels function #1149

merged 43 commits into from
May 12, 2023

Conversation

HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented Apr 28, 2023

Describe your changes
Adding the pcv.create_labels function will serve a similar purpose to multi ROI use cases of pcv.roi_objects. Separates multiple entities and creates a mask with unique pixel intensity values for each of the unique entities. Can also handle seed scatter examples (assume perfect input mask where num(contours) = num(actual seeds) where you'd provide no ROIs.

Type of update
Is this a:

  • Bug fix
  • New feature or feature enhancement
  • Update to documentation
  • Work in progress

Associated issues
Reference associated issue numbers. Does this pull request close any issues?

Additional context
Add any other context about the problem here.

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

@HaleySchuhl HaleySchuhl added enhancement Enhancements to existing features new feature New feature ideas and solutions work in progress Mark work in progress update Updates an existing feature/method Objects class implementation labels Apr 28, 2023
@HaleySchuhl HaleySchuhl self-assigned this Apr 28, 2023
@HaleySchuhl HaleySchuhl changed the base branch from main to release-4.0 April 28, 2023 20:36
@HaleySchuhl HaleySchuhl requested a review from nfahlgren May 5, 2023 19:56
@nfahlgren nfahlgren added ready to review and removed work in progress Mark work in progress labels May 5, 2023
@HaleySchuhl HaleySchuhl added work in progress Mark work in progress and removed ready to review labels May 9, 2023
@HaleySchuhl
Copy link
Contributor Author

In order to call pcv.create_labels(mask=cleaned_mask) we'll have to set a default for rois=None . This case would assume one entity (e.g. seed) per contour and would be used in a seed scatter flatbed scan type design. Technically, would be no different functionality-wise to run pcv.create_labels(mask=cleaned_mask, rois=None, roi_type="partial) since we propose to have default values. Output is a grayscale mask with num + 1 unique pixel values.

If you have multiple rois, then call pcv.create_labels(mask=cleaned_mask, rois=grid_rois, roi_type="partial") . Again output is a grayscale mask with num + 1 unique pixel values.

Finally, in the case where you have just one entity/object of interest per image, utilize pcv.roi.filter. Output is a binary mask a.k.a. still num + 1 unique values. Theoretically, pcv.create_labels(mask=mask, rois=singular_roi, roi_type="partial") and pcv.roi.filter(mask=mask, roi=singular_roi, roi_type="partial") would produce equivalent results.

@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels May 9, 2023
@HaleySchuhl HaleySchuhl requested a review from JorgeGtz May 9, 2023 20:14
@HaleySchuhl HaleySchuhl removed the request for review from JorgeGtz May 11, 2023 17:58
@nfahlgren nfahlgren merged commit 36d3252 into release-4.0 May 12, 2023
5 of 6 checks passed
@nfahlgren nfahlgren deleted the add_create_labels branch May 12, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements to existing features new feature New feature ideas and solutions ready to review update Updates an existing feature/method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants