For the stable Slicer documentation, visit the 4.6 page.
Introduction and Acknowledgements
This work is part of the SparKit project, funded by An Applied Cancer Research Unit of Cancer Care Ontario with funds provided by the Ministry of Health and Long-Term Care and the Ontario Consortium for Adaptive Interventions in Radiation Oncology (OCAIRO) to provide free, open-source toolset for radiotherapy and related image-guided interventions.
The MatlabCommander module is used for running Matlab functions from within Slicer.
It may be necessary to manually add an exception to the firewall to allow Slicer to communicate with the Matlab server on port 4100.
The main use of this module is allowing any Slicer module to run Matlab commands, but the module can be also used for manual testing of the Matlab connection or running simple commands and observe the results without switching to Matlab.
Panels and their use
- Input: Matlab command input
- Matlab command (cmd): Matlab command (e.g., version, x=[1:10], plot(x,x.*x), ...)
- Output: Matlab command output
- Command result (reply): Result of the Matlab command (output only)
- Completed (completed): Checked if the command execution has been completed (output only)
- Server connection: Options for specifying the Matlab command server's network address
- Host name (hostname): Matlab command server IP address or host name
- Port (port): Matlab command server port number
Information for Developers
The module requires the following environment variables (set by Matlab Module Generator module, as it is a loadable module with access to all configuration settings):
- SLICER_MATLAB_EXECUTABLE_PATH: path to Matlab.exe
- SLICER_MATLAB_COMMAND_SERVER_SCRIPT_PATH: path to commandserver.m
The module communicates with Matlab using OpenIGTLink. The commandserver script implements an OpenIGTLink server, which accepts STRING commands (requests should be sent to the CMD or CMD_someuid device and response will be sent from a device named ACK or ACK_someuid)