Hello,
I am Hoon in South Korea. I tried to run the muscle line of action plugin and I successfully extracted the results (e.g., attachment position, vector). But, I don't know how to visualize them in OpenSim viewer.
Could you briefly let me know how to visualize them in OpneSim?
If it is not possible to visualize them in OpenSim, Please let me know other way (e.g., MATLAB?).
(FYI, I use OpenSim 3.3 and MATLAB in Windows 10.)
Thank you very much.
Hoon
Visualization of Muscle Line of Action
- John Davis
- Posts: 59
- Joined: Mon Aug 26, 2019 7:42 am
Re: Visualization of Muscle Line of Action
Hi Hoon,
I've come up with two ways to visualize the results of the line of action plugin. One option is to export the line of action vectors and points in the global coordinate system, then reformat the data and save them as a .mot file to trick OpenSim into thinking they are ground reaction forces. Then you can plot them with the "Preview Experimental Data" feature! They even sync up with inverse kinematics results. That gives a result like this:
Another option is to export the lines of action and attachment points in the local coordinate system of the bone you're interested in, then import the data and the mesh file for that bone into MATLAB, then plot them on the same 3D axis. Happily, the mesh files are in the same coordinate system as the underlying physics model (after a coordinate flip to align things with OpenSim's y-up axis). That gives a result like this:
I've uploaded MATLAB code with a demo of both using data distributed with the Rajagopal 2015 model to my GitHub here: https://github.com/johnjdavisiv/line-of ... alization
Hopefully you and others will find these tricks useful! Check out the readme file for a few caveats - especially the global coordinate system export bug (you need to run it in OpenSim 4.1, else it will crash) and the vtp to stl conversion necessary for plotting the meshes.
-John
I've come up with two ways to visualize the results of the line of action plugin. One option is to export the line of action vectors and points in the global coordinate system, then reformat the data and save them as a .mot file to trick OpenSim into thinking they are ground reaction forces. Then you can plot them with the "Preview Experimental Data" feature! They even sync up with inverse kinematics results. That gives a result like this:
Another option is to export the lines of action and attachment points in the local coordinate system of the bone you're interested in, then import the data and the mesh file for that bone into MATLAB, then plot them on the same 3D axis. Happily, the mesh files are in the same coordinate system as the underlying physics model (after a coordinate flip to align things with OpenSim's y-up axis). That gives a result like this:
I've uploaded MATLAB code with a demo of both using data distributed with the Rajagopal 2015 model to my GitHub here: https://github.com/johnjdavisiv/line-of ... alization
Hopefully you and others will find these tricks useful! Check out the readme file for a few caveats - especially the global coordinate system export bug (you need to run it in OpenSim 4.1, else it will crash) and the vtp to stl conversion necessary for plotting the meshes.
-John