New Segment Editor effect: Local threshold

Hi all,

This extension sounds promising.

I have few issues though.
So first, I draw a circle around my ROI then I edit the threshold of the local histogram. But how can I save the segment? I tried Ctrl + left click, the area keep blinking.

Another question please, is there any way to use fixed threshold (like 40% of SUVmax in PET)?

Appreciate your help,

Sounds like you might be on a Mac - it is command + left click for MacOS.

There seems to be a problem with the installation of the SegmentEditorExtraEffects extension on my Slicer (v. 4.11.20200930). Once installed the “Local Thresholding” tool does not apear amongst my new segmenting tools.

I have already tried:

  • re-installing the program after complete deletion of the program and its files
  • re-installing the extension
  • restarting my pc
  • installing older versions of Slicer

Nothing worked


Can someone help me to obtain the Local Threshold tool?

Screenshot 2021-01-05 080649 Screenshot 2021-01-05 080841

I just tried installing SegmentEditorExtraEffects on the stable release and didn’t encounter any issues. You seem to be missing two segment editor effects: Local Threshold, and Split Volume.

Can you check to see if there are any errors in the log?

There are indeed error remarks, what can I do to fix this?

Thanks in advance!

[CRITICAL][Stream] 05.01.2021 19:02:10 [] (unknown:0) -   File "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThresholdLib/SegmentEditorEffect.py", line 6, in <module>

[CRITICAL][Qt] 05.01.2021 19:02:10 [] (unknown:0) - loadSourceAsModule - Failed to load file "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThresholdLib/SegmentEditorEffect.py"  as module "SegmentEditorLocalThresholdLib" !

[CRITICAL][Stream] 05.01.2021 19:02:10 [] (unknown:0) -   File "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThreshold.py", line 27, in registerEditorEffect

[CRITICAL][Stream] 05.01.2021 19:02:10 [] (unknown:0) -   File "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSplitVolumeLib/SegmentEditorEffect.py", line 10, in <module>

[CRITICAL][Qt] 05.01.2021 19:02:10 [] (unknown:0) - loadSourceAsModule - Failed to load file "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSplitVolumeLib/SegmentEditorEffect.py"  as module "SegmentEditorSplitVolumeLib" !

[CRITICAL][Stream] 05.01.2021 19:02:10 [] (unknown:0) -   File "C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSplitVolume.py", line 34, in registerEditorEffect

Probably the python files cannot be loaded because Slicer is installed in a folder that contains special characters (FĂ©lix). This should not be a problem on recent Windows10 versions. Could you copy here the first 15 lines of the application log (menu: Help/Report a bug) to confirm that your Windows version is too old? If that is indeed the issue then you can either upgrade Windows or install Slicer in a folder that does not have special characters in its path.

Here is the code:

[DEBUG][Qt] 05.01.2021 20:27:39 [] (unknown:0) - Session start time 
: 2021-01-05 20:27:39

[DEBUG][Qt] 05.01.2021 20:27:39 [] (unknown:0) - Slicer version 
: 4.11.20200930 (revision 29402 / 002be18) win-amd64 - installed release

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Operating system 
: Windows / Personal / (Build 19041, Code Page 65001) - 64-bit

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Memory 
: 8102 MB physical, 16038 MB virtual

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - CPU 
: GenuineIntel , 4 cores, 4 logical processors

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - VTK configuration 
: OpenGL2 rendering, TBB threading

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Qt configuration 
: version 5.15.1, with SSL, requested OpenGL 3.2 (compatibility profile)

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Developer mode enabled 
: no

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Prefer executable CLI 
: yes

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Application path 
: C:/Users/FĂ©lix/AppData/Local/NA-MIC/Slicer 4.11.20200930/bin

[DEBUG][Qt] 05.01.2021 20:27:40 [] (unknown:0) - Additional module paths 
: C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules, C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SlicerVMTK/lib/Slicer-4.11/qt-loadable-modules, C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SlicerVMTK/lib/Slicer-4.11/qt-scripted-modules, C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/Sandbox/lib/Slicer-4.11/qt-scripted-modules

[DEBUG][Python] 05.01.2021 20:27:45 [Python] (C:\Users\FĂ©lix\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Python\Lib\site-packages\pydicom\datadict.py:432) - Reversing DICOM dictionary so can look up tag from a keyword


[CRITICAL][Qt] 05.01.2021 20:27:48 [] (unknown:0) - Error(s):

CLI executable: C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SlicerVMTK/lib/Slicer-4.11/qt-loadable-modules/vtkvmtk.py

The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.

This Windows version should be sufficient.

Does this file exist and contains Python code?
C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThresholdLib/SegmentEditorEffect.py

It appears the folder does contain Python code!Screenshot 2021-01-05 204448

Can you compare the file content with this file https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/SegmentEditorLocalThreshold/SegmentEditorLocalThresholdLib/SegmentEditorEffect.py

It is probably not a coincidence that only Local Threshold and Split Volume effects use SimpleITK and they are the ones that cannot be loaded.

Could you try typing this into the Python console (Ctrl-3) and see if you get an error message?

import SimpleITK as sitk

This is the responce:

import SimpleITK as sitk
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\FĂ©lix\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Python\Lib\imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThresholdLib/SegmentEditorEffect.py”, line 6, in
import SimpleITK as sitk
ModuleNotFoundError: No module named ‘SimpleITK’
Traceback (most recent call last):
File “C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorLocalThreshold.py”, line 27, in registerEditorEffect
instance.self().register()
AttributeError: ‘NoneType’ object has no attribute ‘register’
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\FĂ©lix\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Python\Lib\imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSplitVolumeLib/SegmentEditorEffect.py”, line 10, in
import sitkUtils
File “C:\Users\FĂ©lix\AppData\Local\NA-MIC\Slicer 4.11.20200930\bin\Python\sitkUtils.py”, line 4, in
import SimpleITK as sitk
ModuleNotFoundError: No module named ‘SimpleITK’
Traceback (most recent call last):
File “C:/Users/FĂ©lix/AppData/Roaming/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSplitVolume.py”, line 34, in registerEditorEffect
instance.self().register()
AttributeError: ‘NoneType’ object has no attribute ‘register’
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘SimpleITK’

There is no difference between the file on my pc and that from github.

The problem is that SimpleITK is not found. Can you try if it makes a difference if you copy the entire Slicer folder to a path without special characters (for example “c:\tmp\Slicer 4.11.20200930”) and run Slicer from there?

It doesn’t chage anything. The program re-installed the extension in the C:\Users\FĂ©lix\AppData\Roaming folder and keeps on bugging


Could you try removing all the .ini files in Slicer settings folder and then start Slicer and see if import SimpleITK as sitk succeeds?

I only have .init_cpython files, the response of slicer was the following:

import SimpleITK as sitk

Traceback (most recent call last):

File “”, line 1, in

ModuleNotFoundError: No module named ‘SimpleITK’

image

I meant deleting all files and folders in your Slicer settings folder. Probably it is in C:\Users\FĂ©lix\AppData\Roaming\NA-MIC.

I also see that you have some things installed in C:\Users\Public\NA-MIC, which may be the root cause of all issues. Delete the content of that folder, too.

If you don’t want to delete these then you can just move somewhere else (for example, C:\tmp).

Still the same problem

We can do a remote debugging session on your computer, write me your availability in a private message. We can probably find and fix the issue in a 10-20 minutes.