# \#scripted

**URL:** https://discourse.slicer.org/tag/scripted/174.md

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

---

## [Stereo Off-Axis Projection and Mouse Interactions](https://discourse.slicer.org/t/stereo-off-axis-projection-and-mouse-interactions/47552)

<div class="topic-metadata">

**Author:** [@LucasP](https://discourse.slicer.org/u/LucasP)\
**Replies:** 4\
**Last updated:** [July 14, 2026, 6:22pm UTC](https://discourse.slicer.org/t/stereo-off-axis-projection-and-mouse-interactions/47552 "2026-07-14T18:22:48Z")

</div>

:robot: This post was written with AI assistance. But I’m still human Hi, I’m new to 3D Slicer and VTK. I am trying to build a “virtual window” effect using a custom stereo display that gives me real-time viewDistanc…

---

## [Cannot import name 'vtkMRMLPathPlannerTrajectoryNode' at launch](https://discourse.slicer.org/t/cannot-import-name-vtkmrmlpathplannertrajectorynode-at-launch/44227)

<div class="topic-metadata">

**Author:** [@ruffsl](https://discourse.slicer.org/u/ruffsl)\
**Replies:** 1\
**Last updated:** [October 9, 2025, 2:17am UTC](https://discourse.slicer.org/t/cannot-import-name-vtkmrmlpathplannertrajectorynode-at-launch/44227 "2025-10-09T02:17:43Z")

</div>

I have a working scripted extension that enables a user to select a path within any chosen trajectory list, as generated via the separate PathExplorer widget from the SlicerIGT extension: SlicerIGT/PathExplorer at m…

---

## [Programmatically controlling extensions via separate scripted extension](https://discourse.slicer.org/t/programmatically-controlling-extensions-via-separate-scripted-extension/44154)

<div class="topic-metadata">

**Author:** [@ruffsl](https://discourse.slicer.org/u/ruffsl)\
**Replies:** 3\
**Last updated:** [August 21, 2025, 9:00pm UTC](https://discourse.slicer.org/t/programmatically-controlling-extensions-via-separate-scripted-extension/44154 "2025-08-21T21:00:10Z")

</div>

Is it possible to programmatically control the state of other 3D Slicer extensions via my own scripted extension using the python API? Such as trigger UI events or update their internal state? E.g: when restoring Slicer…

---

## [Updating script repository with a command to enable crosshair visibility](https://discourse.slicer.org/t/updating-script-repository-with-a-command-to-enable-crosshair-visibility/21073)

<div class="topic-metadata">

**Author:** [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Replies:** 4\
**Last updated:** [April 25, 2024, 1:37pm UTC](https://discourse.slicer.org/t/updating-script-repository-with-a-command-to-enable-crosshair-visibility/21073 "2024-04-25T13:37:44Z")

</div>

I’m not sure if this is the correct place for such a request, however: There are a lot of examples with the Crosshair in the script repository, however, none of them actually says that you have to make the crosshair vis…

---

## [How to hide the code of the script module?](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135)

<div class="topic-metadata">

**Author:** [@qiqi5210](https://discourse.slicer.org/u/qiqi5210)\
**Replies:** 25\
**Last updated:** [March 20, 2024, 6:54pm UTC](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135 "2024-03-20T18:54:59Z")

</div>

Hello everyone, I would like to ask how to hide the code of the script module. I am developing the script module recently, and I feel that it is a bit insecure to be able to directly see all the code. Hope to get everyo…

---

## [Calculate Statistics with Python takes longer then with 3D Slicer GUI](https://discourse.slicer.org/t/calculate-statistics-with-python-takes-longer-then-with-3d-slicer-gui/34961)

<div class="topic-metadata">

**Author:** [@thorbenjt](https://discourse.slicer.org/u/thorbenjt)\
**Replies:** 0\
**Last updated:** [March 18, 2024, 6:23pm UTC](https://discourse.slicer.org/t/calculate-statistics-with-python-takes-longer-then-with-3d-slicer-gui/34961 "2024-03-18T18:23:30Z")

</div>

Hi there, i am currently working on a script the automates tresholding and in addition splitting the segments into islands. this works just as fine as if i would do it per hand in the 3D Slicer GUI. The critical part …

---

## [Cropping existing volume with ROI and shifting display via Python scripting](https://discourse.slicer.org/t/cropping-existing-volume-with-roi-and-shifting-display-via-python-scripting/33856)

<div class="topic-metadata">

**Author:** [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)\
**Replies:** 4\
**Last updated:** [January 19, 2024, 5:37pm UTC](https://discourse.slicer.org/t/cropping-existing-volume-with-roi-and-shifting-display-via-python-scripting/33856 "2024-01-19T17:37:04Z")

</div>

Hi community. I am writing a Python script to automate a pipeline that will be used in around 1000 CT scans. Now I am able to load 1 DICOM folder and to display Volume rendering with Python # Load DICOM files # https…

---

## [Python script to automate rotation](https://discourse.slicer.org/t/python-script-to-automate-rotation/33275)

<div class="topic-metadata">

**Author:** [@Michael\_Allen](https://discourse.slicer.org/u/Michael_Allen)\
**Replies:** 3\
**Last updated:** [December 10, 2023, 8:01pm UTC](https://discourse.slicer.org/t/python-script-to-automate-rotation/33275 "2023-12-10T20:01:18Z")

</div>

Hi all, I’m working on a project creating radiographic views from CT scans, rotating one volume inside another using the repository script (https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/ScriptedLoadable…

---

## [Command line scripting with SlicerDockers](https://discourse.slicer.org/t/command-line-scripting-with-slicerdockers/25355)

<div class="topic-metadata">

**Author:** [@NaglisR](https://discourse.slicer.org/u/NaglisR)\
**Replies:** 16\
**Last updated:** [August 16, 2023, 3:14pm UTC](https://discourse.slicer.org/t/command-line-scripting-with-slicerdockers/25355 "2023-08-16T15:14:16Z")

</div>

Hi all, A question regarding executing command line scripts while using SlicerDockers: I am using GitHub - pieper/SlicerDockers: docker config files for slicer, everything works succesfully, I am able to access Slicer…

---

## [How to release an extension](https://discourse.slicer.org/t/how-to-release-an-extension/26289)

<div class="topic-metadata">

**Author:** [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Replies:** 7\
**Last updated:** [May 11, 2023, 7:22pm UTC](https://discourse.slicer.org/t/how-to-release-an-extension/26289 "2023-05-11T19:22:10Z")

</div>

When creating a purely scripted (i.e. python only) Slicer extension, what is a good release “object” to create and how do I create it? Ideally I want something that I can use with the extension manager’s Install from fi…

---

## [How to remove NthDataNode from a vtkMRMLSequenceNode?](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083)

<div class="topic-metadata">

**Author:** [@sunshine](https://discourse.slicer.org/u/sunshine)\
**Replies:** 2\
**Last updated:** [November 6, 2022, 3:14pm UTC](https://discourse.slicer.org/t/how-to-remove-nthdatanode-from-a-vtkmrmlsequencenode/26083 "2022-11-06T15:14:13Z")

</div>

Hi everyone, I am working on the scripted module development, trying to edit the vtkMRMLSequenceNode. However, did not find any functions like RemoveNthDataNode(). How could I remove the NthDataNode? Thank you very m…

---

## [Create GridTransform from 3d motion field](https://discourse.slicer.org/t/create-gridtransform-from-3d-motion-field/24496)

<div class="topic-metadata">

**Author:** [@llafitte007](https://discourse.slicer.org/u/llafitte007)\
**Replies:** 1\
**Last updated:** [July 26, 2022, 1:11pm UTC](https://discourse.slicer.org/t/create-gridtransform-from-3d-motion-field/24496 "2022-07-26T13:11:14Z")

</div>

Hi, I am developing a motion estimation module based on an existing library ; the result of the estimate is 3d vector field of type numpy array (shape = (width, height, depth, 3)) plus other fields (origin, spacing, …). …

---

## [Detect when new vtkMRMLScalarVolumeNode with DICOM data has been added](https://discourse.slicer.org/t/detect-when-new-vtkmrmlscalarvolumenode-with-dicom-data-has-been-added/22844)

<div class="topic-metadata">

**Author:** [@bruce](https://discourse.slicer.org/u/bruce)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 5:40am UTC](https://discourse.slicer.org/t/detect-when-new-vtkmrmlscalarvolumenode-with-dicom-data-has-been-added/22844 "2022-04-06T05:40:31Z")

</div>

Hello, I am writing a ScriptedLoadableModule that includes a custom table of all nodes loaded directly from DICOM data (along with custom information relating to these nodes). The table is populated based on whether DIC…

---

## [Import rclpy in scripted module](https://discourse.slicer.org/t/import-rclpy-in-scripted-module/22249)

<div class="topic-metadata">

**Author:** [@LauraConnolly](https://discourse.slicer.org/u/LauraConnolly)\
**Replies:** 3\
**Last updated:** [March 3, 2022, 6:43pm UTC](https://discourse.slicer.org/t/import-rclpy-in-scripted-module/22249 "2022-03-03T18:43:43Z")

</div>

Hi there! I’m trying to import a python library called rclpy into a scripted module, the import is working in a regular python file (outside of Slicer) on Linux but I don’t think it’s supported by pip - I followed these …

---

## [Finding & creating modules from python scripts and/or frameworks](https://discourse.slicer.org/t/finding-creating-modules-from-python-scripts-and-or-frameworks/13203)

<div class="topic-metadata">

**Author:** [@epearlstone](https://discourse.slicer.org/u/epearlstone)\
**Replies:** 3\
**Last updated:** [January 25, 2022, 10:04pm UTC](https://discourse.slicer.org/t/finding-creating-modules-from-python-scripts-and-or-frameworks/13203 "2022-01-25T22:04:50Z")

</div>

I am looking to find python code to create modules. For example I know there is a post describing how to use an AI-assisted brain tumor segmentation but I would like to know where to find other open-source scripts/code t…

---

## [Save parameters as config object](https://discourse.slicer.org/t/save-parameters-as-config-object/21103)

<div class="topic-metadata">

**Author:** [@Karthik](https://discourse.slicer.org/u/Karthik)\
**Replies:** 4\
**Last updated:** [December 18, 2021, 4:57am UTC](https://discourse.slicer.org/t/save-parameters-as-config-object/21103 "2021-12-18T04:57:07Z")

</div>

Hi. I have written a scripted module which has some parameters in the form of sliderwidgets. Currently, I am saving these as .cfg file through the code and reading them next time the same module is instantiated. I was w…

---

## [Loading pickled data](https://discourse.slicer.org/t/loading-pickled-data/21087)

<div class="topic-metadata">

**Author:** [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Replies:** 3\
**Last updated:** [December 17, 2021, 4:02pm UTC](https://discourse.slicer.org/t/loading-pickled-data/21087 "2021-12-17T16:02:25Z")

</div>

I want to load pickled data from the GUI in my custom extension. When using the ‘Add data’ dialog to try to load such data, Slicer throws an error (Error - load failed). As a workaround, I thought I could use the ‘Add …

---

## [How to change the slice fill in 'Segmentations' in a python script](https://discourse.slicer.org/t/how-to-change-the-slice-fill-in-segmentations-in-a-python-script/20871)

<div class="topic-metadata">

**Author:** [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Replies:** 2\
**Last updated:** [December 2, 2021, 7:26pm UTC](https://discourse.slicer.org/t/how-to-change-the-slice-fill-in-segmentations-in-a-python-script/20871 "2021-12-02T19:26:41Z")

</div>

I created a .py script to automatically create some segmentations and now I also want to automatically change the slice fill to 0 and slice outline to 1. How can I do that? I can’t find the appropriate documentation. Al…

---

## [Save (part of) the log file from scripted module](https://discourse.slicer.org/t/save-part-of-the-log-file-from-scripted-module/20884)

<div class="topic-metadata">

**Author:** [@atracsys-sbt](https://discourse.slicer.org/u/atracsys-sbt)\
**Replies:** 1\
**Last updated:** [December 2, 2021, 2:22pm UTC](https://discourse.slicer.org/t/save-part-of-the-log-file-from-scripted-module/20884 "2021-12-02T14:22:48Z")

</div>

Hi, As part of the output files of my scripted module, I would like to provide the whole python console history in a file. I thought of parsing the log file from Temp/Slicer for \[Stream\] lines, but I don’t know how to a…

---

## [Slicer Scripted Module not calling updateParameterNodeFromGUI when UI is updated](https://discourse.slicer.org/t/slicer-scripted-module-not-calling-updateparameternodefromgui-when-ui-is-updated/20122)

<div class="topic-metadata">

**Author:** [@tsims](https://discourse.slicer.org/u/tsims)\
**Replies:** 3\
**Last updated:** [October 19, 2021, 7:38pm UTC](https://discourse.slicer.org/t/slicer-scripted-module-not-calling-updateparameternodefromgui-when-ui-is-updated/20122 "2021-10-19T19:38:09Z")

</div>

Hi everyone, I am working on python module for slicer and am running into a weird issue where my updateParameterNodeFromGUI function is not being called when I interacted with the UI. Is there a signal I may have broken…

---

## [Changing cursor during long running script](https://discourse.slicer.org/t/changing-cursor-during-long-running-script/19190)

<div class="topic-metadata">

**Author:** [@ezgimercan](https://discourse.slicer.org/u/ezgimercan)\
**Replies:** 1\
**Last updated:** [August 14, 2021, 9:15am UTC](https://discourse.slicer.org/t/changing-cursor-during-long-running-script/19190 "2021-08-14T09:15:37Z")

</div>

Is there a way to change the cursor to spinning pinwheel when a long running function is called after a button is pressed in a scripted module? Right now the UI freezes until the function returns but no visual feedback t…

---

## [AttributeError: qMRMLNodeComboBox has no attribute named 'setNoneEnabled'](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365)

<div class="topic-metadata">

**Author:** [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Replies:** 4\
**Last updated:** [June 28, 2021, 3:27pm UTC](https://discourse.slicer.org/t/attributeerror-qmrmlnodecombobox-has-no-attribute-named-setnoneenabled/18365 "2021-06-28T15:27:30Z")

</div>

Operating system: Ubuntu 20.04 Slicer version: 4.11.20210226 Expected behavior: setNoneEnabled() to disable qMRMLNodeComboBox “none” option Actual behavior: reported error My code: … self.ui.fid1MRMLNodeComboBox.no…

---

## [How to remove some segment editor effects](https://discourse.slicer.org/t/how-to-remove-some-segment-editor-effects/16162)

<div class="topic-metadata">

**Author:** [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Replies:** 5\
**Last updated:** [May 31, 2021, 6:46pm UTC](https://discourse.slicer.org/t/how-to-remove-some-segment-editor-effects/16162 "2021-05-31T18:46:29Z")

</div>

Operating system: Windows 10 Slicer version:4.11.202.00930 I am trying to create a new module from the segment editor module and need to remove some of the editor effects that I won’t be needing. Is there any way to do…

---

## [Scriptablemodule error](https://discourse.slicer.org/t/scriptablemodule-error/12676)

<div class="topic-metadata">

**Author:** [@Anand\_Mulay](https://discourse.slicer.org/u/Anand_Mulay)\
**Replies:** 2\
**Last updated:** [July 24, 2020, 2:25pm UTC](https://discourse.slicer.org/t/scriptablemodule-error/12676 "2020-07-24T14:25:33Z")

</div>

suddenly i’m getting this error - Generic Warning: In D:\\D\\S\\Slicer-4102\\Base\\Logic\\vtkSlicerApplicationLogic.cxx, line 866 Failed to compute module home directory given filePath it was working all okay before.

---

## [How to test a scripted module](https://discourse.slicer.org/t/how-to-test-a-scripted-module/4578)

<div class="topic-metadata">

**Author:** [@kayarre](https://discourse.slicer.org/u/kayarre)\
**Replies:** 1\
**Last updated:** [November 26, 2018, 6:58pm UTC](https://discourse.slicer.org/t/how-to-test-a-scripted-module/4578 "2018-11-26T18:58:37Z")

</div>

I modified the SlicerCaseIterator module, but I don’t actually know how to test/debug it. the command i use is ~/tools/Slicer-4.10.0-linux-amd64/Slicer --additional-module-paths ~/build/slicer/SlicerCaseIterator/Slicer…
