royerlab / napari-segment-anything

Segment Anything Model (SAM) native Qt UI
Apache License 2.0
190 stars 17 forks source link

Support for editing existing labels #26

Open christinab12 opened 4 months ago

christinab12 commented 4 months ago

Hi there,

I'm just trying out your plugin and it very nicely works when no segmentations are available. I was wondering if there is any support (or further interest to implement this) for having the "SAM box" and "SAM points" layers operate on existing labels layers whenever a segmentation mask is already available and needs to be slightly corrected?

Thanks, Christina

JoOkuma commented 4 months ago

Hi @christinab12,

We don't support it out of the box. This could be accomplished by copying the object into want to correct into SAM mask layer. Because SAM processes one object at a time, you must do this for every object you want to correct.

We could add a complementary widget to map a labels layer and a label value into the SAM mask. Do you think this would be helpful?

Best,

christinab12 commented 4 months ago

Hi @JoOkuma,

thanks for your answer and sorry for the late reply. Re. the widget you suggested, would the mapping still need to be done on a per object basis?

JoOkuma commented 4 months ago

Yes, @christinab12, I don't see an easy way to get around that because SAM expects a single segmentation instance

christinab12 commented 4 months ago

Thanks for your answer @JoOkuma,

I think this would probably still be a bottleneck for the user, so I think it's best to drop this for now. Feel free to close the issue!

JoOkuma commented 4 months ago

Thanks for the update, @christinab12. I'll leave it open in case it's helpful to others.