Page 1 of 1

Modifying geometry in OpenSim

Posted: Mon Nov 14, 2016 8:07 pm
by bahjs001
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

Re: Modifying geometry in OpenSim

Posted: Wed Nov 16, 2016 7:22 am
by danielpina
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.

Re: Modifying geometry in OpenSim

Posted: Wed Nov 16, 2016 2:17 pm
by bahjs001
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?

Re: Modifying geometry in OpenSim

Posted: Thu Nov 17, 2016 4:08 am
by danielpina
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.

Re: Modifying geometry in OpenSim

Posted: Thu Nov 17, 2016 10:13 pm
by bahjs001
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?

Re: Modifying geometry in OpenSim

Posted: Fri Nov 18, 2016 6:46 am
by danielpina
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".