# Portable RGB-D Camera-Based System for Assessing Gait Impairment Progression in ATTRv Amyloidosis
## 2 Materials and Methods
### Data Acquisition and Processing  
Two acquisition sessions took place at T0 and T1 for each patient, with an interval of one year and a half between them. For each session, patient, and gait trial, we acquired data provided by both of the used systems.  
The 3D position of the reference system's markers was acquired at 200 Hz. The 3-D body joint, depth, and infrared data provided by the RGB-D camera were acquired at 30 Hz, using our KiT software application that enables the online visualization and acquisition of Kinect data [55]. Each body joint data frame includes the 3D position of the 25 joints tracked by the Kinect v2, which are shown in Figure 1. The data from the two systems were synchronized by considering the instant the extra marker touches the ground as the common reference. For more details on the synchronization process, please refer to [53].  
Figure 1: Body joints tracked by the Kinect v2, and retro-reflective markers placed at the subject’s body used by the Qualisys system.  
The acquired data corresponding to walking towards the Kinect were automatically selected using the method described in [50]. Then, the performed gait cycles and associated phases were automatically identified. Only the gait cycles detected by both systems were considered in the analysis presented below. The average number of gait cycles per patient was 33 at T0 and 41 at T1. A gait cycle is defined by two consecutive heel strikes of the same foot. Each gait cycle includes two steps, which are defined by two consecutive heel strikes of opposite feet. For the RGB-D camera, the instants corresponding to heel strikes were estimated using the distance between ankles and a window of size ND1 frames, as described in more detail in [53]. The identification of the heel strike side (left or right) relied on the ankles' velocity, using a window of size ND2 frames. Both measures were previously processed using a moving average filter with a window size of NF1 and NF2, respectively (with the same value as in [53]). Toe offers were detected by finding the maximum absolute difference between the left and right shanks angle, using a window of size ND3, as described in [50].  
The actual heel strike and toe off events were identified based on the foot vertical velocity computed over Qualisys data (ground truth), as described in [50,53].  
For each gait cycle and system, we computed the 23 gait parameters described in [50]. The TBCM-ML and -V sway correspond to the standard deviation of the distance between the TBCM and RGB-D camera in the \(x\)- and \(y\)-axis (corresponding to the mediolateral and vertical directions), respectively. For each frame, the TBCM is the weighted average of the CM of 15 body segments as described in [56]. The CM of each body segment was computed according to [57]. The TBCM sway measures the variability of the TBCM motion and can therefore be useful for assessing posture, evaluating balance disorders, and/or predicting fall risk [57].  
The measures used to compute the gait parameters were firstly processed using a Butterworth filter. To minimize parameter computation error, the filter's order and cutoff frequency were optimized for each parameter. This optimization consisted of selecting the pair of values for order and cut-off frequency that led to the lowest mean absolute between Kinect and Qualisys (for all subjects and gait cycles at T0), when considering the orders of 2, 4 and 6, as well as frequencies between 1 and 9 Hz (integer values). If filtering did not lead to a decrease in error higher than 1 cm for spatial, 1 cm/s for spatiotemporal, and 1 degree for kinematic parameters, then no filtering was applied to the corresponding measure. The Butterworth filter's results are presented in Tables 13 and 14 included in Appendix A.