# How to set MONAI Label extension parameters in 3D Slicer

**URL:** https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379
**Category:** Support
**Tags:** segmentation
**Created:** [July 19, 2022, 1:11am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379 "2022-07-19T01:11:58Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 19, 2022, 1:11am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/1 "2022-07-19T01:11:58Z")

</div>

Hello. All members of 3D-Slicer.

I have a question for setting option of MONAI Label extension.  
.  
I want to extract brain tumor using a DICOM(MRI) file in MONAI Label module.

When I conducted modeling in MONAI Label, The proess that extracts brain tumor using MONAI Label module in 3D-Slicer as follows.

1. In the option of MONAI Label server, I pressed green button.
2. In the option of Master Volume, I pressed ‘arrow’ green button.
3. In the option of Segment Editor, I added two segment, and then I extract brain tumor using ,Paint’ and ‘Grow and Seeds’ effect,
4. At the bottom of Strategy option, I pressed the “Submit Label” button.
5. After selecting ‘deepedit’ model, I pressed ‘Train’ button.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/5/a55daad9d07ce3c4fc101bc4c3b693d3b4990111.png)

But, I occur some problem after conducting above process.

When I press ‘Train’ buttion, after selecting ‘segmentation’ model, Status option run. But Accuracy option didn’t run.

What should I do for extractiong brain tumor in MONAI Label module using a DICOM(MRI) file based on 3D-Slicer.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 19, 2022, 12:51pm UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/2 "2022-07-19T12:51:52Z")

</div>

There is a new and instructive [MONAI Label Training From Scratch video](https://www.youtube.com/watch?v=3HTh2dqZqew&t=95s) available on YouTube that shows all the necessary training steps for a lung segmentation model. The workflow for brain tumors should be very similar.

Please notify us if questions remain.

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 27, 2022, 10:30am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/3 "2022-07-27T10:30:32Z")

</div>

Dear. @rbumm

I tried to extract brain tumor referring for link that you had been shared.

I want to automatically extract brain tumor using MONAI Label with DICOM file of one patient. So I can’t let me train this DICOM file because I have only one DICOM dataset.

I conducted extraction process of brain tumor using MONAI Label in 3D-Slicer refering for share link as follows.

1. I conducted MONAI Label server pressing ’green button’ next to MONAI Label server item.

2. I also created Master Volume after pressing ’green allow button’.

3. I extracted brain tumor using ’Paint’ effect and ‘Grow from Seeds’ effect in Segment Editor option.

4. I pressed ’Submit Label’ button.

5. I selected segmentation in ‘model’ part that is under ‘Submit Label’ button, and then pressed ‘train’ button.

Is that all?

Some brain tumor is hard to extract in NVIDIA AIAA module, so I want to exactly extract brain tumor using MONAI Label module.

When I conducted as process above, I thought I would rather use only Grow from Seed effect in segment editor module than use Segment editor(Grow from Seeds) option in MONAI Label module.

What I want to exactly is as follows.

1. I want to exactly extract brain tumor that is hard to extract in NVIDIA AIAA module using Auto-Segmentation or other method(AI-Assisted Annotation) in MONAI Label.

2. Additionally, I want to find the solution that select ‘model’ type. I don’t know how to appear ‘model’ type in ‘Auto Segmentation’ and ‘SmartEdit/Deepgrow’ option.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/6/46917d3f35dd7f41be46c626bbe8f8ddd0675387.png)

Please, let me know how to solve the problems above.

Thank you for reading my writing.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 28, 2022, 7:16pm UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/4 "2022-07-28T19:16:52Z")

</div>

Dear @platanus,

Please run your NVIDIA Control Panel, go → help and -\>system information and post the results here.

Thank you.

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 29, 2022, 12:38am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/5 "2022-07-29T00:38:47Z")

</div>

Thank you for answering @rbumm

System Information is as following.

NVIDIA System Information Report Generation Date: 07/29/2022 08:40:50  
System Name: KRK

