Skip to content

Commit 3fd9f0c

Browse files
Added data preprocessing to tutorial
1 parent e37d892 commit 3fd9f0c

25 files changed

+237259
-21133
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Step 2 Data Preprocessing
2+
3+
After JMP, the model is ready to use with the OpenSim tools Inverse Kinematics, Inverse Dynamics, and Muscle Analysis (found in Tools > Analyze...). These results will be used with other tools in the NMSM Pipeline. First, these results need to be organized for those tools.
4+
5+
The data preprocessing script included with the NMSM Pipeline can process EMG data, generate muscle-tendon velocity data from muscle-tendon length data, and split data files in multiple trials organized in the directories expected by NMSM Pipeline tools. The data preprocessing script is not a stand-alone tool, so it does not use an XML settings file.
6+
7+
## How to Use
8+
9+
The data preprocessing script can be run after changing input settings, denoted with comments in the script. The script has three main components. Each component is in a separate section of the script, so sections may be skipped if they are not needed.
10+
11+
### Process EMG
12+
13+
In this step, EMG data are highpass filtered, then demeaned, rectified, and then lowpass filtered. Both filters are Butterworth filters, and the order of the filters can be changed. EMG data are also normalized so that the maximum value in each data column over the full time range in the file is 1. This normalization ensures that Muscle-Tendon Personalization, the next tool in the pipeline, finds appropriate activation values for each muscle.
14+
15+
### Create Muscle Tendon Velocity
16+
17+
Muscle-tendon velocity is used in muscle force equations, but this is not calculated by the Muscle Analysis tool. This component of the preprocessing script uses B-spline derivatives to determine the velocity. The cutoff frequency determines the number of nodes used to fit the B-splines.
18+
19+
### Split Data into Trials by Time Pairs
20+
21+
Data are organized into directories, and files are split into the trial intervals specified as start and end time pairs in the `trialTimePairs` array. Regardless of how many frames are included in each time interval, each trial will be resampled to 101 frames by fitting splines.
22+
23+
## Running Data Preprocessing
24+
25+
To run the data preprocessing script:
26+
27+
- Make sure the nmsm-core project is loaded (double click `Project.prj` in the root of nmsm-core).
28+
- Navigate to the nmsm-tutorial/Step-2-Data-Preprocessing directory.
29+
- Open and run the MATLAB script `preprocessing.m`.
30+
31+
The script will run and save properly formatted data in the `preprocessed` directory.

Step-2-Data-Preprocessing/UF_Subject_3_reduced_muscles.osim

Lines changed: 7045 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/Full_EMG.mot

Lines changed: 60007 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/Full_processedEmg.mot

Lines changed: 60005 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/GaitTrial48_IDresults_filtered.sto

Lines changed: 6007 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/GaitTrial48_IKresults.mot

Lines changed: 6011 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/GaitTrial48_forces_ec_reordered.mot

Lines changed: 60007 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/MuscleAnalysis/RCNL_Fullbody_Walking_Model_Reduced_Muscles_MuscleAnalysis_Length.sto

Lines changed: 6012 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/MuscleAnalysis/RCNL_Fullbody_Walking_Model_Reduced_Muscles_MuscleAnalysis_MomentArm_ankle_angle_r.sto

Lines changed: 6012 additions & 0 deletions
Large diffs are not rendered by default.

Step-2-Data-Preprocessing/input_data/MuscleAnalysis/RCNL_Fullbody_Walking_Model_Reduced_Muscles_MuscleAnalysis_MomentArm_hip_flexion_r.sto

Lines changed: 6012 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)