Page 1 of 1

Theia3d and Opensim

Posted: Mon Jul 31, 2023 9:59 am
by gordhan
Hi,

What would be the best way to import markerless c3d data from Theia3d? There aren't any markers for a TRC file, just joint angles from segment pose estimation. I'm using Opensim4.4

Cheers,
Gordhan

Re: Theia3d and Opensim

Posted: Tue Aug 08, 2023 6:45 am
by docvi
Hi,

I do not have all the OpenSim knowledge since I am a just a rare OpenSim user but here is my suggestion.

I dont think there is a straightforward way to do it.
You can use the ezc3d repo to read the c3d file in Matlab and extract the segment data: https://github.com/pyomeca/ezc3d
Then you should probably use the segment data and write a function to create virtual points and another function to export them in the trc format that can be used by opensim.

/Vincent

Re: Theia3d and Opensim

Posted: Tue Aug 08, 2023 2:23 pm
by johnjdavisiv
I think Vincent is right, though you might not have to go to the trouble of creating virtual markers if you can extract the joint angles and if you can be sure they are expressed in the same coordinate system as your OpenSim model's joints. The IKTool is capable of tracking joint angles supplied as a .mot file, so you can just have the model try to match the markerless system joint angles as closely as it can via least squares.

I think that functionality was originally developed for goniometry data, but it should work just fine for markerless data as well. You can even provide relative weightings just like with a marker file. I haven't done this myself though, and I vaguely remember seeing a bug reported on the opensim-core GitHub regarding IK with only a coordinates file (maybe you need a "dummy" marker file with zero weights?), so I'd be interested to hear how it goes. I imagine (as Vincent mentioned) the main challenge will be extracting the joint angles from the c3d file and formatting them correctly as a .mot file that OpenSim can read. You'll want to be very careful with how the Theia3d model defines its joint angles at the knee and ankle, especially in the non-sagittal planes.

Re: Theia3d and Opensim

Posted: Mon Aug 28, 2023 4:14 pm
by gordhan
Thanks John and Vincent for the comments/thoughts. I'll have a go at extracting the joint angles before attempting a virtual markers approach.