Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Jakub Mitura
- Posts: 4
- Joined: Wed Jan 06, 2021 10:46 am
Post
by Jakub Mitura » Tue Jan 12, 2021 11:52 am
Hello I am an Functional anatomy teacher and I recently discovered OpenSim and I would like to use it in classes. I would like to create a set of motions that includes single or groups of muscles , just for visualization. I would like to create script like in sudo code below
Code: Select all
repeatCycles = k // how many times I want the muscle movement to be repeated
muscleList = loadModelsMuscles ("C://Downloads/Modelx") // loading some of the ready models and upload to the list data about muscles from it
// below I instantiate list of actions that I would like to be displayed
listOfActions = muscleList.map{muscle=>
display(muscle.name) //displaying on the screen what muscle we are now displaying
showOnly(muscle) // make this muscle the only one that is displayed
for(1..repeatCycles )// repeat given amount of times the motion of this single muscle
{ ( singleMuscleMot() ) }
}
//creates motion file that when uploaded will for each muscle in a model display the name of this muscle will display it on the model an will couple times perform motion of this single muscle
createMotFile("C://motions", listOfActions )
Is it possible to create such code? Which language and tools to use (I see that there are a lot of tools and 3 languages supported, I can program in all either Matlab, Python or if necessary C++), How to execute this?
Thank You for any help !
Tags:
-
Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Post
by Carmichael Ong » Thu Jan 14, 2021 1:17 pm
This sounds like a great project that would be helpful for many classes!
I think a lot of this could be done in the GUI and could be a nice tutorial for students. You can show/hide muscles by right-clicking them and choosing the correct option. You can also drive a motion using the Forward Dynamics tool (
https://simtk-confluence.stanford.edu/d ... d+Dynamics). We have a more advanced example about using muscles for jumping (
https://simtk-confluence.stanford.edu/d ... erformance). This might be a good place to start, but then to simplify the model and muscles to make a simpler tutorial for a class.
If you were looking to automate some of generating the motions of a simple model, the front page example on our GitHub page would be a good place to start (it has MATLAB, Python, and C++ examples to do the same thing):
https://github.com/opensim-org/opensim-core