osimC3D- importing c3d files to matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
itay coifman
Posts: 4
Joined: Tue Apr 14, 2020 11:50 am

osimC3D- importing c3d files to matlab

Post by itay coifman » Mon Oct 04, 2021 2:38 am

just switched to OpenSim 4.3 but all those issues were the same at 4.1:

Our lab uses Qualisys QTM for sampling biomechanical data and creating c3d files. I was sampling EMG data+ force plate data and when I was trying to run my matlab+OpenSim pipeline reading the c3d I had some issues.

Code: Select all

c3d = osimC3D(c3dPath,0);
a= c3d.getTable_forces();
the TimeSerries table makes no sense it has much more samples (and sample rate-2160 Hz) than the original file (240 Hz)created by exporting directly from the QTM to the Matlab. It seems that somehow the function merges the EMG data with the FP data...

I attached my google drive folder with the relevant C3D, and the corresponding Matlab export (both were created using QTM export)
https://drive.google.com/drive/folders/ ... sp=sharing
any idea what can I do to fix the problem?

another general question:

Code: Select all

osimC3D(path2c3d, ForceLocation)
what is the meaning of the ForceLocation(0 vs 1, 2-is not working at 4.3)?

Tags:

User avatar
John Davis
Posts: 60
Joined: Mon Aug 26, 2019 7:42 am

Re: osimC3D- importing c3d files to matlab

Post by John Davis » Wed Oct 06, 2021 7:17 am

The ForceLocation parameter dictates whether the ground reaction forces are expressed as forces and moments applied at the center of pressure (ForceLocation=1) or expressed as forces and moments applied from the origin of the force plate (ForceLocation=0). ForceLocation=1 is nice for visualization; you can plot your motion and force data in the GUI to see if you have any misalignments.

The advantage of ForceLocation=0 is that you don't get the numerical instabilities that tend to happen with the center of pressure when the vertical GRF is close to zero, and applying the "raw" forces and moments to the model from the force plate origin is (in theory) equivalent to applying the GRF + the free moment to the model at the center of pressure. Ton van den Bogert has a good explanation of this here.

Unfortunately the last time I tried (in 4.1 I think?) I could not get ForceLocation=0 to actually work for my force data (also from QTM, for what it's worth), so I exported .tsv files from QTM, manually pre-processed them in MATLAB, and read them into OpenSim as .mot files instead.

POST REPLY