Fiducial RAS Coordinates to MATLAB

Hello,

OS - Windows 10
Slicer Version - 4.10.2

I have the slicer installed with the MATLAB Bridge extension. I have my own DICOM Image that I load on the 3D slicer. Then I have placed a few fiducials.

I want to transfer these fiducial coordinates to MATLAB because I would like to use those coordinates. Is there a way I can transfer these fiducial coordinates to MATLAB ? Just as a variable or a vector maybe ?

Also for future reference, is there more help regarding this on slicer wiki ? I saw the basic matlab bridge help page but it was quite basic that way.

Best,
Gaurav

Several example modules pass fiducials to Matlab from Slicer.

You can find more details in the How to create, run, customize Matlab modules tutorial on the extension’s documentation page.

I would recommend to move on from Matlab to Python, as Python has so many more and much better tools for medical image computing, you can implement complete application workflows (from server-side processing to end-user GUI), there are no licensing hassles, etc. I’ve implemented Slicer’s MatlabBridge extension because 5-10 years ago it still made sense to use Matlab for some problems, but nowadays it is very hard to justify choosing Matlab over Python.

Hello Andras,

Thank you for your reply. My actual worry was not to pass the variables to MATLAB but rather store them in the workspace. For eg - I used the FillAroundSeeds example program to place fiducials. Now in the MATLAB script FillAroundSeeds.m, there is a specific variable called ‘seeds_LPS’ and I wanted to save this variable in my workspace.

Solution - Was quite easy actually. I used the MATLAB ‘save’ command and added it to the FillAroundSeeds.m file so that whenever 3D slicer runs the matlab module, I will automatically have the LPS coordinates of the fiducial saved as a data file. I can then load this into the variable space.

Thank you for your help!
Best,
Gaurav

PS - The reason I am using MATLAB is that I have a whole other robot kinematics related script and a few other supplementary scripts running in MATLAB. So I don’t want to change them.