# Development

**URL:** https://discourse.slicer.org/c/dev/5.md?no_subcategories=false&page=19

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

**Page:** 20

---

## [Debugging a python script in pycharm](https://discourse.slicer.org/t/debugging-a-python-script-in-pycharm/36585)

<div class="topic-metadata">

**Author:** [@RomanStriker](https://discourse.slicer.org/u/RomanStriker)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 4:10pm UTC](https://discourse.slicer.org/t/debugging-a-python-script-in-pycharm/36585 "2024-06-04T16:10:18Z")

</div>

Hi, I have a python script that I would like to debug step by step. I managed to attach Pycharm’s remote debugger to Slicer using these instructions, however, I cannot run the python script in the Slicer GUI’s python co…

---

## [Is there interest in a reader for cardiac electrophysiology electronanatomic maps?](https://discourse.slicer.org/t/is-there-interest-in-a-reader-for-cardiac-electrophysiology-electronanatomic-maps/6356)

<div class="topic-metadata">

**Author:** [@stephan](https://discourse.slicer.org/u/stephan)\
**Replies:** 24\
**Last updated:** [June 4, 2024, 4:03pm UTC](https://discourse.slicer.org/t/is-there-interest-in-a-reader-for-cardiac-electrophysiology-electronanatomic-maps/6356 "2024-06-04T16:03:47Z")

</div>

Hi, for a research project I developed a python scripted module that reads data exported from cardiac electroanatomic mapping systems (Ensite Velocity, CARTO 3, and Rhythmia) and creates models in Slicer from it (with t…

---

## [Can I automate just importing files, changing their type, and then saving them?](https://discourse.slicer.org/t/can-i-automate-just-importing-files-changing-their-type-and-then-saving-them/36501)

<div class="topic-metadata">

**Author:** [@tryingToCode](https://discourse.slicer.org/u/tryingToCode)\
**Replies:** 3\
**Last updated:** [June 3, 2024, 7:41pm UTC](https://discourse.slicer.org/t/can-i-automate-just-importing-files-changing-their-type-and-then-saving-them/36501 "2024-06-03T19:41:03Z")

</div>

I am trying to write a Python script that imports .msg files into 3D Slicer and saves them as nii files. I’ve never automated anything and I am having a bit of a hard time understanding how to write scripts and run them.…

---

## [Save a tree of centerline curves to json files using Python](https://discourse.slicer.org/t/save-a-tree-of-centerline-curves-to-json-files-using-python/36574)

<div class="topic-metadata">

**Author:** [@ruili](https://discourse.slicer.org/u/ruili)\
**Replies:** 1\
**Last updated:** [June 3, 2024, 3:41pm UTC](https://discourse.slicer.org/t/save-a-tree-of-centerline-curves-to-json-files-using-python/36574 "2024-06-03T15:41:50Z")

</div>

Hello, I have created a tree of centerline curves using functions from the “Extract Centerline” module, and now I want to save the curves in a file structure that can reflect the tree structure. In Slicer, I can do this…

---

## [Display node full fill view](https://discourse.slicer.org/t/display-node-full-fill-view/36564)

<div class="topic-metadata">

**Author:** [@fqzhice](https://discourse.slicer.org/u/fqzhice)\
**Replies:** 2\
**Last updated:** [June 3, 2024, 2:14pm UTC](https://discourse.slicer.org/t/display-node-full-fill-view/36564 "2024-06-03T14:14:44Z")

</div>

we create a new extension to load dicom image, code as below: // add to volume node double dirs\[3\]\[3\]; for (int i = 0; i \< 3; i++) for (int j = 0; j \< 3; j++) dirs\[i\]\[j\] = 0.0; dirs\[0\]\[0\] = 1; dirs\[1\]\[1\] = 1; dir…

---

## [Compute co-occurrence matrix from DICOM](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539)

<div class="topic-metadata">

**Author:** [@sajad\_amiri](https://discourse.slicer.org/u/sajad_amiri)\
**Replies:** 2\
**Last updated:** [June 3, 2024, 11:55am UTC](https://discourse.slicer.org/t/compute-co-occurrence-matrix-from-dicom/36539 "2024-06-03T11:55:15Z")

</div>

Hello friends, I want to know how we can extract the matrices themselves from our DICOM. for example, I want to have a Co-occurrence matrix . to produce new features from this matrix. how can I extract the matrix?

---

## [Issue when enabling the new interaction transform handler using script](https://discourse.slicer.org/t/issue-when-enabling-the-new-interaction-transform-handler-using-script/36509)

<div class="topic-metadata">

**Author:** [@chz31](https://discourse.slicer.org/u/chz31)\
**Replies:** 2\
**Last updated:** [May 31, 2024, 6:14pm UTC](https://discourse.slicer.org/t/issue-when-enabling-the-new-interaction-transform-handler-using-script/36509 "2024-05-31T18:14:01Z")

</div>

Hi, I met a strange issue when I tried to enable interaction transform handler using script using the newest preview Slicer 5.7.0-2024-05-28 in Mac. The command interactionTransformNode.GetDisplayNode().SetEditorVisibi…

---

## [Change slice offset automatically](https://discourse.slicer.org/t/change-slice-offset-automatically/36483)

<div class="topic-metadata">

**Author:** [@Xiaojie\_Guo](https://discourse.slicer.org/u/Xiaojie_Guo)\
**Replies:** 2\
**Last updated:** [May 31, 2024, 1:54am UTC](https://discourse.slicer.org/t/change-slice-offset-automatically/36483 "2024-05-31T01:54:30Z")

</div>

Hi, all I saw a script here, which could change the Red slice. Suppose there is a CT data of 512 slices. I want to scroll from slice 0 to slice 511 automatically, is it possible to implement that using a python script? …

---

## [Layout Manager cannot get the right qMRMLSliceWidget](https://discourse.slicer.org/t/layout-manager-cannot-get-the-right-qmrmlslicewidget/36460)

<div class="topic-metadata">

**Author:** [@nnzzll](https://discourse.slicer.org/u/nnzzll)\
**Replies:** 3\
**Last updated:** [May 30, 2024, 3:29am UTC](https://discourse.slicer.org/t/layout-manager-cannot-get-the-right-qmrmlslicewidget/36460 "2024-05-30T03:29:05Z")

</div>

I create a qMRMLSliceWidget by using this scipt. \>\>\> # layout name is used to create and identify the underlying slice node and should be set to a value that is not used in any of the layouts owned by the layout manage…

---

## [Getting voxel values of a segment](https://discourse.slicer.org/t/getting-voxel-values-of-a-segment/36478)

<div class="topic-metadata">

**Author:** [@Pierre\_Lemois](https://discourse.slicer.org/u/Pierre_Lemois)\
**Replies:** 1\
**Last updated:** [May 29, 2024, 8:01pm UTC](https://discourse.slicer.org/t/getting-voxel-values-of-a-segment/36478 "2024-05-29T20:01:59Z")

</div>

I have an MRI image and a segmentation of an area. I need to obtain the values of each voxel in a segment. I’ve followed the documentation, in particular the section: Get histogram of a segmented region. But I can’t find…

---

## [Visualizing 3D polydata of the model in 2D slice view](https://discourse.slicer.org/t/visualizing-3d-polydata-of-the-model-in-2d-slice-view/4010)

<div class="topic-metadata">

**Author:** [@Feodor](https://discourse.slicer.org/u/Feodor)\
**Replies:** 13\
**Last updated:** [May 29, 2024, 2:28pm UTC](https://discourse.slicer.org/t/visualizing-3d-polydata-of-the-model-in-2d-slice-view/4010 "2024-05-29T14:28:22Z")

</div>

Hi all. The idea is to display the 3d model in the same way as its intersection with the slice plane, that is each 2D slice view display the 3d model from its own “angle of view”. I’m trying to add the polydata of the…

---

## [Plane markup json files - how to create "baseToNode" and "orientation" matrices](https://discourse.slicer.org/t/plane-markup-json-files-how-to-create-basetonode-and-orientation-matrices/31826)

<div class="topic-metadata">

**Author:** [@drobny](https://discourse.slicer.org/u/drobny)\
**Replies:** 4\
**Last updated:** [May 29, 2024, 3:13am UTC](https://discourse.slicer.org/t/plane-markup-json-files-how-to-create-basetonode-and-orientation-matrices/31826 "2024-05-29T03:13:15Z")

</div>

Hi, I’m looking into using slicer for the visualisation of results from another tool. Therefore, I’d like to import plane definitions to quickly inspect whether they are as expected. I use a point and normal vector in …

---

## [Show slice intersection line only in specific view](https://discourse.slicer.org/t/show-slice-intersection-line-only-in-specific-view/36275)

<div class="topic-metadata">

**Author:** [@park](https://discourse.slicer.org/u/park)\
**Replies:** 6\
**Last updated:** [May 28, 2024, 6:46pm UTC](https://discourse.slicer.org/t/show-slice-intersection-line-only-in-specific-view/36275 "2024-05-28T18:46:52Z")

</div>

Hi all, I would like to show intersection line of 2D view only in Axial view. I tried codes below, but it still remain other view. Could I get sloution about this ? def intersectionOnOff(self, flag): slic…

---

## [Remove intesection lines in specific 2D view](https://discourse.slicer.org/t/remove-intesection-lines-in-specific-2d-view/36430)

<div class="topic-metadata">

**Author:** [@park](https://discourse.slicer.org/u/park)\
**Replies:** 0\
**Last updated:** [May 28, 2024, 11:20am UTC](https://discourse.slicer.org/t/remove-intesection-lines-in-specific-2d-view/36430 "2024-05-28T11:20:53Z")

</div>

Hi all, I posted a question last time but did not get solution, so I’m posting it again. I created four 2D slice views looks like the video below. Among these, I only want to display the intersection view in the axial…

---

## [How to update markupsCurve info when it terminated right-click end?](https://discourse.slicer.org/t/how-to-update-markupscurve-info-when-it-terminated-right-click-end/36423)

<div class="topic-metadata">

**Author:** [@park](https://discourse.slicer.org/u/park)\
**Replies:** 1\
**Last updated:** [May 28, 2024, 1:24am UTC](https://discourse.slicer.org/t/how-to-update-markupscurve-info-when-it-terminated-right-click-end/36423 "2024-05-28T01:24:33Z")

</div>

Hi all, I am using the PointModifiedEvent to update curve information when drawing a curve. When I end the curve drawing interaction with a right-click, I noticed that information from undefined parts remains. To addr…

---

## [How to Copy Nodes with Synchronization](https://discourse.slicer.org/t/how-to-copy-nodes-with-synchronization/36342)

<div class="topic-metadata">

**Author:** [@park](https://discourse.slicer.org/u/park)\
**Replies:** 2\
**Last updated:** [May 28, 2024, 1:22am UTC](https://discourse.slicer.org/t/how-to-copy-nodes-with-synchronization/36342 "2024-05-28T01:22:50Z")

</div>

Hello all, I would like to apply gridTransform to a specific Slice View (panoramic view) to visualize the data, as shown in the image below. I was advised that the easiest way to do this is to copy all the data, app…

---

## [Segmented NRRD File is 0 Bytes After Editing](https://discourse.slicer.org/t/segmented-nrrd-file-is-0-bytes-after-editing/36387)

<div class="topic-metadata">

**Author:** [@DrBorg](https://discourse.slicer.org/u/DrBorg)\
**Replies:** 0\
**Last updated:** [May 25, 2024, 1:46pm UTC](https://discourse.slicer.org/t/segmented-nrrd-file-is-0-bytes-after-editing/36387 "2024-05-25T13:46:08Z")

</div>

Hello, I’m working with a segmented NRRD file and I’m trying to remove certain segments. I wrote the script, shown below, to do this. It appears to work, however, the output SEG.NRRD outputs the following error when o…

---

## [How to display markups node only in a specific slice view?](https://discourse.slicer.org/t/how-to-display-markups-node-only-in-a-specific-slice-view/36298)

<div class="topic-metadata">

**Author:** [@park](https://discourse.slicer.org/u/park)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 2:31pm UTC](https://discourse.slicer.org/t/how-to-display-markups-node-only-in-a-specific-slice-view/36298 "2024-05-21T14:31:46Z")

</div>

Hi all I would like to make marksupNode and marksupCurveNode visible only in the red slice. (I prefer them to remain invisible in the green and yellow slices.) Could you please provide an example for achieving this? …

---

## [Automating .vtp export to NIFTI with Slicer Modules](https://discourse.slicer.org/t/automating-vtp-export-to-nifti-with-slicer-modules/36285)

<div class="topic-metadata">

**Author:** [@jag](https://discourse.slicer.org/u/jag)\
**Replies:** 1\
**Last updated:** [May 20, 2024, 10:12pm UTC](https://discourse.slicer.org/t/automating-vtp-export-to-nifti-with-slicer-modules/36285 "2024-05-20T22:12:09Z")

</div>

Hi there, I am trying to convert a .vtp segmentation to a compressed NifTi file. I was able to do it with the Slicer GUI via the following steps: Add data → Choose files → select .vtp file Right click on the imported m…

---

## [Can I center the views on a crosshair position?](https://discourse.slicer.org/t/can-i-center-the-views-on-a-crosshair-position/36244)

<div class="topic-metadata">

**Author:** [@sullivak](https://discourse.slicer.org/u/sullivak)\
**Replies:** 2\
**Last updated:** [May 20, 2024, 9:23pm UTC](https://discourse.slicer.org/t/can-i-center-the-views-on-a-crosshair-position/36244 "2024-05-20T21:23:39Z")

</div>

Hi. I can set the location of crosshairs, e.g. slicer.mrmlScene.GetNodesByClass(‘vtkMRMLCrosshairNode’).GetItemAsObject(0).SetCrosshairRAS(point) but is there a way to re-center the views on that location?

---

## [Customizing 3DSlicer for Video Stream Rendering: Combining ScriptModule for GUI and LoadableModule for Stream Display Without GUI](https://discourse.slicer.org/t/customizing-3dslicer-for-video-stream-rendering-combining-scriptmodule-for-gui-and-loadablemodule-for-stream-display-without-gui/36141)

<div class="topic-metadata">

**Author:** [@herryliq](https://discourse.slicer.org/u/herryliq)\
**Replies:** 5\
**Last updated:** [May 18, 2024, 3:44pm UTC](https://discourse.slicer.org/t/customizing-3dslicer-for-video-stream-rendering-combining-scriptmodule-for-gui-and-loadablemodule-for-stream-display-without-gui/36141 "2024-05-18T15:44:45Z")

</div>

Regarding custom development of 3DSlicer, I am still a newbie and constantly exploring and learning. From the official documentation of 3DSlicer, we can see that there are three types of Modules in 3DSlicer: LoadableMo…

---

## [Run slicer on windows with log / terminal output?](https://discourse.slicer.org/t/run-slicer-on-windows-with-log-terminal-output/36234)

<div class="topic-metadata">

**Author:** [@dangerweenie](https://discourse.slicer.org/u/dangerweenie)\
**Replies:** 0\
**Last updated:** [May 17, 2024, 5:18pm UTC](https://discourse.slicer.org/t/run-slicer-on-windows-with-log-terminal-output/36234 "2024-05-17T17:18:10Z")

</div>

Hi there! New to slicer here, excited to dig in. I’m trying to run the HDBrainExtraction module and it seems to hang (30 minutes or more) when initialzing / installing pytorch. Not sure if slicer uses a .venv, i have …

---

## [Set to outline mode when a segmentation node is added, NOT WORKING](https://discourse.slicer.org/t/set-to-outline-mode-when-a-segmentation-node-is-added-not-working/36203)

<div class="topic-metadata">

**Author:** [@mrlongzhang](https://discourse.slicer.org/u/mrlongzhang)\
**Replies:** 5\
**Last updated:** [May 17, 2024, 9:00am UTC](https://discourse.slicer.org/t/set-to-outline-mode-when-a-segmentation-node-is-added-not-working/36203 "2024-05-17T09:00:39Z")

</div>

I used the follow code in .slicerrc.py to modify the default behavior of slicer 2D slice (up to 5.6.x) to display in outline mode instead of in filled mode for a segmentation. def SetOutline(caller,event): for node i…

---

## [Change active widget](https://discourse.slicer.org/t/change-active-widget/36005)

<div class="topic-metadata">

**Author:** [@dfajtai](https://discourse.slicer.org/u/dfajtai)\
**Replies:** 2\
**Last updated:** [May 17, 2024, 7:53am UTC](https://discourse.slicer.org/t/change-active-widget/36005 "2024-05-17T07:53:48Z")

</div>

I am curious if there is a way to jump from one module to another programmatically using Python. I have a module in which several automatic segmentations were generated. I would like to give an easy option for the user …

---

## [Missing “Reference Volume” option in FreeSurfer Importer (it looks like version 5.6 onwards)](https://discourse.slicer.org/t/missing-reference-volume-option-in-freesurfer-importer-it-looks-like-version-5-6-onwards/35977)

<div class="topic-metadata">

**Author:** [@Nis175](https://discourse.slicer.org/u/Nis175)\
**Replies:** 4\
**Last updated:** [May 16, 2024, 9:17pm UTC](https://discourse.slicer.org/t/missing-reference-volume-option-in-freesurfer-importer-it-looks-like-version-5-6-onwards/35977 "2024-05-16T21:17:20Z")

</div>

Dear 3D Slicer Team, I have noticed that the “Reference Volume” option available in version 5.4.0 of the FreeSurfer importer has been removed in the latest versions, including 5.6.2. Please see the attached screenshots…

---

## [Python code for getting current displayed slice on a red window](https://discourse.slicer.org/t/python-code-for-getting-current-displayed-slice-on-a-red-window/35891)

<div class="topic-metadata">

**Author:** [@mlh](https://discourse.slicer.org/u/mlh)\
**Replies:** 2\
**Last updated:** [May 16, 2024, 12:03pm UTC](https://discourse.slicer.org/t/python-code-for-getting-current-displayed-slice-on-a-red-window/35891 "2024-05-16T12:03:35Z")

</div>

Hi all! Would you please share to me python snippet on how to get a slice index which is shown on a red window? Please point me to similar post if already answered. I couldn’t find it though. Thanks a lot!

---

## [Retrieve the segmentation and source volume from Segment Editor (segmentEditorWidget)](https://discourse.slicer.org/t/retrieve-the-segmentation-and-source-volume-from-segment-editor-segmenteditorwidget/36162)

<div class="topic-metadata">

**Author:** [@waromero](https://discourse.slicer.org/u/waromero)\
**Replies:** 0\
**Last updated:** [May 15, 2024, 9:37am UTC](https://discourse.slicer.org/t/retrieve-the-segmentation-and-source-volume-from-segment-editor-segmenteditorwidget/36162 "2024-05-15T09:37:51Z")

</div>

Hello, I embedded the segmentEditorWidget from the Segment Editor module into my custom-made module. Now I want to retrieve the vtkMRMLScalarVolumeNode from the sourceVolumeNodeSelector; and the vtkMRMLSegmentationNode …

---

## [Colormap loading issue after scene save](https://discourse.slicer.org/t/colormap-loading-issue-after-scene-save/36147)

<div class="topic-metadata">

**Author:** [@connorh](https://discourse.slicer.org/u/connorh)\
**Replies:** 0\
**Last updated:** [May 14, 2024, 3:20pm UTC](https://discourse.slicer.org/t/colormap-loading-issue-after-scene-save/36147 "2024-05-14T15:20:49Z")

</div>

I’m creating custom colormaps for a tool I’ve developed. If I create a continuous colormap I can save the scene, close, reload, and the colormap works as expect. When I create discrete colormaps, it works initially, but…

---

## [Using async socket network](https://discourse.slicer.org/t/using-async-socket-network/35654)

<div class="topic-metadata">

**Author:** [@dael0207](https://discourse.slicer.org/u/dael0207)\
**Replies:** 6\
**Last updated:** [May 12, 2024, 3:51pm UTC](https://discourse.slicer.org/t/using-async-socket-network/35654 "2024-05-12T15:51:17Z")

</div>

Hello Slicer community. I’d like to incorporate a function within Slicer that asynchronously waits for reception. What I want is for the function to execute when Slicer is turned on, asynchronously wait for reception, …

---

## [SimpleITK WriteImage() fails \*silently\* when writing DICOM -- why? And what to do?](https://discourse.slicer.org/t/simpleitk-writeimage-fails-silently-when-writing-dicom-why-and-what-to-do/20369)

<div class="topic-metadata">

**Author:** [@masonbogue](https://discourse.slicer.org/u/masonbogue)\
**Replies:** 9\
**Last updated:** [May 11, 2024, 7:51am UTC](https://discourse.slicer.org/t/simpleitk-writeimage-fails-silently-when-writing-dicom-why-and-what-to-do/20369 "2024-05-11T07:51:22Z")

</div>

Here’s what’s happening (at the Slicer Python console): import SimpleITK as sitk sitk.WriteImage(slices\[0\], "C:\\\\Users\\\\username\\\\test\\\\0000.mhd") # works fine sitk.WriteImage(slices\[0\], "C:\\\\Users\\\\username\\\\test\\\\0000…

[Previous page](https://discourse.slicer.org/c/dev/5.md?no_subcategories=false&page=18)

[Next page](https://discourse.slicer.org/c/dev/5.md?no_subcategories=false&page=20)
