====== Virtual Lab Direction of Progression ====== What if the subject is not walking along the lab axes? What if the subject is walking at a diagonal? To calculate certain measures, such as the trunk angle relative to the lab, the virtual lab should be aligned with the subject's direction of progression. If the subject is not aligned with the principal axes of the lab there are several methods that can be used to do this, a few are described below. If the subject is walking along the principal axes of the lab, a [[Visual3D:Tutorials:Modeling:Virtual_Laboratory_|dynamic virtual lab]] can be used instead of the following methods. ===== Introduction ===== To calculate the trunk angle relative to the lab, the following steps can be taken: * Step 1 - Define the direction of progression * Step 2 - Define the virtual lab * Step 3 - Define the trunk angle relative to the virtual lab === Sample Files === Each of the following methods can be used with the [[https://www.has-motion.com/download/examples/DirectionOfProgression/DOP_SampleFiles.zip|sample data files]]. When opening the CMO file, notice that the Virtual Lab segment is aligned with the principal axes of the lab. The scripts for Method 1 and Method 2 will update the alignment of the Virtual Lab segment so that the axes is aligned with the direction of progression. Method 3 calculates the joint angles manually, so it is not necessary to update the alignment of the Virtual Lab since it is not used. These methods are also explained in [[https://www.has-motion.com/download/examples/DirectionOfProgression/DOP_PPTSlides.zip|power point form]] for a more detailed explanation. === Metric Direction of Progression === |In each of the following methods, the direction of progression will need to be defined (Step 1). Once the direction of progression has been based off some measure, the user will need to determine what "progression" they are looking for. This means that if the subject walked in an arc (blue), does the user want to:\\ \\ - Calculate the average direction the subject traveled (red)\\ - Calculate the median direction the subject traveled (green)\\ - Calculate the difference between the start/stop position (purple)\\ \\ Obviously, it is rare that a subject is walking in a complete circle, but depending on the task, the user should choose the method that will result in the solution they are looking for. | {{:DirectionofProg_Graph.png}} | ==== Method 1 ==== An example script that demonstrates this method can be found [[Visual3D:Documentation:Modeling:Virtual_Lab:Virtual_Lab_Direction_of_Progression_Method_1|here]]. Please review the [[https://www.has-motion.com/download/examples/DirectionOfProgression/DOP_PPTSlides.zip|power point slides]] for a more detailed explanation. === Step 1: Direction of Progression === - Find the rotation between the lab and the trunk segment (Trunk_Rot) - Project the trunk's coordinate system onto the floor: - Create the Y Unit vector by setting the z component of Trunk_Rot's y component to zero, then find the magnitude of this signal - Create the Z Unit vector (0,0,1) - Create the X Unit vector by crossing the Y and Z unit vectors - Calculate the [[#Metric_Direction_of_Progression|metric direction of progression]] from the X Unit vector === Step 2: Define the Virtual Lab === - Create the virtual lab using X Unit Vector metric of the direction of progression === Step 3: Define the trunk angle relative to the virtual lab === Using Model Compute Model Based Data, calculate the Joint_Angle between the Trunk and Virtual Lab segments. ==== Method 2 ==== An example script that demonstrates this method can be found [[Visual3D:Documentation:Modeling:Virtual_Lab:Virtual_Lab_Direction_of_Progression_Method_2|here]]. Please review the [[https://www.has-motion.com/download/examples/DirectionOfProgression/DOP_PPTSlides.zip|power point slides]] for a more detailed explanation. === Step 1: Direction of Progression === |- Get the initial position of the origin of the pelvis (RPVo)\\ \\ - Create this as a time based signal\\ - Create a vector from the origin of the pelvis that offset in the -Y direction of the lab (-Y)\\ - Project the pelvis origin onto the floor (DOP)\\ - Calculate the angle between the origin of the pelvis at t=0, the -Y direction of the lab, and the direction of progression (DOP) at each time point in the trial\\ - Calculate the [[#Metric_Direction_of_Progression|metric direction of progression]] based on the angle (Theta Y) between the direction of progression and the Y Axis\\ - Theta X = 90 - Theta Y | {{:DOP_Method2.png}} | === Step 2: Define the Virtual Lab === - Create landmark to define the orientation of the virtual lab (Dir_Prog_X) - Offset in the X: - 0.1 * SIN ( ( 90 - Theta Y ) * pi()/180 ) - Offset in the Y: - 0.1* COS ( ( 90 - Theta Y ) * pi()/180 ) - Offset in the Z: 0 - Create a [[Visual3D:Tutorials:Modeling:Virtual_Laboratory_#Example:_Creating_a_virtual_laboratory_that_changes_with_the_direction_of_walking|virtual lab]] and use the Dir_Prog_X landmark instead of Lab_Other === Step 3: Define the trunk angle relative to the virtual lab === Using Model Compute Model Based Data, calculate the Joint_Angle between the Trunk and Virtual Lab segments. ==== Method 3 ==== An example script that demonstrates this method can be found [[Visual3D:Documentation:Modeling:Virtual_Lab:Virtual_Lab_Direction_of_Progression_Method_3|here]]. Please review the [[https://www.has-motion.com/download/examples/DirectionOfProgression/DOP_PPTSlides.zip|power point slides]] for a more detailed explanation. === Step 1: Direction of Progression === - Find the location of the model's center of mass at the beginning of the trial - Find the location of the model's center of mass at the end of the trial - Find the difference between the two locations - Create the unit vector of the difference - This result is a metric so this value can be used to define the direction of progression ([[#Metric_Direction_of_Progression|see here for more information]]) - There should be no progression in the vertical direction so set Z=0 === Step 2: Define the Virtual Lab === The joint angles will be solved for manually in Step 3, so it is unnecessary to create a virtual lab for this method. === Step 3: Define the trunk angle relative to the virtual lab === - Define rotation from Lab to VLab - Z component is perpendicular to the ground - Y component is the direction of progression - X component is Y cross Z - Define rotation from Lab to Trunk - Using Compute Model Based Data command select the Joint_Rotation function and resolve the Thorax/Ab rotation in the Lab coordinate system - Solve for the rotation between VLab and the trunk segment - Solve for the joint angles: - Solve for Theta X - Solve for Theta Y - Solve for Theta Z ==== Method 4 ==== This method creates a Virtual Lab segment that follows the general orientation of the Pelvis (or any segment) but keeps the transverse plane parallel to the lab floor. In other word, this method constrains the Virtual Lab to only rotations around the vertical axis based on the Pelvis segment. This method thus allows to compute variables using the instant direction of progression. === Create Landmarks === |\\ **1. Create MID_PSIS:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //MID_PSIS//\\ \\ |

       **Landmark Name:** //MID_PSIS//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //RPSIS//\\    **Ending Point:** //LPSIS//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **ML:** //0.0//    **AP:** //0.0//    **AXIAL:** //0.5//
  8. \\
  9. **Check**: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_MID_PSIS_Landmark.png}}| |\\ **1. Create RPV_Z_Lab:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //RPV_Z_Lab//\\ \\ |

       **Landmark Name:** //RPV_Z_Lab//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //MID_PSIS//\\    **Existing Segment:** //LAB//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **X:** //0.0//    **Y:** //0.0//    **Z:** //0.1//
  8. \\
  9. **DO NOT** Check: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_RPV_Z_Lab_Landmark.png}}| |\\ **1. Create RPV_Y_Lab:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //RPV_Y_Lab//\\ \\ |

       **Landmark Name:** //RPV_Y_Lab//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //MID_PSIS//\\    **Existing Segment:** //LAB//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **X:** //0.0//    **Y:** //0.15//    **Z:** //0.0//
  8. \\
  9. **DO NOT** Check: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_RPV_Y_Lab_Landmark.png}}| |\\ **1. Create RPV_Y:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //RPV_Y//\\ \\ |

       **Landmark Name:** //RPV_Y//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //MID_PSIS//\\    **Existing Segment:** //Pelvis//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **ML:** //0.0//    **AP:** //0.15//    **AXIAL:** //0.0//
  8. \\
  9. **DO NOT** Check: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_RPV_Y_Landmark.png}}| |\\ **1. Create RPV_Y_PROJ:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //RPV_Y_PROJ//\\ \\ |

       **Landmark Name:** //RPV_Y_PROJ//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //MID_PSIS//\\    **Ending Point:** //RPV_Z_Lab//\\    **Lateral object:** //RPV_Y//\\    **Project From:** //RPV_Y_Lab//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **X:** //0.0//    **Y:** //0.0//    **Z:** //0.0//
  8. \\
  9. **DO NOT** Check: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_RPV_Y_PROJ_Landmark.png}}| |\\ **1. Create RPV_Y_Fixed:**\\ \\
    \\
  1. Click **Landmarks** button
  2. \\
  3. Click **Add New Landmark** button
  4. \\
  5. Create Landmark: //RPV_Y_Fixed//\\ \\ |

       **Landmark Name:** //RPV_Y_Fixed//\\

    \\ \\

       **Define Orientation Using:**\\    **Starting Point:** //MID_PSIS//\\    **Ending Point:** //RPV_Y_PROJ//\\

    ||
  6. \\
  7. Offset Using the Following **ML/AP/AXIAL** Offsets:\\    **ML:** //0.0//    **AP:** //0.0//    **AXIAL:** //0.1//
  8. \\
  9. **DO NOT** Check: //Offset by Percent (1.0 = 100%)//
  10. \\
  11. **DO NOT** Check: //Calibration Only Landmark//
