Hi Goncalo,
I would like to explain my system here. It will be a good reference to point to whenever I ask my questions.
My experiment currently records from mice using a 2-photon microscope (~9.8 Hz sampling rate), an EEG amplifier output from an AC-amplifier (-10 to 10 V, 1-2kHz), 2 USB webcams (25-30Hz), 1 video eye tracking camera with a coaxial video output (unsure of sampling rate), and the X and Y running position of the mice on a treadmill detected using a sensor much like a computer mouse sensor (200Hz-1KHz). To these data sets, we eventually want to include TTLs of a laser for optogenetics and other sensory stimuli (i.e., smell, motors, etc).
The X and Y mouse running position is an
analog voltage signal ranging from 0 - 10 V, which we will capture
using analog input channels of the NI-USB6001 at a sampling rate of 200Hz
~1kHz.
The EEG signal is also an analog voltage signal, which we will capture using an analog input channel of the NI-USB6001.
For all video recording devices, we are using (
https://www.bhphotovideo.com/c/product/1131691-REG/inogeni_vga2usb3_usb_3_0_vga_video.html/specs)
, the specification info says the frame rate is upto 60Hz, but I think
it depends on the original video signal. We treat this device as if it
is a webcam. In addition to this device, we use a video signal combiner
that accepts upto 4 video coaxial signals
and compose a single video coaxial signal. The reasons why we used
these options was 1.
we want to monitor a video signal from the eye tracking system that is a coaxial video output, and 2. we were panning a simple system without a PCI board, and 3. by using a video
combiner, we can add 3 additional cameras for environmental views.
With Bonsai, we want to synchronously trigger the recording to start and stop simultaneously. I would also use Bonsai's CombineLatest and Zip to sync the multiple camera frames and create a single montage video of all 3 cameras (2 USB webcams + 1 coaxial output eye tracking camera) along with the timestamps for each frame. We would also send the EEG signal and the mouse's X and Y running position and the eye tracking signal (i.e., pupil diameter) to the NI-USB6001 detected by an AnalogInput node of Bonsai. I am thinking that by using Zip and MatrixWriter in Bonsai, we can synchronize all these signals into one binary data set along with a column of respective timestamps. The timestamps are crucial because eventually, everything would have to be sync-ed with the 2-photon imaging data, which runs at the lowest sampling rate of 9.8Hz.
One concern we have is whether there would be a cumulative memory effect over a 30~40 min
recording. Do you know how well Bonsai performs for 30-40 min recordings with this kind of system? As long as the recording is consistent over a 30-40 min
session with a consistent jitter, we should be fine. If the recording
slows down or skips frames more towards the end
of the 30 min session, that would be a problem.