+ All Categories
Home > Documents > MoS Calculation Guide

MoS Calculation Guide

Date post: 06-Feb-2016
Category:
Upload: unaryunns
View: 13 times
Download: 0 times
Share this document with a friend
Description:
How to calculate the margin of stability (MoS)
44
How to utilize the Margin of Stability code. Last Updated: 6/26/2014
Transcript
Page 1: MoS Calculation Guide

How to utilize the Margin of Stability code.

Last Updated: 6/26/2014

Page 2: MoS Calculation Guide

1. We begin in Cortex

Page 3: MoS Calculation Guide

2. Make sure View Planes Show Analog and 3D Views.

Page 4: MoS Calculation Guide

3. Analog Graphs F1Z and F3Z need to be selected

Right click on the analog graph window

Page 5: MoS Calculation Guide

4. Once completed final cortex window should look as such.

F2Z

Page 6: MoS Calculation Guide

5. Now we trim the data.

• We trim the data in order to look at the MoS during either single or double support.

• So we have to utilize the analog force plate data in order to approximate when the subject is in either single or double support.

• So depending on if you want to gather MoS data for single or double support the manner in which you trim the data will be different.

Page 7: MoS Calculation Guide

5. Now we trim the data.

SINGLE SUPPORT DOUBLE SUPPORT

Page 8: MoS Calculation Guide

5. Now we trim the data.

• Single support data must be selected in cortex running from one peak of the curve to the second peak of the force platform curve.

SINGLE SUPPORT

Page 9: MoS Calculation Guide

5. Now we trim the data.• Double support can be

trimmed at two different points, but consistency is KEY.

• Double support exists from the beginning/end of the curve to approximately the peak of the first/last hump, dependent on what portion of the gait cycle one wishes to select.

• REMEMBER APPROXIMATELY TO THE PEAK! NOT AT THE PEAK otherwise one enters single support.

DOUBLE SUPPORT

Page 10: MoS Calculation Guide

6. Trim selected data.• Select ‘trim capture w/options’ under

the ‘File’ menu option.• Make sure that ‘Save Selected Frames’

is selected.• Provide the location at which you wish

to save it, with an appropriate naming convention that you can use consistently across trials and subejcts.

