plantcv
plantcv copied to clipboard
Add an upper threshold for size to `pcv.fill`
Is your feature request related to a problem? Please describe. There are some applications where the goal is to remove large objects and small objects, and only keep the middle-sized objects. Thanks to @kmurphy61 for this feature request.
Describe the solution you'd like
What I've done before is apply pcv.fill
once initially to remove small unwanted things and store to a mask we can call medium_large
, and then make another mask with pcv.fill
that removes medium-sized with a larger size
parameter so all that remains are things that are unwanted because they are too large
. Finally using pcv.image_subtract
to keep only medium sized things by doing keep = medium_large - large
. Perhaps this is functionality that we could apply in the background only when an upper thresh is specified so that it's not any slower under "normal" applications?
What if we made a new function that functionally overlaps with pcv.fill
but has the upper size threshold as you proposed, but we place it/name it in a clearer way like pcv.filters.obj_size
?
We could potentially deprecate pcv.fill
then at a later date/version.
I like that plan. Plus just reminded me to actually open a PR for pcv.filters.solidity
Closed with #1555