OpenSim/Python Read/Write TRC Compatibility
- Emily Eichenlaub
- Posts: 2
- Joined: Fri Oct 15, 2021 10:37 am
OpenSim/Python Read/Write TRC Compatibility
I am in the process of creating a Python pipeline to batch process and analyze data. I convert my marker data from .c3d to .trc. When I preview my experimental data in OpenSim, my markers are incorrect. However, if I manually open the .trc file, save it, and then reload it in OpenSim, they are in correct locations. Is there a solution to this incompatibility without manually opening and saving .trc files for each trial? Thank you in advance!
Tags:
- Mohammadreza Rezaie
- Posts: 407
- Joined: Fri Nov 24, 2017 12:48 am
Re: OpenSim/Python Read/Write TRC Compatibility
Hi, could you please elaborate the incompatibility? In which software do you open the TRC file?When I preview my experimental data in OpenSim, my markers are incorrect. However, if I manually open the .trc file, save it, and then reload it in OpenSim, they are in correct locations.
Are you using C3DFileAdapter and TRCFileAdapter classes?
- Emily Eichenlaub
- Posts: 2
- Joined: Fri Oct 15, 2021 10:37 am
Re: OpenSim/Python Read/Write TRC Compatibility
Hello, thank you for your response. I am working with OpenSim 4.4, so I am trying to work with ezc3d, as recommended by OpenSim.
- Mohammadreza Rezaie
- Posts: 407
- Joined: Fri Nov 24, 2017 12:48 am
Re: OpenSim/Python Read/Write TRC Compatibility
The issue might be related to the way you write TRC files. If you share this part of your code, troubleshooting would be much easier. Something may be wrong with the headers or delimiters, for example.
OpenSim uses EZC3D internally via C3DFileAdapter. Also TRCFileAdapter and STOFileAdapter classes can be used for writing data (markers, GRF, and EMG) to TRC and MOT/STO files, respectively. They really make things easier. Here you can find some examples on how to use them: https://github.com/opensim-org/opensim- ... Adapter.py
OpenSim uses EZC3D internally via C3DFileAdapter. Also TRCFileAdapter and STOFileAdapter classes can be used for writing data (markers, GRF, and EMG) to TRC and MOT/STO files, respectively. They really make things easier. Here you can find some examples on how to use them: https://github.com/opensim-org/opensim- ... Adapter.py