Page 1 of 1

Failed to run gait analysis through Python

Posted: Thu Apr 04, 2024 2:16 am
by caesar0729
Hello,

I am a first-year graduate student who has just studied sports biomechanics. Now I have some questions and I really hope to get your answers.
I tried using "example_gait_analysis.py" to run the local data I recorded via Opencap, but it failed. I changed the local code location, session id ,the number of "n_gait_cycles = -1"and trial name in the "example_gait_analysis.py" code, but the operation failed. Python showed that it could not recognize the gait cycle and other problems. I am not sure whether it was because I changed the wrong things. The run failed.
And I would like to get the gait cycle and other information and process the data I downloaded from opencap through opensim, but I don't find the gait analysis tool in Opensim

It's my great honor to getting your answer.
Thank you!!

Here is the error code issue I'm having:
4.png
4.png (90.3 KiB) Viewed 1980 times
3.jpg
3.jpg (261.01 KiB) Viewed 1980 times
2.jpg
2.jpg (61.51 KiB) Viewed 1980 times
1.jpg
1.jpg (4.75 KiB) Viewed 1980 times

Re: Failed to run gait analysis through Python

Posted: Mon Apr 08, 2024 10:06 am
by antoinefalisse
hi, I just tested and the gait analysis tool does not seem to be working for your trial with data from children. I have opened an issue, and I will look into that within the next few weeks. https://github.com/stanfordnmbl/opencap ... issues/119. I will report back here if I find a solution. Antoine

Re: Failed to run gait analysis through Python

Posted: Wed Apr 10, 2024 12:43 am
by caesar0729
Thanks doc
Thank you very much for your reply, looking forward to success

Best
jIntao Pan

Re: Failed to run gait analysis through Python

Posted: Wed Apr 17, 2024 1:39 am
by caesar0729
Hi

I attempted to modify the prominence" code in "gait_analysis.py", setting the threshold to "0.2, 0.15, 0.1, 0.05, 0.03, 0.02, 0.01, 0.008, 0.005" and successfully processed several local data. There are still some data that cannot be processed, spikes cannot be detected, and therefore no gait data can be obtained.

I am very much looking forward to your reply.
Best
Jintao Pan
28f7004fb039313c54acfd681044f1c1.png
28f7004fb039313c54acfd681044f1c1.png (335.76 KiB) Viewed 1819 times

Re: Failed to run gait analysis through Python

Posted: Fri Apr 19, 2024 9:37 am
by antoinefalisse
Hi that sounds good. It is very difficult to find settings that work for all cases. Playing with the settings of the detect_gait_peaks function is probably the way to go: https://github.com/stanfordnmbl/opencap ... 90C13-L703

Best, Antoine

Re: Failed to run gait analysis through Python

Posted: Fri Apr 19, 2024 9:55 am
by caesar0729
Hi
There are still a few questions that I can't figure out.
Is the value of prominence based on HS or TO? How is this threshold determined? Is it by calculating the force value? like 1N=1kg m/s2
And how can I change the visualization output to data output in CSV format?
Thank you very much for your reply!

Best
Jintao Pan

Re: Failed to run gait analysis through Python

Posted: Fri Apr 19, 2024 11:10 am
by antoinefalisse
We are looking at peaks in processed marker data.

> And how can I change the visualization output to data output in CSV format?
There are some python modules to output csv files.

Best, Antoine

Re: Failed to run gait analysis through Python

Posted: Fri Apr 19, 2024 11:14 am
by caesar0729
Thanks doc
Thank you very much for your help.I will continue to dig deeper into opencap.

Best
Jintao Pan

Re: Failed to run gait analysis through Python

Posted: Fri Apr 19, 2024 11:28 am
by antoinefalisse
Sound good.