Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image striping when acquiring data with a commutator - discussion #35

Open
GarrettBlair opened this issue Jun 21, 2023 · 5 comments
Open

Comments

@GarrettBlair
Copy link

This is intended to be more of a discussion and spot to organize and document ideas, as the google discussion is a bit dated and long.

Image striping during acquisition
During acquisition occasionally the image becomes misaligned due to a buffer issue. Seems to occur more often when using a commutator. I'm aware this issue has be documented and discussed elsewhere (see google groups discussion, I just want to create a more centralized issue to track progress and solutions.

I've been working a decent amount on identifying and fixing them, but haven't come up with a satisfying method. Currently I manually find the beginning and end of each occurrence, then interpolate them out using the bookend frames (so that motion correction and source extraction don't go haywire), and then throw out the activity from those interpolated times. Usually this only results in a handful of lost frames at a time, but when it lasts hundreds of frames it's very detrimental.

I've found it helpful to classify the stripes into two categories - stable and moving (see examples below).

  • Stable offset stripes seem to be a consistent buffer offset problem (discussed in the google group). It can persist for much longer, and sometimes indefinitely until the scope is power cycled. As @daharoni and others have worked out, the data during these periods can be recovered, though the size of the buffer or offset don't appear consistent (2 examples of different stable offsets below).
  • Moving stripes appear to be much shorter lived, but have an unstable pattern that might make data recovery difficult. I've only seen it persist for about 10 frames at a time though.

Here's a link to example data showing both issues:
https://drive.google.com/drive/folders/1JoomTZ7Ty0XKJo9ZNjIwy6_CUKqlzK_N?usp=sharing

Screenshots

All of the following occurred in sequence:

Normal frame
normal_frame
Example offset pattern
offset_ex1
Another example offset
offset_ex2
Example of moving (non-stable) striping 1
roving_ex1
Example of moving (non-stable) striping 2
roving_ex2
Back to normal imaging (after about 135 frames)
nomal_frame_return

Additional context
Google groups discussion of issue

@jonnew
Copy link
Collaborator

jonnew commented Jun 22, 2023

Which commutator are you using?

e.g. the Open Ephys commutator is a mil-spec grade RF rotary joint that maintaines 50-ohm transmission line through the commutation point (less chance for data corruption than slip ring with no impedance control) that we have testing for hundreds of hours continuous use without issue.

https://open-ephys.org/commutators/coaxial-commutator
https://open-ephys.github.io/commutator-docs/

and that is compatilbe with miniscope v4.

@GarrettBlair
Copy link
Author

Currently using a passive slip ring commutator from Moog that uses a 50Ohm coaxial line for the scope.

@jonnew
Copy link
Collaborator

jonnew commented Jun 23, 2023

OK, yes. That does not maintain 50-ohm transmission line. Introduces discontinuity which results in signal distortion. This is exacerbated by the fact that its right in the middle of the cable (assuming you have a sizable length of coax on either side). This may not be the issue, but it certainly wont help.

@GarrettBlair
Copy link
Author

Yeah I agree the occasional discontinuity from the slip ring is the root cause. The OEPS commutator only support 1 scope for purchase (right?), and I'm using two miniscopes through the commutator and keeping the cabling in and out fairly short (1.5-2.0m on animal side, 5-10cm on DAQ side). I see the OEPS design for 2 scopes is available on the dev site, but I don't have the capacity to fabricate one right now.

I was hoping there could be a software solution to detecting and resolving the striping. Perhaps using a real-time template matching or just a user interface to reset the buffer if they notice it occurring to prevent the stable offset situation from persisting too long during a recording.

@GarrettBlair
Copy link
Author

GarrettBlair commented Jan 25, 2024

I developed a decent fix for the static banding issue - see the demo video and matlab script in my miniscope banding repo

edit - @daharoni fyi, if this helps things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants