Scaled model displaced when loading .mot file

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Scaled model displaced when loading .mot file

Post by Sheeba Davis » Fri Sep 18, 2020 4:06 am

Hello!!!

1. When I open my scaled model in GUI it looks fine but when I load the scaledstatic.mot file, it gets displaced. I checked the model offset, it looks fine.

2. Also in the scaled model, femur and tibia seems to be missing.

Can someone please help me with this.

Thanks in advance,
Sheeba

Tags:

User avatar
Michael Asmussen
Posts: 67
Joined: Mon Jul 11, 2016 7:46 am

Re: Scaled model displaced when loading .mot file

Post by Michael Asmussen » Fri Sep 18, 2020 11:28 am

Hi Sheeba,

1. For the scaled model, how far is it displaced? How far is the model relative to the displayed coordinate system?

2. Where are your .vtp files located? Check to see if you model in the .xml file is calling the correct .vtp file for the femur and tibia.

I hope this helps

Mike

User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Re: Scaled model displaced when loading .mot file

Post by Sheeba Davis » Fri Sep 18, 2020 10:39 pm

Hi Mike

Thank you very much for your reply :D .
1. For the scaled model, how far is it displaced? How far is the model relative to the displayed coordinate system?
The model goes below the ground. I checked the model offset and all of them showed 0. When i actually open the scaled model it look fine but when i overlayed experimental markers on the model markers, the model went below the floor.
2. Where are your .vtp files located? Check to see if you model in the .xml file is calling the correct .vtp file for the femur and tibia.
I checked the .vtp files of femur & tibia which are in the same location as other segments. i am not sure about what you mean by 'Check to see if you model in the .xml file is calling the correct .vtp file for the femur and tibia'. Can you please explain me further. I have attached the scaled model (without displaying the muscles) and also the messages that i got in the message window.
opensim_snapshot.png
scaled model
opensim_snapshot.png (279.59 KiB) Viewed 1701 times
Couldn't find file 'r_femur.vtp'.
Couldn't find file 'r_tibia.vtp'.
Couldn't find file 'l_femur.vtp'.
Couldn't find file 'l_tibia.vtp'.

Thank you for all your help.

Regards
Sheeba

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

Re: Scaled model displaced when loading .mot file

Post by Ayman Habib » Sat Sep 19, 2020 9:41 am

Hi Sheeba,

If you did Marker Placement along with scaling, the resulting model is posed for the static trial so it's very possible it doesn't have the same coordinate values as the original model. There's nothing wrong with that since coordinate values can be changed from the GUI and have no bearing on the model function. You can set the coordinate values/sliders to match the pre-scaled model.

For the mesh files, the model you're using apparently uses custom mesh files (we renamed our mesh files in 4.0+ to avoid duplication so there's no l_femur, r_femur instead we have femur_l and femur_r). If you're not using custom generated meshes, the easiest solution is to change the names of the vtp files in the osim file so you don't need to keep dealing with this issue, and so that the model can be used by others or on different machines/versions without a problem. You can find the latest mesh filenames by opening a model from the distribution (e.g. Gait2354), selecting meshes in the 3D view and picking the filenames from the Properties window.

Hope this helps,
-Ayman

User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Re: Scaled model displaced when loading .mot file

Post by Sheeba Davis » Mon Sep 21, 2020 3:43 am

Hi Ayman

