Modifying geometry in OpenSim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jasvir Bahl
Posts: 8
Joined: Tue Jan 19, 2016 6:05 pm

Modifying geometry in OpenSim

Post by Jasvir Bahl » Mon Nov 14, 2016 8:07 pm

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

User avatar
Daniel Pina
Posts: 32
Joined: Wed Jun 19, 2013 12:08 pm

Re: Modifying geometry in OpenSim

Post by Daniel Pina » Wed Nov 16, 2016 7:22 am

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.

User avatar
Jasvir Bahl
Posts: 8
Joined: Tue Jan 19, 2016 6:05 pm

Re: Modifying geometry in OpenSim

Post by Jasvir Bahl » Wed Nov 16, 2016 2:17 pm

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?

User avatar
Daniel Pina
Posts: 32
Joined: Wed Jun 19, 2013 12:08 pm

Re: Modifying geometry in OpenSim

Post by Daniel Pina » Thu Nov 17, 2016 4:08 am

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.

User avatar
Jasvir Bahl
Posts: 8
Joined: Tue Jan 19, 2016 6:05 pm

Re: Modifying geometry in OpenSim

Post by Jasvir Bahl » Thu Nov 17, 2016 10:13 pm

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?

User avatar
Daniel Pina
Posts: 32
Joined: Wed Jun 19, 2013 12:08 pm

Re: Modifying geometry in OpenSim

Post by Daniel Pina » Fri Nov 18, 2016 6:46 am

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".

POST REPLY