Image processing in Matlab

Hi all,
I have a matlab script that processes an image.
I would like to load a volume in slicer, run the matlab script from slicer, and get the results back in matlab.
Any example/idea of how to do this?

Thanks a lot,
Paolo

You could use launchConsoleProcess to run your matlab script, but it will be a separate process and not have direct access to the volume you loaded into slicer. You would have to write out the volume in a format that can be ingested by your script, and then separately read in whatever the script wrote to disk.

There appears to be an extension SlicerMatlabBridge but IDK how up to date it is given that its documentation is on the old wiki. It seems like this does what you want though

Thanks @ebrahim

@lassoan do you have any suggestions?

The MatlabBridge extension sites exactly what you describe. It should still work. There are examples in its documentation.

1 Like