src.preprocessing package¶
The preprocessing package is not needed when working with the available dataset, since preprocessing has already been applied. However, it might become necessary if new data shall be integrated into the dataset.
src.preprocessing.anonymize module¶
This script anonymizes raw data by removing sensitive data
src.preprocessing.check_clipping module¶
This script checks if the recorded data is clipping. This can happen, since the IMUs record in a fixed range.
src.preprocessing.convert_optogait module¶
This script converts all excel xml files from OptoGait to CSV files. Attention: Files are replaced (XML files are deleted)
src.preprocessing.convert_zebris module¶
This script converts Zebris XML files into gzip compressed json files. Since Zebris produces nested data structures, the raw data cannot be stored in simple CSV files. The XML files turned out to be very large and need a lot of time to be loaded/parsed. Loading JSON files is significantly faster and can be performed via build-in functions in Pandas, without the need to care about parsing. However, JSON files are still quite big due to repetitive keywords. This can cause long loading times when reading from disk/network. Thus, the files are gzip compressed. This leads to fast loading and small files.
src.preprocessing.get_imu_ic_gyro_threshold module¶
Two different kinds of information need to get extracted from the IMU recordings only once and are therefore outsourced to this preprocessing script: The timestamp of initial contact and the gyroscope magnitude threshold that identifies stance phases best.
In order to synchronize Optogait and/or Zebris recordings with the IMU recordings, the initial contact with the treadmill belt has to be found in the IMU data. Since the participants were asked to step on the running treadmill belt with their right foot first, the first peak in the acceleration data of the right foot corresponds to the initial contact. Therefore this script: Opens all right foot IMU CSV file in the base path, Finds first prominent peak (first peak with prominence > 4, this threshold is chosen to fit the recorded data and might not be the best choice for other data recordings), Plot data to let user confirm/correct the peak by manually placing the moment of initial contact (e.g. by experience or with the help of the video recordings), and Exports a CSV file with the obtained timesteps
Low gyroscope energy has turned out to be a good indicator for stance phases. However, the threshold to identify stance phases is different for each subject and trial. Therefore this script: Calculates stance phases based on a default threshold, Displays them, and let the user confirm/correct the threshold, and Exports a CSV file with the thresholds.
-
src.preprocessing.get_imu_ic_gyro_threshold.
ic_onclick
(event)¶ Event handler for click event
-
src.preprocessing.get_imu_ic_gyro_threshold.
stance_onclick
(event)¶ Event handler for click event