User Tools

Site Tools


sift:tutorials:using_directory_watchers

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:using_directory_watchers [2025/02/06 18:30] sgrangersift:tutorials:using_directory_watchers [2025/02/06 19:11] (current) sgranger
Line 170: Line 170:
 The BATCH script "Sift_Script.bat" does not need to be updated, the script gets a reference to its location itself (the %~dp0 you see in the script). The BATCH script "Sift_Script.bat" does not need to be updated, the script gets a reference to its location itself (the %~dp0 you see in the 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+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:tutorials:command_line|Batch Processing Tutorial]]. For more details on creating a .bat file for command line processing in Sift check out the [[sift:tutorials:command_line|Batch Processing Tutorial]].
Line 191: Line 193:
  
 {{:launch_sift.png}} {{:launch_sift.png}}
 +
 +In the Sift Command Line we will create our first watcher this one will point to the V3D Pipeline \\
 +**-CreateWatcher name "V3D_Watcher" directory "C:\Users\shane\OneDrive\Desktop\Testing\Watcher Demo\Watcher Demo\Data" script "C:\Users\shane\OneDrive\Desktop\Testing\Watcher Demo\Watcher Demo\V3D_Pipeline.v3s"** \\
 +
 +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 " <sub>Tip: if you want to quickly get the path to a file or folder click on it and press **Ctrl + Shift + C**</sub> \\
 +
 +{{watcher_v3d.png}} \\
 +
 +Now we will create the second watcher, this time for the Sift script \\
 +**-CreateWatcher name "Sift_Watcher" directory "C:\Users\shane\OneDrive\Desktop\Testing\Watcher Demo\Watcher Demo\CMZs" script "C:\Users\shane\OneDrive\Desktop\Testing\Watcher Demo\Watcher Demo\Sift_Script.bat"** \\
 +
 +{{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
 +
 +<sub>Tip: You can set Sift the launch to the system tray by default if you pass the command **-LaunchMinimized**</sub> \\
 +
 +{{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 "DE3_1_pose_0.c3d" into the Data folder, this will trigger the **V3D_Watcher** which will output the CMZ to the CMZs folder, the **Sift_Watcher** is watching this folder, so when the CMZ is placed within it it will begin to execute the Sift_Script. This will ultimatly export everything to the Exports folder. \\
 +
 +\\
 +
 +That's everything, with some simple set up, you can fully automate the entirety of you processing pipeline!
 +
 +
  
  
  
  
sift/tutorials/using_directory_watchers.1738866616.txt.gz · Last modified: 2025/02/06 18:30 by sgranger