# Effect of acute psychosocial stress on body posture and movements – Pilot Study
## Overview
This repository contains data from the _Pilot Study_ that was collected during the project "Effect of acute psychosocial stress on body posture and movements" (StressPose).
The data in this repository are used for the following publication(s):
* "Machine learning-based detection of acute psychosocial stress from body posture and movements", currently under review.
## How to Work with the Data
### Download from OSF
To access the data download it from [OSF](https://osf.io/qvzdg/).
### Install the StressPose Analysis Package (optional)
If you want to use this dataset it is recommended to install the [`stresspose-analysis`](https://github.com/empkins/stresspose-analysis) package. This package contains various helper functions to work with the dataset (including [`tpcp`](https://github.com/mad-lab-fau/tpcp) `Dataset` representations), process data, and different analysis experiments performed with the dataset.
See the [`stresspose-analysis`](https://github.com/empkins/stresspose-analysis) package for further information.
## Data Acquisition
### Study protocol
Body posture and movements of 21 participants were measured with a motion capture suit during the exposure to stress, induced with the Trier Social Stress Test (TSST) and in a control condition (friendly-TSST). Both consist of a preparation period (5 min) and the (f-)TSST interview.
During the TSST, the participants had to give a free speech (5 min), which they prepared right before the beginning of the TSST. Subsequently, they had to solve a mental arithmetic problem (5 min). In contrast to this, during the f-TSST interview, participants talked for 10 min about their CV, hobbies, favorite books, etc. Each participant took part in the f-TSST and the TSST on two consecutive days at similar times of the day. The condition order (i.e., whether f-TSST or TSST was conducted first) was randomized.
During both conditions six saliva samples were collected: Two saliva samples before the beginning of each (f-)TSST and four afterwards. The motion capture recording was started before the beginning of the (f-)TSST interview and ended right after the end of the (f-)TSST. In addition, a set of questionnaires were collected pre and post of the (f-)TSST interview (PASA, PANAS, STADI).
### Mocap System and Data Collection
For the data collection, the [Perception](https://neuronmocap.com/) Neuron](https://neuronmocap.com/) motion capture suit was used to measure body movements. The suit contains 31 “Neuron” sensor nodes, which include an IMU composed of a gyroscope, accelerometer, and magnetometer. These Neuron sensors are attached to the body by straps and connected to each other via cables.
During the data collection, the suit was connected to the computer via USB. Data collection can be controlled by the Axis Neuron software. Selected body dimensions of the participants were measured in order to create an individual body size model for each participant. Afterwards, the motion capture suit was calibrated using a calibration procedure with four different poses. The calibration is required before the beginning of the data recording to get more accurate results.
With the software of Axis Neuron it is possible to export data into different file formats. For the study the data were exported as BVH files (`.bvh`) and CALC files (`.calc`) for each participant and condition, respectively. Furthermore, the center of mass data was also exported. The BVH file contains the local rotation in Euler angles and the local position for each joint. The CALC file includes, amongst others, velocity, acceleration, and angular velocity for each joint.
### Data Cleaning
Because of position and rotation drift the data were filtered before computing motion features. The position data were filtered with a high-pass Butterworth filter to remove position baseline drift. The rotation data were first transformed from Euler angles to quaternions. The quaternion data were then filtered with a high-pass Butterworth filter before computing the difference between the original quaternion data and the filtered quaternion data to get the approximate rotation drift. The inverse quaternions were calculated from the rotation drift quaternion data and afterwards multiplied with the original quaternion data to remove the rotational drift from the data. In the end, the quaternion data were transformed back into Euler angles.
### Missing Data
Data is missing for the following subjects:
* `VP_01`: mocap data (ftsst), PANAS score (tsst and ftsst)
* `VP_02`: PANAS score (tsst and ftsst)
## Repository Structure
The repository is structured in the following way:
```bash
├── data_per_subject/
│ ├── <subject_id>/
│ │ ├── tsst/
│ │ │ ├── mocap/
│ │ │ │ ├── raw/
│ │ │ │ │ ├── <subject_id>_tsst.raw # raw mocap data as exported from the Axis Neuron software
│ │ │ │ │ └── <subject_id>_tsst.xml # metadata
│ │ │ │ ├── filtered/
│ │ │ │ │ ├── <subject_id>_tsst_centerOfMass.csv # exported and filtered center of mass data as csv
│ │ │ │ │ ├── <subject_id>_tsst_global_pose.csv.gz # exported and filtered global pose data as csv, compressed with gzip
│ │ │ │ │ ├── <subject_id>_tsst.bvh.gz # exported and filtered BVH data as csv, compressed with gzip
│ │ │ │ │ └── <subject_id>_tsst.calc.gz # exported and filtered CALC data as csv, compressed with gzip
│ │ │ │ └── <subject_id>_filter_params_tsst.json # filter parameters used for the filtering of the mocap data
│ │ │ └── <subject_id>_times_tsst.json # start and end times of the different parts of the (f-)TSST
│ │ ├── ftsst/
│ │ │ ├── mocap/
│ │ │ │ ├── raw/
│ │ │ │ │ ├── <subject_id>_ftsst.raw
│ │ │ │ │ └── <subject_id>_ftsst.xml
│ │ │ │ ├── filtered/
│ │ │ │ │ ├── <subject_id>_ftsst_centerOfMass.csv
│ │ │ │ │ ├── <subject_id>_ftsst_global_pose.csv.gz
│ │ │ │ │ ├── <subject_id>_ftsst.bvh.gz
│ │ │ │ │ └── <subject_id>_ftsst.calc.gz
│ │ │ │ └── <subject_id>_filter_params_ftsst.json
│ │ │ └── <subject_id>_times_tsst.json
│ │ └── <subject_id>_body_size_model.xml # body size model for the participant used in the Axis Neuron software to export the mocap data
│ └── ...
├── questionnaire_total/ # questionnaire data
│ ├── raw/ # raw questionnaire data as exported from Unipark
│ │ └── questionnaire_raw.xlsx
│ ├── cleaned/ # cleaned questionnaire data (e.g., checked for consistency, pre/post questionnaires merged)
│ │ └── questionnaire_cleaned.xlsx
│ └── processed/ # processed questionnaire data (questionnaire scores computed from raw items, etc.)
│ └── questionnaire_processed.csv
└── saliva_total/ # saliva data
├── raw/ # raw cortisol data as returned by the lab
│ └── cortisol_samples_raw.xlsx
└── processed/ # processed cortisol levels in long-format and features computed from raw data
├── cortisol_samples.csv
└── cortisol_features.csv
```
### Detailed Description
The `filtered` folder consists of the following filtered files:
* `VP_xx_(f)tsst.bvh.gz`: Biovision hierarchical data, consisting of skeleton hierarchy information and the motion data (rotation and position data), compressed with gzip.
* `VP_xx_(f)tsst.calc.gz`: Axis Neuron specific file format, consists of motion data (position, quaternions, velocity, acceleration, and angular velocity), compressed with gzip.
* `VP_xx_(f)tsst_global_pose.csv.gz`: Global pose data computed from the BVH files, compressed with gzip.
* `VP_xx_(f)tsst_centerOfMass.csv`: Center of mass data exported from the Axis Neuron software.
### Self-Report Variables (`questionnaire_total`)
Questionnaire data collected from all participants. It contains the subfolders:
* `raw`: Raw questionnaire data of *Screening*, *TSST*, and *fTSST* as exported from Unipark, combined in one file.
* `cleaned`: Cleaned questionnaire data (column names adjusted, etc.)
* `processed`: Processed questionnaire data (questionnaire scores computed from raw items, etc.)
### Saliva Variables (`saliva_total`)
Cortisol and alpha-amylase data. It contains the subfolders:
* `raw`: Raw saliva data as received from the laboratory (“plate format”).
* `processed`: Reformatted saliva data in long-format of all participants and features computed from the raw data.