Hi there!
Am Fr., 27. Nov. 2020 um 19:06 Uhr schrieb <
miguelmv...@gmail.com>:
> [...]
> The delta T between the two systems isn’t constant since frame rate varies differently in each one of them. As a result, after recording the number of scope and behavior camera frames is slightly different.
It's probably overkill for your case, but also a pretty great
opportunity to point at my Syntalos project which was specifically
designed to solve synchronization as well as automation issues for
electrophysiology and Miniscope experiments. ;-)
To make use of it, you would simple create a Miniscope and a camera
node, as well as a video recorder node for each of them within a
Syntalos board, and the synchronization would be handled
automatically. We actually tested this and there is no significant
(above one frame) delay between a video source and the Miniscope - if
there was one, however, Syntalos would at least keep the offset
constant.
Usually, these sync problems are way more severe when
electrophysiological data is recorded, as that data has a way bigger
temporal resolution compared to Miniscopes, which are easier to
synchronize.
Potential issues with Syntalos are that it will only run on Linux
(that's a design decision, but it may run (less well) on Microsofts
Linux compatibility layer (Windows Subsystem for Linux)), and that you
currently will have to build the project from source. Also, the
documentation is a bit lacking.
I am currently working on the last two aspects, and hopefully in the
end you will be able to install this project with just a few clicks
and find a lot more documentation online.
The source code an more info on this project is available here:
https://github.com/bothlab/syntalos (and our department is using it a
lot for new experiments)
We don't support the Miniscope-based behavior camera hardware yet, but
it's almost guaranteed that it will be added (generic webcams and a
few types of industrial cameras will work though).
> Would be great to have a solution that would circumvent this problem and render the exact same number of frames. Is this a known issue among other users?
Just a shot in the dark here: The video files themselves to not
contain accurate timestamps (as in: synchronized timestamps), but
rather count frames and have a known, fixed, framerate (instead of a
variable one). Calculating a timestamp from the frame number and
framerate will be very inaccurate (this can be fixed for some video
file formats, but usually isn't worth the effort for our DAQ cases).
Therefore, the official Miniscope DAQ software (as well as any other
DAQ tool that I know of) will create some file which maps frame
numbers to actual timestamps, in case of the Miniscope DAQ stored as
CSV alongside the video file. When reading the data, you'd have to
take a timestamp from these CSV files, not the video files. Then the
times should be accurate-ish. Are you doing that?
I am sorry if you are already using things that way and this is a very
dumb suggestion, but it's better to ask :-)
Another solution to the sync problem I have seen people using is to
make the DAQ tool output UNIX timestamps and compare those with
another video-recording application that also creates absolute UNIX
timestamps for each frame. That's also a very viable way to solve this
issue.
How much does your framerate vary? For my V4 Miniscopes, it's usually
not a large amount (1-3 frames max), but I do see the framerate
fluctuate wildly (10-20 frames range) as soon as there is a
connectivity issue and the signal isn't handled properly (which is
usually some cable issue, or a soldering problem). Depending on how
bad it is, that's maybe worth a look independently of the sync
problem.
Good luck with your experiments and with solving this problem!
Cheers,
Matthias
> On 27 Nov 2020, at 18:06, Sylar Grayson <
perryger...@gmail.com> wrote:
>
> Hi!
>
> Have you checked the delta T between the two systems?
> Here is my method, but it is mainly focusing on postprocessing:
> I try to measure the delta T between the camera recording system and scope recording system before I start my behavior experiment. The delta T could be a function or a constant. After registration, it seems to work a little better in some way. However, I am still looking forward to solve this problem from a hardware level.
> Hope you might find it useful.
>
> Kaii
> 在2020年11月27日星期五 UTC+8 下午4:43:50<
miguelmv...@gmail.com> 写道:
>>
>> Hello everyone,
>>
>> New V4 miniscope user here. We have recently received our new V4 miniscopes and we've been looking into how to setup experiments with synchronized imaging and behavior tracking.
>>
>> Our first approach was to use the latest version of the DAQ software to initiate both behavior camera and scope. The final result are imaging and behavior videos that aren't exactly synchronized, most likely due to slight fluctuations in frame rate in each of them. Regardless of this, and as suggested in a previous discussion here, the timestamp files can be used to match each scope frame with the closest behavior camera frame.
>>
>> We are wondering if more experienced users have found a more straightforward way to synchronize both imaging and behavior streams. For instance, does having the miniscope DAQ trigger frame acquisition in the behavior camera render better synchronization? Is having both behavior camera and scope controlled via Bonsai also a good alternative?
>>
>> Thanks in advance for any input.
>>
>>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Miniscope" group.
> To unsubscribe from this topic, visit
https://groups.google.com/d/topic/miniscope/JTCI2Wu9tJw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
miniscope+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/miniscope/d2ce7233-99cc-4f4c-b5d6-68d6f3cf8a83n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Miniscope" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
miniscope+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/miniscope/309AC9E1-FD88-4752-9AC2-19E8B9DB8D97%40gmail.com.
--
I welcome VSRE emails. See
http://vsre.info/