Difference between revisions of "2017 Winter Project Week/Improve Matlab integration"
From NAMIC Wiki
(One intermediate revision by the same user not shown) | |||
Line 28: | Line 28: | ||
| | | | ||
<!-- Progress and Next steps bullet points (fill out at the end of project week) --> | <!-- Progress and Next steps bullet points (fill out at the end of project week) --> | ||
+ | * Nothing implemented, just discussions made with Andras. | ||
+ | * To be able to work with the Matlab environment & MatlabBridge within Slicer, you need to : | ||
+ | ** define variables as global in your code (matlab commander or matlab module) | ||
+ | ** open Matlab & Slicer without running the matab commander server from Slicer | ||
+ | ** run matlab commander server from Matlab | ||
+ | ** run your matlab code from slicer | ||
+ | ** stop matlab commander server on Matlab | ||
+ | ** call global on variables defined in Slicer within Matlab to see them appear in your workspace and be able to use them in matlab's command window. | ||
+ | * A way to automatize the above would be to: | ||
+ | ** run matlab environment from Slicer | ||
+ | ** have a button in Slicer to Stop/Start the server in matlab environment | ||
+ | ** when the server is stopped, run `whos global` to get a list of variables and `global variablename` to display them in the workspace automatically | ||
+ | * The given module was running some window interfaces with Matlab, which opens a new thread and therefore becomes out of scope from the slicer matlab server instance which would end without keeping an handle on variables defines later on. We would advise not to use Matlab GUI items and do Matlab modules within Slicer to be able to control every step of the way. | ||
|} | |} | ||
Latest revision as of 16:23, 13 January 2017
Home < 2017 Winter Project Week < Improve Matlab integrationKey Investigators
- Alexis Girault (Kitware, Inc.)
Project Description
Objective | Approach and Plan | Progress and Next Steps |
---|---|---|
|
|
|
Background and References
- MatlabBridge : https://www.slicer.org/wiki/Documentation/Nightly/Extensions/MatlabBridge
- ctkConsole : http://www.commontk.org/docs/html/classctkConsole.html
- Matlab commandwindow : https://www.mathworks.com/help/matlab/ref/commandwindow.html
- Matlab workspace : https://www.mathworks.com/help/matlab/ref/workspace.html