sift:tutorials:openbiomechanics_project:impact_shooting_arm_mechanics_free_throw_accuracy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sift:tutorials:openbiomechanics_project:impact_shooting_arm_mechanics_free_throw_accuracy [2025/09/16 13:41] wikisysopsift:tutorials:openbiomechanics_project:impact_shooting_arm_mechanics_free_throw_accuracy [2025/09/17 15:02] (current) wikisysop
Line 282: Line 282:
   * Compute_Model_Based_Data   * Compute_Model_Based_Data
   * Compute_Model_Based_Data   * Compute_Model_Based_Data
 +
 +Splitting the pipeline commands into 3 separate files makes the script easier to follow and simplifies future edits and/or debugging.
  
 ====Using Sift for Statistical Analysis and Data Visualization==== ====Using Sift for Statistical Analysis and Data Visualization====
Line 292: Line 294:
 In order to properly identify all data groups for this tutorial a total of 27 queries will be needed, this includes makes, left misses, and right misses in the x, y, and z planes for each shooting arm joint. The completed query file can be downloaded here for convenience: [[https://has-motion.com/download/examples/final freethrow query.q3d|Query Definitions]]. To complete the tutorial manually follow the steps below.  In order to properly identify all data groups for this tutorial a total of 27 queries will be needed, this includes makes, left misses, and right misses in the x, y, and z planes for each shooting arm joint. The completed query file can be downloaded here for convenience: [[https://has-motion.com/download/examples/final freethrow query.q3d|Query Definitions]]. To complete the tutorial manually follow the steps below. 
  
-**1.** Navigate to the Explore tab on the left and select the Query Builder{{:sift_query_builder.png?48x48}}. Click the plus sign beside "Queries" to add a new query definition and name it **"Wrist Angle X Made"**, click save.+**1.** Navigate to the Explore tab on the left and select the Query Builder{{:sift_query_builder.png?48x48}}. Click the plus sign beside "Queries" to add a new query definition and name it **"Wrist Angle X Made"**, click save. \\
 **2.** In the conditions list below your new query add a new condition using the **+**. Name the condition **"Right X"**\\ **2.** In the conditions list below your new query add a new condition using the **+**. Name the condition **"Right X"**\\
  **a.** Under the "Signals" tab select the options shown below. This command will find the right wrist angle on all made shots in the x direction for all cmz files (each trial) and store the data in **"Wrist Angle X Made".**  **a.** Under the "Signals" tab select the options shown below. This command will find the right wrist angle on all made shots in the x direction for all cmz files (each trial) and store the data in **"Wrist Angle X Made".**
Line 342: Line 344:
  
 ===K-Means Clusters=== ===K-Means Clusters===
-Once PCA has been performed on the select groups we can use K-Means testing on the results. K-Means testing creates uses an unsupervised algorithm to create clusters of data with similar characteristics, a more detailed tutorial can be accessed by reading [[https://wiki.has-motion.com/doku.php?id=sift:tutorials:run_k-means|Running K-Means]].+Once PCA has been performed on the select groups we can use K-Means testing on the results. K-Means testing uses an unsupervised algorithm to create clusters of data with similar characteristics, a more detailed tutorial can be accessed by reading [[https://wiki.has-motion.com/doku.php?id=sift:tutorials:run_k-means|Running K-Means]].
  
 To perform **K-Means** on our results navigate to the **Outlier Detection Using PCA** button on the top tool bar. Select **K-Means** from the dropdown menu. This will generate a dialogue box, complete it like so for your wrist, shoulder and elbow joints. To perform **K-Means** on our results navigate to the **Outlier Detection Using PCA** button on the top tool bar. Select **K-Means** from the dropdown menu. This will generate a dialogue box, complete it like so for your wrist, shoulder and elbow joints.
Line 424: Line 426:
 {{:kmeans_help.png?nolink&600|}} {{:kmeans_help.png?nolink&600|}}
  
-**To script the SIFT command line process a code editor application and the newest version of Python must be installed.** In this tutorial the code editor **Visual Studio Code** is used.+**To script the SIFT command line process a code editor application and the newest version of Python must be installed.** In this tutorial the code editor **Visual Studio Code** is used. Python is just one method of automating processing through the Sift CLI, any other scripting or programming language can be used.
  
 Below are the steps required to build and execute the SIFT command line script. The final code is rather lengthy, it can be downloaded here if needed[[https://has-motion.com/download/examples/freethrowSiftScript.py |Completed Sift Automation Code]]. Completed Sift Automation Code. The code is designed to automate the all the steps done previously in this tutorial from creating the cmz files in Visual 3D, to running PCA analysis on the signals and conducting SPM tests in Sift. Ultimately all these steps below should be combined and be ran in your code editor of choice. Below are the steps required to build and execute the SIFT command line script. The final code is rather lengthy, it can be downloaded here if needed[[https://has-motion.com/download/examples/freethrowSiftScript.py |Completed Sift Automation Code]]. Completed Sift Automation Code. The code is designed to automate the all the steps done previously in this tutorial from creating the cmz files in Visual 3D, to running PCA analysis on the signals and conducting SPM tests in Sift. Ultimately all these steps below should be combined and be ran in your code editor of choice.
Line 440: Line 442:
  
 ===Selecting and accessing the work folder=== ===Selecting and accessing the work folder===
-**1.**The code will open a file explorer prompt and ask the user to select the folder with all the data. +**1.**The code will open a file explorer prompt and ask the user to select the folder with all the data. In the example in the image below, the folder that would be selected is the "introproj_testenv" as it contains the data for participant 1,2, and 3.
  
 {{:selectfolderprompt.png?nolink&600|}} {{:selectfolderprompt.png?nolink&600|}}
Line 482: Line 484:
  
 ====Executing Sift CMD line operations==== ====Executing Sift CMD line operations====
-**1.** The following part of the code is run in the command prompt. This cannot be done if the import subprocess was not done at the beginning of the code. First, Sift will be open in the command prompt which will allow for the specific Sift commands to be used. The first Sift command is going to be "-RunV3DCommand" which runs a single V3D pipeline command. The command that will be ran is to set the variable DEFAULT_DATA to the folder we are currently working on. The following line "-RunV3D" is used to run a full V3D pipeline. For the parameter "script", paste the path to the desired pipeline.+**1.** The following part of the code is run in the command prompt. This cannot be done if the import subprocess was not done at the beginning of the code. First, Sift will be open in the command prompt which will allow for the specific Sift commands to be used. The first Sift command is going to be "-RunV3DCommand" which runs a single V3D pipeline command. The command that will be ran is to set the variable DEFAULT_DATA to the folder we are currently working on.
  
     subprocess.run([     subprocess.run([
Line 492: Line 494:
         "command", "Set_Default_Folders/DEFAULT_DATA="+folder+";",         "command", "Set_Default_Folders/DEFAULT_DATA="+folder+";",
                  
-*An issue you may run into is Sift without GUI not running. This may be caused do to Sift NoGUI already being open on your device. If you want to rerun Sif NoGUI the other instance has to be exited as Sift does not allow for multiple Sift NoGUI to be run simultaneously.+*Note: Only one instance of the Sift command line can be run at once, if you are notified of this error ensure all other command line windows are closed and re-run
                  
 **2.**The following line "-RunV3D" is used to run a full V3D pipeline. For the parameter "script" in the code, paste the path to the desired pipeline. **In order for the pipeline to work for the automation** some changes must be made in the original pipeline that was used. The full pipeline with changes can be [[https://has-motion.com/download/examples/testenvpipeline.v3s|found here]]. **2.**The following line "-RunV3D" is used to run a full V3D pipeline. For the parameter "script" in the code, paste the path to the desired pipeline. **In order for the pipeline to work for the automation** some changes must be made in the original pipeline that was used. The full pipeline with changes can be [[https://has-motion.com/download/examples/testenvpipeline.v3s|found here]].
Line 509: Line 511:
     ;     ;
                
-**b)** In order to make the pipeline save to the newly created "processed" folder, a new folder parameter is made pointing to the "processed" folder. The parameter value for this is the DEFAULT_DATA path then an & followed by the word "processed"This will make it so that it adds "processed" to the end of the path causing the folder to be selected. The File_Save_As command must be changed as well. Set the FOLDER that the .cmz files are being saved to as the new folder created called "FOLDERPROCESSED" +**b)** To simplify the process, the cmz files will be saved to the folder in which the .json are found. In order to make this change make the folder parameter access the folder variable which we previously set as the DEFAULT_DATA_FOLDER
- +
-    Set_Pipeline_Parameter_To_Folder_Path +
-    /PARAMETER_NAME=FOLDERPROCESSED +
-    /PARAMETER_VALUE=&::VISUAL3D_DEFAULT_DATA_FOLDER&processed +
-    ! /FROM_MOTION_FILE_IN_WORKSPACE= +
-    ! /PARAMETER_VALUE_SEARCH_FOR= +
-    ! /PARAMETER_VALUE_REPLACE_WITH= +
-    ! /PARAMETER_VALUE_APPEND= +
-    ! /SET_PROMPT=Select a directory +
-    ! /ALPHABETIZE=TRUE +
-    ;+
  
     File_Save_As     File_Save_As
     /FILE_NAME=TRIAL&::COUNT     /FILE_NAME=TRIAL&::COUNT
-    /FOLDER=::FOLDERPROCESSED+    /FOLDER=::FOLDER
     ! /SET_PROMPT=Save CMZ file as     ! /SET_PROMPT=Save CMZ file as
     ! /SAVE_EMBEDDED_GRAPHICS=FALSE     ! /SAVE_EMBEDDED_GRAPHICS=FALSE
     ! /CREATE_FOLDER_PATH=FALSE     ! /CREATE_FOLDER_PATH=FALSE
 +    ;
 +
 +**c) OPTIONAL** If you are not using .json files for your data you will also have to make changes to the pipeline as it is currently hardcoded to specifically process .json files. In the second command of the pipeline, Set_Pipeline_Parameter_To_List_Of_Files, you can change the FILE_MASK parameter to whichever file type you are using.
 +
 +
 +    Set_Pipeline_Parameter_To_List_Of_Files
 +    /PARAMETER_NAME= FILES
 +    /FOLDER= ::FOLDER
 +    ! /SEARCH_SUBFOLDERS=FALSE
 +    /FILE_MASK=*.json !INSERT YOUR DATA FILE TYPE
 +    ! /ALPHABETIZE=TRUE
 +    ! /RETURN_FOLDER_NAMES=FALSE
 +    ! /RETURN_RELATIVE_FILENAMES=FALSE
     ;     ;
  
Line 533: Line 537:
  
         "-RunV3D",         "-RunV3D",
-        "script","c:/Users/alexh/Downloads/introproj_testenv/testenvpipeline.v3s", #Replace with your pipeline path   +        "script","c:/Users/alexh/Downloads/introproj_testenv/testenvpipelinesimplified.v3s", #Replace with your pipeline path   
  
                  
sift/tutorials/openbiomechanics_project/impact_shooting_arm_mechanics_free_throw_accuracy.1758030064.txt.gz · Last modified: 2025/09/16 13:41 by wikisysop