Add segment_ends and Update morphology tips outputs#1644
Merged
Conversation
avoid saving to outputs in the helper function but produce the same relevant outputs, update instances of find_tips getting used throughout morphology
|
Here's the code health analysis summary for commits Analysis Summary
Code Coverage Report
|
img input not just for plotting debug
add optimal assignment input
since no outputs in sorting, skip the label storage. wasn't used downstream but also don't need to store anymore since _find_tips also doesn't store to outputs
rearrage ome imports and change where things are getting called from
decided to go with returning a list of sorted objects instead of a list of re-sorting IDs
missing branch points, in the case of disconnected leaves, will not be sortable so remove them from returned resorted segments
k034b363
approved these changes
May 9, 2025
Contributor
k034b363
left a comment
There was a problem hiding this comment.
Looks good to me, it works the way I would expect it to and reorders branches to something biologically meaningful on both well behaved and less clean maize pictures. The movement of some functions to helpers makes the previously complex morphology functions quite a bit easier to read as well.
nfahlgren
reviewed
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
_iterative_pruneinto the_helper.pyfile to avoid circular imports (this unfortunately touches most of the functions in this package)find_tips(adds a helper function_find_tipsthat is used internally by many functions and doesn't store outputs so they do not accidentally get overwritten)pcv.morphology.segment_endswhich returns: Re-ordered leaf segments, debug image, list of branch point coordinates, list of leaf tip coordinatespcv.morphology.analyze_stemwhere thelabel=Nonewas causing no data to get saved to Outputs. Resolved by updating with appropriate labels.Type of update
Is this a:
Associated issues
plantcv.morphologysub-package #1643Additional context
tipscoordinates toOutputswas easily overwritten by other morphology functions that utilize thepcv.morphology.find_tipsfunction.For the reviewer
See this page for instructions on how to review the pull request.
plantcv/mkdocs.ymlupdating.md