sift:tutorials:using_directory_watchers
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sift:tutorials:using_directory_watchers [2025/02/06 17:52] – created sgranger | sift:tutorials:using_directory_watchers [2025/02/06 19:11] (current) – sgranger | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Automating Work Flow With Directory Watchers ===== | ===== Automating Work Flow With Directory Watchers ===== | ||
In this tutorial we will walk you through the steps of setting up Sift to automatically process your data when it is loaded. You will learn how to create a directory watcher and point it to a folder your data will be dropped in, then set it to execute all your V3D and Sift processing automatically | In this tutorial we will walk you through the steps of setting up Sift to automatically process your data when it is loaded. You will learn how to create a directory watcher and point it to a folder your data will be dropped in, then set it to execute all your V3D and Sift processing automatically | ||
- | + | ||
+ | ===== The Task ===== | ||
+ | Before we can automate something we need to have an idea of what we are trying to do in the first place, in this example we will take a treadmill running trial captured with Theia, and ultimately run SPM (Statistical Parametric Mapping) to note any significant differences between the left and right knee angles. | ||
+ | |||
+ | To start download this zip file, it contains everything needed to get this example working. | ||
+ | |||
+ | ===== Setting Up ===== | ||
+ | ==== V3D Pipeline ==== | ||
+ | Before we create the watchers themselves we need to inspect the scripts that will be fired by them, first up is the V3D pipeline script " | ||
+ | |||
+ | We do have to make one small alteration, we must set the paths within the pipeline to match our computer replace all occurrences of [[REPLACE]] with the path to the unzipped " | ||
+ | |||
+ | < | ||
+ | File_Open | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! /SUFFIX= | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Compute_Model_Based_Data | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! /AXIS1=X | ||
+ | ! /AXIS2=Y | ||
+ | ! /AXIS3=Z | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Compute_Model_Based_Data | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! /AXIS1=X | ||
+ | ! /AXIS2=Y | ||
+ | ! /AXIS3=Z | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | /FRAME=50 | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | Event_Explicit | ||
+ | / | ||
+ | / | ||
+ | ! /TIME= | ||
+ | ; | ||
+ | |||
+ | File_Save_As | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ==== Sift BATCH Script ==== | ||
+ | The BATCH script " | ||
+ | |||
+ | There are a couple things to note about the script, the first line is ::SIFT, a .bat file will only be executed if this line is present, this prevents a unintended script from being executed by accident, you will also notice that the entire sift command is on one line. This is because they all need to be passed at once via a command line call and new line characters will execute everything preceding it and treat everything remaining as a brand new command to make this easier to manage you can enable wordwrap on your text editor of choice. | ||
+ | |||
+ | This script will query the left and right knee angles, conduct some outlier detection to clean the data, register signals based on their maximum value, and then perform SPM. | ||
+ | |||
+ | For more details on creating a .bat file for command line processing in Sift check out the [[sift: | ||
+ | |||
+ | < | ||
+ | ::SIFT | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | ==== Creating Watchers ==== | ||
+ | To create the watchers themselves we will need to do so within the Sift Command Line, to launch Sift on the command line, first open a command line tutorial you can do this by pressing **Windows Key + ** on your keyboard and typing **cmd** into the window that pops up \\ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | then navigate to the Sift install directory by typing **cd C:\Program Files\Sift** this path may be different depending on your specific computer \\ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Now that we are in the install directory we type **Sift.exe -NoGUI** this will open a command line instance of Sift \\ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | In the Sift Command Line we will create our first watcher this one will point to the V3D Pipeline \\ | ||
+ | **-CreateWatcher name " | ||
+ | |||
+ | Lets break down the command the **name** parameter is how we will refer to the watcher the **directory** parameter will be the one watched, in this case we want to watch the Data folder, and finally the **script** parameter is what we want to execute when the watcher is triggered in this case the V3D pipeline " < | ||
+ | |||
+ | {{watcher_v3d.png}} \\ | ||
+ | |||
+ | Now we will create the second watcher, this time for the Sift script \\ | ||
+ | **-CreateWatcher name " | ||
+ | |||
+ | {{watcher_sift.png}} \\ | ||
+ | |||
+ | now that both watchers have been created lets run **-ListWatchers** just to be sure that everything is correct, the output should look something like this: \\ | ||
+ | |||
+ | {{sift_rename_watchers.png}} \\ | ||
+ | |||
+ | With our watchers made we must set Sift to run in the background (Watchers will only trigger when Sift is running in the background) enter **-LaunchBackgroundInstance** this will immediately launch an instance of Sift in the background, we can interact with it in the system tray icon. Before moving on be sure to exit the open Sift command line console, only one instance can be open at a time and the watcher script will need to open one when executing the BATCH file.\\ | ||
+ | |||
+ | {{sift_launch_bg.png}} \\ | ||
+ | |||
+ | Here we can see what watchers we have made and even enable or disable them | ||
+ | |||
+ | < | ||
+ | |||
+ | {{sift_tray.png}} | ||
+ | |||
+ | ===== Using The Watchers ===== | ||
+ | Now that everything is set up for us all that is left to do is trigger the watchers! To do this simply drag and drop the C3D " | ||
+ | |||
+ | \\ | ||
+ | |||
+ | That's everything, with some simple set up, you can fully automate the entirety of you processing pipeline! | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
sift/tutorials/using_directory_watchers.1738864331.txt.gz · Last modified: 2025/02/06 17:52 by sgranger