# Is there anyway to use MONAI LABEL on a Macbook?

**URL:** <https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921>\
**Category:** Support\
**Tags:** macos, monai\
**Created:** [June 17, 2022, 8:48pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921 "2022-06-17T20:48:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celina\_Hallal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/celina_hallal/32/12339_2.png) [@Celina\_Hallal](https://discourse.slicer.org/u/Celina_Hallal)\
**Post date:** [June 17, 2022, 8:48pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/1 "2022-06-17T20:48:17Z")

</div>

Operating system: MacOS Monterey  
Slicer version: latest version (5.0)  
Python version: 3.10.5

I’m a totally newbie, so my questions may sound a little dumb. Is there anyway to use MONAI LABEL on a Mac M1? Probably will need some really basic explanations. Tks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 18, 2022, 1:38pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/2 "2022-06-18T13:38:11Z")

</div>

You can run the MONAILabel user interface in Slicer on a macbook. However, you need to connect to a MONAILabel server that runs on a GPU-equipped Linux or Windows system.

---

<div class="post-metadata">

**Author:** ![Celina\_Hallal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/celina_hallal/32/12339_2.png) [@Celina\_Hallal](https://discourse.slicer.org/u/Celina_Hallal)\
**Post date:** [June 18, 2022, 3:38pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/3 "2022-06-18T15:38:29Z")

</div>

Hmmmm… How I said earlier, I’m really newbie (Surgeon w almost no programming background trying to learn from scratch)… How exactly I do this? 😅

When I try to use MONAILabel on Slicer without specifying any server, this message appears (this happens even when I try to connect home without any proxy):

Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-30822/MONAILabel/lib/Slicer-5.0/qt-scripted-modules/MONAILabel.py”, line 1030, in fetchInfo  
info = self.logic.info()  
File “/Applications/Slicer.app/Contents/Extensions-30822/MONAILabel/lib/Slicer-5.0/qt-scripted-modules/MONAILabel.py”, line 2121, in info  
return MONAILabelClient(self.server\_url, self.tmpdir, self.client\_id).info()  
File “/Applications/Slicer.app/Contents/Extensions-30822/MONAILabel/lib/Slicer-5.0/qt-scripted-modules/MONAILabelLib/client.py”, line 48, in info  
status, response, \_ = MONAILabelUtils.http\_method(“GET”, self.\_server\_url, selector)  
File “/Applications/Slicer.app/Contents/Extensions-30822/MONAILabel/lib/Slicer-5.0/qt-scripted-modules/MONAILabelLib/client.py”, line 268, in http\_method  
conn.request(method, selector, body=body, headers=headers)  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 1285, in request  
self.\_send\_request(method, url, body, headers, encode\_chunked)  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 1331, in \_send\_request  
self.endheaders(body, encode\_chunked=encode\_chunked)  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 1280, in endheaders  
self.\_send\_output(message\_body, encode\_chunked=encode\_chunked)  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 1040, in \_send\_output  
self.send(msg)  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 980, in send  
self.connect()  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/http/client.py”, line 946, in connect  
self.sock = self.\_create\_connection(  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/socket.py”, line 844, in create\_connection  
raise err  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/socket.py”, line 832, in create\_connection  
sock.connect(sa)  
ConnectionRefusedError: [Errno 61] Connection refused

Sorry if is some really basic thing and thank you Andras!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 19, 2022, 3:01am UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/4 "2022-06-19T03:01:56Z")

</div>

You need to have access to a computer with a strong GPU (NVIDIA GPU with at least 16GB, preferably 24GB RAM) and run MONAILabel server on it. You can configure and run the server by using the commands described [here](https://github.com/Project-MONAI/MONAILabel#installation). If the segmentation task is simple (for example, you need to segment large structure with simple shape and good contrast to surrounding structures) then you may use existing models developed for similar segmentations. However, if your segmentation task is not easy then most likely you need to experiment with network architecture and training parameters. This does not necessarily require programming background, but it could help if you can find someone who has some experience in deep learning to help you.

You might even find someone in the Slicer community who would be interested to collaborate. What is the clinical application - surgical planning? what procedure? What structures would you like to segment?

---

<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 19, 2022, 1:37pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/5 "2022-06-19T13:37:07Z")

</div>

Also @Celina_Hallal you may look at what @rbumm has been doing. He’s also a surgeon who has been working through MONAI Label and getting good results for his application.

> [@How to start with monailabel for new models](https://discourse.slicer.org/t/how-to-start-with-monailabel-for-new-models/21063/88):
>
> After great meetings with @diazandr3s we were able to set the MONAILabel lung segmentation up from scratch, train a model, and autosegment lungs and airways. Windows: We recommend doing this in Windows 11 using Powershell. [Follow the instructions from the ML Github](https://docs.monai.io/projects/label/en/latest/installation.html#windows) to install the prerequisites and ML itself. All in the above link: Test that CUDA is available. Fork MONAILabel from Github Download ML radiology app Download lung dataset Use Slicer 5.1 and ML extension We found that the Deepe…

---

<div class="post-metadata">

**Author:** ![Celina\_Hallal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/celina_hallal/32/12339_2.png) [@Celina\_Hallal](https://discourse.slicer.org/u/Celina_Hallal)\
**Post date:** [June 19, 2022, 7:58pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/6 "2022-06-19T19:58:47Z")

</div>

Great, guys! Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Celina\_Hallal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/celina_hallal/32/12339_2.png) [@Celina\_Hallal](https://discourse.slicer.org/u/Celina_Hallal)\
**Post date:** [June 19, 2022, 8:56pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/7 "2022-06-19T20:56:27Z")

</div>

I’m trying to do better liver segmentations for surgical planning. I’ve been segmenting some cases manually. Most of the pre-trained models I’ve tried weren’t as good as I would need, mostly with surrounding structures like IVC, stomach, and spleen.

I’m a surgical resident from a Brazilian University with interest in Liver Surgery. Last year we had one difficult case that could benefit from a 3D model, and I found it was almost impossible to do it easily using the resources we had at our Radiology Dept…

Since then, I’ve been playing with some cases and studying a bit. Some of my attendings loved the idea, and I’m trying to do something with it for my conclusion thesis (Residency program thesis here in Br is not a big deal, generally we do something we can use later in M.S.c - things work a little different here).

My first idea was to do something like you and Yeo did in " Utility of 3D Reconstruction of 2D Liver Computed Tomography/ Magnetic Resonance Images as a Surgical Planning Tool for Residents in Liver Resection Surgery". But later we discussed and we wouldn’t have plenty of time to do that.

Besides, recently we had some trouble with our preoperative liver volumetry. So, my idea is to create an workflow to make parenchyma and vessel segmentation easier and more reliable (something a busy surgical resident that doesn’t even know what is “DICOM”, “Python” and “Neural networks” can do). I would train a model with a dataset, then try it with our pre and postoperative cases, both oncological and pre-LDLT.

But, as I said earlier, I’m a noob with little programming background (and most of my MD colleagues are way worse). So I may be wandering a bit… But, as they say, the best way to learn is doing it (and failing sometimes 😅 ). Tomorrow I will have a meeting with a guy from the medical physics at the hospital about my project and about using some of the Radiology Dept. computer as server.

Thank you a lot!!!

---

<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 19, 2022, 9:29pm UTC](https://discourse.slicer.org/t/is-there-anyway-to-use-monai-label-on-a-macbook/23921/8 "2022-06-19T21:29:19Z")

</div>

Thanks for providing more context, it sounds like a good project and it hopefully we can help out and answer any questions that come up in your work. Be sure to check out some of the other ongoing work related to liver segmentation and surgery planning. I’m sure additional testing and clinical input would be helpful.

[https://projectweek.na-mic.org/PW37\_2022\_Virtual/Projects/SlicerLiver/](https://projectweek.na-mic.org/PW37_2022_Virtual/Projects/SlicerLiver/)

[https://discourse.slicer.org/t/new-extension-development-plan-self-supervised-learning-and-liver-segmentation/23714](https://discourse.slicer.org/t/new-extension-development-plan-self-supervised-learning-and-liver-segmentation/23714)
