plantcv icon indicating copy to clipboard operation
plantcv copied to clipboard

get masks related to segments?

Open eyaler opened this issue 2 years ago • 2 comments

given a segmented skeleton and a mask on which the skeleton was applied, is there a way to get back separate masks of the pixels associated with each of the found segments? btw, plantcv is amazing!

eyaler avatar Jul 30 '22 03:07 eyaler

i found fill_segments() which seems to do what i want be, it uses a builtin thickness=5, which would give me larger masks

eyaler avatar Jul 31 '22 00:07 eyaler

Thanks @eyaler!

In fill_segments the segment contours are drawn as a binary mask with a thickness of 5 to use as markers (seeds) for watershed segmentation. The resulting segment masks are derived from watershed and not directly from the initial segment contours - so in theory the drawing thickness should not increase the size of the masks. But maybe it would if your segments are thin to start with?

If it would help, we could make the line thickness controllable through pcv.params.line_thickness as we do with other visualization functions.

nfahlgren avatar Aug 01 '22 23:08 nfahlgren