| {{:VirtualLab_RPV_Y_Fixed_Landmark.png}}| === Create Virtual Lab Segment === To create the Virtual Laboratory segment, switch to the **Segment** Tab in model builder mode. |**1. Create the Virtual Lab Segment:**\\ \\ 1. In the Segment Name combo box type **Virtual Lab**\\ \\ 2. Check the **Kinematic Only** Check Box\\ \\ 3. Select the **Create** button | {{:VLab_SegmentName.jpg}}| |4. In the **Virtual Lab** tab, enter these values:\\ \\ |   **Define Proximal Joint and Radius**\\ \\    **Lateral:**//None//     **Joint:** //MID_PSIS//     **Medial:** //None//     \\ \\    **Radius:** //0.01//\\ \\    **Define Distal Joint and Radius**\\ \\    **Lateral:** //None//     **Joint:** //RPV_Z_Lab//     **Medial:** //None//     \\ \\    **Radius:** //0.01//\\ \\    **Extra Target to define Orientation**\\ \\    **Select:** //Lateral//     //RPV_Y_Fixed//\\ \\    **Select Tracking Targets:**\\ \\       **Check:** //Use Calibration Targets for Tracking//|\\ \\ 5. Click on **Build Model.**\\ \\ 6. Click on **Close Tab** before proceeding. | {{:VirtualLab_4DoF.png}}| \\