# \#matlab

**URL:** https://discourse.slicer.org/tag/matlab/59.md

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

---

## [Matlab -- Slicer](https://discourse.slicer.org/t/matlab-slicer/41688)

<div class="topic-metadata">

**Author:** [@Fayez](https://discourse.slicer.org/u/Fayez)\
**Replies:** 1\
**Last updated:** [February 14, 2025, 3:01am UTC](https://discourse.slicer.org/t/matlab-slicer/41688 "2025-02-14T03:01:23Z")

</div>

Hi Everyone, I have a matlab script that reads and import data into matlab. I want to load these files from matlab script into slider environment via the matlab code. Is this possible ? Thanks

---

## [Lung segmentation using monai auto3dseg on matlab](https://discourse.slicer.org/t/lung-segmentation-using-monai-auto3dseg-on-matlab/37054)

<div class="topic-metadata">

**Author:** [@sasurgan](https://discourse.slicer.org/u/sasurgan)\
**Replies:** 2\
**Last updated:** [June 27, 2024, 3:11am UTC](https://discourse.slicer.org/t/lung-segmentation-using-monai-auto3dseg-on-matlab/37054 "2024-06-27T03:11:38Z")

</div>

I want to use the monai auto3dseg lung model on matlab, I could not find the pre-trained model on the internet. I can access it as model.pt from the Slicer 3D cache folder but I am not sure how to use it. Can anyone help…

---

## [How to contribute my Matlab coding into 3D Slicer](https://discourse.slicer.org/t/how-to-contribute-my-matlab-coding-into-3d-slicer/33765)

<div class="topic-metadata">

**Author:** [@akmal871026](https://discourse.slicer.org/u/akmal871026)\
**Replies:** 2\
**Last updated:** [January 15, 2024, 5:33am UTC](https://discourse.slicer.org/t/how-to-contribute-my-matlab-coding-into-3d-slicer/33765 "2024-01-15T05:33:29Z")

</div>

Dear All, I have some code in Matlab syntax. This is about the segmentation tumor on Iodine-131 SPECT imaging. Anyone know how to contribute my coding into 3D Slicer? What I meant is I want put into the extension mana…

---

## [Slicer to Matlab IGTLink Connection](https://discourse.slicer.org/t/slicer-to-matlab-igtlink-connection/30189)

<div class="topic-metadata">

**Author:** [@LauraConnolly1](https://discourse.slicer.org/u/LauraConnolly1)\
**Replies:** 1\
**Last updated:** [June 23, 2023, 12:38am UTC](https://discourse.slicer.org/t/slicer-to-matlab-igtlink-connection/30189 "2023-06-23T00:38:05Z")

</div>

Hi there! We’re trying to connect 3D Slicer to Matlab using a controller code written in 2018. I’m a bit confused about how to set up the server connection from 3D Slicer to Matlab in the Matlab Commander module. We cha…

---

## [Load nii volumes from 3d Slicer to Matlab](https://discourse.slicer.org/t/load-nii-volumes-from-3d-slicer-to-matlab/29685)

<div class="topic-metadata">

**Author:** [@Anatole](https://discourse.slicer.org/u/Anatole)\
**Replies:** 1\
**Last updated:** [May 27, 2023, 3:58am UTC](https://discourse.slicer.org/t/load-nii-volumes-from-3d-slicer-to-matlab/29685 "2023-05-27T03:58:11Z")

</div>

Operating system: Windows 10 Slicer version: 3D Slicer 5.2.2.2 Expected behavior: Get the same volumes with the same absolute position in world coordinates from 3d Slicer in Matlab Actual behavior: Get a slight positi…

---

## [Reformat module keeps switching images back](https://discourse.slicer.org/t/reformat-module-keeps-switching-images-back/27691)

<div class="topic-metadata">

**Author:** [@scrmc](https://discourse.slicer.org/u/scrmc)\
**Replies:** 1\
**Last updated:** [February 7, 2023, 9:59pm UTC](https://discourse.slicer.org/t/reformat-module-keeps-switching-images-back/27691 "2023-02-07T21:59:31Z")

</div>

Hi all, I’m experiencing a somewhat strange issue with the Reformat module. Although I know it isn’t recommended, I unfortunately must read .mat files into Slicer. For some reason these are rotated when I first read the…

---

## [MatlabBridge - empty volume by default instead of no volume](https://discourse.slicer.org/t/matlabbridge-empty-volume-by-default-instead-of-no-volume/27525)

<div class="topic-metadata">

**Author:** [@georg](https://discourse.slicer.org/u/georg)\
**Replies:** 2\
**Last updated:** [January 29, 2023, 4:37pm UTC](https://discourse.slicer.org/t/matlabbridge-empty-volume-by-default-instead-of-no-volume/27525 "2023-01-29T16:37:55Z")

</div>

Dear 3D-Slicer community, I am developing an extension using MatlabBridge which involves loading 3D and 4D images into 3D-Slicer. I adapted the automatically generated Matlab function to do so, but unfortunately it only …

---

## [Difference in STL file exported from 3DSlicer and created in Matlab](https://discourse.slicer.org/t/difference-in-stl-file-exported-from-3dslicer-and-created-in-matlab/25850)

<div class="topic-metadata">

**Author:** [@SimoneCR](https://discourse.slicer.org/u/SimoneCR)\
**Replies:** 18\
**Last updated:** [October 26, 2022, 5:46pm UTC](https://discourse.slicer.org/t/difference-in-stl-file-exported-from-3dslicer-and-created-in-matlab/25850 "2022-10-26T17:46:18Z")

</div>

I have a 512x512x331 DICOM volume of a CT scan, with voxel size of 0.723x0.723x0.8. I manually segmented (Region Growing) it in 3DSlicer to retain the femur head only. Exporting this segment to STL file, I can see that i…

---

## [Need help making a 3D mesh given co-ordinates of the vertices and vertex indices of each face for 3D Slicer - trimesh/vtkwrite/etc](https://discourse.slicer.org/t/need-help-making-a-3d-mesh-given-co-ordinates-of-the-vertices-and-vertex-indices-of-each-face-for-3d-slicer-trimesh-vtkwrite-etc/24536)

<div class="topic-metadata">

**Author:** [@jsalas424](https://discourse.slicer.org/u/jsalas424)\
**Replies:** 2\
**Last updated:** [July 28, 2022, 3:19pm UTC](https://discourse.slicer.org/t/need-help-making-a-3d-mesh-given-co-ordinates-of-the-vertices-and-vertex-indices-of-each-face-for-3d-slicer-trimesh-vtkwrite-etc/24536 "2022-07-28T15:19:45Z")

</div>

Hi all, Given the following data: The Cartesian co-ordinates of the vertices in the surface mesh: n vertices x 3 The vertex indices of each face in the surface mesh: n faces x 3 I’m trying to make some 3D file that I…

---

## [Issue loading VTK file](https://discourse.slicer.org/t/issue-loading-vtk-file/24469)

<div class="topic-metadata">

**Author:** [@jsalas424](https://discourse.slicer.org/u/jsalas424)\
**Replies:** 3\
**Last updated:** [July 24, 2022, 9:46pm UTC](https://discourse.slicer.org/t/issue-loading-vtk-file/24469 "2022-07-24T21:46:48Z")

</div>

Hello, I generated a VTK file matlab using vtkwrite from triangle mesh data. The raw data looks like this: 16.2150000000000 13.2360000000000 126.065000000000 16.1490000000000 14.2370000000000 125.708000000000 16.8430…

---

## [Completed with errors ](https://discourse.slicer.org/t/completed-with-errors/23580)

<div class="topic-metadata">

**Author:** [@maria\_2000](https://discourse.slicer.org/u/maria_2000)\
**Replies:** 2\
**Last updated:** [May 25, 2022, 8:59am UTC](https://discourse.slicer.org/t/completed-with-errors/23580 "2022-05-25T08:59:02Z")

</div>

Hi.When I use the Matlab Module Generator I’m facing with these errors. How can I solve these errors? ERROR: Unable to find Matlab executable defined in the SLICER\_MATLAB\_EXECUTABLE\_PATH environment variable: 0 ERROR: …

---

## [Reading Matlab mat file into 3D Slicer](https://discourse.slicer.org/t/reading-matlab-mat-file-into-3d-slicer/1987)

<div class="topic-metadata">

**Author:** [@marasov](https://discourse.slicer.org/u/marasov)\
**Replies:** 5\
**Last updated:** [April 24, 2022, 3:51am UTC](https://discourse.slicer.org/t/reading-matlab-mat-file-into-3d-slicer/1987 "2022-04-24T03:51:51Z")

</div>

Hello! I made several X-ray images of a metal ball of different density from different angles. Then I applied CBCT reconstruction to them and got a \*.mat file. 3D Cone beam CT (CBCT) projection backprojection FDK, ite…

---

## [Extensions from github](https://discourse.slicer.org/t/extensions-from-github/17421)

<div class="topic-metadata">

**Author:** [@KAVIYA\_DHARSHINI](https://discourse.slicer.org/u/KAVIYA_DHARSHINI)\
**Replies:** 4\
**Last updated:** [May 4, 2021, 2:31am UTC](https://discourse.slicer.org/t/extensions-from-github/17421 "2021-05-04T02:31:05Z")

</div>

Operating system:Windows 64 bit Slicer version: 4.13 Expected behavior: Matlab bridge extensions visible under developer tools after getting cloned from github. Actual behavior: not able to find the matlab bridge exte…

---

## [MatlabBridge, MatlabCommander problems](https://discourse.slicer.org/t/matlabbridge-matlabcommander-problems/15074)

<div class="topic-metadata">

**Author:** [@DimaLat](https://discourse.slicer.org/u/DimaLat)\
**Replies:** 0\
**Last updated:** [December 15, 2020, 2:05pm UTC](https://discourse.slicer.org/t/matlabbridge-matlabcommander-problems/15074 "2020-12-15T14:05:33Z")

</div>

Operating system: Windows Slicer version: 4.11 Expected behavior: My Matlab module is woking and giving a Matlab files Actual behavior: My Matlab module is not working and not saving files, its just openinig one more …

---

## [ROI to IJK coordinates with MATLAB bridge](https://discourse.slicer.org/t/roi-to-ijk-coordinates-with-matlab-bridge/14764)

<div class="topic-metadata">

**Author:** [@OscarD](https://discourse.slicer.org/u/OscarD)\
**Replies:** 1\
**Last updated:** [December 4, 2020, 9:06am UTC](https://discourse.slicer.org/t/roi-to-ijk-coordinates-with-matlab-bridge/14764 "2020-12-04T09:06:04Z")

</div>

Operating system: Windows 10 Slicer version: 4.11.0 Expected behavior: Find IJK coordinates of ROI Actual behavior: I get negative or bigger than dimensions IJK coordinates Dear slicers, I am trying to get iMin, iMa…

---

## [Matlab Bridge Module Creation](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687)

<div class="topic-metadata">

**Author:** [@aginn](https://discourse.slicer.org/u/aginn)\
**Replies:** 3\
**Last updated:** [August 7, 2018, 9:10pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687 "2018-08-07T21:10:22Z")

</div>

Hi all, I am relatively new to 3D Slicer and Matlab Bridge. I have been using Matlab Bridge to create a custom module to cut down on my segmentation times. Is there a way to call and execute a pre-existing 3D Slicer Mo…

---

## [Convert Matlab coordinates to Slicer](https://discourse.slicer.org/t/convert-matlab-coordinates-to-slicer/7163)

<div class="topic-metadata">

**Author:** [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Replies:** 7\
**Last updated:** [June 18, 2019, 7:24pm UTC](https://discourse.slicer.org/t/convert-matlab-coordinates-to-slicer/7163 "2019-06-18T19:24:00Z")

</div>

Hello, I would like to convert Matlab coordinates to Slicer. I load Dicom images to Matlab and I get some coordinates. Then, I try to load them on Slicer, but both are in a completely different position. Could you pl…

---

## [How to import a slicer segmentation into other tools like matlab?](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958)

<div class="topic-metadata">

**Author:** [@Chongran\_Sun](https://discourse.slicer.org/u/Chongran_Sun)\
**Replies:** 2\
**Last updated:** [August 31, 2018, 5:08pm UTC](https://discourse.slicer.org/t/how-to-import-a-slicer-segmentation-into-other-tools-like-matlab/3958 "2018-08-31T17:08:53Z")

</div>

Operating system: Mac OS Slicer version: 4.8.1 Expected behavior: I saved my tumor segmentation as a nrrd file or seg.nrrd file and open them in other tools (MRIcron, matlab). When I open the segmentation, I need t…

---

## [Loading in a segmentation generated outside slicer (on matlab)](https://discourse.slicer.org/t/loading-in-a-segmentation-generated-outside-slicer-on-matlab/3556)

<div class="topic-metadata">

**Author:** [@Nassir](https://discourse.slicer.org/u/Nassir)\
**Replies:** 2\
**Last updated:** [July 22, 2018, 9:23pm UTC](https://discourse.slicer.org/t/loading-in-a-segmentation-generated-outside-slicer-on-matlab/3556 "2018-07-22T21:23:17Z")

</div>

Hey guys! I’m trying to load a scalar volume that was exported out of slicer, “WHS\_SD\_rat\_atlas\_v2\_original”, back in as a segmentation. The whole reason I am doing this is to avoid manually defining the segments. To do…

---

## [Calling in a .mat object into 3D Slicer](https://discourse.slicer.org/t/calling-in-a-mat-object-into-3d-slicer/1492)

<div class="topic-metadata">

**Author:** [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Replies:** 2\
**Last updated:** [November 20, 2017, 3:26pm UTC](https://discourse.slicer.org/t/calling-in-a-mat-object-into-3d-slicer/1492 "2017-11-20T15:26:31Z")

</div>

I was wondering if Slicer has any functionality for calling in a .mat object into the program. I know that there is a MATLAB bridge, does this have the capability of calling in these objects?

---

## [Matlab Functions for Interacting with Slicer Data?](https://discourse.slicer.org/t/matlab-functions-for-interacting-with-slicer-data/786)

<div class="topic-metadata">

**Author:** [@\_jmichael](https://discourse.slicer.org/u/_jmichael)\
**Replies:** 1\
**Last updated:** [July 30, 2017, 12:30am UTC](https://discourse.slicer.org/t/matlab-functions-for-interacting-with-slicer-data/786 "2017-07-30T00:30:15Z")

</div>

Are there any existing collections of functions developed for Matlab that allow data saved from Slicer (e.g. markups fiducial, affine transforms, etc.) to be loaded in/out of Matlab? I’m aware of the Matlab Bridge exten…
