bingogome / samm

A 3D Slicer integration to Meta's SAM.
https://arxiv.org/abs/2304.05622
MIT License
241 stars 34 forks source link

[dev] BUG of 2D image in slicer. add 2d imgae support #16

Closed lancesye closed 1 year ago

lancesye commented 1 year ago

I want to use Samm to label a 2D image in 3D slicer. But Samm have not support 2d image yet. In samm-workspace, it generate too much slices. However, 2D image should only have one slice. I think I should modify the SammBaseLib\LogicSamm.py. What should I do? 图片1 图片2

bingogome commented 1 year ago

Thanks for trying it out.

Unfortunately 2D images are not supported now, but it should be easy to implement. I will get back to this issue this weekend.

Could you attach the test image here (just to make sure the slicing axis is correct when I test it).

lancesye commented 1 year ago

OCTA.zip

lancesye commented 1 year ago

Thank you very much for your contribution

lancesye commented 1 year ago

I notice that you use Markups as SAM model label points. But the coordinate of marking a point in 2D image have something wrong. When I release the left button of the mouse, the marked point move to (0,0,0) . It seems a problem with the slicer itself, and maybe I need to recompile the slicer, but this step is very complex. I don't have a good solution. image image

bingogome commented 1 year ago

There are two things.

  1. Please refer to the Known Issue section in readme and issue #13.

  2. The embedding, image slices, and masks are transmitted as slices of 3D image. I'll try to add the support of 2D images ASAP.

Apologies ahead. If you have an emergent request, shoot me an email at yliu333@jhu.edu and I can try to arrange something.

bingogome commented 1 year ago

Looks like after resolving #13, 2D image like the one you sent can also be used. I tried it out and it worked. Only problem is the fiducial points sync is slightly off and will disappear. I am pushing a new commit which should take care of that.

bingogome commented 1 year ago

c41750f81672335aea7d5242417f18b67a8ff157

Closing issue. Reopen if the problem persists.