How do I modify the geometry of the femur in OpenSim, i.e. change in hip joint centre location, femoral anteversion and femoral neck length. I can determine the geometry in an external software from a segmented bone but am not sure how to then modify/scale the model in OpenSim to match.
Any help would be appreciated.
Jas
Modifying geometry in OpenSim
- Daniel Pina
- Posts: 32
- Joined: Wed Jun 19, 2013 12:08 pm
Re: Modifying geometry in OpenSim
You can edit all the parameters of each body through the *.osim file, using a text editor. It uses XML annotation so a programming-oriented text editor like "Notepad++" is highly recommended.
Here is the part of the online documentation explaining what you're looking for:
http://simtk-confluence.stanford.edu:80 ... Sim+Models
Mos popular models (e.g. gait2392) have commentaries explaining almost every line in the model, but if you can't find a specific parameter feel free to ask.
Here is the part of the online documentation explaining what you're looking for:
http://simtk-confluence.stanford.edu:80 ... Sim+Models
Mos popular models (e.g. gait2392) have commentaries explaining almost every line in the model, but if you can't find a specific parameter feel free to ask.
- Jasvir Bahl
- Posts: 8
- Joined: Tue Jan 19, 2016 6:05 pm
Re: Modifying geometry in OpenSim
Thanks for your response Daniel. So I simply modify the geometry in notepad ++ using the x,y,z in the parent (i.e. pelvis)? Is there also a way to change this in the OpenSim GUI?
- Daniel Pina
- Posts: 32
- Joined: Wed Jun 19, 2013 12:08 pm
Re: Modifying geometry in OpenSim
You can't change the geometry in the osim file.
What you can do is create another geometry file (e.g. femur2.stl), copy it to the geometry folder in opensim and then edit the osim file to refer to the new geometry file, under <DisplayGeometry> of the intended femur (left, right or both). And then you need to change the mass and inertia parameters of the new femur in the osim file too.
You can take the inertia parameters from the new geometry file using a software like Solidworks.
What you can do is create another geometry file (e.g. femur2.stl), copy it to the geometry folder in opensim and then edit the osim file to refer to the new geometry file, under <DisplayGeometry> of the intended femur (left, right or both). And then you need to change the mass and inertia parameters of the new femur in the osim file too.
You can take the inertia parameters from the new geometry file using a software like Solidworks.
- Jasvir Bahl
- Posts: 8
- Joined: Tue Jan 19, 2016 6:05 pm
Re: Modifying geometry in OpenSim
Okay I see what you mean. If I import an STL with different geometry to the 2392 file, this would obviously effect the new muscle attachments points won't it?
- Daniel Pina
- Posts: 32
- Joined: Wed Jun 19, 2013 12:08 pm
Re: Modifying geometry in OpenSim
Yes. If you give a new name to the femur's body (e.g. femur2_r instead of the default femur_r) then you'll have to edit the muscle paths to cross the new body, or you'll probably get an error while opening the model in OpenSim.
If you just edit the existing femur_r to use the new parameters and geometry file, then the muscle paths will still cross the new femur, though you may have to edit these paths because their positioning is relative (not absolute) to the center of the "host body".
If you just edit the existing femur_r to use the new parameters and geometry file, then the muscle paths will still cross the new femur, though you may have to edit these paths because their positioning is relative (not absolute) to the center of the "host body".