Page 1 of 1

Unable to associate motion(.mot file) to model

Posted: Thu Jan 29, 2015 5:33 pm
by jask
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

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

Posted: Fri Jan 30, 2015 9:05 am
by aymanh
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

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

Posted: Mon Feb 02, 2015 3:29 pm
by jask
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

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

Posted: Tue Feb 03, 2015 11:16 am
by aymanh
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

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

Posted: Tue Feb 03, 2015 9:23 pm
by jask
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

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

Posted: Wed Feb 04, 2015 8:18 am
by manez
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

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

Posted: Sat Sep 21, 2019 8:02 am
by mritula
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

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

Posted: Sat Sep 21, 2019 9:04 am
by aymanh
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