Skip to content

Commit dfdbff4

Browse files
authored
Merge pull request #110 from neurogeriatricskiel/documentation-dev
Documentation Improvement
2 parents 5e338e3 + 0185add commit dfdbff4

34 files changed

+485
-154
lines changed

README.md

Lines changed: 120 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,125 @@ Welcome to the KielMotionAnalysisToolbox (KielMAT). We are a Python based toolbo
1313

1414
The toolbox is aimed at motion researchers who want to use Python-based open-source software to process their data. We have implemented validated algorithms in modules to process motion data, as shown in the table below:
1515

16-
## Overview of modules
17-
| Module | Description | Data |
18-
|--------------------------------|------------------------------------------------|----------------------------------------|
19-
| Gait sequence detection (GSD) | Detects gaits | 3D accelerations from the lower back |
20-
| Initial contact detection (ICD)| Detects initial contact during gait | 3D accelerations from the lower back |
21-
| More to follow... | Additional modules to be added | |
16+
## Overview of Modules
17+
18+
The table below provides an overview of key modules, their functionalities, input data, validation datasets, and outputs.
19+
20+
<div style="width: 100%; text-align: left; margin-top: 20px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden;">
21+
22+
<table style="width: 100%; border-collapse: collapse; font-size: 0.9em;">
23+
24+
<thead style="background-color: #f2f2f2;">
25+
<tr>
26+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Module</th>
27+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Description</th>
28+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Input Data</th>
29+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Validation Dataset</th>
30+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Event Type</th>
31+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Output Parameters</th>
32+
</tr>
33+
</thead>
34+
35+
<tbody>
36+
<tr>
37+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/modules/gsd/">Gait Sequence Detection</a></td>
38+
<td style="padding: 8px;">Detects gait sequences</td>
39+
<td style="padding: 8px;">3D accelerations from lower back IMU</td>
40+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/mobilised/">Mobilise-D</a> and <a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/keepcontrol/">KeepControl</a></td>
41+
<td style="padding: 8px;">gait sequence</td>
42+
<td style="padding: 8px;">-</td>
43+
</tr>
44+
45+
<tr>
46+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/modules/icd/">Initial Contact Detection</a></td>
47+
<td style="padding: 8px;">Detects initial and final contacts within each gait cycle</td>
48+
<td style="padding: 8px;">3D accelerations from lower back IMU</td>
49+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/mobilised/">Mobilise-D</a> and <a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/keepcontrol/">KeepControl</a></td>
50+
<td style="padding: 8px;">initial contact, final contact</td>
51+
<td style="padding: 8px;">Temporal parameters (e.g., step time, stride time)</td>
52+
</tr>
53+
54+
<tr>
55+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/modules/pam/">Physical Activity Monitoring</a></td>
56+
<td style="padding: 8px;">Monitors physical activity levels</td>
57+
<td style="padding: 8px;">3D accelerations from wrist IMU</td>
58+
<td style="padding: 8px;"><a href="https://www.fairpark2.eu/">Fair Park Ⅱ</a></td>
59+
<td style="padding: 8px;">-</td>
60+
<td style="padding: 8px;">Mean and duration of activity level</td>
61+
</tr>
62+
63+
<tr>
64+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/modules/ptd/">Postural Transition Detection</a></td>
65+
<td style="padding: 8px;">Detects sit-to-stand and stand-to-sit transitions</td>
66+
<td style="padding: 8px;">3D acceleration and gyroscope data from lower back IMU</td>
67+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/keepcontrol/">KeepControl</a> and <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC4460963/">SENSE-PARK</a></td>
68+
<td style="padding: 8px;">sit-to-stand, stand-to-sit</td>
69+
<td style="padding: 8px;">Spatio-temporal parameters (e.g., postural transition angle)</td>
70+
</tr>
71+
72+
<tr>
73+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/modules/td/">Turn Detection</a></td>
74+
<td style="padding: 8px;">Detects turn movements</td>
75+
<td style="padding: 8px;">3D acceleration and gyroscope data from lower back IMU</td>
76+
<td style="padding: 8px;"><a href="https://neurogeriatricskiel.github.io/KielMAT/datasets/keepcontrol/">KeepControl</a> and <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC4460963/">SENSE-PARK</a></td>
77+
<td style="padding: 8px;">turn</td>
78+
<td style="padding: 8px;">Spatio-temporal parameters (e.g., turn angle)</td>
79+
</tr>
80+
81+
</tbody>
82+
</table>
83+
</div>
84+
85+
## Units
86+
87+
The table below provides an overview of commonly used value types and their corresponding units. Before starting work with modules in the toolbox, ensure that all data is in standard SI units as specified. This ensures compatibility with the algorithms, which are designed to expect inputs in these units.
88+
89+
<div style="width: 50%; text-align: left; margin-top: 20px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden;">
90+
91+
<table style="width: 100%; border-collapse: collapse; font-size: 0.9em;">
92+
93+
<thead style="background-color: #f2f2f2;">
94+
<tr>
95+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Value</th>
96+
<th style="padding: 10px; border-bottom: 1px solid #ddd;">Unit</th>
97+
</tr>
98+
</thead>
99+
100+
<tbody>
101+
<tr>
102+
<td style="padding: 8px;">Acceleration</td>
103+
<td style="padding: 8px;">m/s²</td>
104+
</tr>
105+
106+
<tr>
107+
<td style="padding: 8px;">Angular Velocity</td>
108+
<td style="padding: 8px;">deg/s</td>
109+
</tr>
110+
111+
<tr>
112+
<td style="padding: 8px;">Velocity</td>
113+
<td style="padding: 8px;">m/s</td>
114+
</tr>
115+
116+
<tr>
117+
<td style="padding: 8px;">Distance</td>
118+
<td style="padding: 8px;">m</td>
119+
</tr>
120+
121+
<tr>
122+
<td style="padding: 8px;">Time</td>
123+
<td style="padding: 8px;">s</td>
124+
</tr>
125+
126+
<tr>
127+
<td style="padding: 8px;">Sampling Rate</td>
128+
<td style="padding: 8px;">Hz</td>
129+
</tr>
130+
131+
</tbody>
132+
</table>
133+
</div>
22134

