AllenNeuralDynamics / Bonsai.AllenNeuralDynamics

A Bonsai package for version control and manipulation of Git repositories
https://allenneuraldynamics.github.io/Bonsai.AllenNeuralDynamics/
Other
0 stars 0 forks source link

Stream Buffer Handling Mode available to set for Spinnaker cameras #73

Open lambdaloop opened 1 month ago

lambdaloop commented 1 month ago

This would allow users to take advantage of the buffer built into to the Spinnaker cameras

You can see some documentation here: https://www.1stvision.com/cameras/IDS/IDS-manuals/en/stream-buffer-handling-mode.html

The default is "NewestOnly" which will drop old frames if not retrieved fast enough. A good alternative is "OldestFirst" which will store frames in a buffer, but drop new frames if buffer is full.

For live applications NewestOnly makes sense, but for many scientific applications where the videos are analyzed posthoc you often want OldestFirst to minimize frame drops.

bruno-f-cruz commented 1 month ago

A few questions:

  1. Assuming no dropped frames, does this make a difference?
  2. What happens to the frame counter provided by the camera?
  3. Why does NewestOnly doesn't make sense for many scientific applications? It sounds like something important for close loop experiments?
lambdaloop commented 1 month ago
Assuming no dropped frames, does this make a difference?

I don't think this makes a difference when there are no dropped frames in the first place.

What happens to the frame counter provided by the camera?

I can't find documentation on this, but presumably the frame ids are buffered?

Why does NewestOnly doesn't make sense for many scientific applications? It sounds like something important for close loop experiments?

Sorry I phrased that poorly. I agree it's important for closed loop experiments, which is what I was including in "live applications". It should really be framed as "live" vs "posthoc" analysis.

bruno-f-cruz commented 1 month ago

I am ok with defining OldestFirst as default as it is indeed the current default of the SDK anyway: https://www.flir.com/support-center/iis/machine-vision/application-note/understanding-buffer-handling/

The default buffer handling mode for Spinnaker is Oldest First.