# Development

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

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

**Page:** 91

---

## [How to get current segmentation master volume?](https://discourse.slicer.org/t/how-to-get-current-segmentation-master-volume/12538)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 2\
**Last updated:** [July 15, 2020, 1:12pm UTC](https://discourse.slicer.org/t/how-to-get-current-segmentation-master-volume/12538 "2020-07-15T13:12:41Z")

</div>

Hello! Thank you for all the help @Sunderlandkyl @lassoan - we got our module to work. Our very last question is when we assign our masterVolumeNode right now: masterVolumeNode = SampleData.SampleDataLogic().downloadCT…

---

## [Texts module does not observe changed nodes](https://discourse.slicer.org/t/texts-module-does-not-observe-changed-nodes/12533)

<div class="topic-metadata">

**Author:** [@joachim](https://discourse.slicer.org/u/joachim)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 3:03pm UTC](https://discourse.slicer.org/t/texts-module-does-not-observe-changed-nodes/12533 "2020-07-14T15:03:17Z")

</div>

I’m working on adding Markdown and HTML support for the Texts module. This module works on vtkMRMLTextNode nodes. If I change such a node outside the Texts module GUI by adding an attribute using the Data module or progr…

---

## [Running Test Class - Python Scripted Module](https://discourse.slicer.org/t/running-test-class-python-scripted-module/12506)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 18\
**Last updated:** [July 14, 2020, 2:38pm UTC](https://discourse.slicer.org/t/running-test-class-python-scripted-module/12506 "2020-07-14T14:38:21Z")

</div>

Hello! We have finished our code and tested it manually through the Python interactor. Now, we are attempting to run it through a module, so it is just a click of the button. In the testing class in our python file, do w…

---

## [Error downloading SampleData](https://discourse.slicer.org/t/error-downloading-sampledata/12526)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 1:24pm UTC](https://discourse.slicer.org/t/error-downloading-sampledata/12526 "2020-07-14T13:24:48Z")

</div>

Hello, when I try and download SampleData, I get this error: Traceback (most recent call last): File “/Applications/Slicer.app/Contents/lib/Slicer-4.11/qt-scripted-modules/SampleData.py”, line 356, in b.connect(‘clic…

---

## [How to add black boundaries around the Volume?](https://discourse.slicer.org/t/how-to-add-black-boundaries-around-the-volume/12516)

<div class="topic-metadata">

**Author:** [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 4:11am UTC](https://discourse.slicer.org/t/how-to-add-black-boundaries-around-the-volume/12516 "2020-07-14T04:11:39Z")

</div>

Hello, I have a model and I convert it into a Scalar Volume, but I want to add some extra black space around. Please check the picture. Is this possible? Thanks

---

## [LOTS of Camera nodes?](https://discourse.slicer.org/t/lots-of-camera-nodes/12512)

<div class="topic-metadata">

**Author:** [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Replies:** 2\
**Last updated:** [July 13, 2020, 8:22pm UTC](https://discourse.slicer.org/t/lots-of-camera-nodes/12512 "2020-07-13T20:22:22Z")

</div>

My current scene has somewhere around 45 camera nodes, nearly all of them named “Camera”, although I have 10 "Default Scene Camera"s and 4 "Camera\_1"s, in addition to a Camera\_2, Camera\_3, and Camera\_4. Where do these a…

---

## [Interaction with the plot](https://discourse.slicer.org/t/interaction-with-the-plot/12379)

<div class="topic-metadata">

**Author:** [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Replies:** 10\
**Last updated:** [July 13, 2020, 12:02pm UTC](https://discourse.slicer.org/t/interaction-with-the-plot/12379 "2020-07-13T12:02:05Z")

</div>

Dear Developers, I am developing an app in Slicer to show continuously updated histogram of the data. So far I have managed to achieve this by using plot module: https://www.slicer.org/wiki/Documentation/Nightly/Develo…

---

## [Overlay color onto vtkMRMLScalarVolumeNode image](https://discourse.slicer.org/t/overlay-color-onto-vtkmrmlscalarvolumenode-image/12481)

<div class="topic-metadata">

**Author:** [@rohan\_n](https://discourse.slicer.org/u/rohan_n)\
**Replies:** 4\
**Last updated:** [July 10, 2020, 9:55pm UTC](https://discourse.slicer.org/t/overlay-color-onto-vtkmrmlscalarvolumenode-image/12481 "2020-07-10T21:55:33Z")

</div>

For a Slicer module I am developing, the user selects which image they want to use as an input by selecting its vtkMRMLScalarVolumeNode from a dropdown menu. Then, the user presses a button to colorize the tumor on that…

---

## [Importing DICOM files in my own module C++](https://discourse.slicer.org/t/importing-dicom-files-in-my-own-module-c/12455)

<div class="topic-metadata">

**Author:** [@DavidCai1246](https://discourse.slicer.org/u/DavidCai1246)\
**Replies:** 5\
**Last updated:** [July 10, 2020, 9:05pm UTC](https://discourse.slicer.org/t/importing-dicom-files-in-my-own-module-c/12455 "2020-07-10T21:05:48Z")

</div>

I would like to import DICOM files in my own module by calling the import function in the “DICOM” module without actually switching to the “DICOM” module. Is this possible to do? I was thinking of calling the import fun…

---

## ["Locking" the slider for a slice](https://discourse.slicer.org/t/locking-the-slider-for-a-slice/12480)

<div class="topic-metadata">

**Author:** [@rohan\_n](https://discourse.slicer.org/u/rohan_n)\
**Replies:** 2\
**Last updated:** [July 10, 2020, 6:38pm UTC](https://discourse.slicer.org/t/locking-the-slider-for-a-slice/12480 "2020-07-10T18:38:34Z")

</div>

Is there a way to restrict which slices the user can view? For example, configure the red slice’s slider (lock it in place) so that the user cannot view anything other than the center axial slice of the image. If so, wha…

---

## [Search the closest point](https://discourse.slicer.org/t/search-the-closest-point/12470)

<div class="topic-metadata">

**Author:** [@loubna](https://discourse.slicer.org/u/loubna)\
**Replies:** 3\
**Last updated:** [July 10, 2020, 5:36pm UTC](https://discourse.slicer.org/t/search-the-closest-point/12470 "2020-07-10T17:36:39Z")

</div>

Hi; I have found many spatial locators like : vtkPointLocator, vtkKdTree, and vtkOctreePointLocator, but I am confused about the most efficent one. I have a polydata from which I construct a vtkImageData using some fil…

---

## [How to Load anyway option](https://discourse.slicer.org/t/how-to-load-anyway-option/12479)

<div class="topic-metadata">

**Author:** [@Anand\_Mulay](https://discourse.slicer.org/u/Anand_Mulay)\
**Replies:** 1\
**Last updated:** [July 10, 2020, 4:43pm UTC](https://discourse.slicer.org/t/how-to-load-anyway-option/12479 "2020-07-10T16:43:34Z")

</div>

How can i pass this option when i’m loading the scalarVolume thought a script. this is my code in script DSVPC = DICOMScalarVolumePluginClass() db = slicer.dicomDatabase if(db.patients()): …

---

## [Slicer Local Threshold Scripted Effect Error](https://discourse.slicer.org/t/slicer-local-threshold-scripted-effect-error/12463)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 8\
**Last updated:** [July 10, 2020, 3:49pm UTC](https://discourse.slicer.org/t/slicer-local-threshold-scripted-effect-error/12463 "2020-07-10T15:49:47Z")

</div>

When we run our code in the Python interactor, our code enters an infinite error sequence pointing to line 75 in SegmentEditorEffect.py This line reads: r,g,b = segmentationNode.GetSegmentation().GetSegment(segmentID).G…

---

## [Extract all 2D slices from Binary labelMap](https://discourse.slicer.org/t/extract-all-2d-slices-from-binary-labelmap/12417)

<div class="topic-metadata">

**Author:** [@loubna](https://discourse.slicer.org/u/loubna)\
**Replies:** 2\
**Last updated:** [July 9, 2020, 6:46pm UTC](https://discourse.slicer.org/t/extract-all-2d-slices-from-binary-labelmap/12417 "2020-07-09T18:46:51Z")

</div>

Hi, I have 3D vtkImageData (binarylabelMap) from which, I want extract all 2D slices. How can I do that thank’s in advance

---

## [Changing Input/Ouput for Module from Volume Nodes to Directories](https://discourse.slicer.org/t/changing-input-ouput-for-module-from-volume-nodes-to-directories/12469)

<div class="topic-metadata">

**Author:** [@lennymartinez](https://discourse.slicer.org/u/lennymartinez)\
**Replies:** 1\
**Last updated:** [July 9, 2020, 5:49pm UTC](https://discourse.slicer.org/t/changing-input-ouput-for-module-from-volume-nodes-to-directories/12469 "2020-07-09T17:49:46Z")

</div>

Hi, working on the GUI for an extension. It was originally a CLI extension that took in an input directory of dcm files and an ouput directory for storing an obj file made with dcm images. Trying to do the same thing but…

---

## [Cannot serialize a bytes object larger than 4 GiB - shelve](https://discourse.slicer.org/t/cannot-serialize-a-bytes-object-larger-than-4-gib-shelve/12454)

<div class="topic-metadata">

**Author:** [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Replies:** 3\
**Last updated:** [July 9, 2020, 5:21pm UTC](https://discourse.slicer.org/t/cannot-serialize-a-bytes-object-larger-than-4-gib-shelve/12454 "2020-07-09T17:21:15Z")

</div>

Hello, I am trying to run partial incremental PCA with the following decomposer.partial\_fit But I get the following error when I trying this: file\[‘eigenModes’\] = decomposer.components\_ OverflowError: cannot seri…

---

## [Looping Over Segmentation Algorithm Targets Wrong Segment](https://discourse.slicer.org/t/looping-over-segmentation-algorithm-targets-wrong-segment/12459)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 2\
**Last updated:** [July 9, 2020, 3:20pm UTC](https://discourse.slicer.org/t/looping-over-segmentation-algorithm-targets-wrong-segment/12459 "2020-07-09T15:20:43Z")

</div>

We have got our segmentation algorithm working! Now we are looping over it to allow doctors to segment multiple vertebrae. Whenever we run our code in a for loop, the seed around the second point, F-2(purple in the diagr…

---

## [Python - Editing Feature Size Local Threshold](https://discourse.slicer.org/t/python-editing-feature-size-local-threshold/12393)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 24\
**Last updated:** [July 9, 2020, 12:30pm UTC](https://discourse.slicer.org/t/python-editing-feature-size-local-threshold/12393 "2020-07-09T12:30:03Z")

</div>

In the local threshold code on GitHub, there is a function updateMRMLfromGUI: def updateMRMLFromGUI(self): SegmentEditorThresholdEffect.updateMRMLFromGUI(self) minimumDiameterMm = self.minimumDiameterSpinBox.value sel…

---

## [Python Set MasterVolumeNode](https://discourse.slicer.org/t/python-set-mastervolumenode/12437)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 0\
**Last updated:** [July 8, 2020, 1:42pm UTC](https://discourse.slicer.org/t/python-set-mastervolumenode/12437 "2020-07-08T13:42:31Z")

</div>

Is the masterVolumeNode automatically set to the only master volume? For example, if a user were to upload their own data called Chest(Chest.nrrd), how would I set the masterVolumeNode to Chest(without using the name of …

---

## [Markups Node Table for vtkMRMLMarkupsLineNode](https://discourse.slicer.org/t/markups-node-table-for-vtkmrmlmarkupslinenode/12338)

<div class="topic-metadata">

**Author:** [@EricM](https://discourse.slicer.org/u/EricM)\
**Replies:** 2\
**Last updated:** [July 8, 2020, 1:16pm UTC](https://discourse.slicer.org/t/markups-node-table-for-vtkmrmlmarkupslinenode/12338 "2020-07-08T13:16:57Z")

</div>

Hello Slicer Community, I’m trying to include a module where annotators can draw major and minor axes on brain images. I found that the vtkMRMLMarkupsLineNode does just the job. In Slicer 4.11 (not sure about previous v…

---

## [Python Module Logic Class](https://discourse.slicer.org/t/python-module-logic-class/12415)

<div class="topic-metadata">

**Author:** [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Replies:** 3\
**Last updated:** [July 7, 2020, 7:26pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415 "2020-07-07T19:26:49Z")

</div>

Hello! We are working on testing our module, but it only sets the image to the FA.nrrd because of the ScriptedLoadableModuleTest. As you can see, our code uses a pre-placed fiducial point to create a segment around it…

---

## [Import label map to segmentation with names](https://discourse.slicer.org/t/import-label-map-to-segmentation-with-names/12414)

<div class="topic-metadata">

**Author:** [@Niels](https://discourse.slicer.org/u/Niels)\
**Replies:** 0\
**Last updated:** [July 7, 2020, 1:11pm UTC](https://discourse.slicer.org/t/import-label-map-to-segmentation-with-names/12414 "2020-07-07T13:11:56Z")

</div>

I am using python for my module and I am exporting my label map to a segmentation. The names of the segments seem to get numbers but I want them to have names after the import. Is that possible? slicer.modules.segmenta…

---

## [Assign specific index to segment](https://discourse.slicer.org/t/assign-specific-index-to-segment/12402)

<div class="topic-metadata">

**Author:** [@pieper](https://discourse.slicer.org/u/pieper)\
**Replies:** 2\
**Last updated:** [July 6, 2020, 8:05pm UTC](https://discourse.slicer.org/t/assign-specific-index-to-segment/12402 "2020-07-06T20:05:47Z")

</div>

@Sunderlandkyl, do we have a way to set a specific labelmap index number to a segment? That is, we are trying to pass nrrd files to another program and want to use a convention something like 1-10 are various specific s…

---

## [Getting file name from a DICOM slice](https://discourse.slicer.org/t/getting-file-name-from-a-dicom-slice/12364)

<div class="topic-metadata">

**Author:** [@DavidCai1246](https://discourse.slicer.org/u/DavidCai1246)\
**Replies:** 7\
**Last updated:** [July 6, 2020, 7:04pm UTC](https://discourse.slicer.org/t/getting-file-name-from-a-dicom-slice/12364 "2020-07-06T19:04:49Z")

</div>

I would like to get a filename/path from a particular slice of a dicom image. For example I have loaded a DICOM file with several hundred slices and I would like to get the filename/path of a particular slice. I have we…

---

## [Creating a plane with an origin in the middle](https://discourse.slicer.org/t/creating-a-plane-with-an-origin-in-the-middle/12373)

<div class="topic-metadata">

**Author:** [@talmazov](https://discourse.slicer.org/u/talmazov)\
**Replies:** 1\
**Last updated:** [July 4, 2020, 3:23pm UTC](https://discourse.slicer.org/t/creating-a-plane-with-an-origin-in-the-middle/12373 "2020-07-04T15:23:14Z")

</div>

Hey, I am trying to create a plane with an origin/center set in the middle (ie. 0.5x\_length, 0.5y\_length). I don’t have a problem creating a plane, playing around with set center and origin yield weird results, the onl…

---

## [Slicer crashes during loading, error in Python?](https://discourse.slicer.org/t/slicer-crashes-during-loading-error-in-python/1470)

<div class="topic-metadata">

**Author:** [@terajnol](https://discourse.slicer.org/u/terajnol)\
**Replies:** 17\
**Last updated:** [July 4, 2020, 3:30am UTC](https://discourse.slicer.org/t/slicer-crashes-during-loading-error-in-python/1470 "2020-07-04T03:30:35Z")

</div>

Hi everyone, I am a brand new user of Slicer 3D and I first want to tell you I am amazed by this soft! A lots of people did a great job ! I am actually editing a scripted module with Python, and after a minor change, I…

---

## [Transform does not match VTM matrix array](https://discourse.slicer.org/t/transform-does-not-match-vtm-matrix-array/12370)

<div class="topic-metadata">

**Author:** [@talmazov](https://discourse.slicer.org/u/talmazov)\
**Replies:** 2\
**Last updated:** [July 4, 2020, 3:25am UTC](https://discourse.slicer.org/t/transform-does-not-match-vtm-matrix-array/12370 "2020-07-04T03:25:24Z")

</div>

I am obtaining a plane’s transform matrix then trying to use it elsewhere transform = slicer.vtkMRMLTransformNode() transform.SetName(model.GetName()+‘\_trans’) slicer.mrmlScene.AddNode(transform) model.SetAndObserveT…

---

## [Access an object between modules/extensions in python](https://discourse.slicer.org/t/access-an-object-between-modules-extensions-in-python/12351)

<div class="topic-metadata">

**Author:** [@talmazov](https://discourse.slicer.org/u/talmazov)\
**Replies:** 7\
**Last updated:** [July 4, 2020, 2:59am UTC](https://discourse.slicer.org/t/access-an-object-between-modules-extensions-in-python/12351 "2020-07-04T02:59:59Z")

</div>

Hey all, If I have module\_A that I have previously used and have some generic object within it, how can I access that object in module\_A from module\_B? I know I can use another module/extension’s logic but I need to ac…

---

## ["QOpenGLWidget: Failed to create context" and "composeAndFlush: QOpenGLContext creation failed" and "composeAndFlush: makeCurrent() failed"](https://discourse.slicer.org/t/qopenglwidget-failed-to-create-context-and-composeandflush-qopenglcontext-creation-failed-and-composeandflush-makecurrent-failed/12327)

<div class="topic-metadata">

**Author:** [@Lee\_Newberg](https://discourse.slicer.org/u/Lee_Newberg)\
**Replies:** 17\
**Last updated:** [July 3, 2020, 9:37pm UTC](https://discourse.slicer.org/t/qopenglwidget-failed-to-create-context-and-composeandflush-qopenglcontext-creation-failed-and-composeandflush-makecurrent-failed/12327 "2020-07-03T21:37:26Z")

</div>

I can run Slicer if I download binaries, but when I try to build from sources and then run it, I am getting errors. Any thoughts on what I should do differently? I get these errors whether I build using Qt-5.12.9 or Qt…

---

## [Automated Spinal Cord Segmentation](https://discourse.slicer.org/t/automated-spinal-cord-segmentation/3161)

<div class="topic-metadata">

**Author:** [@Hikmat](https://discourse.slicer.org/u/Hikmat)\
**Replies:** 10\
**Last updated:** [July 3, 2020, 7:14pm UTC](https://discourse.slicer.org/t/automated-spinal-cord-segmentation/3161 "2020-07-03T19:14:05Z")

</div>

Slicer version: 4.8.1 Hi, I am aiming to automate spinal cord segmentation from MR images. I have been using Spinal Cord Toolbox (SCT); a Linux-based open-source software dedicated specifically to the processing and an…

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

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