# Development

**URL:** https://discourse.slicer.org/c/dev/5.md?page=23

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

**Page:** 24

---

## [Slicer --no-main-window --python-script in windows command prompt not working](https://discourse.slicer.org/t/slicer-no-main-window-python-script-in-windows-command-prompt-not-working/6481)

<div class="topic-metadata">

**Author:** [@Allison\_Clement](https://discourse.slicer.org/u/Allison_Clement)\
**Replies:** 38\
**Last updated:** [March 15, 2024, 5:01pm UTC](https://discourse.slicer.org/t/slicer-no-main-window-python-script-in-windows-command-prompt-not-working/6481 "2024-03-15T17:01:17Z")

</div>

I am trying to submit a python code to slicer python interactor via the windows command line. I can run my slicer using --python-script mypath. When I add --no-main-window before the --python-script mypath, the code does…

---

## [Slicer doesn't print anything during for loops even with sys.stdout.flush()](https://discourse.slicer.org/t/slicer-doesnt-print-anything-during-for-loops-even-with-sys-stdout-flush/34914)

<div class="topic-metadata">

**Author:** [@leadro](https://discourse.slicer.org/u/leadro)\
**Replies:** 1\
**Last updated:** [March 15, 2024, 3:50pm UTC](https://discourse.slicer.org/t/slicer-doesnt-print-anything-during-for-loops-even-with-sys-stdout-flush/34914 "2024-03-15T15:50:05Z")

</div>

I’m developing a 3DSlicer extension that includes very long processes (huge for loops). I’d like to show the progress with a progressbar (like tqdm) or at least print some progress information at each iteration but nothi…

---

## [Converting 3D slicer obtained information into an oriented bounding box in Python (using simpleitk/vtk etc)](https://discourse.slicer.org/t/converting-3d-slicer-obtained-information-into-an-oriented-bounding-box-in-python-using-simpleitk-vtk-etc/34902)

<div class="topic-metadata">

**Author:** [@Poorvica\_Ramanand](https://discourse.slicer.org/u/Poorvica_Ramanand)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 6:24am UTC](https://discourse.slicer.org/t/converting-3d-slicer-obtained-information-into-an-oriented-bounding-box-in-python-using-simpleitk-vtk-etc/34902 "2024-03-15T06:24:36Z")

</div>

Greetings, I have exported statistical values as below into a CSV file of the CT Liver Segmentation. I wish to convert this information into a bounding box for organs by loading on Python externally in Jupyter/Google Co…

---

## [Segmentation memory size variations](https://discourse.slicer.org/t/segmentation-memory-size-variations/34862)

<div class="topic-metadata">

**Author:** [@SANTIAGO\_PENDON\_MING](https://discourse.slicer.org/u/SANTIAGO_PENDON_MING)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 8:21am UTC](https://discourse.slicer.org/t/segmentation-memory-size-variations/34862 "2024-03-14T08:21:39Z")

</div>

Hi to everyone. Today we’re concerned with segmentation memory sizes. We are using two different approaches to the same problem: linear (input driven) and non-linear (event/button driven). The main steps of the process…

---

## [BUG while saving data as bundle with no segments](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148)

<div class="topic-metadata">

**Author:** [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Replies:** 12\
**Last updated:** [March 14, 2024, 4:34am UTC](https://discourse.slicer.org/t/bug-while-saving-data-as-bundle-with-no-segments/34148 "2024-03-14T04:34:09Z")

</div>

Hello @lassoan @jcfr @pieper @jamesobutler, I loaded sample data with no segments and then saved it as a bundle. Next time when i load the bundled file and try to add my first segment the effects does not seem to work.…

---

## [Slicer's existing architecture](https://discourse.slicer.org/t/slicers-existing-architecture/34732)

<div class="topic-metadata">

**Author:** [@MJamal](https://discourse.slicer.org/u/MJamal)\
**Replies:** 6\
**Last updated:** [March 14, 2024, 4:30am UTC](https://discourse.slicer.org/t/slicers-existing-architecture/34732 "2024-03-14T04:30:27Z")

</div>

Is it possible to port slicer’s existing architecture from single-threaded to multi-threaded?

---

## [Running a Module in Parallel](https://discourse.slicer.org/t/running-a-module-in-parallel/12641)

<div class="topic-metadata">

**Author:** [@vertebrae](https://discourse.slicer.org/u/vertebrae)\
**Replies:** 19\
**Last updated:** [March 14, 2024, 3:34am UTC](https://discourse.slicer.org/t/running-a-module-in-parallel/12641 "2024-03-14T03:34:11Z")

</div>

Hello, I am currently using a python scripted module to run my vertebra segmentation program. The program uses a for loop to segment multiple fiducial points. This process takes a long time to run and I thought that run…

---

## [Create and save model as an STL file](https://discourse.slicer.org/t/create-and-save-model-as-an-stl-file/34880)

<div class="topic-metadata">

**Author:** [@eychoi](https://discourse.slicer.org/u/eychoi)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 8:39pm UTC](https://discourse.slicer.org/t/create-and-save-model-as-an-stl-file/34880 "2024-03-13T20:39:00Z")

</div>

Hi Experts, I’d like convert labels in a nifti volume into a model, then save the model as an STL file–all on the command line. I was able to create the model using the cli-module: ModelMaker. However, I don’t see a mod…

---

## [Converting a 2D numpy array to a VTK image](https://discourse.slicer.org/t/converting-a-2d-numpy-array-to-a-vtk-image/34825)

<div class="topic-metadata">

**Author:** [@yaraabdelazim](https://discourse.slicer.org/u/yaraabdelazim)\
**Replies:** 4\
**Last updated:** [March 12, 2024, 1:51pm UTC](https://discourse.slicer.org/t/converting-a-2d-numpy-array-to-a-vtk-image/34825 "2024-03-12T13:51:52Z")

</div>

Hello, I am trying to detect edges in a volume and therefore, I use OpenCV. After converting my slice to a numpy array and detecting the edges, I am able to display it in my Jupyter notebook. Here is the result I get: …

---

## [Where can I find code for functionalities like segmentation, registration etc](https://discourse.slicer.org/t/where-can-i-find-code-for-functionalities-like-segmentation-registration-etc/34831)

<div class="topic-metadata">

**Author:** [@Arun03Kumar](https://discourse.slicer.org/u/Arun03Kumar)\
**Replies:** 1\
**Last updated:** [March 12, 2024, 4:04am UTC](https://discourse.slicer.org/t/where-can-i-find-code-for-functionalities-like-segmentation-registration-etc/34831 "2024-03-12T04:04:14Z")

</div>

Dear 3D slicer family. I am learning the codebase for learning purpose, I learned some UI implementation techniques, but I want to create a toggle button in segmentation or in functionality tools section so that it init…

---

## [Slicer Segmentation inverted normals for closed surface representation](https://discourse.slicer.org/t/slicer-segmentation-inverted-normals-for-closed-surface-representation/34762)

<div class="topic-metadata">

**Author:** [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Replies:** 4\
**Last updated:** [March 11, 2024, 7:22am UTC](https://discourse.slicer.org/t/slicer-segmentation-inverted-normals-for-closed-surface-representation/34762 "2024-03-11T07:22:08Z")

</div>

Hi everyone, We have recently noticed a problem when exporting STL and OBJ from segmentations in Slicer. Depending on the Volume’s affine, the generated normals can point inside instead of outside. This doesn’t cause a…

---

## [Save view slices to .PNG or .jpeg](https://discourse.slicer.org/t/save-view-slices-to-png-or-jpeg/34806)

<div class="topic-metadata">

**Author:** [@joanne40226](https://discourse.slicer.org/u/joanne40226)\
**Replies:** 0\
**Last updated:** [March 10, 2024, 7:01am UTC](https://discourse.slicer.org/t/save-view-slices-to-png-or-jpeg/34806 "2024-03-10T07:01:22Z")

</div>

Hi community! I now need to save all of the slices from the Red node view. I can only do it by copy image manually. I’m wondering if I can do it in the python interactor to save all slices in a command? Thank you.

---

## [Failed to fetch models from remote server. make sure server address is correct and \<server\_uri\>/v1/models is accessible in browser](https://discourse.slicer.org/t/failed-to-fetch-models-from-remote-server-make-sure-server-address-is-correct-and-server-uri-v1-models-is-accessible-in-browser/26015)

<div class="topic-metadata">

**Author:** [@platanus](https://discourse.slicer.org/u/platanus)\
**Replies:** 9\
**Last updated:** [March 9, 2024, 5:20am UTC](https://discourse.slicer.org/t/failed-to-fetch-models-from-remote-server-make-sure-server-address-is-correct-and-server-uri-v1-models-is-accessible-in-browser/26015 "2024-03-09T05:20:50Z")

</div>

Hello. 3D-Slicer members. I have used well NVIDIA AIAA module in 3d-slicer since June first, 2022. However, it occurred some error nvidia aiaa module in 3d-slicer yesterday. The occurred error is as following. When …

---

## [Python code controls the display of a certain layer of slices in the view](https://discourse.slicer.org/t/python-code-controls-the-display-of-a-certain-layer-of-slices-in-the-view/34781)

<div class="topic-metadata">

**Author:** [@petit223](https://discourse.slicer.org/u/petit223)\
**Replies:** 0\
**Last updated:** [March 8, 2024, 3:05pm UTC](https://discourse.slicer.org/t/python-code-controls-the-display-of-a-certain-layer-of-slices-in-the-view/34781 "2024-03-08T15:05:01Z")

</div>

In the development of the 3D Slicer plug-in, I want to automatically display the corresponding slice on the Green view based on the serial number of the magnetic resonance image entered by the user (I don’t care about th…

---

## [Looking for old Slicer 3D source code with wxWidgets and VTK](https://discourse.slicer.org/t/looking-for-old-slicer-3d-source-code-with-wxwidgets-and-vtk/34752)

<div class="topic-metadata">

**Author:** [@keri](https://discourse.slicer.org/u/keri)\
**Replies:** 17\
**Last updated:** [March 8, 2024, 9:11am UTC](https://discourse.slicer.org/t/looking-for-old-slicer-3d-source-code-with-wxwidgets-and-vtk/34752 "2024-03-08T09:11:49Z")

</div>

Hi, The question is not about Slicer 3D but I remember I’ve read that Slicer used to be using wxWidgets before it was translated to Qt. Now there is a task to understand how can I combine wxWidgets with VTK (even I don…

---

## [Developing Universal Viewer](https://discourse.slicer.org/t/developing-universal-viewer/34756)

<div class="topic-metadata">

**Author:** [@Islam\_Ibrahim](https://discourse.slicer.org/u/Islam_Ibrahim)\
**Replies:** 1\
**Last updated:** [March 7, 2024, 3:02am UTC](https://discourse.slicer.org/t/developing-universal-viewer/34756 "2024-03-07T03:02:20Z")

</div>

I’m developing a universal viewer for all this plugins to work in concert if i need to make it commercial viewer how can i take permission from owner of the plugins 1- Total Segmentator 2- MONAI Auto3DSeg 3- OpenAnato…

---

## [Crop volume using python](https://discourse.slicer.org/t/crop-volume-using-python/30364)

<div class="topic-metadata">

**Author:** [@Mani\_Barathi](https://discourse.slicer.org/u/Mani_Barathi)\
**Replies:** 9\
**Last updated:** [March 7, 2024, 1:26am UTC](https://discourse.slicer.org/t/crop-volume-using-python/30364 "2024-03-07T01:26:53Z")

</div>

why some dicom data are not cropped in 3d slicer? Once after setting the ROI and click apply button, its not cropping the selected region. Please help to resolve this issue.

---

## [How to use Pycharm to create software with partial slicer functionality](https://discourse.slicer.org/t/how-to-use-pycharm-to-create-software-with-partial-slicer-functionality/34740)

<div class="topic-metadata">

**Author:** [@conffite](https://discourse.slicer.org/u/conffite)\
**Replies:** 0\
**Last updated:** [March 6, 2024, 1:23pm UTC](https://discourse.slicer.org/t/how-to-use-pycharm-to-create-software-with-partial-slicer-functionality/34740 "2024-03-06T13:23:11Z")

</div>

I have been stuck in this problem for a long time, and there are no steps to refer to online. Please help me, I need your guidance

---

## [Adding a new effect to the Segment Editor module](https://discourse.slicer.org/t/adding-a-new-effect-to-the-segment-editor-module/34717)

<div class="topic-metadata">

**Author:** [@yaraabdelazim](https://discourse.slicer.org/u/yaraabdelazim)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 9:23am UTC](https://discourse.slicer.org/t/adding-a-new-effect-to-the-segment-editor-module/34717 "2024-03-06T09:23:27Z")

</div>

Hello, I am trying to develop a SegmentEditor effect that works kind of like the Level Tracing effet but instead of detecting levels, it would detect the edges in the volume. However, I can’t really find any documentati…

---

## [Real-time tracking with Vicon](https://discourse.slicer.org/t/real-time-tracking-with-vicon/2781)

<div class="topic-metadata">

**Author:** [@val.dil](https://discourse.slicer.org/u/val.dil)\
**Replies:** 7\
**Last updated:** [March 5, 2024, 11:35am UTC](https://discourse.slicer.org/t/real-time-tracking-with-vicon/2781 "2024-03-05T11:35:23Z")

</div>

Hello! I want to develop an extension that aim to acquire in real time the position of some markers and visualize them on a MRI, this is in order to track the position of an electrode inside the brain during a brain sur…

---

## [What the "PATH"is?](https://discourse.slicer.org/t/what-the-path-is/34712)

<div class="topic-metadata">

**Author:** [@Tiam66](https://discourse.slicer.org/u/Tiam66)\
**Replies:** 0\
**Last updated:** [March 5, 2024, 9:03am UTC](https://discourse.slicer.org/t/what-the-path-is/34712 "2024-03-05T09:03:44Z")

</div>

when i installed a plugin from developer wizard,it showed a warningWARNING: The script jupyter-server.exe is installed in ‘D:\\slicer\\Slicer 5.6.1\\lib\\Python\\Scripts’ which is not on PATH."i wonder what the “PATH refer to…

---

## [File Save Behavior Query: TIFF Files Auto-Selecting on Second Save](https://discourse.slicer.org/t/file-save-behavior-query-tiff-files-auto-selecting-on-second-save/34665)

<div class="topic-metadata">

**Author:** [@Aram\_Harutyunyan](https://discourse.slicer.org/u/Aram_Harutyunyan)\
**Replies:** 2\
**Last updated:** [March 5, 2024, 8:15am UTC](https://discourse.slicer.org/t/file-save-behavior-query-tiff-files-auto-selecting-on-second-save/34665 "2024-03-05T08:15:29Z")

</div>

I’ve encountered a unexpected behavior in an application running on Ubuntu 22.04 , app version 5.7.0-2024-02-29 , and I’m trying to determine whether it’s a bug or an intended feature. The issue revolves around the proce…

---

## [How to add additional buttons to scriptedsegmenteditoreffect?](https://discourse.slicer.org/t/how-to-add-additional-buttons-to-scriptedsegmenteditoreffect/34151)

<div class="topic-metadata">

**Author:** [@tueboesen](https://discourse.slicer.org/u/tueboesen)\
**Replies:** 3\
**Last updated:** [March 4, 2024, 2:54pm UTC](https://discourse.slicer.org/t/how-to-add-additional-buttons-to-scriptedsegmenteditoreffect/34151 "2024-03-04T14:54:39Z")

</div>

I am creating an extension for segment editor using the scriptedsegmenteditoreffect, and I would like to add another button to the widget. I saw how the on\_apply button is added in setupOptionFrame and tried to add anot…

---

## [Calling SurfaceToolBox Logic Programatically](https://discourse.slicer.org/t/calling-surfacetoolbox-logic-programatically/34668)

<div class="topic-metadata">

**Author:** [@oothomas](https://discourse.slicer.org/u/oothomas)\
**Replies:** 1\
**Last updated:** [March 3, 2024, 6:58am UTC](https://discourse.slicer.org/t/calling-surfacetoolbox-logic-programatically/34668 "2024-03-03T06:58:41Z")

</div>

Hello everyone, I’ve been working on automating the cleaning of polygon models derived from segmentations and encountered a stumbling block. Specifically, I’m having trouble utilizing the logic from the SurfaceToolbox m…

---

## [Intrest in creating a slicing or splitting software using 3D slicer](https://discourse.slicer.org/t/intrest-in-creating-a-slicing-or-splitting-software-using-3d-slicer/34667)

<div class="topic-metadata">

**Author:** [@George\_z](https://discourse.slicer.org/u/George_z)\
**Replies:** 0\
**Last updated:** [March 3, 2024, 3:17am UTC](https://discourse.slicer.org/t/intrest-in-creating-a-slicing-or-splitting-software-using-3d-slicer/34667 "2024-03-03T03:17:40Z")

</div>

Hello, I am interested to know how to use your software to split large dicom files using this opensource also if I can extract or create images of any SOP class and transfer syntax Best Regards George

---

## [How to generate a .seg.nrrd file out of multiple STLs with Python?](https://discourse.slicer.org/t/how-to-generate-a-seg-nrrd-file-out-of-multiple-stls-with-python/34607)

<div class="topic-metadata">

**Author:** [@Dzemal](https://discourse.slicer.org/u/Dzemal)\
**Replies:** 5\
**Last updated:** [March 1, 2024, 5:06am UTC](https://discourse.slicer.org/t/how-to-generate-a-seg-nrrd-file-out-of-multiple-stls-with-python/34607 "2024-03-01T05:06:03Z")

</div>

Hi together, I’m trying to write a code snippet in Python for a pipeline that should generate a .seg.nrrd file by using the actual DICOM and the segmented STLs. In Slicer, I have performed this by using the module ‘Segm…

---

## [Calculation of centroid using image dimension,image spacing and image origin.](https://discourse.slicer.org/t/calculation-of-centroid-using-image-dimension-image-spacing-and-image-origin/34619)

<div class="topic-metadata">

**Author:** [@ebin1234](https://discourse.slicer.org/u/ebin1234)\
**Replies:** 0\
**Last updated:** [February 29, 2024, 5:55pm UTC](https://discourse.slicer.org/t/calculation-of-centroid-using-image-dimension-image-spacing-and-image-origin/34619 "2024-02-29T17:55:55Z")

</div>

I have a doubt in calculation of centroid using image dimension,image spacing and image origin. After that I have to place the 3D view in the center and anterior position . The camera should focus on this centroid . I di…

---

## [A single JPEG image in view](https://discourse.slicer.org/t/a-single-jpeg-image-in-view/34608)

<div class="topic-metadata">

**Author:** [@bzhu](https://discourse.slicer.org/u/bzhu)\
**Replies:** 1\
**Last updated:** [February 29, 2024, 3:20pm UTC](https://discourse.slicer.org/t/a-single-jpeg-image-in-view/34608 "2024-02-29T15:20:34Z")

</div>

I created a customized grid layout, in which most views are used to view nifti files generated from different algorithms and one view is used to display a JPEG file showing analysis/comparison result of the algorithms. …

---

## [How to load FreeSurfer surface files in correct position using Python script](https://discourse.slicer.org/t/how-to-load-freesurfer-surface-files-in-correct-position-using-python-script/13183)

<div class="topic-metadata">

**Author:** [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Replies:** 4\
**Last updated:** [February 28, 2024, 10:17pm UTC](https://discourse.slicer.org/t/how-to-load-freesurfer-surface-files-in-correct-position-using-python-script/13183 "2024-02-28T22:17:17Z")

</div>

Hello, am writing a module which uses FreeSurfer segmentations and surface files. Empirically and based on another discourse post (Nifti file and freesurfer pial file mismatch in slicer) I had previously developed a tra…

---

## [How to mark some strings as translatable?](https://discourse.slicer.org/t/how-to-mark-some-strings-as-translatable/34008)

<div class="topic-metadata">

**Author:** [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Replies:** 11\
**Last updated:** [February 28, 2024, 8:47pm UTC](https://discourse.slicer.org/t/how-to-mark-some-strings-as-translatable/34008 "2024-02-28T20:47:52Z")

</div>

Hi, Python modules generated by the extension wizard are using the ‘\_()’ function for strings to be translated. The simple use case is obvious: \_(“T e x t”). How do we mark formatted strings with runtime place holders…

[Previous page](https://discourse.slicer.org/c/dev/5.md?page=22)

[Next page](https://discourse.slicer.org/c/dev/5.md?page=24)
