Cli modules at Slicer vs built Slicer

Hi All,

I am trying to run a CLI module from python:

cliNode = slicer.cli.run( slicer.modules.linemarkerregistration, None, parameters, True)

When I am running that on Slicer that I build, seems that I get the desired OutputText.
But If I run it at a client Slicer(one that you can download and run it) seems that I get an empty OutputText.

Why did that happen? Should I always call cli modules from Slicer that I built?

Thanks,
Eleni

Hi:

Is this a custom C++ CLI that you have written and built against Slicer? In order to ensure that a CLI runs with a certain version of Slicer, they need to be built with the same build environment, and the CLI needs to be built against the same(ish) version of Slicer you are trying to use it in. So if you are doing a custom module, it will likely only work in the Slicer you have built yourself. Did you get any error output (modules not found, etc?)

Python modules would be more flexible if you want to test with downloaded binaries, since they just need to match the Slicer API of the binary.

Sam

1 Like

Hi Sam,

It is a C++ CLI custom module that I want to use but seems that is a three-year code. Both cliNode.GetErrorText() and cliNode.GetOutputText() returns me an empty string. I was wondering why that module works on Slicer that I have built (4.9.0 version) and not at binary one(4.8.1 version).
Note: In both environments works fine if I manually insert the module and run it.

So, maybe should be built again with a new environment in order to work?

Thanks a lot,
Eleni

Hi @siaeleni -

Yes, it can be problematic to mix different builds of C++ libraries - the compilers and build settings need to match exactly. Building the CLI from source to match your build should work.

HTH,
Steve

1 Like