# Struggling to integrate SAM model to 3D slicer, need help

**URL:** https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244
**Category:** Development
**Created:** [June 26, 2023, 8:51pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244 "2023-06-26T20:51:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sobia\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sobia_khan/32/66558_2.png) [@Sobia\_Khan](https://discourse.slicer.org/u/Sobia_Khan)
#### Post date: [June 26, 2023, 8:51pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/1 "2023-06-26T20:51:17Z")

</div>

Hi,

I was wondering if anyone could help me with integrating the SAM model into the 3D slicer.

I have spent two days on it and am stuck.

Help will be highly appreciated.

Thanks

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [June 26, 2023, 9:27pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/2 "2023-06-26T21:27:06Z")

</div>

Thanks for reaching out and sorry to hear that you were not able to accomplish your goal.

To help us better understand your issue, would you provide some more context ?

---

<div class="post-metadata">

### Author: ![Sobia\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sobia_khan/32/66558_2.png) [@Sobia\_Khan](https://discourse.slicer.org/u/Sobia_Khan)
#### Post date: [June 26, 2023, 9:34pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/3 "2023-06-26T21:34:19Z")

</div>

I am trying this

> <https://github.com/bingogome/samm/blob/main/README.md>

First, I have enabled developer tools but I still don’t see the developer tools dropdown on the left.  
I tried doing the extension wizard, and then it said install from a file.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/4/24ea5569d1c61a684fdeb2ab6d89e6d5341e7475.png)  
But I am not sure what to upload here.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/7/b75e8666c6cae8dbfaed743850e423bc1175f615.png)

can you please guide me?

Thanks

---

<div class="post-metadata">

### Author: ![Sobia\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sobia_khan/32/66558_2.png) [@Sobia\_Khan](https://discourse.slicer.org/u/Sobia_Khan)
#### Post date: [June 26, 2023, 9:39pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/4 "2023-06-26T21:39:26Z")

</div>

I tried to zip the samm directory and install it from that but this is what I get

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/2/82c8e52e6ad327612fdf8423532ab68466187f7b.png)

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [June 26, 2023, 9:48pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/5 "2023-06-26T21:48:47Z")

</div>

Maybe have a look at this work and see if it either addresses what you are trying to do or helps narrow down what’s not working for you.

> [@Integration of “Segment Anything Model”?](https://discourse.slicer.org/t/integration-of-segment-anything-model/28787/24):
>
> Hi everybody! My team and I have just released a new extension called TomoSAM that integrates SAM into Slicer: Here is a youtube tutorial video to get started with it: [[TomoSAM Tutorial] ](https://www.youtube.com/watch?v=4nXCYrvBSjk)

---

<div class="post-metadata">

### Author: ![Sobia\_Khan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sobia_khan/32/66558_2.png) [@Sobia\_Khan](https://discourse.slicer.org/u/Sobia_Khan)
#### Post date: [June 26, 2023, 9:57pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/6 "2023-06-26T21:57:07Z")

</div>

Thank you for this Pieper. It is definitely something I would need next, but it doesn’t address how to import and integrate the model into the Slicer, where I am facing the problem.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 26, 2023, 10:20pm UTC](https://discourse.slicer.org/t/struggling-to-integrate-sam-model-to-3d-slicer-need-help/30244/7 "2023-06-26T22:20:45Z")

</div>

It appears we need to improve documentation related to the topic of how to load scripted modules that are not available from the Extensions Manager.

The “Additional Module Paths” setting allows for specifying a scripted module’s directory for loading. See [Application settings — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#additional-module-paths). This is also described in [GitHub - fsemerar/SlicerTomoSAM: An extension of 3D Slicer using the Segment Anything Model (SAM) to aid the segmentation of 3D data from tomography or other imaging techniques.](https://github.com/fsemerar/SlicerTomoSAM#installation).

Additionally if using lates Slicer Preview, you can also drag-and-drop the directory into the Slicer main window and it will detect it as a new module to load. See [ENH: Improve Python scripted module detection when drag-and-dropping · Slicer/Slicer@1f4ba1a · GitHub](https://github.com/Slicer/Slicer/commit/1f4ba1af5d019accbe45e2efc637f09f3ca2ef0e)
