MONAILabel: Segmentation_[anatomy] model does not show up under Auto Segmentation header.

Describe the bug When using a fairly straightforward non-interactive segmentation model, I expected to be able to provide a handful of manual segmentations, train the model, and simply run the auto segmentation to finish up the rest of my dataset.

However, I unfortunately can’t select the model in the Auto Segmentation header.

I am using a custom implementation of the segmentation_spleen.py example files, with only the label name and class names changed.

To Reproduce Steps to reproduce the behavior:

  1. Provide a number of manual segmentations to start off the segmentation model
  2. Train model successfully
  3. Notice that there is no way to actually use the trained model

Expected behavior After providing a few manual segmentations, I expect to be able to use the now trained model in segmenting my anatomy of choice.

Screenshots WhereModel

Environment

Ensuring you use the relevant python executable, please paste the output of:

================================
Printing MONAI config...
================================
MONAI version: 0.9.0
Numpy version: 1.22.4
Pytorch version: 1.11.0+cpu
MONAI flags: HAS_EXT = False, USE_COMPILED = False
MONAI rev id: af0e0e9f757558d144b655c63afcea3a4e0a06f5
MONAI __file__: C:\Users\[Username]\AppData\Local\pypoetry\Cache\virtualenvs\nnunetdocker-uHdzYLSm-py3.9\lib\site-packages\monai\__init__.py

Optional dependencies:
Pytorch Ignite version: 0.4.8
Nibabel version: 3.2.2
scikit-image version: 0.19.3
Pillow version: 9.1.1
Tensorboard version: 2.9.1
gdown version: 4.4.0
TorchVision version: 0.12.0+cpu
tqdm version: 4.64.0
lmdb version: 1.3.0
psutil version: 5.9.1
pandas version: 1.4.2
einops version: 0.4.1
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: 0.4.3

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
System: Windows
Win32 version: ('10', '10.0.19044', 'SP0', 'Multiprocessor Free')
Win32 edition: Enterprise
Platform: Windows-10-10.0.19044-SP0
Processor: Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
Machine: AMD64
Python version: 3.9.13
Process name: python.exe
Command: ['C:\\Users\\[Username]\\AppData\\Local\\Programs\\Python\\Python39\\python.exe', '-c', 'import monai; monai.config.print_debug_info()']
Open files: [popenfile(path='C:\\Windows\\System32\\en-US\\kernel32.dll.mui', fd=-1), popenfile(path='C:\\Windows\\System32\\en-US\\tzres.dll.mui', fd=-1), popenfile(path='C:\\Windows\\System32\\en-US\\KernelBase.dll.mui', fd=-1)]  
Num physical CPUs: 12
Num logical CPUs: 24
Num usable CPUs: 24
CPU usage (%): [5.0, 3.8, 1.9, 0.6, 0.0, 1.2, 1.9, 1.9, 0.6, 0.0, 0.6, 0.6, 2.5, 72.3, 0.6, 0.6, 0.6, 1.2, 1.9, 0.0, 1.2, 1.9, 0.0, 13.8]
CPU freq. (MHz): 3504
Load avg. in last 1, 5, 15 mins (%): [0.0, 0.0, 0.0]
Disk usage (%): 66.6
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 31.7
Available memory (GB): 15.7
Used memory (GB): 16.0

================================
Printing GPU config...
================================
Num GPUs: 0
Has CUDA: False
cuDNN enabled: False

Additional context None, however CUDA 11.6 and 11.7 are installed, and nvidia-smi works, while MONAI tells me CUDA is not available. This is (probably) not relevant to my issue though, and I might open a new issue for that.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29

Commits related to this issue

Most upvoted comments

Agree, but it is difficult to find out. By installing 5.0.3 we have an empty extension “directory” and need to collect MonaiLabel (and other extensions) again from the extension manager. In that step, we probably get the latest MonaiLabel extension sources. It looks as if in the previous version (with the error that you and I saw) the list of available ML models was not correctly displayed by the extension, thus, the MonaiLabel auto segmentation drop-down field remained empty. I did not observe a crash of any kind. Probably there was just a necessary update in 3D Slicer, otherwise, it would not have been necessary to publish a new stable.

Did you see a crash and - is your problem solved now?

It would still be interesting to know what the reason for this issue is. Is there anything cashed by MONIA Label, that we could delete instead of reinstalling everything?

After having the same problem on my laptop (Auto segmentation -> model dropdown menu empty and “run” greyed out) I was able to solve the issue by:

  • Removing 3D Slicer 5.0.2
  • Installing 3D Slicer 5.0.3 stable

image

  • Starting 3D Slicer stable and installing the MonaiLabel extension again
  • then I can connect to the intended model “segmentation” :

image

Oh no, I’ve just noticed that as part of the DEI efforts, master volume has been renamed to reference volume. This would be OK, except we should have backward compatibility methods in place for several years to give time for extension developers to update. I’ll fix the issue ASAP. In the meantime, the Slicer Stable Release should work.

Yup, that’s how I had installed the plugin on my end. We had a little issue with our hospital’s network temporarily blocking Slicer’s extension server, so I just cloned your repo and installed from there.

I downloaded 5.1.0, installed the plugin directly from the current version of this repo and the model name is now visible in the Auto Segmentation section. However, whenever I try to get the next sample, I get a Slicer error with the following details:

Slicer 5.1.0 Preview error:

Traceback (most recent call last):
  File "[snip]/MONAILabel/plugins/slicer/MONAILabel/MONAILabel.py", line 1236, in onNextSampleButton
    self.initSample(sample)
  File "[snip]/MONAILabel/plugins/slicer/MONAILabel/MONAILabel.py", line 1257, in initSample
    self.ui.embeddedSegmentEditorWidget.setMasterVolumeNode(self._volumeNode)
AttributeError: qMRMLSegmentEditorWidget has no attribute named 'setMasterVolumeNode'

Additionally, loading a patient for uploading to the server also does not trigger the master volume to update, so I can’t run inference.

I did install directly from your main branch right from the start. Switching on developer mode changes nothing of note? It just adds some additional options.

i mean… configure your plugin in development mode (uninstall earlier one)… based on the main branch of github… https://github.com/Project-MONAI/MONAILabel/tree/main/plugins/slicer#install-plugin-in-developer-mode