SliceTracker module cannot be loaded on Slicer 4.11.20200930

Hi,

I am trying to use SliceTracker on the new Slicer release (4.11.20200930 Stable Release), but the Slicer fails to load the module (see the error message below). I’m wondering if anyone is facing the same issue. I’m running it on Ubuntu 20.04 LTS.

Thanks,

Junichi

Here’s the message I got on the Python Interactor:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/junichi/slicer/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 618, in _exec
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/junichi/.config/NA-MIC/Extensions-29402/DeepInfer/lib/Slicer-4.11/qt-scripted-modules/DeepInfer.py", line 1, in <module>
    import Queue
ModuleNotFoundError: No module named 'Queue'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/junichi/slicer/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 618, in _exec
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/junichi/.config/NA-MIC/Extensions-29402/SliceTracker/lib/Slicer-4.11/qt-scripted-modules/SliceTracker.py", line 6, in <module>
    from SliceTrackerUtils.configuration import SliceTrackerConfiguration
  File "/home/junichi/.config/NA-MIC/Extensions-29402/SliceTracker/lib/Slicer-4.11/qt-scripted-modules/SliceTrackerUtils/configuration.py", line 1, in <module>
    import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/junichi/slicer/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 618, in _exec
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/junichi/.config/NA-MIC/Extensions-29402/SliceTracker/lib/Slicer-4.11/qt-scripted-modules/SliceTrackerRegistration.py", line 309
    raise AttributeError, "File not found: %s" % inputFile
                        ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/junichi/slicer/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/imp.py", line 170, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 618, in _exec
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/junichi/.config/NA-MIC/Extensions-29402/SliceTracker/lib/Slicer-4.11/qt-scripted-modules/SurfaceCutToLabel.py", line 11, in <module>
    from SegmentEditorSurfaceCutLib import SurfaceCutLogic
  File "/home/junichi/.config/NA-MIC/Extensions-29402/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorSurfaceCutLib/__init__.py", line 4, in <module>
    from SegmentEditorEffect import *
ModuleNotFoundError: No module named 'SegmentEditorEffect'
TypeError: module.__init__() argument 1 must be str, not qSlicerScriptedLoadableModule

These module not found errors are probably just Python 2 -> 3 changes. See these links for details:

@che85 was the lead developer of this module, and it has not been maintained since he left the lab. Would be great to have it updated, contributions are most welcomed.

Thanks! I’ll take a look when I find time.

There seem to be several issues in SliceTracker as well as DeepInfer and SlicerSegmentEditorExtraEffects. See:

I made quick fixes to these modules, and SliceTracker seems to be loaded successfully.

1 Like

Thank you Junichi! Will you make pull requests with those modifications to the main repos?

I’ve just sent pull requests for SliceTracker and SegmentEditorExtraEffects. I sent a request for DeepInfer, but Alireza mentioned that he still needed to fix other issues.

1 Like

Just an update - I worked on the module further, and it is working under limited conditions (no DeepInfer / mpReview). See: https://github.com/SlicerProstate/SliceTracker/issues/358

SliceTracker, SlicerDevelopmentToolbox, and DeepInfer must be updated. I mentioned earlier that SlicerSegmentEditorExtraEffects has an issue, but @lassoan advised me how to avoid it on the SliceTracker side.

@tokjun thank you for working on this. I have not yet, but I will review and test PRs. @che85 will you have a chance to take a look?