Page 1 of 1

OpenSIM transform tool make .trc files corrupt

Posted: Thu Aug 01, 2019 10:20 am
by frstrtr
OpenSIM transform tool make .trc files corrupt

after saving transformed .trc files with marker data OpenSIM throws an error when opening transformed file:

InverseKinematicsTool Failed: Error reading column Labels in file transformed_walking2.trc'. Unexpected number of column labels. Expected = 46. Recieved = 44.
Thrown at trcfileadapter.cpp:125 in extendRead().

Re: OpenSIM transform tool make .trc files corrupt

Posted: Thu Aug 01, 2019 11:48 am
by jimmy
There are some details on the trc file format here. The error message you are getting seems to indicate the NumMarkers property in the trc header is specifying 46 markers but there are only 44 markers worth of data. This type of error typically happens when you edit the number of markers in the data but don't change the NumMarkers property in the header.

Re: OpenSIM transform tool make .trc files corrupt

Posted: Fri Aug 02, 2019 6:18 am
by frstrtr
I made an experiment.

My original .trc file didn't throw any error

but after i save .trc from this original file using transfrom tool - it throws mentioned above error.

Re: OpenSIM transform tool make .trc files corrupt

Posted: Fri Aug 02, 2019 8:00 am
by jimmy
What transform tool?

Re: OpenSIM transform tool make .trc files corrupt

Posted: Sat Aug 03, 2019 7:22 am
by frstrtr
Opensim

File -> Preview Experimental Data... (open .trc file)

right click on experimental data .trc file in Navigator -> Transform

Rotate X/Y or Z

Save as... (transformed .trc file)

Re: OpenSIM transform tool make .trc files corrupt

Posted: Mon Aug 05, 2019 7:42 am
by tkuchida
This is a known issue with the GUI (https://github.com/opensim-org/opensim-gui/issues/1102). You should be able to edit the TRC file, replacing spaces with tabs. Please see the "Marker (.trc) Files" page in the Confluence documentation (https://simtk-confluence.stanford.edu:8 ... c%29+Files) for a description of the required TRC file format.

Re: OpenSIM transform tool make .trc files corrupt

Posted: Mon Aug 05, 2019 11:09 am
by frstrtr
Thanks, Thomas!

But already solved it by fixing GitHub dvarnai/pyC3D2OSIM python script.

resulting code here:
https://github.com/IISCI/c3d_2_trc