Code and documentation related to the Tardigrade project in KITP QBio 2025.
We will be using SpinView to record videos from the microscope.
To use SpinView, you need to install the Spinnaker SDK. Instructions for Windows and macOS are below.
- Download the latest Spinnaker SDK for Windows from here.
- Run the installer and follow the on-screen instructions.
- Select USB-3 drivers for your camera during installation.
- Reboot if prompted.
- Open SpinView (
C:\Program Files\FLIR Systems\Spinnaker\bin64\vs2015\SpinView_WPF.exe). - Connect your camera and test SpinView.
- Install dependencies using Homebrew (instructions):
- Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install dependencies:
brew install pkg-config libomp libusb [email protected]
- Install Homebrew:
- Download the Spinnaker SDK for macOS from here. Use version 4.1 for Apple Silicon, or 3.2 for Intel Macs.
- Unpack the zip, open the
.dmg, and run the.pkginstaller. If you see a security warning, allow the package in System Settings → Privacy & Security. - Open SpinView (
/Applications/Spinnaker/apps/SpinView_QT). - Connect your camera and test SpinView.
We use Arduino for stimulus control. Install the Arduino IDE as follows:
- Download the latest Arduino IDE from the official website.
- Run the installer and follow instructions.
- Allow driver installation if prompted.
If you have Homebrew, install Arduino IDE with:
brew install arduino-ideOr download from the official website, open the .dmg, and drag Arduino to Applications. Allow the app in System Settings → Privacy & Security if needed.
- Open Arduino IDE.
- Go to File > Examples > 01.Basics > Blink.
- Connect your Arduino board via USB.
- Select the correct board (Tools > Board > Arduino AVR Boards > Arduino Uno or your model).
- Select the correct port (Tools > Port).
- In the Blink sketch, change both
delay(1000);todelay(100);. - Click Upload.
- The onboard LED should blink rapidly, confirming setup.
- Install Anaconda (Python 3).
- Download and install Visual Studio Code.
- Download the Tardigrade Tracker Software from GitHub and save to your desktop. The folder should contain:
TardigradeTracker.yamlTardigradeTracker.pyTrajectoryTracker.py- Test Videos (place in the same directory)
- Create a clean virtual environment:
conda env create -f TardigradeTracker.yaml
- Check environment creation:
conda env list
- Activate the environment:
conda activate TardigradeTracker
- Verify environment:
The result should look like:
conda list
# packages in environment at /path/to/anaconda3/envs/TardigradeTracker: # # Name Version Build Channel bzip2 1.0.8 h0d85af4_4 conda-forge ca-certificates 2025.1.31 h4653dfc_0 conda-forge libexpat 2.7.0 h0dc2134_0 conda-forge libffi 3.4.6 h9cdd2b7_0 conda-forge liblzma 5.8.1 h9cdd2b7_0 conda-forge libzlib 1.3.1 h9cdd2b7_0 conda-forge ncurses 6.5 h9cdd2b7_0 conda-forge openssl 3.4.1 h0d85af4_0 conda-forge python 3.13.2 h0d85af4_0 conda-forge readline 8.2 h8228510_1 conda-forge tk 8.6.13 h9cdd2b7_1 conda-forge tzdata 2025b h0c530f3_0 conda-forge # pip packages: easygui 0.98.3 joblib 1.4.2 numpy 2.2.4 opencv-python 4.11.0.86 pillow 11.1.0 scikit-learn 1.6.1 scipy 1.15.2 threadpoolctl 3.6.0 tqdm 4.67.1 - Open Visual Studio Code and the
TardigradeTracker.pyfile. - Click the run arrow in the upper right corner.
- When prompted, select the folder containing test videos and choose a video file.
- The video loads into the GUI for analysis.
- Click the video to draw a box around the tardigrade (large enough so it stays inside throughout).
- Ensure the algorithm tracks the tardigrade throughout the video. Adjust contrast, brightness, and threshold as needed.
- When satisfied, click the run button at the bottom of the GUI.
- Two new files are generated: a video showing the tracked tardigrade and a CSV with extracted measurements. Monitor progress in Visual Studio Code.