I am developing a CLI module and calling it from my scripted module using “slicer.cli.run” . I can parse the arguments from my scripted module to CLI module but I failed to get the returning arguments from my CLI module.
I am trying to copy fudicial registration module but unfortunately I wasn’t able to get the returning argument in my scripted module. I am missing simething, it might be very basic, but I have wasted alot of time in it.
My XML is:
<?xml version="1.0" encoding="utf-8"?>
Examples
CLI_test
0.0.1
http://www.example.com/Slicer/Modules/CLI_test
Slicer
FirstName LastName (Institution), FirstName LastName (Institution)
This work was partially funded by NIH grant NXNNXXNNNNNN-NNXN
IO
sigmas
sigmas
s
output
<label>Sigmas</label>
<description><![CDATA[A double value (in units of mm) passed to the algorithm]]></description>
</float-vector>
<double>
<name>rms</name>
<longflag>rms</longflag>
<description><![CDATA[Display RMS Error.]]></description>
<flag>R</flag>
<label>RMS Error</label>
<channel>output</channel>
<default>0.1</default>
</double>
The part of updating rms value in my CLI .cpp code is:
Just to be clear, If I run my CLI module as standalone program it does generate an output text file, my question is, how can I get the output if I call my CLI from scripted module with slicer.cli.run command.
Thank you for you reply Andras, I have tried this command, the problem is my ‘rms’ variable doesn’t get updated. its just returning the same initial value.
Ideally, inital rms value should go into my CLI module , it should get updated, and I should get the updated variable.
this is the python code from where I am calling my CLI