Automatic Scaling Tool - Isssue

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Kevin Soter
Posts: 3
Joined: Mon May 01, 2023 6:10 am

Automatic Scaling Tool - Isssue

Post by Kevin Soter » Sun Oct 27, 2024 9:18 am

Hello everyone!

I recently saw the Automatic Scaling Tool by Di Pietro and collegues (2024), which would drastically facilitate the most time consuming part of any OpenSim workflow. However, I quickly faced an issue which I seem to be unable to solve. I would appreciate any help in order to localize my issue and get the AST to work!

Getting it to work was not too difficult, it also runs smoothly and results in very low errors (below the set RMS error which I kept at the default of 0.004m). However, the position my scaled and marker adjusted model assumes after the scaling process does not match the experimental position whatsoever. Most prominently my subject is standing in severe plantarflexion (~20 degrees, see attached figure), but there is also a slight forward lean and the pelvis is tilted anteriorly. While this happens the virtual marker position perfectly matches the experimental marker position, resulting in the models' geometry visibly not matching the markers. I cannot figure out what the problem might be.
AST_Problem_Plantarflexion.png
AST_Problem_Plantarflexion.png (128.99 KiB) Viewed 502 times
I am using the model gait2392 from which I deleted the torso using OpenSimCreator. Furthermore, I deleted the original markerset and created one that matches the markers used in our experiments. In addition, based on the experimental markers I calculate extra markers for the scaling which are then added to the static .trc file (hip, knee and ankle joint centre as well as extra markers on the pelvis). These markers are then used for the scaling factors. The marker weights are all set to 1.0, except all tracking markers (RTH, LTH, RSH & LSH) which are set to 0.0. I set all anatomical markers and the joint center markers to fixed. Within the tool I set it to estimate subject pose. My subject is 160cm tall and weighs 63kg.
I attached the model .osim file, the static .trc file with the calculated markers and the scale setup .xml file. In an extra folder I attached the final .osim model file with adjusted markers as well as the coordinate .mot (Coord_Static) file I get as an output from the AST tool.

I also tried not estimating the subject pose thus including a coordinate .mot file (ACL_01_coord.mot) into the scaling setup file reflecting the joint angles of my subject. However, this results in the same problem (when loading the .mot file).

The only issue I can ascertain is that the calcaneus geometry after scaling is much too big, which seems to push up the heel while the forefoot stays on the ground. I checked and double-checked all markers and their respective parent frames, the setup file and even the model file. But I cannot figure out why this would happen. Especially as I can manually scale the model just fine.

Thank you for your help!

Best regards

Kevin

P.S.: Since the files (more specifically the .trc file seems to be too big to upload I add them here through a google drive link: https://drive.google.com/open?id=1fRulq ... =drive_fs

Tags:

User avatar
John Davis
Posts: 59
Joined: Mon Aug 26, 2019 7:42 am

Re: Automatic Scaling Tool - Isssue

Post by John Davis » Mon Oct 28, 2024 10:52 pm

I can't speak to the automatic tool, but from the data in your folder it looks like the source of your problems is that the foot is not "tall" enough. From your scale setup file, you are not scaling the height (Y axis) of the calcaneus or talus or toes at all. This is going to lead to a poor fit since different subjects have different "height" feet - i.e. the distance from the floor to the center of the ankle joint.

Because the foot is not tall enough, the IK tool drags the model upward to fit the rest of the markers (knee joint, hip joint, etc) as closely as possible, and the only degree of freedom that's left is the ankle joint - so your model goes on its tippy-toes to at least minimize the squared error to the metatarsal markers.

I recommend the following: first, create a new virtual marker (in your experimental data AND on the model) by projecting the ankle joint center marker down to the floor. You'd also benefit from a mid-metatarsal marker that is projected down to the floor too.

Then, scale the width of the foot according to the metatarsal markers, the length of the foot according to the mid-metatarsal-floor marker and the mid-ankle-floor marker, and the height according to the mid-ankle-floor marker and the mid-ankle marker.

This video around the 21min mark shows how to do it: https://www.youtube.com/watch?v=ZG7wzvQC6eU

As a bonus, you can use the projected floor markers to drag the model down to the floor by increasing their weight. That can also help lock down a wobbly forefoot. Basically, increasing the weight on these markers adds a stronger prior to the IK tool that penalizes this kind of tippy-toe behavior, which is sometimes necessary since you have so few markers being tracked on the feet, so squared error there is cheap compared to the rest of the body.

You may also want to adjust the weights on the pelvis IK, depending on what markers you use for the pelvis tracking. The ASIS markers on the model are significantly higher than the experimental markers, and that can cause issues if you use them for tracking pelvic tilt. There is usually a tradeoff between how much you trust your ASIS, PSIS, and HJC markers. Me personally, I tend to trust ASIS more than PSIS, so if this were my model I would definitely fine-tune the pelvis to get it to line up better.

Your model's left knee joint center is also a bit ahead of the experimental KJC, but that's a problem that might fix itself after the feet are squared away.

User avatar
Kevin Soter
Posts: 3
Joined: Mon May 01, 2023 6:10 am

Re: Automatic Scaling Tool - Isssue

Post by Kevin Soter » Wed Oct 30, 2024 4:37 am

Hi John,

Thank your for your response!

I actually used to scale my models along the Y-axis exactly as you describe, however, I realized that the scale factor usually is something along the lines of 1.5 to 2.0 times the originial, even if my subjects dimensions should be smaller (female, below 1.70m, ~60kg). Thus, when I looked into the automatic scaling tool and found this I checked if this might have been the issue (it was not :D). I assume this happens as the subjects in our experiments wear shoes, so now I went back to the way I did it before, also scaling along the Y-axis. Unfortunately, this did not change anything.

What actually did help is using the ground markers as ankers! Thank you for the recommendation!
However, there still seems to be some kind of trade-off. As you mentioned, my ASIS markers are off. Increasing the weight on these results in a slight tip-toe behaviour again. I guess I just have to find the best middle-ground that adheres to the actual position of the subject.

Everything considered, I believe the AST to be a nice idea, but it cannot be used mindlessly!

Best regards

Kevin

User avatar
Aaron Fox
Posts: 289
Joined: Sun Aug 06, 2017 10:54 pm

Re: Automatic Scaling Tool - Isssue

Post by Aaron Fox » Wed Nov 06, 2024 5:24 pm

Hi Kevin,

Not sure if the automatic scaling tool will allow you to do this as I'm unfamiliar, but in traditional scaling you can also add weights to joint coordinates to be a certain value (e.g. 0 degrees if you are confident they are in a neutral position). These coordinate scales also have weights (they don't need to be that high to make a difference), and they can help pose the scaled model in a neutral position, but again will add in a trade off between this and marker error.

Aaron

User avatar
Kevin Soter
Posts: 3
Joined: Mon May 01, 2023 6:10 am

Re: Automatic Scaling Tool - Isssue

Post by Kevin Soter » Thu Nov 07, 2024 2:30 am

Hi Aaron,

Thank you for the suggestion!

In fact, I tried this already before finding the solution presented by John (using virtual markers projected to the ground as ankers). While it gave me more accurate joint angles it resulted in the model hovering over the ground (roughly the same distance the heel was raised previously). Furthermore, I do not have a separate accurate joint angle measurement, so this would be solely based on looking at the video staken during the static trial.

Thank you nevertheless :)
I hope this thread might help others who want to utilize the automatic scaling tool.

Best
Kevin

POST REPLY