plantcv icon indicating copy to clipboard operation
plantcv copied to clipboard

Add an upper threshold for size to `pcv.fill`

Open HaleySchuhl opened this issue 9 months ago • 2 comments

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?

HaleySchuhl avatar May 01 '24 18:05 HaleySchuhl

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.

nfahlgren avatar May 01 '24 18:05 nfahlgren

I like that plan. Plus just reminded me to actually open a PR for pcv.filters.solidity

HaleySchuhl avatar May 01 '24 18:05 HaleySchuhl

Closed with #1555

HaleySchuhl avatar Jul 23 '24 15:07 HaleySchuhl