Generally, CLIs are not intended to have direct access to the Slicer scene / infrastructure. They are meant for non-interactive data processing with non-slicer libraries. If you want to work within the Slicer environment, you should keep the code within a python scripted module.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Cli modules at Slicer vs built Slicer | 3 | 602 | November 6, 2018 | |
Import slicer module in script cli module | 0 | 15 | July 18, 2024 | |
Basic questions on CLI modules vs Scripted Modules | 3 | 361 | March 22, 2020 | |
Unable to access/import slicer's cli module from python script | 3 | 1173 | August 25, 2021 | |
How can I write a python CLI code using slicer internal module | 7 | 656 | June 9, 2021 |