Thank you very much for your reply.
If you did Marker Placement along with scaling, the resulting model is posed for the static trial so it's very possible it doesn't have the same coordinate values as the original model. There's nothing wrong with that since coordinate values can be changed from the GUI and have no bearing on the model function. You can set the coordinate values/sliders to match the pre-scaled model.
When I open the scaled model, this is how it looks,
opensim_snapshot.png
scaled model
opensim_snapshot.png (302.68 KiB) Viewed 1674 times
but when I load a motion file, then the model goes below the ground,
opensim_snapshot2.png
scaled model loaded with .mot file
opensim_snapshot2.png (102.09 KiB) Viewed 1674 times
I am unable to understand where might be the problem.
For the mesh files, the model you're using apparently uses custom mesh files (we renamed our mesh files in 4.0+ to avoid duplication so there's no l_femur, r_femur instead we have femur_l and femur_r). If you're not using custom generated meshes, the easiest solution is to change the names of the vtp files in the osim file so you don't need to keep dealing with this issue, and so that the model can be used by others or on different machines/versions without a problem. You can find the latest mesh filenames by opening a model from the distribution (e.g. Gait2354), selecting meshes in the 3D view and picking the filenames from the Properties window.
I have renamed the femur and tibia segments in the properties window of my model based on the names of the bodies provided in Gait2354 model, but still the scaled model is the same with the absence of those segments. Is anything missing in what I have done?

Also, matlab crashes when I run the code.

Thanks in advance,
Regards
Sheeba

User avatar
Axel Koussou
Posts: 56
Joined: Mon Aug 10, 2020 12:07 am

Re: Scaled model displaced when loading .mot file

Post by Axel Koussou » Wed Sep 23, 2020 1:20 am

Hi Sheeba,

I'm using the Rajagopal model and I had the same problem of missing femur and tibia after scaling.
So, as explained by Ayman, I renamed my .vtp files in my osim file. For example, if you look at the attachments, for the tibia I renamed from l_tibia.vtp to tibia_l.vtp.
I can't explain to you why but it seems to work.

Hope it will help.
Attachments
Capture.PNG
Capture.PNG (27.28 KiB) Viewed 1635 times

User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Re: Scaled model displaced when loading .mot file

Post by Sheeba Davis » Fri Sep 25, 2020 3:06 am

Hi Axel

Thanks for your response.

Ya, I renamed the vtp files as Ayman mentioned and I can now see the femur and tibia in my scaled model.

Thanks,
Sheeba

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

Re: Scaled model displaced when loading .mot file

Post by Ayman Habib » Fri Sep 25, 2020 11:29 am

Hi Sheeba,

The pose of the scaled model suggests that the static trial was collected in a different coordinate system from OpenSim (Y up, X forward). For static trial and scaling that maybe ok, but for other motions moving forward you need to preview and transform experimental data using the File->Preview Experimental Data... feature of the application.

Hope this helps,
-Ayman

User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Re: Scaled model displaced when loading .mot file

Post by Sheeba Davis » Sun Sep 27, 2020 11:57 pm

Hi Ayman

Thank you very much for your response.

I realized that the data's orientation is same as that of OpenSim and so I didn't have to rotate. But now I find another problem that I have added some new markers to the model based on experimental data and included them for scaling the model (in sclaemeasurementSet.xml & scaletask.xml files). Of course the errors were large, at the same I also observed that when I load the static motion file to the scaled model (as I wanted to overlay experimental markers on the model markers to see how far are the new model markers from the experimental markers) and what I observe is shown below (the new markers are displayed away from the scaled model).
scaled model.png
scaled model
scaled model.png (154.44 KiB) Viewed 1585 times
scaled model loaded with static.mot file.png
scaled model loaded with static.mot file
scaled model loaded with static.mot file.png (282.04 KiB) Viewed 1585 times
Can you please let me know what might be the problem? Thanks for all your help.

Regards
Sheeba

User avatar
Sheeba Davis
Posts: 56
Joined: Sat Mar 23, 2019 5:19 am

Re: Scaled model displaced when loading .mot file

Post by Sheeba Davis » Mon Sep 28, 2020 4:23 am

Hi Ayman

I solved the issue. The new markers were not connected to parent body but to the ground.

Another question: In order to reduce rms and max marker errors, I slightly moved the new markers manually close to experimental markers and scaled it again. This procedure reduced the errors. But is it right to keep moving all the markers this way? I tried to move only the new markers that I placed manually (also reduced their weights in scaletask file) and did not touch the original model markers. Can you please give your opinion on this?

Thanks
Sheeba

POST REPLY