visual3d:documentation:pipeline:signal_commands:computing_the_range_of_motion
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:signal_commands:computing_the_range_of_motion [2024/06/19 12:53] – sgranger | visual3d:documentation:pipeline:signal_commands:computing_the_range_of_motion [2024/07/17 15:46] (current) – created sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== background | + | ====== Computing the Range of Motion ====== |
- | there are several steps required to determine the range of motion. this page details three examples: | + | ==== Background ==== |
- | * example 1 uses events | + | There are several steps required |
- | * example 2 computes the range by finding the maximum and minimum joint angle and using the evaluate expression command to calculate the difference (range) | + | |
- | * example 3 computes a cummulative | + | |
- | ===== example | + | * Example |
+ | * Example 2 computes the range by finding the maximum and minimum joint angle and using the evaluate expression command to calculate the difference (range) | ||
+ | * Example 3 computes a cummulative | ||
- | consider the right knee angle angle expressed as "right knee ang". compute the range of motion over all frames in the file using events. the result is named "right knee ang rom". | + | ==== Example 1: Compute Range of Motion from events |
- | * compute start and end events | + | Consider |
- | * compute | + | |
- | * use the pipeline command for the event_global_maximum to determine the frame at which the maximum joint angle occurs during the range of interest (e.g. start and end event labels); this will create an event label. **note: you will have to select the component of the signal to use. for the default visual3d segment coordinate system flexion/ | + | |
- | * use the pipeline command metric_signal_value_at_event to create a metric value containing the joint angle at the "maximum" | + | |
- | * use the pipeline command for the event_global_minimum to determine the frame at which the minimum joint angle occurs during | + | |
- | * use the pipeline command metric_signal_value_at_event to create a metric value containing the joint angle at the " | + | |
- | * use the pipeline command for evaluate_expression to subtract the minimum value from the maximum value. **note: | + | |
- | * the metric | + | |
- | the script from the above steps can be found below: | + | * Compute START and END events |
+ | * Compute | ||
+ | * Use the pipeline command for the EVENT_GLOBAL_MAXIMUM to determine the Frame at which the maximum joint angle occurs during the range of interest (e.g. Start and End Event Labels); This will create an Event Label. **Note: you will have to select the component of the signal to use. For the default Visual3D segment coordinate system flexion/ | ||
+ | * Use the pipeline command Metric_Signal_Value_At_Event to create a metric value containing the joint angle at the " | ||
+ | * Use the pipeline command for the EVENT_GLOBAL_MINIMUM to determine the Frame at which the minimum joint angle occurs during the range of interest (e.g. Start and End Event Labels); This will create an Event Label. **Note: you will have to select the component of the signal to use. For the default Visual3D segment coordinate system flexion/ | ||
+ | * Use the pipeline command Metric_Signal_Value_At_Event to create a metric value containing the joint angle at the " | ||
+ | * Use the pipeline command for Evaluate_Expression to subtract the minimum value from the maximum value. **Note: in the expression you will have to select the component of the signal to use. For the default Visual3D segment coordinate system flexion/ | ||
+ | * The metric "Right Knee Ang ROM" created in the previous step is the range of motion for the component of the joint angle selected. | ||
+ | |||
+ | The script from the above steps can be found below: | ||
< | < | ||
- | ! define | + | ! Define |
- | event_explicit | + | Event_Explicit |
- | /event_name=start | + | /EVENT_NAME=START |
- | /frame=1 | + | /FRAME=1 |
- | ! /time= | + | ! /TIME= |
; | ; | ||
- | ! define | + | ! Define |
- | event_explicit | + | Event_Explicit |
- | /event_name=end | + | /EVENT_NAME=END |
- | /frame=eof | + | /FRAME=EOF |
- | ! /time= | + | ! /TIME= |
; | ; | ||
- | compute_model_based_data | + | Compute_Model_Based_Data |
- | /result_name=right knee ang | + | /RESULT_NAME=Right Knee Ang |
- | /function=joint_angle | + | /FUNCTION=JOINT_ANGLE |
- | /segment=rsk | + | /SEGMENT=RSK |
- | /reference_segment=rth | + | /REFERENCE_SEGMENT=RTH |
- | /resolution_coordinate_system= | + | /RESOLUTION_COORDINATE_SYSTEM= |
- | ! /use_cardan_sequence=false | + | ! /USE_CARDAN_SEQUENCE=FALSE |
- | ! /normalization=false | + | ! /NORMALIZATION=FALSE |
- | ! /normalization_method= | + | ! /NORMALIZATION_METHOD= |
- | ! /normalization_metric= | + | ! /NORMALIZATION_METRIC= |
- | ! /negatex=false | + | ! /NEGATEX=FALSE |
- | ! /negatey=false | + | ! /NEGATEY=FALSE |
- | ! /negatez=false | + | ! /NEGATEZ=FALSE |
- | ! /axis1=x | + | ! /AXIS1=X |
- | ! /axis2=y | + | ! /AXIS2=Y |
- | ! /axis3=z | + | ! /AXIS3=Z |
; | ; | ||
- | ! calculate | + | ! Calculate |
- | event_global_maximum | + | Event_Global_Maximum |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | /signal_folder=original | + | /SIGNAL_FOLDER=ORIGINAL |
- | /event_name=max | + | /EVENT_NAME=MAX |
- | /select_x=true | + | /SELECT_X=TRUE |
- | ! /select_y=false | + | ! /SELECT_Y=FALSE |
- | ! /select_z=false | + | ! /SELECT_Z=FALSE |
- | ! /event_sequence= | + | ! /EVENT_SEQUENCE= |
- | ! /exclude_events= | + | ! /EXCLUDE_EVENTS= |
- | /start_at_event=start | + | /START_AT_EVENT=START |
- | /end_at_event=end | + | /END_AT_EVENT=END |
; | ; | ||
- | ! find the joint angle at event max | + | ! Find the joint angle at event MAX |
- | metric_signal_value_at_event | + | Metric_Signal_Value_At_Event |
- | /result_metric_name=right knee ang_max | + | /RESULT_METRIC_NAME=Right Knee Ang_MAX |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | /signal_folder=original | + | /SIGNAL_FOLDER=ORIGINAL |
- | /event_name=max | + | /EVENT_NAME=MAX |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
- | ! /generate_vector_length_metric=false | + | ! /GENERATE_VECTOR_LENGTH_METRIC=FALSE |
- | ! /retain_no_data_values=false | + | ! /RETAIN_NO_DATA_VALUES=FALSE |
; | ; | ||
- | ! calculate | + | ! Calculate |
- | event_global_minimum | + | Event_Global_Minimum |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | /signal_folder=original | + | /SIGNAL_FOLDER=ORIGINAL |
- | /event_name=min | + | /EVENT_NAME=MIN |
- | /select_x=true | + | /SELECT_X=TRUE |
- | ! /select_y=false | + | ! /SELECT_Y=FALSE |
- | ! /select_z=false | + | ! /SELECT_Z=FALSE |
- | ! /event_sequence= | + | ! /EVENT_SEQUENCE= |
- | ! /exclude_events= | + | ! /EXCLUDE_EVENTS= |
- | /start_at_event=start | + | /START_AT_EVENT=START |
- | /end_at_event=end | + | /END_AT_EVENT=END |
; | ; | ||
- | ! find the joint angle at event min | + | ! Find the joint angle at event MIN |
- | metric_signal_value_at_event | + | Metric_Signal_Value_At_Event |
- | /result_metric_name=right knee ang_min | + | /RESULT_METRIC_NAME=Right Knee Ang_MIN |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | /signal_folder=original | + | /SIGNAL_FOLDER=ORIGINAL |
- | /event_name=min | + | /EVENT_NAME=MIN |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
- | ! /generate_vector_length_metric=false | + | ! /GENERATE_VECTOR_LENGTH_METRIC=FALSE |
- | ! /retain_no_data_values=false | + | ! /RETAIN_NO_DATA_VALUES=FALSE |
; | ; | ||
- | ! subtract | + | ! Subtract |
- | ! the metric created is the range of motion for the component of the joint angle selected. | + | ! The metric created is the range of motion for the component of the joint angle selected. |
- | evaluate_expression | + | Evaluate_Expression |
- | /expression=metric::processed::right knee ang_max::x-metric::processed::right knee ang_min::x | + | /EXPRESSION=METRIC::PROCESSED::Right Knee Ang_MAX::X-METRIC::PROCESSED::Right Knee Ang_MIN::X |
- | /result_type=metric | + | /RESULT_TYPE=METRIC |
- | /result_name=right knee ang rom | + | /RESULT_NAME=Right Knee Ang ROM |
- | ! /result_folder=processed | + | ! /RESULT_FOLDER=PROCESSED |
; | ; | ||
</ | </ | ||
- | ===== example | + | ==== Example |
- | consider | + | Consider |
< | < | ||
- | ! find the maximum value of all 3 components | + | ! Find the maximum value of all 3 components |
- | metric_maximum | + | Metric_Maximum |
- | /result_metric_name=_max | + | /RESULT_METRIC_NAME=_MAX |
- | /apply_as_suffix_to_signal_name=true | + | /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | ! /signal_folder=original | + | ! /SIGNAL_FOLDER=ORIGINAL |
- | ! /signal_components=all_components | + | ! /SIGNAL_COMPONENTS=ALL_COMPONENTS |
- | /event_sequence= | + | /EVENT_SEQUENCE= |
- | /exclude_events= | + | /EXCLUDE_EVENTS= |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
- | ! /create_global_maximum=false | + | ! /CREATE_GLOBAL_MAXIMUM=FALSE |
; | ; | ||
- | ! find the minimum value of all 3 components | + | ! Find the minimum value of all 3 components |
- | metric_minimum | + | Metric_Minimum |
- | /result_metric_name=_min | + | /RESULT_METRIC_NAME=_MIN |
- | /apply_as_suffix_to_signal_name=true | + | /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=right knee ang | + | /SIGNAL_NAMES=Right Knee Ang |
- | ! /signal_folder=original | + | ! /SIGNAL_FOLDER=ORIGINAL |
- | ! /signal_components=all_components | + | ! /SIGNAL_COMPONENTS=ALL_COMPONENTS |
- | /event_sequence= | + | /EVENT_SEQUENCE= |
- | /exclude_events= | + | /EXCLUDE_EVENTS= |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
- | ! /create_global_minimum=false | + | ! /CREATE_GLOBAL_MINIMUM=FALSE |
; | ; | ||
- | ! the range of motion can be estimated as the difference between max and min | + | ! The range of motion can be estimated as the difference between max and min |
- | ! note: that this isn't quite true because angles are not vectors | + | ! Note: that this isn't quite true because angles are not vectors |
- | evaluate_expression | + | Evaluate_Expression |
- | /expression=metric::processed::right knee ang_max-metric::processed::right knee ang_min | + | /EXPRESSION=METRIC::PROCESSED::Right Knee Ang_MAX-METRIC::PROCESSED::Right Knee Ang_MIN |
- | /result_name=right knee ang rom | + | /RESULT_NAME=Right Knee Ang ROM |
- | /result_type=metric | + | /RESULT_TYPE=METRIC |
- | ! /result_folder=processed | + | ! /RESULT_FOLDER=PROCESSED |
; | ; | ||
</ | </ | ||
- | ===== example | + | ==== Example |
- | one may want to calculate the cummulative amount of a certain movement occurring at a joint during a task. for example, consider hip flexion range of motion for 2 subjects: | + | One may want to calculate the cummulative amount of a certain movement occurring at a joint during a task. For example, consider hip flexion range of motion for 2 subjects: |
- | * subject | + | * Subject |
- | * subject | + | * Subject |
- | the range is the same (40°) for both subjects but the amount of movement is different. | + | The range is the same (40°) for both subjects but the amount of movement is different. |
- | the following set of pipeline commands will compute this cumulative range. | + | The following set of pipeline commands will compute this cumulative range. |
< | < | ||
- | ! compute | + | ! Compute |
- | first_derivative | + | First_Derivative |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=rknee_angle | + | /SIGNAL_NAMES=RKNEE_ANGLE |
- | ! /signal_folder=original | + | ! /SIGNAL_FOLDER=ORIGINAL |
- | /result_suffix=_vel | + | /RESULT_SUFFIX=_VEL |
- | /result_folder=velocity | + | /RESULT_FOLDER=VELOCITY |
; | ; | ||
- | ! rectify | + | ! Rectify |
- | evaluate_expression | + | Evaluate_Expression |
- | /expression=abs(link_model_based::velocity::rknee_angle_vel) | + | /EXPRESSION=ABS(LINK_MODEL_BASED::VELOCITY::RKNEE_ANGLE_VEL) |
- | /result_name=rknee_angle_vel | + | /RESULT_NAME=RKNEE_ANGLE_VEL |
- | /result_type=link_model_based | + | /RESULT_TYPE=LINK_MODEL_BASED |
- | /result_folder=rectified_velocity | + | /RESULT_FOLDER=RECTIFIED_VELOCITY |
; | ; | ||
- | ! integrate | + | ! Integrate |
- | metric_integrate | + | Metric_Integrate |
- | /result_metric_name=range | + | /RESULT_METRIC_NAME=RANGE |
- | ! /apply_as_suffix_to_signal_name=false | + | ! /APPLY_AS_SUFFIX_TO_SIGNAL_NAME=FALSE |
- | ! /result_metric_folder=processed | + | ! /RESULT_METRIC_FOLDER=PROCESSED |
- | /signal_types=link_model_based | + | /SIGNAL_TYPES=LINK_MODEL_BASED |
- | /signal_names=rknee_angle_vel | + | /SIGNAL_NAMES=RKNEE_ANGLE_VEL |
- | /signal_folder=rectified_velocity | + | /SIGNAL_FOLDER=RECTIFIED_VELOCITY |
- | /signal_components=x | + | /SIGNAL_COMPONENTS=X |
- | /event_sequence=start+stop | + | /EVENT_SEQUENCE=START+STOP |
- | /exclude_events= | + | /EXCLUDE_EVENTS= |
- | /generate_mean_and_stddev=false | + | /GENERATE_MEAN_AND_STDDEV=FALSE |
- | ! /append_to_existing_values=false | + | ! /APPEND_TO_EXISTING_VALUES=FALSE |
; | ; | ||
</ | </ |
visual3d/documentation/pipeline/signal_commands/computing_the_range_of_motion.1718801580.txt.gz · Last modified: 2024/06/19 12:53 by sgranger