Initial Testing of Assembled Miniscopes

From UCLA Miniscope
Revision as of 18:47, 21 April 2016 by DAharoni (talk | contribs) (Checking for Light Leakage)

Jump to: navigation, search

This page is a work in progress.

Once your Miniscope system is up and running, it is important to be able to test, and debug, all aspects of the system before moving to imaging in vivo. The sections below will discuss the procedures we use to validate Miniscopes we build before using them in experiments. As you become more comfortable with using Miniscopes some of the sections below can be skipped.

Testing the Coaxial Cable Connection

In our experience, the connection of the coax cable, either to the CMOS Imaging Sensor PCB or SMA connector, is by far the most common point of failure when building a Miniscope System. Take care when soldering these connections not to short the inner conductor to the outer shield. It helps to cover the solder joint as well as ~1cm of coax cable extending from the solder join in a semi-flexible epoxy, silicone, or glue (hot glue works well) to take the strain of cable movement off of the solder joint.

Once assembled, connect the Miniscope system to your computer and run the DAQ software. With the video streaming from the scope, move/twist/wiggle the coax cable with greater intensity that what you would expect an animal to apply, especially at the ends of the cable. If soldered correctly, the video stream should not drop out even with excessive movement and twisting of the cable.

Testing the Stability of the DAQ Software


When running your Miniscope system on a new computer it is important to check the following

  • Stability of video stream: We have found some combinations of USB drivers, computer hardware, and Window's OS can lead to the video stream failing a few minutes after the software has connected to the scope. This seems to mainly be an issue with Windows 8 and is independent of if you are recording the video to disk. To test the stability of your system,
    1. Connect a scope to the DAQ Box and then the DAQ Box to the computer.
    2. Open up the DAQ software and connect to the Miniscope.
    3. Leave the system running for 5 minutes. Do not click the 'record' button.
    4. If the video stream is still present (not Red Screen of Doom) your system should not have any driver or OS issues.
  • Streaming video frame rate: The default frame rate of your Miniscope system is 30FPS but can be adjusted using the drop down 'Frame Rate' box in our DAQ software (labeled with a red '1' in the picture to the right).
    1. Connect a cope to the DAQ Box and then the DAQ Box to the computer.
    2. Open up the DAQ software and connect to the Miniscope.
    3. Observe the current frame rate (labeled with a red '2' in the picture to the right). It should be stable within 1 FPS from the expected value. This is just an approximate measure of the frame rate, the frame rate of the recorded video should be extremely stable.
    4. You can also connect to a behavioral camera to add strain on your system. Generally the behavioral camera will have larger fluctuations in the displayed frame rate.
  • Write speed of video data: You want to make sure your computer is able to write the uncompressed video data to your HDD or SSD as quick (and hopefully much quicker)than the rate at which you are acquiring it. Slow or encryted hard drives can be a source of problems here.
    1. Connect a cope to the DAQ Box and then the DAQ Box to the computer.
    2. Open up the DAQ software and connect to the Miniscope.
    3. Click 'record' and observe the 'Write Speed (fps)' (labled with a red '3' in the picture to the right). This box displays the current write speed of your data. The number displayed will fluctuate but should stay above the acquisition frame rate of your Miniscope. If the write speed falls below the acquisition frame rate, video frames will be written into a circular buffer which is 256 frames long. If the write speed stays low for too long the software will begin to overwrite frames in the circular buffer. The 'timestamps.dat' file created during recording keeps track of the buffer size and is an addition place you can look when evaluating the write speed of your computer.

Imaging Your Surroundings

An assembled scope can image your surrounds when a GRIN lens is not placed into the hole in the base of the scope. Connect the scope to your computer and then point the base of the scope toward objects that are illuminated with room or sun light. A few notes

  • The scope has a green bandpass filter sitting before the CMOS imaging sensor. This means you will only be collecting light between 500nm and 550nm.
  • Most objects in the environment will not fluoresce under the blue excitation LED. This means most object will not show up unless being illuminated by a light source that contains green wavelengths such as room light or sunlight.
  • Adjust the focus slider to adjust the focal plane of your Miniscope. Most object will appear to be "infinitely" far away from the CMOS imaging sensor. Your focus slider will need to be placed close to its highest point in order to focus on these objects. This focusing slider position is equivalent to imaging at the bottom surface of your GRIN lens if a GRIN lens was mounted into the base of the scope.

Checking for Light Leakage

When assembled correctly, no excitation light from the LED should leak onto the CMOS imaging sensor in your scope. The following steps will walk you through testing a scope for such light leakage. If you do find that your scope leaks light the most common sources of the leak are the excitation or emission filter being scratched, placed in the wrong orientation, or significantly misaligned.

  1. Connect a scope to the DAQ Box and then the DAQ Box to the computer.
  2. Open up the DAQ software and connect to the Miniscope.
  3. Place the opening in the base of the scope (you can do this with or without a GRIN lens) against a black surface that won't fluoresce. You may be surprised at what materials weakly fluoresce green when blasted with blue excitation light.
  4. Turn the exposure and gain of the scope to their maximum values.
  5. Slowly turn up the excitation LED power from 0% to max power. Depending on your scope and DAQ software version the LED will likely max out at around 40%.
  6. As you increase the LED power watch the video stream for large increases in pixel brightness across large regions of your image. A small overall increase in pixel value of ~20 (the pixel values range from 0 to 255) is expected. You may also notice at max gain that some pixels become noisy. This is also normal but care should be taken in experiments to minimize this noise by limiting the gain or by correct these noisy pixels during offline processing of your data.

Imaging Calibration Slides

Image of a calibration slide with 9.8μm line spacing (superimposed red boxes are 10px x 10px)

Test Slides

Green Fluorescing Tape

Imaging GFP Slides

Similar to imaging test slides, you can use your Miniscope to image brain slice slides expressing GFP or slides with other fluorescent sources. A few key points for imaging slides are listed below:

  • Your scope has a green bandpass filter (500nm to 550nm) in front the the CMOS imaging sensor. This means only will only be able to see green fluorescence.
  • Take note of the thickness of your cover slip, usually around 170um thick. You will be imaging through the cover slip to reach the fluorescing sample. If you are using less than a 15mm focal length achromatic lens, you will likely not be able to focus past the bottom of the cover slip. Even a 15mm focal length achromatic lens will generally just reach about 50um below the bottom of the cover slip with the focusing slider pushed to its lowest position.

The video to the left is of a TetTag GFP slide being imaged with a 15mm focal length achromatic lens and 0.25 pitch GRIN lens. A few notes:

  • Their are some compression artifacts present due to YouTube's compression of the video.
  • The disk of light near the center of the field of view is due to reflection of the fluorescent light between the cover slip and bottom of GRIN lens... you should not see this disk when imaging in vivo.
  • The left and right portions of the field of view are dimmer than what you should expect to see with your own system. The outer dimness was greatly reduced in the newer versions of the Miniscope main body.