Nmsbuilder Tutorial Create An Opensim Model From Test Data
Nmsbuilder Tutorial Create An Opensim Model From Test Data
Tutorial
Create
an
OpenSim
model
from
Test
Data
1. Objectives
NMSBuilder
is
an
open-source
software
package,
being
developed
within
the
NMSPhysiome
project.
It
allows
to
import
and
edit
subject-specific
data
from
different
sources,
develop
OpenSim
musculoskeletal
models,
leverage
OpenSim
to
perform
dynamic
simulations
of
movement
and
store
the
results.
Next
release
features
will
also
include
statistical
post-processing
and
visualization
tools,
as
well
as
import/export
facilities
of
Matlab
file
formats.
The
software
integrates
the
multimodal
data
fusion
functionalities
of
Multimod
Application
Framework
with
the
OpenSim
API.
The
purpose
of
this
tutorial
is
to
help
users
getting
started
with
the
software,
creating
a
simple
OpenSim
musculoskeletal
model
from
subject-specific
data
distributed
with
the
alpha
version
released.
Only
specific
tools
to
the
purpose
will
be
described
in
this
tutorial.
For
all
other
software
capabilities
and
potential,
users
are
referred
to
the
user's
guide.
Figure
1
-
Main
parts
of
a
musculoskeletal
model
in
OpenSim.
All
necessary
features
are
definable
within
NMSBuilder
operations
2. Test
Data
First
of
all,
download
the
test
data
from
here:
https://www.biomedtown.org/nmsphysiome/reception/alpha/
Test
data
include
models
of
the
right
thigh
and
shank
of
a
specific
normal
subject,
derived
from
MRI
images.
File
Open
Test
Data.msf
to
import
the
data.
To
visualize
and
navigate
the
data
elements,
select
View
Add
View
Surface
and
go
into
the
Data
Tree
panel.
Data
are
organized
in
a
hierarchical
tree
and
divided
into
rigid
bodies
(parent),
joints,
marker
sets
and
attachment
points
(children),
plus
Muscle
Actuator
and
OpenSim
model
source
code:
Figure 2 - Test data visualized in a surface view. Each object is stored in the hierarchical tree in the data tree bar
Marker
Sets:
Identified
with
a
virtual
palpation
procedure
on
anatomical
landmarks
[1].
Attachment
Points:
Registered
from
Delp
model
[2]
onto
the
specific
anatomy.
Vastus
lateralis
muscle,
including
the
origin/via/insertion
points
and
maximum
isometric
force
parameter.
Other
muscle
parameters
can
be
defined
from
VME
metadata
facilities
(Operations
Modify
VME
Metadata,
also
refer
to
user's
guide).
Additional
files,
distributed
in
the
Geometries
and
output
model
folder,
include
the
vtp
geometry
files
and
the
osim
model
file,
created
as
result
of
this
tutorial.
Figure
3
-
VME
Metadata
parameters
of
R_Thigh
multi-surface
after
performing
the
compute
Inertial
Tensor
operation
3
Definition
of
joints
Two
joint
reference
frames
(RefSys)
define
position
and
orientation
of
the
joint
in
each
of
the
two
connected
bodies.
The
origin
of
the
RefSys
will
be
the
center/axis
of
rotation
of
the
joint,
and
the
degree
of
freedom
will
take
place
along
its
axes
(Pin
Joint
rotates
along
the
blue
Z-axis).
The
two
RefSys
have
to
be
created
from
anatomical
landmarks
defined.
This
can
be
done
in
two
ways:
1. Select
a
landmark
cloud
(Marker
Set)
representing
the
anatomical
landmarks
of
the
bone
corresponding
to
the
desired
body,
then
Operation
Create
Derive
AFRefsys
and
then
select
the
acronym
corresponding
to
the
bone.
This
will
create
a
RefSys
child
of
the
landmark
cloud.
Select
it,
go
to
the
vme
tab
and
assign
the
requested
landmarks.
2. Operation
Create
RefSys.
Select
it,
go
to
the
vme
tab,
check
Select
Plane.
The
first
landmark
to
feed
will
be
the
origin,
the
second
one
will
define
the
X
axis
and
the
third
will
define
the
plane
and
direction
of
the
Y
axis.
The
RefSys
can
be
moved
(rotated
and
translated)
using
the
Move
facilities
(refer
to
user's
guide):
select
it,
Operation
Create
Derive
Freeze
VME.
This
will
create
an
object
that
can
be
moved
as
any
other
VME
object.
In
the
Test
Data,
the
knee
joint
is
modelled
as
a
pin
joint
with
the
axis
of
rotation
passing
through
the
RME
and
RLE
markers.
The
RefSys
in
Parent
is
defined
using
RME
and
RLE
as
origin
and
point1,
and
then
rotating
the
RefSys
to
make
this
axis
the
Z-axis.
From
this,
RefSys
in
Child
is
defined
such
to
have
the
knee
neutral
pose
according
to
ISB
standard
[3].
Definition
of
muscle
actuators
An
action
line
representing
the
muscle
needs
to
be
created:
select
Operation
Create
Derive
Wrapped
Action
Line,
go
to
vme
tag,
select
Pivot-set
method
and
set
wrap
to
manual,
feed
the
start
and
end
points
and
a
list
of
ordered
midpoints.
Physiological
muscle
parameters
can
be
assigned
through
VME
Metadata
facilities
(Operation
Modify
VME
Metadata):
the
maximum
isometric
force
parameter
can
be
assigned
adding
a
"maxIsometricForce"
numeric
tag
and
typing
the
value.
To
see
other
valid
muscle
parameter
tags,
please
refer
to
the
user's
guide.
If
muscle
parameters
are
not
defined,
default
values
will
be
assumed.
Create
OpenSim
model
from
Wizard
Once
all
necessary
model
objects
have
been
defined
(body
properties,
RefSys,
muscle
action
lines),
the
user
is
ready
to
create
the
OpenSim
model.
The
more
user-friendly
way
is
to
use
the
Wizard
facility:
Operations
Create
New
OpenSim
model
from
Wizard
will
guide
users
through
a
step-by-step
procedure
in
selecting
all
the
necessary
model
objects
and
create
the
OpenSim
model
source
code
to
be
compiled
later.
1. Create
Bodies
from
Surfaces
Select
Add
Groups
to
define
multi-surface
bodies
and
pick
"R_Thigh"
and
"R_Shank"
groups.
Bodies
will
be
automatically
added
to
the
model.
In
addition,
this
operation
creates
and
saves
all
geometry
vtp
files
in
the
default
model
directory.
Figure 4 - First step of creating OpenSim model from Wizard: create bodies from multi-surfaces
2. Create
Joints
To
define
the
free
joint
with
the
ground,
select
the
Child
Body,
pick
"R_Thigh"
and
Add
Joint.
To
define
the
hinge
joint
at
the
knee,
select
Pin
Joint
from
the
drop-down
menu
and
pick
the
necessary
bodies
and
reference
frames
corresponding
to
Parent
Body,
RefSys
in
Parent,
Child
Body,
RefSys
in
Child,
and
then
Add
Joint.
3. Create
Marker
Sets
To
attribute
the
two
defined
marker
sets
to
the
corresponding
bodies,
select
Source
Landmark
Cloud
and
pick
the
corresponding
Marker
Set,
to
then
select
Target
Body
and
pick
the
corresponding
body.
Select
Add
Marker
Set
each
time
to
add
the
markers
to
the
model.
4. Add
Muscles
Select
Add
Muscle
and
simply
pick
the
wrapped
action
line
corresponding
to
the
"R_vas_lat"
muscle.
Selecting
continue
in
the
last
step
of
the
procedure
(Wizard
Done!)
will
automatically
add
the
model
source
code
to
the
data
tree,
and
an
Figure 5 - Create Pin Joint
from Create OpenSim
automatic
pop-up
window
will
show
the
created
cpp
file
in
a
modelfrom Wizard
Notepad++
text
editor.
Now
this
file
needs
to
be
compiled
to
create
the
corresponding
.osim
model.
Select
the
OpenSimModel
from
the
data
tree
and
go
to
Operations
Modify
OpenSim
Model
Editing
Tools:
selecting
Generate
Model,
the
source
code
will
be
compiled
and
the
model
file
will
automatically
show
up
in
the
text
editor.
The
"outputmodel.osim"
will
be
saved
in
the
default
directory,
editable
from
the
Editing
Tool
panel.
The
created
.osim
model
can
now
be
imported
in
OpenSim.
References
[1]
Taddei
et
al.,
2007.
Virtual
palpation
of
skeletal
landmarks
with
multimodal
display
interfaces.
Medical
informatics
and
the
Internet
in
medicine,
32(3):
191-8
[2]
Delp
et
al.,
1990.
An
interactive
graphics-based
model
of
the
lower
extremity
to
study
orthopaedic
surgical
procedures.
IEEE
transactions
on
bio-medical
engineering,
37(8):
757-67
[3]
Wu
et
al.,
2002.
ISB
recommendation
on
definitions
of
joint
coordinate
system
of
various
joints
for
the
reporting
of
human
joint
motion--part
I:
ankle,
hip,
and
spine.
International
Society
of
Biomechanics.
J
Biomech,
35(4):543-8