But then I got a different error when trying to run the module with an existing parameter node:
>>> slicer.cli.run(slicer.modules.elastix, paramNode)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Program Files\Slicer 4.11.0-2019-06-11\bin\Python\slicer\cli.py", line 78, in run
logic.SetDeleteTemporaryFiles(1 if delete_temporary_files else 0)
AttributeError: 'SlicerBaseLogicPython.vtkSlicerScriptedLoadableMod' object has no attribute 'SetDeleteTemporaryFiles'
SetDeleteTemporaryFiles is a function in vtkSlicerCLIModuleLogic, so it is strange that the ‘logic’ variable in cli.py is a vtkSlicerScriptedLoadableModuleNode instance. Not sure how it can happen.
(Note: I used an old nightly, so it may be different on a newer one)
not the usual way but it get invoked, now the parameter set is a bit awkward and the results I got are not the ones from the module itself (The outputTransformNode is not updated at all)
The error I am getting is
>>>'SlicerBaseLogicPython.vtkSlicerScriptedLoadableMod' object has no attribute 'CreateNodeInScene'
You cannot call SlicerElastix as a CLI module because it is not a CLI module but a (Python) loadable module. At the time I’ve added this module, Python CLI option was not available and I would not switch, because loadable module allows creating a more user-friendly GUI.
You can use Sequence registration module as an example of using Elastix from another module.