Unable to associate motion(.mot file) to model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jas K
Posts: 5
Joined: Wed Jan 28, 2015 4:15 pm

Unable to associate motion(.mot file) to model

Post by Jas K » Thu Jan 29, 2015 5:33 pm

Hello,

I am relatively new to OpenSim, basically I have managed to export data from Visual 3D in .mot format. I am trying to load this motion file to lower extremity model (Both legs with muscles) and it comes up with an error : 'Could not associate motion file to model'. However I am able to load the same motion file to a different model - 3DGiantModel2392. I am not sure why its happening, I would appreciate any help.

Regards
Jas

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Unable to associate motion(.mot file) to model

Post by Ayman Habib » Fri Jan 30, 2015 9:05 am

Hi Jas,

For OpenSim to associate a motion file to a model, the file has to have at least some column headers that match the names of the coordinates in the model.

Hope this explains why you can associate a motion with one model but not another.

Best regards,
-Ayman

User avatar
Jas K
Posts: 5
Joined: Wed Jan 28, 2015 4:15 pm

Re: Unable to associate motion(.mot file) to model

Post by Jas K » Mon Feb 02, 2015 3:29 pm

Hi Ayman,

Thanks for your reply. Would you be able to clarify how to match the column headers with the name of the coordinates in the model? Is there an example or a tutorial that I could follow that shows me how to do it?

Thankyou
Jas

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Unable to associate motion(.mot file) to model

Post by Ayman Habib » Tue Feb 03, 2015 11:16 am

Hi Jas,

The motion file (.mot or .sto) is an ASCII file that you can open in notepad and see the column headers as text. These headers should match the names of the coordinates in the model. Coordinate names show up in the Coordinate view in the OpenSim GUI and can be edited by opening the model .osim file in a text editor and changing the names of the coordinates accordingly (they would be located under the <Coordinate> tags.

Hope this helps,
-Ayman

User avatar
Jas K
Posts: 5
Joined: Wed Jan 28, 2015 4:15 pm

Re: Unable to associate motion(.mot file) to model

Post by Jas K » Tue Feb 03, 2015 9:23 pm

Hi Ayman,

Thankyou for explaining why I was unable to associate the motion to the model. What I can see is the motion file has names like hip_flexion_r whereas the model .osim file has names like r_hip_flexion. I have tried editing the model .osim file in the editor and changed the names from r_hip_flexion to hip_flexion_r exactly like the names in the motion(.mot) file.
Now I get a loading error, I cant load the edited model .osim file. I am not sure if manually editing the model .osim file is the right way to do it? or if I am just making a typing error somewhere though I used find and replace so I dont think I have missed anything.

Thankyou
Jas

User avatar
Iman Shirinbayan
Posts: 7
Joined: Mon Oct 20, 2014 6:39 am

Re: Unable to associate motion(.mot file) to model

Post by Iman Shirinbayan » Wed Feb 04, 2015 8:18 am

Hi Jas,

I think you better change the header of your (.mot) file rather than changing your .osim file. Because sometimes in .osim file, when you change a joint's name, you have to change some other representations of that join's name such as display subroutines (that might cause the error). I think it is more convenient to adjust you .mot file to .osim. file.

Bests,
Iman

User avatar
Mritula Chandrasekaran
Posts: 94
Joined: Tue Dec 19, 2017 5:36 am

Re: Unable to associate motion(.mot file) to model

Post by Mritula Chandrasekaran » Sat Sep 21, 2019 8:02 am

Hi I have data of many subjects, it becomes impossible to change the .mot headers of so many subjects. What shall I do? I am facing the same problem

Thanks,
Mritula

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Unable to associate motion(.mot file) to model

Post by Ayman Habib » Sat Sep 21, 2019 9:04 am

Hello,

You can write a script to modify all the files in python or matlab or alternatively you can change the model file to rename coordinates, just make sure you don't have other files (e.g. setup files for tools) or other places in the model that refer to the old coordinate names.

Hope this helps,
-Ayman

POST REPLY