How to run python based CLI modules?

i have a little question.
do these parts need to install more cmake?

No, not if you do everything in python.

2 Likes

Can you give me a tutorial or link on how to combine python code into 3D slicer?
I’ve read a lot of ways but still don’t know how to do it.
Since I am still a student, my ability to analyze documents is still a bit poor. hope you can help me.

Sure - open the Python interactor:

image

and enter some Python code.

A good starting point for reading is:

https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html

Copy/paste source code from that page into the Python interactor.

If you want to integrate deep learning source code into 3D Slicer you will probably need a programmer.

1 Like

hi Rbumm!
thankyou so much.

Can I ask if the integration of deep learning code is also done on Python interactor?

slicer
i tried integrating deep learning in this way, but i don’t know is it correct?

If your deep learning code is written in Python - it probably is. You would need to write a program in Python language and load and test it via the Python interactor.

This would be a starting point to write your own 3D Slicer extension.

Please remember that this forum is not a chat program and every question you ask pushes the thread up to the beginning again.

sorry so much, I’ll keep an eye on this.

Hi Andras,
I am working on running the radiomics cli for batch processing. I want to update the binwidth. I have the following code.

how can I define the binwidth using params.

 params = {}
            params["Image"] = slicer.util.getNode(apt_data.GetID())
            params["Mask"] = slicer.util.getNode(seg.GetID())
            params["param"] = directoryPath+"/param_file.file.yaml" this line is not working when I run default without passing file it works. 
            params["out"] = t
cliModule = slicer.modules.slicerradiomicscli
                cliNode = slicer.cli.runSync(cliModule, None, params)

regards,
Saima