[display]  
Operating System: Windows 10 Home, 64-bit  
DirectX Version: 12.0  
GPU Processor: NVIDIA GeForce RTX 3070 Laptop GPU  
Driver Version: 471.51  
Driver Type: DCH  
Direct3D feature level: 12\_1  
CUDA Core: 5120  
Resizable BAR Yes  
Max-Q technology 3rd generation  
Dynamic Boost 2.0 Yes  
WhisperMode 2.0 Yes  
Advanced Optimus No  
Maximum graphics performance 100 W  
Core clock: 1290 MHz  
Memory data rate: 12.00 Gbps  
Memory interface: 256-bit  
Memory bandwidth: 384.06 GB/s  
Total available graphics memory: 16079 MB  
Dedicated video memory: 8192 MB GDDR6  
System video memory: 0 MB  
Shared system memory: 7887 MB  
Video BIOS Version: 94.04.4F.00.19  
IRQ: Not used  
Bus: PCI Express x8 Gen3  
Device Id: 10DE 249D 20141A58  
Part number: 4735 0010

[Component]

| nvui.dll | | 8.17.14.7151 | | NVIDIA User Experience Driver Component |
| --- | --- | --- | --- | --- |
| nvxdplcy.dll | | 8.17.14.7151 | | NVIDIA User Experience Driver Component |
| nvxdbat.dll | | 8.17.14.7151 | | NVIDIA User Experience Driver Component |
| nvxdapix.dll | | 8.17.14.7151 | | NVIDIA User Experience Driver Component |
| NVCPL.DLL | | 8.17.14.7151 | | NVIDIA User Experience Driver Component |
| nvCplUIR.dll | | 8.1.940.0 | | NVIDIA Control Panel |
| nvCplUI.exe | | 8.1.940.0 | | NVIDIA Control Panel |
| nvWSSR.dll | | 30.0.14.7151 | | NVIDIA Workstation Server |
| nvWSS.dll | | 30.0.14.7151 | | NVIDIA Workstation Server |
| nvViTvSR.dll | | 30.0.14.7151 | | NVIDIA Video Server |
| nvViTvS.dll | | 30.0.14.7151 | | NVIDIA Video Server |
| nvLicensingS.dll | | 6.14.14.7151 | | NVIDIA Licensing Server |
| nvDispSR.dll | | 30.0.14.7151 | | NVIDIA Display Server |
| nvDispS.dll | | 30.0.14.7151 | | NVIDIA Display Server |
| nvDevToolSR.dll | | 30.0.14.7151 | | NVIDIA Licensing Server |
| nvDevToolS.dll | | 30.0.14.7151 | | NVIDIA 3D Settings Server |
| PhysX | | 09.20.0221 | | NVIDIA PhysX |
| NVCUDA64.DLL | | 30.0.14.7151 | | NVIDIA CUDA 11.4.101 driver |
| nvGameSR.dll | | 30.0.14.7151 | | NVIDIA 3D Settings Server |
| nvGameS.dll | | 30.0.14.7151 | | NVIDIA 3D Settings Server |

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 29, 2022, 10:48am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/6 "2022-07-29T10:48:59Z")

</div>

This seems to be great hardware to use MonaiLabel.

To address some of the questions above:

