Theia3d and Opensim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Gordhan Mahtani
Posts: 2
Joined: Wed Oct 26, 2022 2:39 pm

Theia3d and Opensim

Post by Gordhan Mahtani » Mon Jul 31, 2023 9:59 am

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

Tags:

User avatar
Vincent Fohanno
Posts: 23
Joined: Thu May 10, 2018 10:03 am

Re: Theia3d and Opensim

Post by Vincent Fohanno » Tue Aug 08, 2023 6:45 am

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

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

Re: Theia3d and Opensim

Post by John Davis » Tue Aug 08, 2023 2:23 pm

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.

User avatar
Gordhan Mahtani
Posts: 2
Joined: Wed Oct 26, 2022 2:39 pm

Re: Theia3d and Opensim

Post by Gordhan Mahtani » Mon Aug 28, 2023 4:14 pm

Thanks John and Vincent for the comments/thoughts. I'll have a go at extracting the joint angles before attempting a virtual markers approach.

POST REPLY