SlicerIGT module loading issue

I’m trying to use the latest SlicerIGT, which now requires SlicerIGSIO. I use the latest of this as well.

I have Slicer built in release mode, from May 5 (this hash).

I built SlicerIGSIO and SlicerIGT with the default CMake options, except adding the SlicerIGSIO inner folder to SlicerIGT for the dependency. When I start Slicer with the proper folders added (qt-loadable-module/Release and the SlicerIGSIO bin folder, plus the one that has the x64 vp9 dll), I get the following errors:

DLL load failed while importing vtkSlicerLandmarkDetectionModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerPivotCalibrationModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerVolumeReconstructionModuleLogicPython: The specified module could not be found.
DLL load failed while importing vtkSlicerVolumeReconstructionModuleMRMLPython: The specified module could not be found.
DLL load failed while importing vtkSlicerSequenceIOModuleLogicPython: The specified module could not be found.
Failed to load vtkSlicerVideoUtilModuleLogicPython: No module named vtkSlicerSequenceIOModuleMRMLPython
DLL load failed while importing vtkSlicerSequenceIOModuleMRMLPython: The specified module could not be found.

I tried:

  • Copying the stray dlls all into qt-loadable-module/Release, same thing
  • Load one of the dlls that fail to load into depends (started with the launcher, with the SlicerIGT additional launcher settings ini), no DLL in the list that is actually not there (it listed things like vtkImaging-9.1.dll and a few similar ones, but they are present, especially that Slicer needs them too and it started alright)
  • Package both SlicerIGSIO and SlicerIGT and add the folders in the unzipped packages
  • Installed today’s nightly (05.30)
    • Compared the content of my packages with the factory packages, they are identical
    • Starting the nightly with the two extensions installed, I get the following: Failed to load vtkSlicerVolumeReconstructionModuleLogicPython: No module named vtkSlicerIGSIOCommonPython which probably indicates that not everything is alright even in the factory
  • Double and triple checked that I built the matching configurations (all Release mode).

I don’t have any more ideas other than using a more recent Slicer, which build I’ll start now.

Does anyone have any tips that may help?

Thanks!

Update: the same thing happens with the latest Slicer as well.

Has anyone successfully used locally built Slicer with locally build SlicerIGT recently? If so, how?

I’m running Slicer locally built with IGT/IGSIO on Arch. IGT is configured with

cmake -DSlicer_DIR:PATH=/home/arc/src/Slicer-SuperBuild9/Slicer-build -DCMAKE_BUILD_TYPE:STRING=Release -DSlicerIGSIO_DIR:PATH=/home/arc/src/SlicerIGSIO-SuperBuild9/inner-build -DSlicer_USE_GIT_PROTOCOL:BOOL=OFF /home/arc/src/SlicerIGT

Slicer itself works, when it loads. Sometimes it must be launched 2 - 3 times before it loads. And there’s always a crash message when it is closed normally. I didn’t have time to cross check if it may be related to IGSIO. Never had this before.

Thanks @chir.set ! When you launch Slicer successfully, do you see the Pivot Calibration or Volume Reconstruction module? Do you have the errors in the Python window that I reported above? If you have those modules and you don’t have those specific errors then it is a different issue and I suggest opening a new topic for your problem so that the two unrelated things don’t mix.

What does this mean? What happens the rest of the times?

These modules are available in the module list, they can be searched and selected.

The errors you have reported above are not in the Python console, nor in applictaion log, and neither in bash stdout.

Yes, you are right. I’ll build again this weekend and if the problem persists, I’ll dig deeper into that and start a discussion on its own.

It means that Slicer may occasionally fail to start with this in console :

$ programs/Slicer/Slicer 
  Error(s):
    CLI executable: /home/user/programs/Slicer/bin/../lib/Slicer-5.1/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.
Fail to instantiate module  "vtkvmtk"
The following modules failed to be instantiated:
   vtkvmtk
Switch to module:  "Volumes"
error: [/home/user/programs/Slicer/bin/SlicerApp-real] exit abnormally - Report the problem.

When it successfully starts, it is normally usable. Please note it is a clean build. When it launches and then it is closed via the menu, this is in stdout :

......
Loading Slicer RC file [/home/user/.slicerrc.py]
Switch to module:  "PivotCalibration"
Switch to module:  "VolumeReconstruction"
Switch to module:  ""
Switch to module:  ""
double free or corruption (out)
error: [/home/user/programs/Slicer/bin/SlicerApp-real] exit abnormally - Report the problem.