Question: Why does nothing show up under “Auto Segmentation” after you connected to ML server and trained?  
Answer: There was a recent [issue/bug](https://github.com/Project-MONAI/MONAILabel/issues/852#) when using 3D Slicer 5.0.2 and the MonaiLabel extension.

(1) please make sure that you use 3D Slicer 5.0.3 stable for your next tests.  
(2) Start 3D Slicer 5.0.3 stable and install the MonaiLabel extension again.  
(3) Restart Slicer.

Please report back if that does not solve your problem.

Question:

> [@platanus](#):
>
> I want to automatically extract brain tumor using MONAI Label with DICOM file of one patient. So I can’t let me train this DICOM file because I have only one DICOM dataset.

Answer:  
You will need to train a machine learning model with many labeled volumes to have acceptable results. At least 3-5 different volumes (patients) are needed, you would need to label them one by one, then start the MonaiLabel training process.  
If you want to do your brain tumor segmentation **on one dataset only** I would recommend using 3D Slicers Segment Editor - no need to involve AI

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 30, 2022, 8:25am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/7 "2022-07-30T08:25:12Z")

</div>

Thank you for answering details. @rbumm

Now, I’m using 3D-Slicer 5.1.2 preview version.

Should I install 5.0.3 stable version for using Auto Segmentation in MONAI Label?

Anyway… As you let me know above, I installed 3D-Slicer 5.0.3 stable version. After reopening 3D-Slicer, I tried to extract brain tumor using MONAI Label.

The reason that I try to run Auto Segmentation in MONAI Label is because I’d like to exactly extract brain tumor in one volume using AI-Assisted Annotation.

Brain tumor can exactly extract in one volume using Grow from Seeds effect in Segment Editor module and NVIDIA AIAA. But there is brain tumor hard to extract in one volume using Segment Editor and NVIDIA AIAA modules.

I didn’t solve problem as following yet.  
#1  
Although you recommended that I need to use Segment Editor of 3D-Slicer when I use only one volume, I’d like to run using Auto-Segmentation(Inference mode) or SmartEdit/Deepgrow options(Inference mode) in MONAI Label.  
Please, let me know how to extract brain tumor using Auto-Segmentation and SmartEdit/Deepgrow in MONAI Label module.

#2  
I installed 3D-Slicer 5.0.3 version and ran MONAI Label module after reopening 3D-Slicer, but it doesn’t show up nothing in ‘Model’ item, ‘run’ button, ‘Label’ item and ‘Update’ button of Auto-Segmentation option and SmartEdit/Deepgrow option in MONAI Label module.  
And I have question regarding run of MONAI Label server for extracting brain tumor.

#3  
When I run MONAI server, I input command “monailabel start\_server --app apps/radiology --studies datasets/Task02\_57453299\_VS --conf models deepedit”.  
Is it right to do this?

Thank you for always helping me.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 30, 2022, 12:27pm UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/8 "2022-07-30T12:27:48Z")

</div>

> [@platanus](#):
>
> Please, let me know how to extract brain tumors using Auto-Segmentation and SmartEdit/Deepgrow in the MONAI Label module.

Please understand that for using auto-segmentation there are only two options here.

(1) You will need somebody who provides a working MonaiLabel brain tumor segmentation model to you. I (probably we) can not help here yet.

or

(2) you would need to train a MonaiLabel model **yourself** using **many** brain tumor volumes (50-100 patients minimum) with a steep learning curve and unclear outcome. I would not recommend you to do this for your special problem. Use Slicers conventional segment editor for the task and wait for a MonaiLabel brain tumor segmentation model to be published in the near future.

Of course, in the meantime, you can experiment with MonaiLabel.

> [@platanus](#):
>
> I installed 3D-Slicer 5.0.3 version and ran MONAI Label module after reopening 3D-Slicer but it doesn’t show up nothing …

Did you start the server first ?

> [@platanus](#):
>
> When I run MONAI server, I input command “monailabel start\_server --app apps/radiology --studies datasets/Task02\_57453299\_VS --conf models deepedit”.  
> Is it right to do this?

The command line looks ok, where did you get the `Task02_57453299_VS` parameter from, and what happens if you issue that command? Please post a screenshot of the result or the output of the command.

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 31, 2022, 5:01am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/9 "2022-07-31T05:01:56Z")

</div>

Yon mean that It is not easy for me to run Auto Segmentation in MONAI Label based on 3D-Slicer.

Task02\_57453299\_VS is a folder included one volume(DICOM file).

When I input command “monailabel start\_server --app apps/radiology --studies datasets/Task02\_57453299\_VS --conf models deepedit”, it occurrs result as following.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/6/d6b84c46a2b8c97bdef1916dd8175834b1eede30.png)

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 31, 2022, 5:54am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/10 "2022-07-31T05:54:59Z")

</div>

MonaiLabel will not read your DICOM data directly from a folder.

Enter the following command:

`monailabel datasets`

and you will get something like:

```auto
Using PYTHONPATH=C:\Users\yourname\MONAILabel;
Available Datasets are:
----------------------------------------------------
  Task01_BrainTumour : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task01_BrainTumour.tar
  Task02_Heart : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task02_Heart.tar
  Task03_Liver : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task03_Liver.tar
  Task04_Hippocampus : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task04_Hippocampus.tar
  Task05_Prostate : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task05_Prostate.tar
  Task06_Lung : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task06_Lung.tar
  Task07_Pancreas : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task07_Pancreas.tar
  Task08_HepaticVessel : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task08_HepaticVessel.tar
  Task09_Spleen : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task09_Spleen.tar
  Task10_Colon : https://msd-for-monai.s3-us-west-2.amazonaws.com/Task10_Colon.tar 

```