• The file naming convention originally used was:– Folders: ‘[Subject type][Subject #]’

• For example, MS08 or MSC08.

– Files: ‘Trimmed_Trimmed_[Subject Type][Subject #]C2_[Foot Used][Trial Number]• For example,

Trimmed_Trimmed_MS08C2_R5 or Trimmed_TrimmedMSC08C2_R5

Page 11: MoS Calculation Guide

7. Once you have trimmed all necessary data, you may close Cortex.

• The files we are concerned with are the .trc files. Opening them in excel should reveal XYZ data for all markers across the trimmed frames.

Page 12: MoS Calculation Guide

NOW WE BEGIN WITH MATLAB

SETTING UP THE DATA FOR ANALYSIS

Page 13: MoS Calculation Guide

1. Open Matlab

• Prior to calculating the MoS we must organize the raw data from the trimmed .trc files.

• In order to organize this data we have two sets of MATLAB code.

• One set of code for Single Support and a separate set for Double Support

• For each set of code you will organize left and right foot data separately.

Page 14: MoS Calculation Guide

1. Open Matlab

• For Single Support .trc organization one will use the following files:– ‘Write_Trimmed_Files_For_Analysis_Right_Foot_SACRAL_SHI

FT.m’– ‘Write_Trimmed_Files_For_Analysis_Left_Foot_AP_Sacral_Shi

ft.m’• For Double Support .trc organization one will use the

following files:– ‘Write_Trimmed_Files_For_Analysis_Right_Foot_DS_Shift.m’– ‘Write_Trimmed_Files_For_Analysis_Left_Foot_DS_Shift.m’

Page 15: MoS Calculation Guide

2. Open Appropriate File for .trc Organization (Single or Double Support?)

• The steps necessary for one to use the code for Single and Double Support are identical.

• So for the purposes of demonstrating how to utilize the organization code I will use Double Support Code.

Page 16: MoS Calculation Guide

3. Specify Subjects to be Analyzed.

• When you run the data organization code, you must specify which subjects you wish to look at.

• In this case I am looking at all of the subjects with MS listed here.

• So I enter their subject number or ‘FOLDER_NUMBER’ between the two [……..] brackets.

Page 17: MoS Calculation Guide

4. Specify Total Number of Subjects Analyzed

• Here we specify the total number of subjects we wish to organize.• The line of code you are to change begins with

– ‘for folder_count = 1:1…’– The portion after the equals sign will always begin with ‘1:1…’– It is the final number on that line which in the picture below is ‘10’, that

will be changed from time to time depending on the total number of subjects to be analyzed.

– As specified in STEP 3 we are going to look at 10 MS Subjects in this example.

Page 18: MoS Calculation Guide

5. Specify File Name and Location

Page 19: MoS Calculation Guide

5. Specify File Name and Location• ‘sheet_read’ is the variable

where the location of the folder and .trc file are stored.

• My folders for this example were located at:– ‘F:\Thesis_Files\

Double_Support_Trimmings\...’

Page 20: MoS Calculation Guide

5. Specify File Name and Location• Once you have located your

folders you must enter the name of the folder MINUS the SUBJECT NUMBER.

• The name of my folders was ‘MS…’ therefore I typed MS, BUT I did NOT type the subject number.

Page 21: MoS Calculation Guide

5. Specify File Name and Location• Now we must specify the specific FILE MINUS

the SUBJECT NUMBER and TRAIL NUMBER.• My files were titled, ‘Trimmed_Trimmed_M’• It was listed without the subject and trail

number.• BUT you’ll notice that the subject and trail

number surround the condition number, ‘C2_L’.

• You’ll also notice that the condition number was still listed. So file and folder names are allowed to be broken up with variable names.

Page 22: MoS Calculation Guide

5. Specify foot used

• Write a ‘L’ to indicate LEFT FOOT.• Write a ‘R’ to indicate RIGHT FOOT.

Page 23: MoS Calculation Guide

5. Specify File Type

• All files should be trc, so place ‘.trc’ after rootname.

Page 24: MoS Calculation Guide

5. Specify Output File Name

• The output file name is at your discretion, but be sure to include a underscore at the end of your file name because subject number is added when the file is output.

Page 25: MoS Calculation Guide

5. Specify Number of trails per Subject

• Here we specify the total number of trails per subject: • The line of code you are to change begins with

– ‘for counter_file = 1:1…’– The portion after the equals sign will always begin with ‘1:1…’– It is the final number on that line which in the picture below is ‘5’, that

will be changed from time to time depending on the total number of trails per subject.

– The number of trails per subject MUST be the SAME for ALL SUBJECTS that you listed within STEP 3 (‘folder_count’).

Page 26: MoS Calculation Guide

6. Run the code!

• Now that you have successfully entered all the information you can run the code by clicking on the green play button!

Page 27: MoS Calculation Guide

6. How the output file should look! (Number of Sheets)

• Each output file for each subject (left or right foot) should have a number of sheets equal to the number of trails you conducted per foot plus one (in this case we conducted 5 trails plus one, so six sheets).

• The first sheet (Sheet M) contains the data necessary to calculate leg length.

• The remaining sheets (One through Five in this case) represent either the left or right foot trials, dependent upon what your specified for ‘foot_used’.

Page 28: MoS Calculation Guide

6. How the output file should look! (The layout of Sheet M)

• Sheet M should contain six columns.

• The number of rows are dependent upon how you trimmed the data and the frames during which the CoM (Sacral Marker) is within the Base of Support. During Double

Support: Troch

During Single Support: Troch

During Double Support: Troch

During Single Support: Troch

Page 29: MoS Calculation Guide

6. How the output file should look! (The layout of Sheets 1,2,3…)

• Sheets 1,2,3… should contain nine columns.

• The number of rows are dependent upon how you trimmed the data and the frames during which the CoM (Sacral Marker) is within the Base of Support.

During Double

Support: V. Sacral

During Single

Support: V. Sacral

During Double

Support: MTP LAT

During Single

Support: MTP Lat

During Double

Support: Cal Lat

During Single

Support: Heel

Page 30: MoS Calculation Guide

SECOND PHASE OF USING MATLAB

CALCULATING THE MARGIN OF STABILITY

Page 31: MoS Calculation Guide

1. Open Matlab

• For all Margin of stability calculations one can use the following file:– ‘New_MoS_Cal_All.m’

Page 32: MoS Calculation Guide

2. Specify Subjects for which MoS will be calculated.

• Before running the MoS code, one must specify which subjects one wishs to calculate MoS for.

• In this case I am looking at all of the same subjects with MS listed within STEP 3 of the DATA ORGANIZATION CODE, except now their marker positions are organized for analysis.

• So I enter their subject number or ‘FOLDER_NUMBER’ between the two [……..] brackets.

Page 33: MoS Calculation Guide

3. Specify Total Number of Subjects for which MoS will be Calculated

• Here we specify the total number of subjects for which we wish to calculate MoS.

• The line of code you are to change begins with– ‘for counter_MoS_file = 1:1…’– The portion after the equals sign will always begin with ‘1:1…’– It is the final number on that line which in the picture below is ‘10’, that will

be changed from time to time depending on the total number of subjects for which MoS will be calculated.

– As specified in STEP 2 we are going to look at 10 MS Subjects in this example.

Page 34: MoS Calculation Guide

4. Specify File Name and Location

• ‘filename’ is the variable where the location of the file is stored.

• My file was located at:– ‘C:\Users\Sahibjit Ranu\

Downloads\Matlab_DS\MS\Sacral_Shifted_DS_ML\...’

Page 35: MoS Calculation Guide

4. Specify File Name and Location• Now we must specify the specific

FILE name MINUS the SUBJECT NUMBER.

• My files were titled, ‘Ordered_Data_ML_DS_MS_’

• It was listed without the subject number.

• BUT you’ll notice that the subject number is followed by the foot used and file type (‘L.xls’).

Page 36: MoS Calculation Guide

5. Specify foot used

• Write a ‘L’ to indicate LEFT FOOT.• Write a ‘R’ to indicate RIGHT FOOT.

Page 37: MoS Calculation Guide

5. Specify Type of MoS You Would Like To Calculate

• MoS_type = ‘SS’– This is used for ALL AP DATA regardless of whether it is

AP DOUBLE SUPPORT or AP SINGLE SUPPORT.

• MoS_type = ‘DS_ML’– This is used for ONLY DOUBLE SUPPORT in the ML

DIRECTION.

Page 38: MoS Calculation Guide

5. Specify File Type

• All files should be .xls, so place ‘.xls’ after rootname.

Page 39: MoS Calculation Guide

5. Specify Output File Name

• The output file name is at your discretion, subject number and foot used is added automatically when the file is output.

Page 40: MoS Calculation Guide

5. Specify Number of trails per Subject

• Here we specify the total number of trails per subject:

• The line of code you are to change begins with– ‘for sheet_count= 1:1…’– The portion after the equals sign

will always begin with ‘1:1…’– It is the final number on that

line which in the picture below is ‘5’, that will be changed from time to time depending on the total number of trails per subject.

– The number of trails per subject MUST be the SAME for ALL SUBJECTS that you listed within STEP 2 (‘folder_number’).

Page 41: MoS Calculation Guide

6. Run the code!

• Now that you have successfully entered all the information you can run the code by clicking on the green play button!

Page 42: MoS Calculation Guide

6. How the output file should look! (Number of Sheets)

• Each output file for each subject (left or right foot) should have 2 sheets.– ‘Margin of Stability’– ‘Subject Averages’

• The first sheet (‘Margin of Stability’) contains margin of stability values for each frame. Each column is a trail and each row is the margin of stability value for that frame.

• The second sheet (‘Subject Averages’) lists out (in the following order): the mean, maximum, minimum, and range.

Page 43: MoS Calculation Guide

6. How the output file should look! (The layout of the ‘Margin of Stability’ Sheet)

• The ‘Margin of Stability’ sheet should contain a quantity of columns equivalent to the number of trials conducted.

• The number of rows are dependent upon how you trimmed the data and the frames during which the CoM (Sacral Marker) is within the Base of Support.

Total Number of Trials (5)

Total Number of

Frame over which

the MoS was

Calculated.

Page 44: MoS Calculation Guide

6. How the output file should look! (The layout of the ‘Subject Averages’ sheet)

• The ‘Subject Averages’ sheet should contain four columns.

• The number of rows is equal to one.

• The columns are in the following order: Mean MoS, Maximum MoS, Minimum MoS, and Range of MoS.

Mean MoS

Max MoS

Range of

MoS

Min MoS


Recommended