-
Notifications
You must be signed in to change notification settings - Fork 2
Video_Digital
Below is code on how to create video clips with behavioral timestamps noted in a strip plot. In this example, a tumble feeder is flashing a blue LED when a mouse touches the feed bars. This code will take a large video file (multiple hours) and create small clips around each blue flash, and add a strip plot to the top to reflect timing of blue flashes. Click HERE for a full .py file of this code, broken into steps.
This is an example of the final video:

This section of code allows you to move your ROI within your video. The purpose of this was to limit the search for blue light flashes to the LED only. When you run this code on your video, it will produce a .jpg file showing your ROI as a red square. Change the values in the CONFIGURATION section until you are only capturing your visual trigger in the ROI.


Once your ROI is set, copy and paste the values into this section of code. This code takes your larger video and creates smaller clips when the trigger is detected. Depending on the size of your video, this part can take a long time. Again, this code can be changed to create clips based on other inputs.

Once you have clips made and you have selected a specific clip, you can run this code on it. This section of code will store the timestamps of your specific trigger. The purpose of this is to allow you to crop and edit your video after, and still have timestamps available for graphing. If you wanted to crop your trigger out of your video, run this code to save the timestamps of when they occur, and then clip the video using other software before appending the pulse graph.
This is the final section of code, which is used to create a graph on top of your video, showing different parameters of your trigger. Here I am using it to show touches and meals. Touches are the raw trigger timestamps, while meals are classified based on the timepoints of those touches. This graph can be modified to show any data and allows for a lot of customization.

🧠 Home
- Onboarding Guide
- Lab Manual
- NRB Printer setup
- Travel Guidelines
- Software Setup
- Poster Printing
- Poster Templates/examples
- Reviewing Papers
- Making Figures
- Transnetyx info
- Onboarding WashU Undergraduates
- Cage cards
- Surgery cards
- Mouse Transfer Procedure
- Cage Check
- IACUC Protocols
- Mouse Genotyping
- Diet nutritional information
-- Chow diet
-- FED3 grain pellets (Bioserv)
-- High fat diet
- RNA extraction (Trizol)
- cDNA synthesis with Biorad reagent
- Designing primers
- Setting up the qPCR and analysis
- Localizing injections with DiI
- GCaMP8
- ChR2 (H134R)
- GrabDA
- dLight
- Caspase
- mCherry / YFP Controls
- retroCre
Acquisition
Analysis
- Electrode array construction
- Attaching fibers to Inn NeuroPhys arrays
- NanoZ Impedance Testing
- NanoZ Gold Plating
- Recording Setup
- Data Analysis
- Electrode lesions for histology
- Antibody stocks
- Cryostat
- Freezing microtome
- SST & PV immunostaining
- GFP immunostraining
- IHF troubleshooting
Ex Vivo
- Overview
- Current Clamp
- Voltage Clamp
- Clampex Protocols
- Solutions & Recipes
- Troubleshooting
- Post-patching IHC
- PPR with ClampFit
In Vivo