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

Interactive object count #754

Open
wants to merge 181 commits into
base: interactive-tools
Choose a base branch
from
Open

Conversation

JorgeGtz
Copy link
Contributor

@JorgeGtz JorgeGtz commented Apr 14, 2021

Describe your changes
Added the function detect_discs which helps detecting the pollen grains in the image in #746.
This branch is intended to be updated with the interactive tool for counting objects in an image.
Added the function get_centroids that returns the coordinates of the connected regions in a binary image. The coordinates can be used in the interactive tool to automatically count the objects given by the binary image.

Type of update
Is this a:

  • New feature or feature enhancement
  • Work in progress

Associated issues
Associated with #746

Additional context
The goal is to provide an interactive tool for object counting that can be used with other PlantCV functions to semi-automate the counting.

@JorgeGtz JorgeGtz added new feature New feature ideas and solutions work in progress Mark work in progress labels Apr 14, 2021
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

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

Comparison is base (7c7b4ec) 100.00% compared to head (7d79c18) 96.27%.
Report is 2 commits behind head on interactive-tools.

❗ Current head 7d79c18 differs from pull request most recent head 9137049. Consider uploading reports for the commit 9137049 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           interactive-tools     #754      +/-   ##
=====================================================
- Coverage             100.00%   96.27%   -3.73%     
=====================================================
  Files                    158      160       +2     
  Lines                   6944     7389     +445     
=====================================================
+ Hits                    6944     7114     +170     
- Misses                     0      275     +275     
Flag Coverage Δ
unittests 96.27% <50.98%> (-3.73%) ⬇️

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

Files Coverage Δ
plantcv/plantcv/__init__.py 100.00% <ø> (ø)
plantcv/plantcv/annotate/__init__.py 100.00% <100.00%> (ø)
plantcv/plantcv/annotate/classes.py 100.00% <100.00%> (ø)
plantcv/plantcv/annotate/detect_discs.py 100.00% <100.00%> (ø)
plantcv/plantcv/annotate/get_centroids.py 100.00% <100.00%> (ø)
plantcv/plantcv/classes.py 100.00% <100.00%> (ø)
plantcv/plantcv/visualize/__init__.py 100.00% <ø> (ø)
plantcv/plantcv/watershed.py 100.00% <100.00%> (ø)
plantcv/plantcv/annotate/temp_file.py 0.00% <0.00%> (ø)

... and 23 files with indirect coverage changes

@JorgeGtz JorgeGtz changed the base branch from master to 4.x April 19, 2021 14:29
@nfahlgren nfahlgren added this to the PlantCV v4.x milestone Apr 23, 2021
@DannieSheng DannieSheng added ready to review and removed work in progress Mark work in progress labels Apr 26, 2021
@DannieSheng DannieSheng added the work in progress Mark work in progress label Apr 27, 2021
@JorgeGtz JorgeGtz added ready to review and removed work in progress Mark work in progress labels Apr 28, 2021
@JorgeGtz JorgeGtz added work in progress Mark work in progress and removed ready to review labels Aug 5, 2021
@HaleySchuhl HaleySchuhl self-assigned this Sep 15, 2021
@HaleySchuhl
Copy link
Contributor

HaleySchuhl commented Sep 15, 2021

I started reviewing/testing this PR and ran into a few questions:

  • Is get_centroids redundant since detect_discs is returning coordinates? When the threshold is set to the upper bound of 1, then I think the latter is already performing the functionality of gathering centroids. I also think these data should get stored to output observations.
  • Should we consider updating the format that data gets saved out to be more consistent with other output observations? It seems safe to assume that these tools would be used just on one image at a time since it's a user-in-the-loop type of workflow, but right now the json data getting stored out doesn't have the other standard metadata that we include with plantcv outputs.

Updates I plan to make:

  • round coordinates stored by the decect_disks function to be integers
  • write a static tutorial that goes from raw image, includes detect_disks and ClickCount, and eventually add it to the tutorial gallery and binder tutorials.
  • resolve conflicts

@nfahlgren
Copy link
Member

The branch has been fully updated with the 4.x branch, so ready to review/work on again

@HaleySchuhl
Copy link
Contributor

I can start testing this out after lunch! Can you slack me the test notebook and image you have or is it already on the datasci shared drive?

@nfahlgren
Copy link
Member

I only did code updates to fix the conflicts and refactor the tests into modules. Looks like you might have been testing it before, but you might not have gotten to the notebook stage yet? And/or @JorgeGtz might have somthing.

I think we were also discussing merging in the Points functionality?

@HaleySchuhl
Copy link
Contributor

I have a stomata notebook after all. Added this function to the agenda for discussion at dev meeting tomorrow :)

HaleySchuhl
HaleySchuhl previously approved these changes May 5, 2023
@HaleySchuhl HaleySchuhl removed their assignment May 5, 2023
@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels May 5, 2023
@HaleySchuhl HaleySchuhl removed the request for review from nfahlgren May 5, 2023 16:29
@HaleySchuhl HaleySchuhl dismissed their stale review June 20, 2023 14:50

outdated

remove self return from .correct method test
finish out code example
updating example to insert images into code chunks
methods felt unreadable so added line to separate
undefined variable name update to defined
testing refactored class methods and such, so pushing to GitHub so the code isn't just locally on my computer like it has been all week.
change default label to label, add label param to init, add label param to save_counts method, wrap logic for only doing fancy label configuration if there is a binary image available to use for create_labels
update save_coords to be a fnx talking to outputs.observations and update old function to be named "print_coords" for to text file
remove extra output
remove coordinate calculation and return
move detect_discs
fix import statement
update logic of test (unfiltered mask has more stuff)
@HaleySchuhl HaleySchuhl force-pushed the interactive-object-count branch from b39eff7 to e5cb828 Compare January 18, 2024 16:39
remove device counter and import of params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature ideas and solutions work in progress Mark work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants