Horizontal scan lines during imaging

415 views
Skip to first unread message

Zeeshan Haqqee

unread,
Aug 17, 2020, 6:29:40 PM8/17/20
to Miniscope
Hello,

I'm getting horizontal scanning lines in my image during recording and I have no idea how to get rid of them completely. They're either very thick and apparent or very thin, sometimes fluctuating in size. I've noticed that if I gently nudge the rigid-flex PCB connecting to the EWL (the little circles sandwiching the EWL) then these lines disappear and the image is super clear. However, the digital focus stops working. If I nudge it back, the digital focus works again, but then the lines come back. I've tried soldering many different coax-ufl cables thinking that might be the issue, but it's always the same. Video below.

https://youtu.be/jTkS3f6xV0I

Any advice would be appreciated. I'm mostly concerned this will interfere with image analysis and cell extraction.
Thanks,

Zeeshan

Zeeshan Haqqee

unread,
Aug 19, 2020, 2:28:19 PM8/19/20
to Miniscope
Still having this issue. Here's some updates on what I've tried:

I've tried switching the coax 4 times, using different lengths and thickness, even different solder types, with and without PCB for SMA, and I've tried with someone else's coax cable (her scope does not produce lines). Nothing made a difference. I notice the issue either disappears completely, or is there fully. If I nudge the little circles sandwiching the electronic focus lens, then the lines disappear, but the focus won't work. Nudge it back (or plug/unplug scope) and I can focus again, but lines are also back.

So then I thought maybe it's that lens. Swapped it with a fresh one and no difference. I took out the lens and sandwiched it between the circular PCBs with my fingers (maybe it wasn't gripping properly) and still, getting lines. Even though the lens isn't inside, so it's something wrong with the image itself!

Because it only happens when there's contact with the electronic focus lens, I think it's defective chip issue, meaning that maybe it somehow doesn't have enough power to power the lens, the LED, and CMOS, and so the image suffers (when lens connected)? Looking online, it seems like these banding issues are caused in videos by a mismatch in shutter speed between the light and image sensor in cameras, so now I'm wondering if maybe the LED is flickering when the lens is connected, causing these lines, However, issue persists even at LED set to 0, EWL set to 0,and gain set lowest.



image.png

Federico Sangiuliano

unread,
Aug 19, 2020, 6:38:00 PM8/19/20
to Miniscope
Hello Zeeshan. Can you please upload pictures of the miniscope? Especially the PCB that has the EWL cables.

Thank you

Federico

Zeeshan Haqqee

unread,
Aug 19, 2020, 7:16:18 PM8/19/20
to Miniscope


Here you go! More uploading... 

20200819_185307.jpg

20200819_185220.jpg

20200819_185207.jpg

20200819_185200.jpg

20200819_185152.jpg

20200819_185134.jpg

20200819_185143.jpg


Zeeshan Haqqee

unread,
Aug 19, 2020, 7:20:48 PM8/19/20
to Miniscope

20200819_185134.jpg

20200819_184835.jpg

20200819_184724.jpg

20200819_185258.jpg


Zeeshan Haqqee

unread,
Aug 19, 2020, 7:22:50 PM8/19/20
to Miniscope
Sorry, I have no idea why these look stretched. I can upload original pictures once I transfer photos from my phone, if you prefer. Let me know.

Zeeshan

Federico Sangiuliano

unread,
Aug 19, 2020, 7:28:02 PM8/19/20
to Miniscope
Don't worry! Those pictures are perfect. I suspect that a diode is causing this issue.

diode.png

That diode has some stripes that show the orientation. Can you send me a picture of that part? It's easy once you unscrew the LED-EWL pcb.

Thank you

Federico

Zeeshan Haqqee

unread,
Aug 19, 2020, 7:56:34 PM8/19/20
to Miniscope

20200819_195056.jpg

Let me know if you'd prefer a different angle.

Daniel Aharoni

unread,
Aug 19, 2020, 8:03:40 PM8/19/20
to Miniscope
Hi Zeeshan,
Thank you for the detailed information concerning the issue you are having.

These horizontal lines are caused by electrical noise from the electrowetting lens (EWL) driver that propagates back up the 3.3V power line to the CMOS sensor. The EWL driver generates a large ~+70V square wave at around 5KHz, on the up and down swing of the square wave there seems to be an inrush of current that our 3.3V voltage regulator isn't super great at keeping up with. Interestingly, these up and down swings are not very quick so all the onboard bypass capacitors do not do a good job isolating these current swings. 

The actual noise that propagates back on the 3.3V line is actually very small but our CMOS sensor seems to be particularly sensitive to this and, ideally, the reference voltage of the CMOS sensor should be generated from a separate voltage regulator but we don't have the space to do so. We played around with adding larger and larger bypass capacitors on the 3.3V line to isolate this noise and it turns out that using a 47uF capacitor between 3.3V and GND does a very good job of removing these horizontal lines. On the current V4 Miniscope PCBs, there is this 47uF capacitor sitting right near the EWL driver and it usually does a pretty good job removing these lines but it looks like there are some edge cases where they still show up.

Likely all V4 Miniscopes will show a tiny bit of these horizontal stripes when the Gain of the CMOS sensor is turned up to its max but generally otherwise it won't be visible. 

The good news: This noise is extremely easy to completely remove from your recorded data before doing any other image processing step. We will put together a short tutorial on how to do this along with providing MATLAB and Python code. I might even add a real-time filtering option in the Miniscope DAQ Software if enough people request it. Below is a very short guide on how to remove these horizontal lines in a post-processing step:
  1. The horizontal lines have a very specific spatial frequency that is very localized in the FFT of an Miniscope image.
  2. First take the 2D FFT of each frame of your recording
  3. Next, plot the 2D FFT and you will see 1 or 2 localized spots along the x or y axis which represent these horizontal lines.
  4. Set these bins of the 2D FFT to 0.
  5. Take the inverse 2D FFT to re-generate the Miniscope frame but without the spacific spatial frequencies you set to 0 in the FFT
  6. Save these filtered frames back to an .avi or .tiff file.
I hope this helps! We will continue to track down the source of why a few Miniscopes still show much more visible horizontal lines.

Zeeshan Haqqee

unread,
Aug 19, 2020, 8:49:11 PM8/19/20
to Miniscope
Hi Daniel,

Thank you for the detailed explanation. Indeed, of the 6 scopes assembled so far between the two labs I work in, only 2 of them show large horizontal lines. For the others, they are indeed still present but much less noticeable and much thinner. I'll pass along the information about post processing to those who are more familiar with the analysis. If real time correction on the software is possible, that would be amazing, but I understand that depends on how frequent of an issue this happens to be among users.

Thanks,
Zeeshan

J Quinn Lee

unread,
Sep 2, 2020, 1:56:06 PM9/2/20
to Miniscope
Hi Daniel,

I have a potentially related problem to Zeeshan, but am not sure if it is due to the same issue or comes from a different source. I have updated the V4 software and DAQ, and am using a single coax to a commutator, and another from the commutator to the scope. Where the coax connects to the scope I have applied some kwik-sil to help hold the connection in place (reduce rotation). I sometimes see the following problem in the ms video (screen shots attached) where the image seems to suddenly misalign with a banding pattern, and it usually seems to happen with greater tension on the coax but occurs less frequently with a little more slack between the cable and the commutator. I also noticed frames from the miniscope tend to drop when this pattern appears. Can you source the potential issue?
Please let me know.

All the best,
Quinn
Quinn_MS_glitch_img1.png
Quinn_MS_glitch_img2.png

Daniel Aharoni

unread,
Sep 2, 2020, 2:26:44 PM9/2/20
to Miniscope
Hi Quinn,
This misalignment of some pixel rows of the image seems to be due to a damaged Miniscope DAQ (along with possibly a slightly unstable coax cable/connector/commutator). I can't say I know this conclusively but this issue showed up in my lab once and never showed up again once we switched to a different DAQ. This has also happened in 1 other lab I know of and they also were able to get rid of this issue by try another DAQ.

What is happening here is a buffer in the Miniscope DAQ gets partially filled and then likely a brief data disconnection occurs between the serializer on the V4 and the deserializer on the DAQ. When this happens the DAQ's firmware is suppose to clear the buffers and wait for a new frame to begin but for some reason it seems like it isn't clearing a partially filled buffer. This results in this misalignment you are seeing in subsequent frames. 

Unfortunately I haven't been able to reproduce this issue since it happened in my lab quite a while back. I'll take a quick look through the firmware code to see if there is an obvious place that the code would enter into when this happens. If so I can make sure buffers are cleared before acquiring the next frame.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages