danforthcenter / plantcv

Plant phenotyping with image analysis
Mozilla Public License 2.0
665 stars 265 forks source link

Prune by location (rather than by size) #1624

Open HaleySchuhl opened 3 weeks ago

HaleySchuhl commented 3 weeks ago

Is your feature request related to a problem? Please describe. The pcv.morphology.prune function currently works by checking the length of each secondary segment (primary segments are not currently eligible for pruning since they are responsible for keeping the skeleton as a fully connected line graph).

Describe the solution you'd like Filter on y-axis (or x-axis) and remove segments completely below OR partially below a user-defined threshold.

Additional context Helpful for tillering plants. Helps to drop non-biologically relevant segments from consideration.

The lower portion of a plant will often display leaf occlusion/overlap artifacts, while the top part of the plant continues to be unhindered from trait extraction. Consider only recently emerged leaves at the top of the image.