Worm Machine Vision

Setting up worm tracker software:

This page is an explanation of how to set up Worm Tracker 2.0 software. Please read carefully.

Acquire the necessary hardware:
  1. A PC running Windows XP or Windows Vista or Windows 7.
  2. As described in the harware section: Dino-Lite type microscope/webcam.
  3. As described in the harware section: Zaber motorized stage driven through a serial port (other stages like Prior and Ludl can also work but have not been tested extensively).
Setting Up Your USB Camera (Dino-Lite Users Disregard This Section)
  1. Install the webcam software.
  2. Test your webcam with its software.
  3. Remove all webcam optics in front of its CCD (see here for details).
  4. Mount the camera onto the microscope.
Setting Up Your Motorized Stage
  1. Connect Dino-Lite camera to your computer with it's USB cable.
  2. Connect Zaber stage serial port to computer, connect the power cord and switch the stage on.
Installing The Worm Tracker
  1. Make sure you have the latest version of Java. Download and install it from here.
  2. Download the Worm Tracker installer from here.
  3. Run the installer.
Setting Up The Worm Tracker
  1. Webcam Setup
    1. Double click the Worm Tracker icon on your desktop.
    2. Choose "Preferences" from the "File" menu.
    3. Click the "Display" tab.
    4. Click the "Detect New Cameras" button and wait for it to complete. This will take a while but don't worry, you only have to do it once.
    5. You should now see video from your webcam.
    6. If your webcam is a color one (most likely) click the "Convert To Grayscale" checkbox.
    7. Vignetting is the dark rim you are now likely to see framing the video images. It is a result of non-uniform lighting traveling through the microscope into the webcam. Click the "Vignette Correction" checkbox and follow the instructions to remove the vignette.
  2. Stage Setup
    1. In the "Preferences" dialog box click the "Tracking" tab.
    2. In the "Stage" panel choose your stage type and the serial port through which it's connected.
    3. You will now calibrate the microscope and stage for worm tracking. Please only use agar petri dishes that are identical in size and agar height to the ones you intend to use for worm tracking.
    4. Setup your magnification: Place a dish with worms under the microscope. Adjust the magnification so that the worm size you intend to track occupies approximately 3/4 of the video image. We use this size so that the motorized stage can keep up with the worm's speed (you can calibrate it as necessary). Lock (or note) the magnification.
    5. Align the camera's axes: Print the following page out and cut a square from it. Find an agar petri dish without worms or food. Place the square on the agar in the dish and place the dish under the microscope. Find the black dot in the center of the square and focus on it. Using your stage's joystick (if you have one) or, on the main screen, the up/down/left/right buttons to move the stage (in the "TRACKING" panel's "Stage" subpanel), ensure that the X & Y axes of the webcam are correct and aligned (i.e. the black dot stays entirely in axis when moving the stage just up & down or left & right). You will likely have to make small adjustments to the webcam's mounting. Adjust the stage movements size as needed in the "Preferences" dialog "Movement" panel.
    6. Determine the number of stage steps per pixel: Use the same black dot. In the "Threshold" panel, adjust the "Manual Threshold" (you have to press enter each time you change the number) until most of the black dot is painted green and this green overlay is fairly stable in size & shape from one video frame to the next. Now, find the "Stage" panel again and, near the "Steps/Pixels:" field, click the "Calibrate" button and follow the on screen instructions.
    7. Your motorized stage should list the conversion between stage steps and microns. Enter the X & Y values into the appropriate "Steps/Microns" fields.
  3. Tracking Setup
    1. In the "Preferences" dialog box click the "Tracking" tab.
    2. When tracking the worm's centroid, choose the "Centroid" radio button in the "Tracking" Panel. In the "Threshold" panel, adjust the "Manual Threshold" or "Continuous Auto-Threshold" as needed so that most of the worm is painted green. Then, in the "Tracking" panel define the "Centroid Boundary" (painted orange) so that the worm is always maintained in view of the webcam (this may take some trial and error but, for the most part, smaller boundaries are better).
    3. When tracking the worm's movement, choose the "Movement" radio button in the "Tracking" Panel. In the "Threshold" panel, adjust the "Camera Noise Threshold" as needed so that moving parts of the worm are painted red. Then, in the "Tracking" panel define the "Movement Boundary" (painted magenta) so that the worm is always maintained in view of the webcam (this may take some trial and error but, for the most part, large boundaries are better).
    4. Before tracking, in the "Display" panel's "Rate" subpanel, set the tracking rate to be about every second (your webcam's frame rate and the speed of your motorized stage dictate this number; in short, stage movements must complete before the next tracking occurs or things will go haywire!).
  4. Tracking Worms
    1. In the "File" menu save your configuration (as the default if you don't already have one).
    2. Go to the main screen.
    3. Find the worm.
    4. In the "TRACKING" panel's "Stage" subpanel, hit the "Start" button.
    5. Decide whether you want to log stage or worm coordinates (the analysis software uses stage coordinates. If you want to analyze your videos with our software you MUST choose stage coordinates!!!).
    6. In the "RECORDING" panel's "File" subpanel, fill in your choice of file name and details.
    7. In the "Length" subpanel, choose the length of the video.
    8. In the "Controls" subpanel, start recording or just take a snapshot.
Preparing worm plates for tracking
  • To maximize the quality of videos it is imporatnt to prapare the NGM plates carefully. Grow worms on normal plates and track them on low peptone plates to minimize noise in the video by the surrounding bacteria. Please download the detailed protocol here: worm plate preparation.

Download this explanation as a pdf or a MS word file.

Documents to print:

© 2012, MRC Laboratory of Molecular Biology, Cambridge, UK.