Converting c3d to mot

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Rodrigo Mateus
Posts: 55
Joined: Thu Feb 22, 2018 3:07 am

Converting c3d to mot

Post by Rodrigo Mateus » Fri Feb 01, 2019 11:57 am

Hello there!

I was trying to get into the issue of converting a c3d file to be used in opensim. Since it is the first time I do this step ( in my works with opensim I received the .mot files), I used the matlab scripts from the project from felipe alvim (https://simtk.org/projects/c3d2opensim). To get confortable with the code, I used the SLTHT in the same project, however, I can not get rid of this error in Matlab:

Undefined function 'adapta_nomes_coordgen' for input arguments of type 'cell'.

Error in c3d2OS (line 151)
lista_nomes_coordgen2 = adapta_nomes_coordgen (lista_nomes_coordgen1);

How do I get around this?

Best regards,

Rodrigo Mateus

Tags:

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Converting c3d to mot

Post by jimmy d » Fri Feb 08, 2019 11:01 am

The project you linked seems to be pretty old and I wouldn't expect the functions to still work with OpenSim 4.0.

You could try to use the in-built methods of 4.0 with the included Matlab classes to perform the transform. Documentation for setting your Matlab environment is here and documentation for the C3D adapter is here.

I think I read somewhere that you are using Matlab 2014-- just be aware that OpenSim 4.0 is 64-bit and that must match your Matlab version (Matlab must be 64- it version)

User avatar
saylee patkar
Posts: 35
Joined: Wed Jun 20, 2018 1:03 am

Re: Converting c3d to mot

Post by saylee patkar » Wed Feb 20, 2019 12:18 am

jimmy wrote:
Fri Feb 08, 2019 11:01 am
The project you linked seems to be pretty old and I wouldn't expect the functions to still work with OpenSim 4.0.

You could try to use the in-built methods of 4.0 with the included Matlab classes to perform the transform. Documentation for setting your Matlab environment is here and documentation for the C3D adapter is here.

I think I read somewhere that you are using Matlab 2014-- just be aware that OpenSim 4.0 is 64-bit and that must match your Matlab version (Matlab must be 64- it version)
Dear sir,
I have configured MATLAB with Opensim successfully. Also I have extracted some c3d files using example script "c3dExport.m". But some c3d files I could not convert to trc and mot due to some error as follows.
1. Illegal Column label.*119 changed to _119
Invalid field name :'_119'.
(this is error from utility osimTableToStruct(Line 94))

2. Java exception occurred:

I have added pictures of errors since I am working on different computer and on that I am not allowed any connectivity access.
Attachments
Error.docx
(117.57 KiB) Downloaded 16 times

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Converting c3d to mot

Post by jimmy d » Wed Feb 20, 2019 10:14 am

The error is related to some renaming issues found here. Unnamed markers in the C3D are given the name "*N" where N is a number. The Matlab function tries to rename that too "_N", but underscores are illegal at the beginnning of the Matlab Struct members.

You could fix this in one of two ways; (i) delete all the unnamed markers in your C3D, or (ii) edit the local version of the Matlab Script to change '*' characters to something like 'm' ( "*119" -> "m119").

A fix will be included in the next OpenSim update, but that may be awhile.

User avatar
saylee patkar
Posts: 35
Joined: Wed Jun 20, 2018 1:03 am

Re: Converting c3d to mot

Post by saylee patkar » Thu Feb 21, 2019 2:07 am

jimmy wrote:
Wed Feb 20, 2019 10:14 am
(ii) edit the local version of the Matlab Script to change '*' characters to something like 'm' ( "*119" -> "m119").

A fix will be included in the next OpenSim update, but that may be awhile.
this solved the error.
Thank you.

POST REPLY