This notebook visualizes the MMCL dataset

LE: May 14th, 2013 MM (started the notebook)


In [4]:
# define and import data
subject = 2  #good subjects: 1,2,3,7. Other subjects have comparatively bad data quality
ttype = 1 # 1: free running, 2: metronome running (data incomplete!)

repetition = 1 # for most subjects: 1...6 are available
frame = 2315 # frame of the data. each repetition contains 60000 frames (250Hz sampling rate)



import mutils.io as mio
from pylab import *
# load kinematic data
k = mio.KinData(data_dir = '../data/2011-mmcl_mat')
k.load(subject, ttype)

Define the bone model. Each "bone" is a collection of markers which will be connected in the plot.


In [5]:
bone_model = [['r_anl', 'r_mtv', 'r_hee', 'r_anl', 'r_kne', 'r_trc', 'r_sia', 'r_sip', 'sacr',],
              ['l_anl', 'l_mtv', 'l_hee', 'l_anl', 'l_kne', 'l_trc', 'l_sia', 'l_sip', 'sacr',],
              ['l_sip', 'l_acr', 'cvii', 'r_acr', 'r_sip'],
              ['r_wrm', 'r_wrl', 'r_elb', 'r_acr'],
              ['l_wrm', 'l_wrl', 'l_elb', 'l_acr'],
              ['cvii', 'front', 'l_hea', 'r_hea', 'front'],
              ]

In [6]:
fig = figure("bone model", figsize=(10,10))
ax = fig.add_subplot(111, frameon=False)
raw = k.raw_dat[repetition] # shortcut
for bone in bone_model:
    x_data = []
    y_data = []
    for elem in bone:
        t = text(raw[elem][frame, 1] + .025, raw[elem][frame, 2], elem) #, backgroundcolor='#cccccc', alpha=.5)
        t.set_bbox(dict(facecolor='#cccccc', alpha=0.75))
        x_data.append(raw[elem][frame, 1]) # horizontal component
        y_data.append(raw[elem][frame, 2]) # vertical component
    plot(x_data, y_data, 'o-', color='#553200', linewidth=3, markeredgecolor='#ff2200', markerfacecolor='#ccddff', markersize=8)
        
axis('equal')
grid('on')
show()



In [ ]: