Hi, all
Our lab bought a SIMM full body model before. I have imported it into OpenSim 3.0, but
I find that the muscle type is Schutte1993Muscle, which has been deprecated. How can
I convert it to the newest muscle type?
Looking forward to your reply,
Many thanks,
Jiang
How to convert muscle type
- Jiang Ping
- Posts: 132
- Joined: Sun Aug 26, 2012 4:09 am
Re: How to convert muscle type
Code: Select all
Muscle & mus=my.updMuscles().get(musclenames[0]); //musclenames[0] is the name of a test 1993muscle
Thelen2003Muscle *test0=new Thelen2003Muscle();
test0->set_isDisabled(mus.get_isDisabled());
test0->setMinControl(mus.getMinControl());
test0->setMaxControl(mus.getMaxControl());
test0->set_GeometryPath(mus.get_GeometryPath());
test0->setOptimalForce(mus.getOptimalForce());
test0->setMaxIsometricForce(mus.getMaxIsometricForce());
test0->setOptimalFiberLength(mus.getOptimalFiberLength());
test0->setTendonSlackLength(mus.getTendonSlackLength());
test0->setPennationAngleAtOptimalFiberLength(mus.getPennationAngleAtOptimalFiberLength());
test0->setMaxContractionVelocity(mus.getMaxContractionVelocity());
test0->setName("test");
my.addForce(test0);
- Yannik Schröder
- Posts: 14
- Joined: Wed Apr 18, 2012 11:40 am
Re: How to convert muscle type
As far as i know you can simply open the .osim file in your favourite text editor and do a search and replace. Replace "Schutte1993Muscle_deprecated" with "Thelen2003Muscle" or the muscle model you want to use.
When you open the file in OpenSim it will set the Thelen specific parameters to default values.
When you open the file in OpenSim it will set the Thelen specific parameters to default values.
- Ayman Habib
- Posts: 2238
- Joined: Fri Apr 01, 2005 12:24 pm
Re: How to convert muscle type
Thanks Yannik and Jiang,
Indeed changing the string corresponding to the muscle-model-name in XML will modify the muscle model. The muscle-path is common to all muscle models so it will stay intact, other parameters however need to be examined because:
1. Different muscle models may have different attributes/properties. Unspecified ones will take on default value.
2. Even in the case when properties have the same name, they could mean something different (e.g. pre 3.0 muscle models had activation1 & activation2 that had completely different meaning even if they had the same name in the file).
So, whether using a script (C++, Matlab or Jython) or editing XML you need to decide how to set the various properties of the new muscle model if not satisfied with defaults.
Best regards,
-Ayman
Indeed changing the string corresponding to the muscle-model-name in XML will modify the muscle model. The muscle-path is common to all muscle models so it will stay intact, other parameters however need to be examined because:
1. Different muscle models may have different attributes/properties. Unspecified ones will take on default value.
2. Even in the case when properties have the same name, they could mean something different (e.g. pre 3.0 muscle models had activation1 & activation2 that had completely different meaning even if they had the same name in the file).
So, whether using a script (C++, Matlab or Jython) or editing XML you need to decide how to set the various properties of the new muscle model if not satisfied with defaults.
Best regards,
-Ayman