Capture high frame rate videos of a custom-made, CatWalk like setup for mice using a FLIR's BlackFly camera. A video is saved to disk every time motion is detected and while locomotion satisfies the criteria defined in the configuration.
See related resources:
- Install Spinnaker SDK
- Install Python version 3.8 (notice that the only supported Python version is 3.8).
- Open
cmd
- Run
pip install walkway
orpython -m pip install walkway
.
- Power on IR light source.
- Plug in camera to computer.
- Adjust camera settings using SpinView (optional)
- Adjust camera aperture and focus to view region of interest under the light conditions expected during the experiment.
- Adjust image format to limit the view to the apparatus' walkway. Note that some parameters can only be changed when acquisition is off.
- Open
cmd
- Run
python -m walkway.capture
to start auto-triggering. - Press
q
on the GUI orctrl+c
on the command window when done. - Video files are saved to cmd's working directory (defaults to
C:/Users/<your username>
in Windows). You maycd
to a different directory prior to start capturing to save videos elsewhere. - You may use a configuration file in JSON format with
python -m walkway.capture --configuration configuration.json
; this will override any parameters previously set to the camera. - Run
python -m walkway.capture --help
for more information. - Run
python -m walkway.gui
to open a GUI with a single camera. - Run
python -m walkway.experiment
to open an experiment with two FLIR cameras and a Petteron microphone.
MATLAB scripts to analyze data collected with the Walkway setup.
See related resources:
- MATLAB (last tested with R2023a)
- Install MATLAB
- Download and extract these scripts to Documents/MATLAB folder.
To export a table with gait metrics:
- Create a new data loader to match your DLC data columns (use
loadData.m
as a reference). - Edit
process.m
according to your experimental setup and run.
For further analysis, such as replicating those described in the paper paper, also modify paper.m
and preprocess.m
.
Make sure to run startup.m
every time you restart MATLAB to add dependencies to MATLAB's search path.
- For the data loader associated to the paper, DLC files are expeected to be saved in the following format:
[Sex][GroupId][MouseId]-[Mode][Year][Month][Day][Hour][Minute][Second][Microsecond]
For example:F0203-T20220124110229988302
Sex: 1 character encoding sex: M or F GroupId: 2-digit number (e.g. 01) MouseId: 2-digit number (e.g. 02). Mode: 1 character encoding recording mode, T: automatic trigger, C: manual trigger. Year: 4-digit number (e.g. 2023) Month, Day, Hour, Minute, Second: 2-digit number. Microsecond: 6-digit number.
For group testing, where multiple animals may trigger detection, MouseId can be omitted from the filename:
M02-C20220128162425752937
CAD files and assembly instructions for a Walkway apparatus.
See related resources:
- 6mm clear acrylic sheets
- Strip of IR LEDs
- Power supply
- Female DC barrel jack adapter
- Power cord
- BFS-U3-16S2M-CS USB Blackfly® S, Monochrome Camera
- USB 3.1, Type-A to Micro-B
- Varifocal lens (Fujinon DV3.4X3.8SA-1)
- Laser cut the acrylic sheets using the provided CAD drawings. Remove protective film.
- Use 2 part epoxy to place the LED strips facing up as shown in the diagram above.
- Connect the LED strip to the LED connector -making sure to match the polarity and attach it to the narrow space of the LED holder.
- Connect positive and negative sides of the LED connector to the positive and negative sides of the DC adapter (respectively). Optionally, add a 50 to 200 Ohm resistor in series with one of the two LED cables to dim the lights.
- Assemble all acrylic parts (except removable parts) using painter's tape and apply acrylic cement or 2-part epoxy. Remove painter's tape after drying.
- Mount camera with lens and attach the usb to a computer running the acquisition software.
- Insert removable walls.
- Place the mouse in the cage.
- Close the lid and power on the LEDs.
See Changelog
© 2021 Leonardo Molina