Marcos Duarte
Laboratory of Biomechanics and Motor Control
Federal University of ABC, Brazil
Motion Analysis Corporation (MAC, http://www.motionanalysis.com/) builds motion capture systems and their software (e.g., Cortex) generates files in ASCII and binary formats for the different signals (kinematics, analog data, force plate data, etc.). Here are functions for reading most of the files saved in ASCII format. These files have headers with few lines with meta data and the signals are stored in columns and the rows for the different frames (instants of time).
The ".trc" (Track Row Column) file in ASCII contains X-Y-Z position data for the reflective markers from a motion capture trial. The position data for each marker is organized into 3 columns per marker (X, Y and Z position) with each row being a new frame. The position data is relative to the global coordinate system of the capture volume and the position values are in the units used for calibration.
The ".anc" (Analog ASCII Row Column) file contains ASCII analog data in row-column format. The data is derived from ".anb" analog binary files. These binary ".anb" files are generated simultaneously with video ".vc" files if an optional analog input board is used in conjunction with video data capture.
The ".cal" file contains force plate calibration parameters.
The ".forces" file contains force plate data. The data is saved based on the "forcepla.cal" file of the trial and converts the raw force plate data into calibrated forces. The units used are Newtons and Newton-meters and each line in the file equates to one analog sample.
%load_ext autoreload
%autoreload 2
import numpy as np
%matplotlib notebook
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import signal
import sys
sys.path.insert(1, r'./../functions') # add to pythonpath
from read_trc import read_trc
print(read_trc.__doc__)
Read .trc file format from Cortex MAC. This function: 1. Read trc file; 2. Can delete or replace markers (columns) with empty data; 3. Correct number of markers in the header according to the actual number of non-empty markers; 4. Can save a '.trc' file with updated information and data; 5. Return header information (optional) and data (marker position) as dataframe or dataarray. The .trc (track row column) file in ASCII contains X-Y-Z position data for the reflective markers from a motion capture trial. The position data for each marker is organized into 3 columns per marker (X, Y and Z position) with each row being a new frame. The position data is relative to the global coordinate system of the capture volume and the position values are in the units used for calibration. Parameters ---------- fname : string Full file name of the .trc file to be opened. fname2 : string (default = '') Full file name of the .trc file to be saved with updated information and data if desired. If fname2 is '', no file is saved. If fname2 is '=', the original file name will be used. If fname2 is a string with length between 1 and 3 (other than '='), e.g., '_2', this string is appended to the original file name. units : string (default = '') Change the units of the data if desired. Accepted output units are 'm' or 'mm'. dropna : bool (default = False) True: Delete column if it has only missing or NaN values. False: preserve column and replace column values by parameter `na` (see below) if inputed, otherwise maintain default pandas value (NaN). na : float or None (default = 0.0) Value to replace (if `dropna` is False) column values if this column has only missing or NaN values. Input None to maintain default pandas value for this case (NaN). fmt : string (default = 'multi') Format of the output: 'uni', 'multi', 'xarray' 'uni': returns variable with trc header info plus pandas dataframe with markerxyz as labels and "Frame#" and "Time" as columns; 'multi': returns variable with trc header info plus multilabel pandas dataframe with "Marker", "Coordinate" and "XYZ", as labels and "Time" as index; 'xarray': returns variable as dataarray xarray and trc header info as attributes of this dataarray. show_msg : bool (default = True) Whether to print messages about the execution of the intermediary steps (True) or not (False). Returns ------- h : Python dictionary with .trc header info (if `fmt` = 'uni' or 'multi') keys: header (the .trc full header), data_rate (Hz), camera_rate (Hz), nframes, nmarkers, markers (names), xyz (X1,Y1,Z1...), units. data : pandas dataframe or xarray dataarray Three possible output formats according to the `fmt` option: 'uni': dataframe with shape (nframes, 2+3*nmarkers) with markerxyz as labels and columns: Frame#, time and position data, or 'multi': fataframe with shape (nframes, 3*nmarkers) with "Marker", "Coordinate" and "XYZ" as labels, "Time" as index, and data position as columns, or 'xarray': dataarray with dims=['time', 'marker', 'component'] and trc header info as attributes of this dataarray. Examples -------- Notes -----
import sys, os
path2 = r'./../data/'
fname = os.path.join(path2, 'arm26_elbow_flex.trc')
h, df = read_trc(fname, fname2='', dropna=True, na=0.0, fmt='uni')
df.head()
Opening file "./../data/arm26_elbow_flex.trc" ... done.
Frame# | Time | r_acromionx | r_acromiony | r_acromionz | r_humerus_epicondylex | r_humerus_epicondyley | r_humerus_epicondylez | r_radius_styloidx | r_radius_styloidy | r_radius_styloidz | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 0.000000 | -13.054524 | 39.505476 | 169.505476 | -12.559380 | -297.414380 | 199.985620 | -13.124683 | -533.569683 | 251.420317 |
1 | 2 | 0.008333 | -12.960648 | 39.599352 | 169.599352 | -12.567324 | -297.422324 | 199.977676 | -12.867025 | -533.600380 | 251.382550 |
2 | 3 | 0.016667 | -12.853425 | 39.706575 | 169.706575 | -12.574394 | -297.429394 | 199.970606 | -12.582610 | -533.629817 | 251.345015 |
3 | 4 | 0.025000 | -12.736429 | 39.823571 | 169.823571 | -12.580312 | -297.435312 | 199.964688 | -12.246998 | -533.658334 | 251.306576 |
4 | 5 | 0.033333 | -12.613556 | 39.946444 | 169.946444 | -12.584846 | -297.439846 | 199.960154 | -11.837471 | -533.686073 | 251.266170 |
h
{'header': [['PathFileType', '4', '(X/Y/Z)', 'arm26_elbow_flex.trc', '', '', '', '', '', '', ''], ['DataRate', 'CameraRate', 'NumFrames', 'NumMarkers', 'Units', 'OrigDataRate', 'OrigDataStartFrame', 'OrigNumFrames', '', '', ''], ['120', '120', '121', '3', 'mm', '120', '1', '121', '', '', ''], ['Frame#', 'Time', 'r_acromion', '', '', 'r_humerus_epicondyle', '', '', 'r_radius_styloid', '', '', ''], ['', '', 'X1', 'Y1', 'Z1', 'X2', 'Y2', 'Z2', 'X3', 'Y3', 'Z3']], 'data_rate': 120.0, 'camera_rate': 120.0, 'nframes': 121, 'nmarkers': 3, 'markers': ['r_acromion', 'r_humerus_epicondyle', 'r_radius_styloid'], 'xyz': ['X1', 'Y1', 'Z1', 'X2', 'Y2', 'Z2', 'X3', 'Y3', 'Z3'], 'units': 'mm', 'fname': './../data/arm26_elbow_flex.trc', 'fname2': ''}
h, df = read_trc(fname, fname2='', dropna=True, na=0.0, fmt='multi')
df.head()
Opening file "./../data/arm26_elbow_flex.trc" ... done.
Marker | r_acromion | r_humerus_epicondyle | r_radius_styloid | ||||||
---|---|---|---|---|---|---|---|---|---|
Coordinate | X | Y | Z | X | Y | Z | X | Y | Z |
XYZ | X1 | Y1 | Z1 | X2 | Y2 | Z2 | X3 | Y3 | Z3 |
Time | |||||||||
0.000000 | -13.054524 | 39.505476 | 169.505476 | -12.559380 | -297.414380 | 199.985620 | -13.124683 | -533.569683 | 251.420317 |
0.008333 | -12.960648 | 39.599352 | 169.599352 | -12.567324 | -297.422324 | 199.977676 | -12.867025 | -533.600380 | 251.382550 |
0.016667 | -12.853425 | 39.706575 | 169.706575 | -12.574394 | -297.429394 | 199.970606 | -12.582610 | -533.629817 | 251.345015 |
0.025000 | -12.736429 | 39.823571 | 169.823571 | -12.580312 | -297.435312 | 199.964688 | -12.246998 | -533.658334 | 251.306576 |
0.033333 | -12.613556 | 39.946444 | 169.946444 | -12.584846 | -297.439846 | 199.960154 | -11.837471 | -533.686073 | 251.266170 |
da = read_trc(fname, fname2='', dropna=True, na=0.0, fmt='xarray')
da
Opening file "./../data/arm26_elbow_flex.trc" ... done.
<xarray.DataArray 'Position data' (time: 121, marker: 3, component: 3)> array([[[ -13.05452443, 39.50547557, 169.5054756 ], [ -12.55937962, -297.4143796 , 199.9856204 ], [ -13.12468341, -533.5696827 , 251.4203173 ]], [[ -12.96064763, 39.59935237, 169.5993524 ], [ -12.56732433, -297.4223243 , 199.9776757 ], [ -12.86702479, -533.6003803 , 251.3825496 ]], [[ -12.85342531, 39.70657469, 169.7065747 ], [ -12.57439418, -297.4293942 , 199.9706058 ], [ -12.58261002, -533.6298174 , 251.345015 ]], ..., [[ -11.91518938, 40.64481062, 170.6448106 ], [ -12.50145015, -297.3564501 , 200.0435499 ], [ 231.0730594 , -300.0052994 , 231.0669795 ]], [[ -11.96689527, 40.59310473, 170.5931047 ], [ -12.50375329, -297.3587533 , 200.0412467 ], [ 231.0449219 , -299.7324972 , 231.0210452 ]], [[ -12.03835742, 40.52164258, 170.5216426 ], [ -12.50767284, -297.3626728 , 200.0373272 ], [ 231.0167559 , -299.4841418 , 230.9769121 ]]]) Coordinates: * time (time) float64 0.0 0.008333 0.01667 0.025 ... 0.9833 0.9917 1.0 * marker (marker) <U20 'r_acromion' ... 'r_radius_styloid' * component (component) <U1 'X' 'Y' 'Z' Attributes: header: [['PathFileType', '4', '(X/Y/Z)', 'arm26_elbow_flex.trc', '... data_rate: 120.0 camera_rate: 120.0 nframes: 121 nmarkers: 3 markers: ['r_acromion', 'r_humerus_epicondyle', 'r_radius_styloid'] xyz: ['X1', 'Y1', 'Z1', 'X2', 'Y2', 'Z2', 'X3', 'Y3', 'Z3'] units: mm fname: ./../data/arm26_elbow_flex.trc fname2:
array([[[ -13.05452443, 39.50547557, 169.5054756 ], [ -12.55937962, -297.4143796 , 199.9856204 ], [ -13.12468341, -533.5696827 , 251.4203173 ]], [[ -12.96064763, 39.59935237, 169.5993524 ], [ -12.56732433, -297.4223243 , 199.9776757 ], [ -12.86702479, -533.6003803 , 251.3825496 ]], [[ -12.85342531, 39.70657469, 169.7065747 ], [ -12.57439418, -297.4293942 , 199.9706058 ], [ -12.58261002, -533.6298174 , 251.345015 ]], ..., [[ -11.91518938, 40.64481062, 170.6448106 ], [ -12.50145015, -297.3564501 , 200.0435499 ], [ 231.0730594 , -300.0052994 , 231.0669795 ]], [[ -11.96689527, 40.59310473, 170.5931047 ], [ -12.50375329, -297.3587533 , 200.0412467 ], [ 231.0449219 , -299.7324972 , 231.0210452 ]], [[ -12.03835742, 40.52164258, 170.5216426 ], [ -12.50767284, -297.3626728 , 200.0373272 ], [ 231.0167559 , -299.4841418 , 230.9769121 ]]])
array([0. , 0.008333, 0.016667, 0.025 , 0.033333, 0.041667, 0.05 , 0.058333, 0.066667, 0.075 , 0.083333, 0.091667, 0.1 , 0.108333, 0.116667, 0.125 , 0.133333, 0.141667, 0.15 , 0.158333, 0.166667, 0.175 , 0.183333, 0.191667, 0.2 , 0.208333, 0.216667, 0.225 , 0.233333, 0.241667, 0.25 , 0.258333, 0.266667, 0.275 , 0.283333, 0.291667, 0.3 , 0.308333, 0.316667, 0.325 , 0.333333, 0.341667, 0.35 , 0.358333, 0.366667, 0.375 , 0.383333, 0.391667, 0.4 , 0.408333, 0.416667, 0.425 , 0.433333, 0.441667, 0.45 , 0.458333, 0.466667, 0.475 , 0.483333, 0.491667, 0.5 , 0.508333, 0.516667, 0.525 , 0.533333, 0.541667, 0.55 , 0.558333, 0.566667, 0.575 , 0.583333, 0.591667, 0.6 , 0.608333, 0.616667, 0.625 , 0.633333, 0.641667, 0.65 , 0.658333, 0.666667, 0.675 , 0.683333, 0.691667, 0.7 , 0.708333, 0.716667, 0.725 , 0.733333, 0.741667, 0.75 , 0.758333, 0.766667, 0.775 , 0.783333, 0.791667, 0.8 , 0.808333, 0.816667, 0.825 , 0.833333, 0.841667, 0.85 , 0.858333, 0.866667, 0.875 , 0.883333, 0.891667, 0.9 , 0.908333, 0.916667, 0.925 , 0.933333, 0.941667, 0.95 , 0.958333, 0.966667, 0.975 , 0.983333, 0.991667, 1. ])
array(['r_acromion', 'r_humerus_epicondyle', 'r_radius_styloid'], dtype='<U20')
array(['X', 'Y', 'Z'], dtype='<U1')
fname = os.path.join(path2, 'arm26_elbow_flex_e.trc')
h, df = read_trc(fname, fname2='', dropna=False, na=0.0, fmt='multi')
df.head()
Opening file "./../data/arm26_elbow_flex_e.trc" ... done.
Marker | r_acromion | r_humerus_epicondyle | r_radius_styloid | ||||||
---|---|---|---|---|---|---|---|---|---|
Coordinate | X | Y | Z | X | Y | Z | X | Y | Z |
XYZ | X1 | Y1 | Z1 | X2 | Y2 | Z2 | X3 | Y3 | Z3 |
Time | |||||||||
0.000000 | -13.054524 | 39.505476 | 169.505476 | 0.0 | 0.0 | 0.0 | -13.124683 | -533.569683 | 251.420317 |
0.008333 | -12.960648 | 39.599352 | 169.599352 | 0.0 | 0.0 | 0.0 | -12.867025 | -533.600380 | 251.382550 |
0.016667 | -12.853425 | 39.706575 | 169.706575 | 0.0 | 0.0 | 0.0 | -12.582610 | -533.629817 | 251.345015 |
0.025000 | -12.736429 | 39.823571 | 169.823571 | 0.0 | 0.0 | 0.0 | -12.246998 | -533.658334 | 251.306576 |
0.033333 | -12.613556 | 39.946444 | 169.946444 | 0.0 | 0.0 | 0.0 | -11.837471 | -533.686073 | 251.266170 |
h, df = read_trc(fname, fname2='', dropna=True, na=0.0, fmt='multi')
df.head()
Opening file "./../data/arm26_elbow_flex_e.trc" ... Number of markers changed from 3 to 2. done.
Marker | r_acromion | r_radius_styloid | ||||
---|---|---|---|---|---|---|
Coordinate | X | Y | Z | X | Y | Z |
XYZ | X1 | Y1 | Z1 | X2 | Y2 | Z2 |
Time | ||||||
0.000000 | -13.054524 | 39.505476 | 169.505476 | -13.124683 | -533.569683 | 251.420317 |
0.008333 | -12.960648 | 39.599352 | 169.599352 | -12.867025 | -533.600380 | 251.382550 |
0.016667 | -12.853425 | 39.706575 | 169.706575 | -12.582610 | -533.629817 | 251.345015 |
0.025000 | -12.736429 | 39.823571 | 169.823571 | -12.246998 | -533.658334 | 251.306576 |
0.033333 | -12.613556 | 39.946444 | 169.946444 | -11.837471 | -533.686073 | 251.266170 |
da = read_trc(fname, fname2='', dropna=True, na=0.0, fmt='xarray')
da
Opening file "./../data/arm26_elbow_flex_e.trc" ... Number of markers changed from 3 to 2. done.
<xarray.DataArray 'Position data' (time: 121, marker: 2, component: 3)> array([[[ -13.05452443, 39.50547557, 169.5054756 ], [ -13.12468341, -533.5696827 , 251.4203173 ]], [[ -12.96064763, 39.59935237, 169.5993524 ], [ -12.86702479, -533.6003803 , 251.3825496 ]], [[ -12.85342531, 39.70657469, 169.7065747 ], [ -12.58261002, -533.6298174 , 251.345015 ]], [[ -12.73642902, 39.82357098, 169.823571 ], [ -12.24699837, -533.6583339 , 251.3065762 ]], [[ -12.6135559 , 39.9464441 , 169.9464441 ], [ -11.83747124, -533.6860727 , 251.2661701 ]], [[ -12.48889884, 40.07110116, 170.0711012 ], [ -11.33375263, -533.7129239 , 251.2228408 ]], [[ -12.36661015, 40.19338985, 170.1933899 ], [ -10.71857495, -533.7384701 , 251.1757657 ]], ... [[ -11.92946669, 40.63053331, 170.6305333 ], [ 231.1686938 , -301.8004443 , 231.2845456 ]], [[ -11.89222162, 40.66777838, 170.6677784 ], [ 231.1493615 , -301.2057996 , 231.2236921 ]], [[ -11.87722018, 40.68277982, 170.6827798 ], [ 231.1262125 , -300.7204226 , 231.1675614 ]], [[ -11.88496206, 40.67503794, 170.6750379 ], [ 231.1004416 , -300.3270241 , 231.1155571 ]], [[ -11.91518938, 40.64481062, 170.6448106 ], [ 231.0730594 , -300.0052994 , 231.0669795 ]], [[ -11.96689527, 40.59310473, 170.5931047 ], [ 231.0449219 , -299.7324972 , 231.0210452 ]], [[ -12.03835742, 40.52164258, 170.5216426 ], [ 231.0167559 , -299.4841418 , 230.9769121 ]]]) Coordinates: * time (time) float64 0.0 0.008333 0.01667 0.025 ... 0.9833 0.9917 1.0 * marker (marker) <U16 'r_acromion' 'r_radius_styloid' * component (component) <U1 'X' 'Y' 'Z' Attributes: header: [['PathFileType', '4', '(X/Y/Z)', 'arm26_elbow_flex.trc', '... data_rate: 120.0 camera_rate: 120.0 nframes: 121 nmarkers: 2 markers: ['r_acromion', 'r_radius_styloid'] xyz: ['X1', 'Y1', 'Z1', 'X2', 'Y2', 'Z2'] units: mm fname: ./../data/arm26_elbow_flex_e.trc fname2:
array([[[ -13.05452443, 39.50547557, 169.5054756 ], [ -13.12468341, -533.5696827 , 251.4203173 ]], [[ -12.96064763, 39.59935237, 169.5993524 ], [ -12.86702479, -533.6003803 , 251.3825496 ]], [[ -12.85342531, 39.70657469, 169.7065747 ], [ -12.58261002, -533.6298174 , 251.345015 ]], [[ -12.73642902, 39.82357098, 169.823571 ], [ -12.24699837, -533.6583339 , 251.3065762 ]], [[ -12.6135559 , 39.9464441 , 169.9464441 ], [ -11.83747124, -533.6860727 , 251.2661701 ]], [[ -12.48889884, 40.07110116, 170.0711012 ], [ -11.33375263, -533.7129239 , 251.2228408 ]], [[ -12.36661015, 40.19338985, 170.1933899 ], [ -10.71857495, -533.7384701 , 251.1757657 ]], ... [[ -11.92946669, 40.63053331, 170.6305333 ], [ 231.1686938 , -301.8004443 , 231.2845456 ]], [[ -11.89222162, 40.66777838, 170.6677784 ], [ 231.1493615 , -301.2057996 , 231.2236921 ]], [[ -11.87722018, 40.68277982, 170.6827798 ], [ 231.1262125 , -300.7204226 , 231.1675614 ]], [[ -11.88496206, 40.67503794, 170.6750379 ], [ 231.1004416 , -300.3270241 , 231.1155571 ]], [[ -11.91518938, 40.64481062, 170.6448106 ], [ 231.0730594 , -300.0052994 , 231.0669795 ]], [[ -11.96689527, 40.59310473, 170.5931047 ], [ 231.0449219 , -299.7324972 , 231.0210452 ]], [[ -12.03835742, 40.52164258, 170.5216426 ], [ 231.0167559 , -299.4841418 , 230.9769121 ]]])
array([0. , 0.008333, 0.016667, 0.025 , 0.033333, 0.041667, 0.05 , 0.058333, 0.066667, 0.075 , 0.083333, 0.091667, 0.1 , 0.108333, 0.116667, 0.125 , 0.133333, 0.141667, 0.15 , 0.158333, 0.166667, 0.175 , 0.183333, 0.191667, 0.2 , 0.208333, 0.216667, 0.225 , 0.233333, 0.241667, 0.25 , 0.258333, 0.266667, 0.275 , 0.283333, 0.291667, 0.3 , 0.308333, 0.316667, 0.325 , 0.333333, 0.341667, 0.35 , 0.358333, 0.366667, 0.375 , 0.383333, 0.391667, 0.4 , 0.408333, 0.416667, 0.425 , 0.433333, 0.441667, 0.45 , 0.458333, 0.466667, 0.475 , 0.483333, 0.491667, 0.5 , 0.508333, 0.516667, 0.525 , 0.533333, 0.541667, 0.55 , 0.558333, 0.566667, 0.575 , 0.583333, 0.591667, 0.6 , 0.608333, 0.616667, 0.625 , 0.633333, 0.641667, 0.65 , 0.658333, 0.666667, 0.675 , 0.683333, 0.691667, 0.7 , 0.708333, 0.716667, 0.725 , 0.733333, 0.741667, 0.75 , 0.758333, 0.766667, 0.775 , 0.783333, 0.791667, 0.8 , 0.808333, 0.816667, 0.825 , 0.833333, 0.841667, 0.85 , 0.858333, 0.866667, 0.875 , 0.883333, 0.891667, 0.9 , 0.908333, 0.916667, 0.925 , 0.933333, 0.941667, 0.95 , 0.958333, 0.966667, 0.975 , 0.983333, 0.991667, 1. ])
array(['r_acromion', 'r_radius_styloid'], dtype='<U16')
array(['X', 'Y', 'Z'], dtype='<U1')
h, data = read_trc('./../data/walk.trc', fname2='', dropna=False, na=0.0, fmt='uni')
data
Opening file "./../data/walk.trc" ... Number of markers changed from 28 to 55. done.
Frame# | Time | R.ASISx | R.ASISy | R.ASISz | L.ASISx | L.ASISy | L.ASISz | R.PSISx | R.PSISy | ... | V_R.TT_KJCz | V_L.TT_KJCx | V_L.TT_KJCy | V_L.TT_KJCz | V_R.MT2x | V_R.MT2y | V_R.MT2z | V_L.MT2x | V_L.MT2y | V_L.MT2z | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 0.000 | 516.54236 | 966.88000 | -306.10416 | 531.67438 | 981.34631 | -560.16077 | 315.74045 | 977.08398 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
1 | 2 | 0.007 | 523.92200 | 967.96594 | -308.23773 | 539.83044 | 982.78345 | -561.77612 | 323.29425 | 977.64166 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
2 | 3 | 0.013 | 531.20807 | 968.92493 | -310.12112 | 547.60663 | 984.00653 | -563.42725 | 330.56866 | 978.15283 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | 4 | 0.020 | 538.24219 | 969.77612 | -311.72064 | 555.40649 | 985.09637 | -564.85162 | 337.63867 | 978.81207 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
4 | 5 | 0.027 | 545.11420 | 970.81128 | -313.07266 | 563.14301 | 986.00916 | -566.06659 | 344.50589 | 979.21619 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
179 | 180 | 1.193 | 1875.04834 | 958.35535 | -290.67004 | 1897.06970 | 960.27222 | -546.90094 | 1678.10901 | 977.31805 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
180 | 181 | 1.200 | 1885.37988 | 958.09222 | -291.67429 | 1907.52881 | 960.81549 | -547.97144 | 1688.67249 | 977.12646 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
181 | 182 | 1.207 | 1895.50452 | 957.80798 | -292.71875 | 1917.97290 | 961.49707 | -548.99799 | 1699.17065 | 977.02045 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
182 | 183 | 1.213 | 1905.40540 | 957.61029 | -293.84250 | 1928.34631 | 962.31494 | -550.08704 | 1709.65186 | 976.93237 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
183 | 184 | 1.220 | 1916.91516 | 958.57813 | -294.85443 | 1938.59363 | 963.29272 | -551.26306 | 1720.05396 | 976.89636 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
184 rows × 167 columns
h, data = read_trc('./../data/walk.trc', fname2='', dropna=False, na=0.0, fmt='multi')
data
Opening file "./../data/walk.trc" ... Number of markers changed from 28 to 55. done.
Marker | R_ASIS | L_ASIS | R_PSIS | L_PSIS | ... | V_R_TT_KJC | V_L_TT_KJC | V_R_MT2 | V_L_MT2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Coordinate | X | Y | Z | X | Y | Z | X | Y | Z | X | ... | Z | X | Y | Z | X | Y | Z | X | Y | Z |
XYZ | X1 | Y1 | Z1 | X2 | Y2 | Z2 | X3 | Y3 | Z3 | X4 | ... | Z52 | X53 | Y53 | Z53 | X54 | Y54 | Z54 | X55 | Y55 | Z55 |
Time | |||||||||||||||||||||
0.000 | 516.54236 | 966.88000 | -306.10416 | 531.67438 | 981.34631 | -560.16077 | 315.74045 | 977.08398 | -388.89532 | 312.81592 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
0.007 | 523.92200 | 967.96594 | -308.23773 | 539.83044 | 982.78345 | -561.77612 | 323.29425 | 977.64166 | -391.11392 | 320.88770 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
0.013 | 531.20807 | 968.92493 | -310.12112 | 547.60663 | 984.00653 | -563.42725 | 330.56866 | 978.15283 | -393.34290 | 328.17276 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
0.020 | 538.24219 | 969.77612 | -311.72064 | 555.40649 | 985.09637 | -564.85162 | 337.63867 | 978.81207 | -395.60764 | 335.90649 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
0.027 | 545.11420 | 970.81128 | -313.07266 | 563.14301 | 986.00916 | -566.06659 | 344.50589 | 979.21619 | -397.85052 | 343.31287 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
1.193 | 1875.04834 | 958.35535 | -290.67004 | 1897.06970 | 960.27222 | -546.90094 | 1678.10901 | 977.31805 | -385.06229 | 1678.84143 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
1.200 | 1885.37988 | 958.09222 | -291.67429 | 1907.52881 | 960.81549 | -547.97144 | 1688.67249 | 977.12646 | -386.23868 | 1689.18640 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
1.207 | 1895.50452 | 957.80798 | -292.71875 | 1917.97290 | 961.49707 | -548.99799 | 1699.17065 | 977.02045 | -387.41364 | 1699.72668 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
1.213 | 1905.40540 | 957.61029 | -293.84250 | 1928.34631 | 962.31494 | -550.08704 | 1709.65186 | 976.93237 | -388.50803 | 1710.00281 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
1.220 | 1916.91516 | 958.57813 | -294.85443 | 1938.59363 | 963.29272 | -551.26306 | 1720.05396 | 976.89636 | -389.46796 | 1720.32813 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
184 rows × 165 columns
h, data = read_trc('./../data/walk.trc', fname2='', dropna=True, na=0.0, fmt='multi')
data
Opening file "./../data/walk.trc" ... done.
Marker | R_ASIS | L_ASIS | R_PSIS | L_PSIS | ... | R_MT2 | L_Knee_Medial | L_Ankle_Medial | L_MT2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Coordinate | X | Y | Z | X | Y | Z | X | Y | Z | X | ... | Z | X | Y | Z | X | Y | Z | X | Y | Z |
XYZ | X1 | Y1 | Z1 | X2 | Y2 | Z2 | X3 | Y3 | Z3 | X4 | ... | Z25 | X26 | Y26 | Z26 | X27 | Y27 | Z27 | X28 | Y28 | Z28 |
Time | |||||||||||||||||||||
0.000 | 516.54236 | 966.88000 | -306.10416 | 531.67438 | 981.34631 | -560.16077 | 315.74045 | 977.08398 | -388.89532 | 312.81592 | ... | -295.95847 | 584.31927 | 491.83475 | -451.49405 | 640.91467 | 102.96970 | -461.64136 | 766.49017 | 67.05472 | -520.25671 |
0.007 | 523.92200 | 967.96594 | -308.23773 | 539.83044 | 982.78345 | -561.77612 | 323.29425 | 977.64166 | -391.11392 | 320.88770 | ... | -296.16809 | 585.61047 | 491.72031 | -452.45239 | 641.00195 | 102.78003 | -461.30609 | 766.70880 | 66.18866 | -519.62793 |
0.013 | 531.20807 | 968.92493 | -310.12112 | 547.60663 | 984.00653 | -563.42725 | 330.56866 | 978.15283 | -393.34290 | 328.17276 | ... | -296.09930 | 586.44348 | 491.23099 | -453.99197 | 641.22186 | 102.52743 | -461.05392 | 766.92682 | 65.27229 | -519.13348 |
0.020 | 538.24219 | 969.77612 | -311.72064 | 555.40649 | 985.09637 | -564.85162 | 337.63867 | 978.81207 | -395.60764 | 335.90649 | ... | -295.37305 | 588.36719 | 491.34662 | -454.16455 | 641.47699 | 102.29733 | -460.72614 | 767.09344 | 64.64764 | -518.64502 |
0.027 | 545.11420 | 970.81128 | -313.07266 | 563.14301 | 986.00916 | -566.06659 | 344.50589 | 979.21619 | -397.85052 | 343.31287 | ... | -294.78860 | 589.59979 | 491.36469 | -454.49768 | 641.77759 | 102.33441 | -460.27908 | 767.23840 | 64.11570 | -518.32220 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
1.193 | 1875.04834 | 958.35535 | -290.67004 | 1897.06970 | 960.27222 | -546.90094 | 1678.10901 | 977.31805 | -385.06229 | 1678.84143 | ... | -349.12631 | 1974.25183 | 481.42581 | -449.71994 | 2117.11304 | 115.82814 | -464.73233 | 2238.68921 | 116.63618 | -525.20459 |
1.200 | 1885.37988 | 958.09222 | -291.67429 | 1907.52881 | 960.81549 | -547.97144 | 1688.67249 | 977.12646 | -386.23868 | 1689.18640 | ... | -348.93127 | 1982.22021 | 480.87662 | -450.35571 | 2121.40991 | 113.80779 | -464.63849 | 2244.71509 | 110.86374 | -523.01886 |
1.207 | 1895.50452 | 957.80798 | -292.71875 | 1917.97290 | 961.49707 | -548.99799 | 1699.17065 | 977.02045 | -387.41364 | 1699.72668 | ... | -348.68399 | 1989.57397 | 480.27377 | -451.05280 | 2124.43408 | 112.07399 | -464.43576 | 2248.97974 | 104.70275 | -520.64160 |
1.213 | 1905.40540 | 957.61029 | -293.84250 | 1928.34631 | 962.31494 | -550.08704 | 1709.65186 | 976.93237 | -388.50803 | 1710.00281 | ... | -348.85641 | 1996.14453 | 479.61557 | -451.70987 | 2127.16431 | 110.69190 | -464.25732 | 2252.41968 | 98.64201 | -519.56976 |
1.220 | 1916.91516 | 958.57813 | -294.85443 | 1938.59363 | 963.29272 | -551.26306 | 1720.05396 | 976.89636 | -389.46796 | 1720.32813 | ... | -348.74100 | 2001.50623 | 478.78607 | -452.58780 | 2129.84302 | 109.49210 | -464.42734 | 2255.61060 | 93.78249 | -518.34271 |
184 rows × 84 columns