# \#cli

**URL:** https://discourse.slicer.org/tag/cli/89.md

[Latest](https://discourse.slicer.org/latest.md) · [Categories](https://discourse.slicer.org/categories.md) · [Tags](https://discourse.slicer.org/tags.md)

---

## [How to convert a custom 3D Slicer plugin with ParameterNodes into a CLI-friendly module?](https://discourse.slicer.org/t/how-to-convert-a-custom-3d-slicer-plugin-with-parameternodes-into-a-cli-friendly-module/44217)

<div class="topic-metadata">

**Author:** [@khyatisethia](https://discourse.slicer.org/u/khyatisethia)\
**Replies:** 2\
**Last updated:** [September 3, 2025, 11:47am UTC](https://discourse.slicer.org/t/how-to-convert-a-custom-3d-slicer-plugin-with-parameternodes-into-a-cli-friendly-module/44217 "2025-09-03T11:47:54Z")

</div>

Hi everyone, I’ve been working on a custom plugin for 3D Slicer, and I’ve run into a design issue that makes it hard to reuse the logic outside of the GUI. Right now, my ModuleWidget class is tightly coupled to the Sli…

---

## [Configure c++ intellisense and cmake tools for vscode](https://discourse.slicer.org/t/configure-c-intellisense-and-cmake-tools-for-vscode/37198)

<div class="topic-metadata">

**Author:** [@kritc](https://discourse.slicer.org/u/kritc)\
**Replies:** 0\
**Last updated:** [July 4, 2024, 3:21pm UTC](https://discourse.slicer.org/t/configure-c-intellisense-and-cmake-tools-for-vscode/37198 "2024-07-04T15:21:25Z")

</div>

I’m currently developing C++ CLI modules in Visual Studio Code in mac-apple-silicon. How to configure c++ intellisense and cmake tools to work in vscode ? please advice. The extension workspace is outside slicer sour…

---

## [CLI module output image segmentation](https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797)

<div class="topic-metadata">

**Author:** [@Franciska](https://discourse.slicer.org/u/Franciska)\
**Replies:** 1\
**Last updated:** [April 29, 2024, 2:27pm UTC](https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797 "2024-04-29T14:27:37Z")

</div>

Hi! I would like to create a custom module, just like the BlurImage example. I put mine under Segmentation modules. When using the module, under the IO parameters I can chose Output Volume as creating a new volume, or…

---

## [Script for resampling scalar volumes](https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717)

<div class="topic-metadata">

**Author:** [@nthach17](https://discourse.slicer.org/u/nthach17)\
**Replies:** 1\
**Last updated:** [November 22, 2021, 9:52am UTC](https://discourse.slicer.org/t/script-for-resampling-scalar-volumes/20717 "2021-11-22T09:52:45Z")

</div>

Hello, I’m new to the developer aspect of 3D Slicer and would like to compile a Python script for resampling batch of scalar volumes. While looking at the documentation for the ResampleVolume module, Modules:ResampleVol…

---

## [How to access or save output image after running CLI from Python](https://discourse.slicer.org/t/how-to-access-or-save-output-image-after-running-cli-from-python/20494)

<div class="topic-metadata">

**Author:** [@gnketiah](https://discourse.slicer.org/u/gnketiah)\
**Replies:** 2\
**Last updated:** [November 15, 2021, 9:39am UTC](https://discourse.slicer.org/t/how-to-access-or-save-output-image-after-running-cli-from-python/20494 "2021-11-15T09:39:56Z")

</div>

I have created or run a CLI from Python to calculate T1 mapping as follows. cliNode = slicer.cli.runSync(slicer.modules.t1mapping, None, parameters) Detailed script: def t1mapping(parameters = {}): '''Code for run…

---

## [Command Line Interface (CLI) much slower compared to starting in separate python environment](https://discourse.slicer.org/t/command-line-interface-cli-much-slower-compared-to-starting-in-separate-python-environment/19042)

<div class="topic-metadata">

**Author:** [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)\
**Replies:** 5\
**Last updated:** [August 3, 2021, 6:14pm UTC](https://discourse.slicer.org/t/command-line-interface-cli-much-slower-compared-to-starting-in-separate-python-environment/19042 "2021-08-03T18:14:38Z")

</div>

Hi, I created a small script which generates a transform matrix and publishes the matrix via OpenIGTLink (pyigtlink). This script I want to start together with a Slicer Guidelet application. The application will connect…

---

## [Cancel CLI module running from a loadable scripted module through clicking the cancel button of qProgressDialog](https://discourse.slicer.org/t/cancel-cli-module-running-from-a-loadable-scripted-module-through-clicking-the-cancel-button-of-qprogressdialog/18330)

<div class="topic-metadata">

**Author:** [@bywbilly](https://discourse.slicer.org/u/bywbilly)\
**Replies:** 2\
**Last updated:** [June 29, 2021, 5:01pm UTC](https://discourse.slicer.org/t/cancel-cli-module-running-from-a-loadable-scripted-module-through-clicking-the-cancel-button-of-qprogressdialog/18330 "2021-06-29T17:01:05Z")

</div>

Hi, I run a CLI module in the background in a customized loadable scripted module. And following here How to update the progress bar from a scripted CLI - #2 by strider\_hunter, I create a progressDialog to show the prog…

---

## [Write a python CLI module but do not show in the slicer app](https://discourse.slicer.org/t/write-a-python-cli-module-but-do-not-show-in-the-slicer-app/18287)

<div class="topic-metadata">

**Author:** [@bywbilly](https://discourse.slicer.org/u/bywbilly)\
**Replies:** 9\
**Last updated:** [June 24, 2021, 4:49pm UTC](https://discourse.slicer.org/t/write-a-python-cli-module-but-do-not-show-in-the-slicer-app/18287 "2021-06-24T16:49:23Z")

</div>

Hi, I implemented an interactive python loadable module but it requires a heavy computation to do something with the volume. To avoid this heavy computation stuff to block the main slicer app, (after some search) I fin…

---

## [Threshold scalar volume to labelmap](https://discourse.slicer.org/t/threshold-scalar-volume-to-labelmap/4457)

<div class="topic-metadata">

**Author:** [@kayarre](https://discourse.slicer.org/u/kayarre)\
**Replies:** 11\
**Last updated:** [October 22, 2018, 11:01pm UTC](https://discourse.slicer.org/t/threshold-scalar-volume-to-labelmap/4457 "2018-10-22T23:01:33Z")

</div>

I am trying to use the python interface to load a (float) scalar volume in the form of a signed distance field want to apply thresholdscalarvolume to generate a label map with everything below 0.0. It doesn’t seem to b…

---

## [How to add default text to combobox(qMRMLNodeComboBox) before opening any customize model.](https://discourse.slicer.org/t/how-to-add-default-text-to-combobox-qmrmlnodecombobox-before-opening-any-customize-model/17569)

<div class="topic-metadata">

**Author:** [@Mahesh\_Timmanagoudar](https://discourse.slicer.org/u/Mahesh_Timmanagoudar)\
**Replies:** 3\
**Last updated:** [May 12, 2021, 12:24pm UTC](https://discourse.slicer.org/t/how-to-add-default-text-to-combobox-qmrmlnodecombobox-before-opening-any-customize-model/17569 "2021-05-12T12:24:41Z")

</div>

we have customised model. The GUI is written in XML code. Depending on XML tag qSlicerCLIModuleWidgetPrivate class function is called and dynamically combo box is created. We wanted to add some default text to combo box …

---

## [GeneraeOverlayImages in CIP not working](https://discourse.slicer.org/t/generaeoverlayimages-in-cip-not-working/16044)

<div class="topic-metadata">

**Author:** [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Replies:** 1\
**Last updated:** [February 17, 2021, 11:39pm UTC](https://discourse.slicer.org/t/generaeoverlayimages-in-cip-not-working/16044 "2021-02-17T23:39:23Z")

</div>

Operating system: Windows Slicer version:4.11 Expected behavior: Actual behavior: I’m trying to use Generate Overlay Images cip script in my ubuntu terminal using the CLI command-line tools. Can anyone tell me how to…

---

## [Calls to CLI makes tests to fail](https://discourse.slicer.org/t/calls-to-cli-makes-tests-to-fail/13835)

<div class="topic-metadata">

**Author:** [@Alex\_Vergara](https://discourse.slicer.org/u/Alex_Vergara)\
**Replies:** 14\
**Last updated:** [February 4, 2021, 11:51am UTC](https://discourse.slicer.org/t/calls-to-cli-makes-tests-to-fail/13835 "2021-02-04T11:51:14Z")

</div>

In my module I have some calls to Slicer CLI scripts, like brainsresample. In my code I do parameters = {'inputVolume': nodeCT.data, 'referenceVolume': nodeSPECT.data, 'outputVolume': CTRSNode, 'interpolat…

---

## [Getting a temporary directory path in a CLI module](https://discourse.slicer.org/t/getting-a-temporary-directory-path-in-a-cli-module/13817)

<div class="topic-metadata">

**Author:** [@Mik](https://discourse.slicer.org/u/Mik)\
**Replies:** 2\
**Last updated:** [October 3, 2020, 3:20am UTC](https://discourse.slicer.org/t/getting-a-temporary-directory-path-in-a-cli-module/13817 "2020-10-03T03:20:00Z")

</div>

Input and output volumes are stored in temporary directory, and i need to transform an input volume into MetaImage format for further processing in plastimatch. How setup correctly the mha file name (without parsing the …

---

## [Passing hierarchies to CLIs](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706)

<div class="topic-metadata">

**Author:** [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Replies:** 2\
**Last updated:** [May 26, 2020, 1:39pm UTC](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706 "2020-05-26T13:39:26Z")

</div>

Hello. I’m trying to develop a CLI module which takes a set of models as input and gives a set of models as output. It seems to be possible to use vtkMRMLModelHierarchy nodes for this, but is it possible to use vtkMRMLS…

---

## [Can't input boolean into module being wrong as a cli](https://discourse.slicer.org/t/cant-input-boolean-into-module-being-wrong-as-a-cli/7534)

<div class="topic-metadata">

**Author:** [@jrojasUNC](https://discourse.slicer.org/u/jrojasUNC)\
**Replies:** 3\
**Last updated:** [July 11, 2019, 4:39pm UTC](https://discourse.slicer.org/t/cant-input-boolean-into-module-being-wrong-as-a-cli/7534 "2019-07-11T16:39:27Z")

</div>

Operating system: Windows 10 64 bit Slicer version:4.11 nightly Expected behavior: Actual behavior: Hi, I’m trying to run my own scripted module as a cli. I can input a string into the module just fine, but when I t…

---

## [Cli modules at Slicer vs built Slicer](https://discourse.slicer.org/t/cli-modules-at-slicer-vs-built-slicer/4618)

<div class="topic-metadata">

**Author:** [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Replies:** 3\
**Last updated:** [November 6, 2018, 5:26pm UTC](https://discourse.slicer.org/t/cli-modules-at-slicer-vs-built-slicer/4618 "2018-11-06T17:26:51Z")

</div>

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…

---

## [Programming a script to automate Slicer Extension Module for DiceComputation (CLI)](https://discourse.slicer.org/t/programming-a-script-to-automate-slicer-extension-module-for-dicecomputation-cli/3924)

<div class="topic-metadata">

**Author:** [@phoenixyuwilkie](https://discourse.slicer.org/u/phoenixyuwilkie)\
**Replies:** 5\
**Last updated:** [August 28, 2018, 3:13pm UTC](https://discourse.slicer.org/t/programming-a-script-to-automate-slicer-extension-module-for-dicecomputation-cli/3924 "2018-08-28T15:13:29Z")

</div>

Hello all, I am currently trying to program a script that will automate thresholding of scalar volumes then compute the DSC values of these segmentations when compared with previously manually segmented ones. While the …

---

## [Use existing slicer modules with python and cli](https://discourse.slicer.org/t/use-existing-slicer-modules-with-python-and-cli/2743)

<div class="topic-metadata">

**Author:** [@hadasara](https://discourse.slicer.org/u/hadasara)\
**Replies:** 5\
**Last updated:** [May 1, 2018, 4:36pm UTC](https://discourse.slicer.org/t/use-existing-slicer-modules-with-python-and-cli/2743 "2018-05-01T16:36:02Z")

</div>

Hi, I followed this tutorial on how to use existing modules in slicer through cli library: It sounds not bad (considering my understanding in cli is close to 0…) Anyway, since I want to use…

---

## [Threading CLI commands](https://discourse.slicer.org/t/threading-cli-commands/1576)

<div class="topic-metadata">

**Author:** [@purav70](https://discourse.slicer.org/u/purav70)\
**Replies:** 1\
**Last updated:** [December 1, 2017, 4:55pm UTC](https://discourse.slicer.org/t/threading-cli-commands/1576 "2017-12-01T16:55:11Z")

</div>

Hi there, I was wondering if the method slicer.cli.run() acted as a thread, thereby running the command asynchronously, versus the method slicer.cli.runSync(). I need to call on a cli run command several times, and bec…

---

## [CLI Module widget internationalization](https://discourse.slicer.org/t/cli-module-widget-internationalization/1477)

<div class="topic-metadata">

**Author:** [@Ted\_Chen](https://discourse.slicer.org/u/Ted_Chen)\
**Replies:** 10\
**Last updated:** [November 21, 2017, 2:16am UTC](https://discourse.slicer.org/t/cli-module-widget-internationalization/1477 "2017-11-21T02:16:25Z")

</div>

Hello, We are translating the 3D slicer and the loadable module can be done well but seems there is no good explanation document about CLI module internationalization. As my understanding, SlicerExecutionModel defined …