Then download the Task01\_BrainTumor dataset with:

`monailabel datasets --download --name Task01_BrainTumour --output datasets `

This will download the mentioned dataset to your harddrive.

Then you could run

```auto
monailabel start_server --app apps/radiology --studies datasets/Task01_BrainTumour --conf models deepedit 

```

Start 3D Slicer, connect to MonaiLabel in the extension,  
just press the green button:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/3/3308e725d62fff4e36484e6e35864bcb131ec9ae.png)  
and your fields will be populated. Press “Next Sample” to load the first volume.

Please do all this and report back. You should see one of the brain tumor volumes from the Task01 dataset in 3D Slicer. It is not your volume. It is one of the downloaded series.

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [July 31, 2022, 8:25am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/11 "2022-07-31T08:25:44Z")

</div>

@rbumm Thank you for answering my question.

I simply wanted to compare brain tumor extraction results using Segment Editor(Grow from Seeds) and NVIDIA AIAA using clinical DICOM data as shown in the figure below.

So I first extracted the brain tumor using NVIDIA AIAA. However, there was a brain tumor that NVIDIA could not extract, so I posted a question on the 3D-Slicer Forum.

When I extract brain tumor using Segment Editor(Grow from Seeds), brain tumor extracts well.  
but I should compare Segment Editor and NVIDIA AIAA(other AIAA).

First image is to use option of Auto-Segmentation in NVIDIA AIAA.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/c/ecf8105026c084e247f08244916a12268f8c38e0.jpeg)

Second image is to use option of Segment from boundary point(DExtr3D).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/a/6ab80e8ec3dd10844610b4d835f3b8f45af6dfe6.jpeg)

@pieper mentioned MONAI Label to solve my [problem](https://discourse.slicer.org/t/do-you-know-how-to-exactly-extract-brain-tumor-using-nvidia-module/24153).

So, I had tried to run MONAI Label for extracting brain tumor.

Although you have helped a lot, it is not easy to extract brain tumor of the figure above using MONAI Label.

I don’t have to use the MONAI Label to extract brain tumor.

I should extract brain tumor using AIAA method such as pre-trained Auto Segmentation or Segment from boundary point(DExtr3D) included in NVIDIA AIAA.

If brain tumor of above figure don’t extract using pre-trained Auto Segmentation or DeeEdit/DeepGrow included in MONAI Label, can you suggest alterative other AIAA method?

I should compare Segment Editor module and NVIDIA AIAA(or other AIAA) module after extracting brain tumor of figure above.

---

<div class="post-metadata">

### Author: ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)
#### Post date: [July 31, 2022, 9:53am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/12 "2022-07-31T09:53:03Z")

</div>

> [@platanus](#):
>
> can you suggest alterative other AIAA method

No, I can not suggest an alternate AIAA method.

---

<div class="post-metadata">

### Author: ![platanus](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@platanus](https://discourse.slicer.org/u/platanus)
#### Post date: [August 4, 2022, 6:20am UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/13 "2022-08-04T06:20:50Z")

</div>

Thank you for helping me @rbumm.

---

<div class="post-metadata">

### Author: ![deboshree\_roy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deboshree_roy/32/17026_2.png) [@deboshree\_roy](https://discourse.slicer.org/u/deboshree_roy)
#### Post date: [October 25, 2022, 12:46pm UTC](https://discourse.slicer.org/t/how-to-set-monai-label-extension-parameters-in-3d-slicer/24379/14 "2022-10-25T12:46:53Z")

</div>

@rbunn I have been stuck in a similar situation and I hope you will be able to guide me through this  
I have my own pre-trained model (.pth file) that I is tested and shown to give good results  
On loading the same model in 3D Slicer to conf → deepedit.py and editing the labels, I expect a well defined result when I run Auto-segment module.

But the results are completely off the track. Can you please help me on how to go about this ?