Not a blocker right now. I’ll investigate this weekend.

1 Like

I tried the same thing on another computer (locally built Slicer5 with locally built SlicerIGSIO and SlicerIGT) and the same errors appear.

Can someone please try it in their environment?

@Sunderlandkyl any comment?

Thanks!

It seems that now we cannot copy DLLs from the bin folder to the lib/Slicer-5.1/qt-loadable-modules/Release. In the past these superbuild and 3rd party DLLs could be just copied there and they were loaded OK. Instead of copying them there, copying them to S5R\Slicer-build\bin\Release solved the DLL loading issue and the three modules now appear.

I still get these errors on startup

Failed to load vtkSlicerVolumeReconstructionModuleLogicPython: No module named vtkSlicerIGSIOCommonPython
Failed to load vtkSlicerVolumeReconstructionModuleLogicPython: No module named vtkSlicerIGSIOCommonPython
Failed to load vtkSlicerVolumeReconstructionModuleLogicPython: No module named vtkSlicerIGSIOCommonPython

but as I mentioned before the same errors appear with the factory build too.

Hi Csaba, I’m getting the same issue, I’ll try this solution. I’m not sure if this is related or not, but I also have these errors when I try to use the Guidelet example extension you created:

Traceback (most recent call last):
  File "//imagingsrv.robarts.ca/Peters_Users$/cgibson/Documents/ExampleGuideletExtension-master/ExampleGuidelet/ExampleGuidelet.py", line 22, in __init__
    self.probeModel = slicer.util.loadModel('//imagingsrv.robarts.ca/Peters_Users$/cgibson/Documents/ExampleGuideletExtension-master/ExampleGuidelet/c7hd3.stl')
  File "C:\Users\cgibson\AppData\Local\NA-MIC\Slicer 5.1.0-2022-05-24\bin\Python\slicer\util.py", line 813, in loadModel
    return loadNodeFromFile(filename, 'ModelFile', {}, returnNode)
  File "C:\Users\cgibson\AppData\Local\NA-MIC\Slicer 5.1.0-2022-05-24\bin\Python\slicer\util.py", line 668, in loadNodeFromFile
    success = app.coreIOManager().loadNodes(filetype, properties, loadedNodesCollection)
ValueError: Could not find matching overload for given arguments:
('ModelFile', {'fileName': '//imagingsrv.robarts.ca/Peters_Users$/cgibson/Documents/ExampleGuideletExtension-master/ExampleGuidelet/c7hd3.stl'}, <vtkmodules.vtkCommonCore.vtkCollection(0x00000234B256E880) at 0x00000234B71808E0>)
 The following slots are available:
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters, vtkCollection loadedNodes, vtkMRMLMessageCollection userMessages) -> bool
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters, vtkCollection loadedNodes) -> bool
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters) -> bool
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters, vtkCollection loadedNodes, vtkMRMLMessageCollection userMessages) -> bool
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters, vtkCollection loadedNodes) -> bool
loadNodes(qSlicerIO::IOFileType fileType, qSlicerIO::IOProperties parameters) -> bool

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\cgibson\AppData\Local\NA-MIC\Slicer 5.1.0-2022-05-24\lib\Python\Lib\imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 613, in _exec
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:/Users/cgibson/AppData/Local/NA-MIC/Slicer 5.1.0-2022-05-24/NA-MIC/Extensions-30970/SlicerDMRI/lib/Slicer-5.1/qt-scripted-modules/NIfTIFile.py", line 7, in <module>
    import nifti
ModuleNotFoundError: No module named 'nifti'
Failed to load vtkSlicerVolumeReconstructionModuleLogicPython: No module named vtkSlicerIGSIOCommonPython

Not sure if this helps, but normally when I’m loading/debugging multiple extensions that contain third party libraries, I create a AdditionalLauncherSettings.ini file that combines the settings for all of the extensions that I am using. Using that file to start VisualStudio, etc. seems to work.

I’ll take a look at the vtkSlicerIGSIOCommonPython error messages.

1 Like

Thanks @Sunderlandkyl !

@ChristophG123 Not sure why that file cannot be loaded. The slicer.util function has not changed. It may be due to the path you’re trying to use? If you copy it locally and load it from there does it work?
In any case please create a new topic for this issue because what you reported is unrelated to this topic and it’s best to keep different discussions separate. Thanks!

Not sure what guidelet example extension it is, I don’t remember seeing it, let alone creating…