Efficient Processing Pipeline for Motion Sequence Analysis
When analyzing motion data measured with the OpenGo sensor insole system, we are often interested in single or repetitive motion sequences. Let’s assume we want to apply a script-based analysis on just those sequences (e.g. using Python), i.e. we wish to get hold of the corresponding raw data sequences without having to manually handle portions of measurement files.
A super efficient processing pipeline to achieve this is as follows:
- Use the OpenGo Software to manually set events, marking the beginning and ending of motion sequences of interest, or highlighting specific points in time.
- Export the data as a .txt file.
- Use the OpenGo Python library to extract the raw data sequences.
These steps are explained in the following.
Setting Events in OpenGo Software
You can use the OpenGo Software to manually set events. Events are organized in groups, and carry a name and value. All of these three attributes can later be used to easily filter events in Python. Use line graphs, plantar pressure distribution widgets, and video(s) to perfectly set the desired events.
Tip: Use the mouse wheel on the line graph time axis to zoom in and out, or use the “+” key to zoom in.
Pro tip: Events can also be set using the “E” key on your keyboard.
Export Data as Text File
Just go to the Analyze screen and export your desired measurement (or complete folders) as text files. They will automatically include your events.
Extract Events and Data in Python
Let’s extract the total force measured by the left sensor insole for all sequences marked by events. This is simple, as the below Code Example 1 shows.
Here, we assume that we have chosen an event value of 1 for all events starting a sequence, and an event value of 2 for the stopping events. Have a look at the optional arguments of get_events() and get_event_pairs() for further filtering options.
The OpenGo Python library provides a fully working example including sample data. You can install the OpenGo Python library from PyPI using: pip install moticon-opengo
If you rather want to work with automatically detected step events instead of manually set events, check out our article Gait analysis with 29 lines of Python code – programming with OpenGo text export.