23-
The idea is that various motion data can be loaded into our dedicated dataclass which rely on principles from the [Motion-BIDS](https://bids-specification.readthedocs.io/en/latest/modality-specific-files/motion.html) standard.
24135

25136
## Installation
26137
The toolbox has been released on [pypi](https://pypi.org/project/kielmat/) and can be installed via pip:
@@ -30,6 +141,8 @@ pip install kielmat
30141
It requires Python 3.10 or higher.
31142

32143
## Data classes
144+
The idea is that various motion data can be loaded into our dedicated dataclass which rely on principles from the [Motion-BIDS](https://bids-specification.readthedocs.io/en/latest/modality-specific-files/motion.html) standard.
145+
33146
### Data classes: conceptual framework
34147

35148
Motion data is recorded with many different systems and modalities, each with their own proprietary data format. KielMAT deals with this by organizing both data and metadata in a [BIDS-like format](https://bids-specification.readthedocs.io/en/stable/modality-specific-files/motion.html). The BIDS format suggests that [motion recording data](https://bids-specification.readthedocs.io/en/stable/modality-specific-files/motion.html#motion-recording-data) from a single tracking system is organized in a single `*_tracksys-<label>_motion.tsv` file.

docs/dataclass.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
In the following the KielMAT dataclass is described.
2-
The dataclass is used to store motion data in a standardized way. We provide some small set of import functions, each of which returns a `pandas.DataFrame` or a dict.
3-
User should easily be able to write their own import functions, to get the their data into the provided dataclass (this step might take some thinking).
4-
After the data is in the dataclass, running functions on the data from our toolbox should be really straight forward.
1+
In the following, the KielMAT dataclass is described. The dataclass is used to store motion data in a standardized way. We provide a small set of import functions, each of which returns a `pandas.DataFrame` or a dict. Users should easily be able to write their own import functions to get their data into the provided dataclass (this step might take some thinking). After the data is in the dataclass, running functions on the data from our toolbox should be really straightforward.
52

6-
## KielMAT data class
73
```mermaid
84
classDiagram
95
class KielMATRecording {
@@ -15,6 +11,7 @@ classDiagram
1511
add_events(tracking_system, new_events)
1612
add_info(key, value)
1713
export_events(file_path, tracking_system=None, file_name=None, bids_compatible_fname=False)
14+
validate_channels() -> str
1815
}
1916
2017
```

docs/datasets/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Overview
22

3-
This part of the project documentation focuses on
4-
the avaliable **datasets**.
3+
This section of the project documentation focuses on the available **datasets** used within the KielMAT toolbox. These datasets are essential for testing and validating the functionality of the toolbox’s modules. Below is an introduction to the available datasets, with links to further details and data access.
4+
55

66
## [Keep Control](keepcontrol.md)
77

8+
The **Keep Control** dataset is derived from the [Keep Control](https://www.keep-control.eu/) project, which is part of an Industrial Academic Initial Training Network. This dataset includes full-body mobility data collected from both healthy and neurological cohorts, and is primarily used to validate inertial measurement unit (IMU) algorithms.
9+
810
## [Mobilise-D](mobilised.md)
11+
12+
The **Mobilise-D** dataset is derived from the [Mobilise-D](https://mobilise-d.eu/) consortium, a European project aimed at developing a comprehensive system for monitoring and evaluating people's gait using digital technologies. The dataset includes data collected using sensors worn on the body, such as a low back-worn inertial measurement unit (IMU). The dataset provides valuable insights into real-world gait analysis using wearable sensors and has been used to validate gait measurement methodologies.

docs/examples/basic_00_load_Data_into_KielMAT.md renamed to docs/examples/basic_01_load_Data_into_KielMAT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Tutorial: Load data into an `KielMATRecording` object
22

33
**Author:** Julius Welzel
4+
45
**Last update:** Fri 22 Mar 2024
56

67
## Learning objectives
78
By the end of this tutorial:
9+
810
- you can load data and channel information into an `KielMATRecording` object
911
- you can add Recording specific information to the `KielMATRecording` object
1012
- you are educated about the relationship between a `KielMATRecording` object and the [BIDS standard](https://bids-specification.readthedocs.io/en/stable/).
@@ -141,7 +143,7 @@ print(recording.events)
141143

142144

143145

144-
![png](basic_00_load_Data_into_KielMAT_files/basic_00_load_Data_into_KielMAT_1.png)
146+
![png](basic_01_load_Data_into_KielMAT_files/basic_01_load_Data_into_KielMAT_1.png)
145147

146148

147149

File renamed without changes.
File renamed without changes.

docs/examples/index.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
11
# Overview
22

3-
This is a collection of examples to explain various parts of the KielMAT toolbox.
3+
This section contains a series of examples designed to demonstrate key features and functionalities within the KielMAT toolbox. These examples will guide users through common workflows and illustrate how to apply different modules to motion analysis data.
44

55
## Construct Your DataClass
66

7-
### [Example 1: Load data into KielMAT](basic_00_load_Data_into_KielMAT.md)
8-
### [Example 2: Load datasets](basic_01_load_dataset.md)
9-
### [Example 3: Events in dataclass](basic_02_events.md)
7+
The `DataClass` is the central data structure in KielMAT, which stores and organizes motion data along with associated events. The following examples guide you through the process of loading and structuring your data.
8+
9+
### [Example 1: Load data into KielMAT](basic_01_load_Data_into_KielMAT.md)
10+
In this example, you will learn how to load motion data into `KielMAT`'s `DataClass`. This step is essential for processing any motion capture data, whether it's from IMUs, C3D files, or other data formats.
11+
12+
### [Example 2: Load datasets](basic_02_load_dataset.md)
13+
This example demonstrates how to load datasets into `KielMAT`. You will learn how to import data from different sources, handle multiple datasets, and integrate them into a unified structure for analysis.
14+
15+
### [Example 3: Events in DataClass](basic_03_events.md)
16+
The `DataClass` not only stores motion data but also provides functionality to mark and organize events (such as gait sequences, initial contacts, or other notable movement occurrences). This example shows how to tag specific events within the `DataClass`, allowing you to analyze them in the context of the motion data.
1017

1118
## Run Modules
1219

13-
### [Example 1: Gait Sequence Detection](modules_01_gsd.md)
14-
### [Example 2: Initial Contact Detection](modules_02_icd.md)
15-
### [Example 3: Physical Activity Monitoring](modules_03_pam.md)
20+
KielMAT includes several pre-built modules to analyze motion data for different tasks. The following examples demonstrate how to apply each module to extract meaningful information from your data.
21+
22+
### [Example 4: Gait Sequence Detection](modules_04_gsd.md)
23+
This example introduces the [Gait Sequence Detection](https://neurogeriatricskiel.github.io/KielMAT/modules/gsd/) module. This module identifies gait sequences using 3D accelerometer data from a lower back sensor.
24+
25+
### [Example 5: Initial Contact Detection](modules_05_icd.md)
26+
This example introduces the [Initial Contact Detection](https://neurogeriatricskiel.github.io/KielMAT/modules/icd/) module. It identifies and characterizes initial contacts within each detected gait sequence using the gait sequence detection module.
27+
28+
### [Example 6: Physical Activity Monitoring](modules_06_pam.md)
29+
This example introduces the [Physical Activity Monitoring](https://neurogeriatricskiel.github.io/KielMAT/modules/pam/) module. The example shows how the module is implemented on sample 3D acceleration data from an IMU sensor to monitor physical activity levels.
30+
31+
### [Example 7: Postural Transition Detection](modules_07_ptd.md)
32+
This example introduces the [Postural Transition Detection](https://neurogeriatricskiel.github.io/KielMAT/modules/ptd/) module. It demonstrates how the module is implemented on sample 3D acceleration and 3D angular velocity data from a lower back IMU sensor to detect postural transitions, such as sit-to-stand or stand-to-sit.
33+
34+
### [Example 8: Turn Detection](modules_08_td.md)
35+
This example introduces the [Turn Detection](https://neurogeriatricskiel.github.io/KielMAT/modules/td/) module. It demonstrates how the module is implemented on sample 3D acceleration and 3D angular velocity data from a lower back IMU sensor to detect turns.

docs/examples/modules_01_gsd.md renamed to docs/examples/modules_04_gsd.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ plt.show()
159159

160160

161161

162-
![](modules_01_gsd_files/modules_01_gsd_7_0.png)
162+
![](modules_04_gsd_files/modules_04_gsd_7_0.png)
163163

164164

165165

@@ -210,7 +210,7 @@ plt.show()
210210

211211

212212

213-
![](modules_01_gsd_files/modules_01_gsd_9_0.png)
213+
![](modules_04_gsd_files/modules_04_gsd_9_0.png)
214214

215215

216216

@@ -250,7 +250,7 @@ print(recording.events)
250250

251251

252252

253-
![](modules_01_gsd_files/modules_01_gsd_11_1.png)
253+
![](modules_04_gsd_files/modules_04_gsd_11_1.png)
254254

255255

256256

@@ -352,6 +352,6 @@ plt.show()
352352

353353

354354

355-
![](modules_01_gsd_files/modules_01_gsd_13_1.png)
355+
![](modules_04_gsd_files/modules_04_gsd_13_1.png)
356356

357357

0 commit comments

Comments
 (0)