I create a script cli module and call this script as below:
PythonQt::init();
PythonQtObjectPtr context = PythonQt::self()->getMainModule();
QString cmd = QString(
"import os\n"
"import sys\n"
"CTASegExePath=slicer.app.slicerHome + '/CTAModule/lib/VesselCenterline.py'\n"
"pythonSlicerExecutablePath=os.path.dirname(sys.executable)+'/PythonSlicer.exe'\n"
"commandLine = [pythonSlicerExecutablePath, CTASegExePath]\n"
"proc=slicer.util.launchConsoleProcess( commandLine ,useStartupEnvironment=True)\n"
"slicer.util.logProcessOutput(proc)\n"
);
context.evalScript(cmd);
in VesselCenterline.py scirpt
I cant import slicer module and call slicer python API, it says no module named “xxx”
How can i do about this ?