Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRC file written by GUI cannot be read by TRCFileAdapter #1112

Closed
tkuchida opened this issue May 28, 2019 · 7 comments
Closed

TRC file written by GUI cannot be read by TRCFileAdapter #1112

tkuchida opened this issue May 28, 2019 · 7 comments
Labels

Comments

@tkuchida
Copy link
Member

tkuchida commented May 28, 2019

Steps to reproduce

  • File > Preview Experimental Data…
  • Open walking2_markers.trc (extracted from walking2.c3d) and attached in this .zip file: walking2_markers.zip
  • In Navigator, expand "ExperimentalData_0", right-click on "walking2_markers.trc", and select "Transform"
  • Rotate by 90 degrees about X (arbitrary) and save as "transformed_walking2_markers.trc"
  • Preview new "transformed_walking2_markers.trc" file in GUI --> works
  • Attempt to read file in Python using TRCFileAdapter:
import opensim as osim
markers = osim.TRCFileAdapter.read('transformed_walking2_markers.trc')

Expected result

File can be read in the GUI and in Python

Actual result

Either both should work or both should fail. The GUI can read the file, which suggests to the user that the file has been correctly written. However, the file cannot be read from Python because the whitespace in the header is incorrect. Error message:

RuntimeError: std::exception in 'OpenSim::TimeSeriesTableVec3 OpenSim::TRCFileAdapter::read(std::string const &)': Error reading column Labels in file 'transformed_walking2_markers.trc'. Unexpected number of column labels. Expected = 46. Recieved = 44.
	Thrown at trcfileadapter.cpp:125 in extendRead().

Environment and GUI version

Public release of 4.0

@tkuchida tkuchida added the bug label May 28, 2019
@tkuchida
Copy link
Member Author

@aymanhab See L409 and L410 here: spaces should be \t as elsewhere.

@aymanhab
Copy link
Member

Perfect, now that you did the hard part and found it @tkuchida do you mind submitting a PR ;) or I can do it later. Thanks 👍

@tkuchida
Copy link
Member Author

Unfortunately, I've never been able to build the GUI 😢 so I have no way of testing.

@aymanhab
Copy link
Member

aymanhab commented Jun 6, 2019

A build/artifact including the fix successfully opened the trc file from the scripting shell.

@aymanhab
Copy link
Member

If somebody can verify fix in artifact that would be great. Use scripting shell easier than python environment

@jimmyDunne
Copy link
Member

I downloaded and installed the latest GUI artifact on a Windows VM, performed the transform in the GUI, and use Python to read the transformed trc. It seemed to work without issue-- no exceptions or oddities. I think we should still test again when before doing the next minor release.

@aymanhab
Copy link
Member

Any reason this is not closed @jimmyDunne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants