Category: Micro-Manager

  • Triggerscope Mini Micro-Manager Setup

    Below is a short video introducing the Triggerscope Mini, as well as demonstrating how to set it up in micromanager.

    If you’re in a hurry, I’ve also outlined the basic steps below with screen shots.

    Connect the triggerscope mini to a USB-2 compliant port, via it’s USB C connection cable (included).

    Open micromanager, select the device configuration wizard, and browse to the add device page.

    Scroll the device list until you see “Triggerscope-MM” expand that and select the -Hub device.

    A window will appear, set the COM port to the port used by the triggerscope mini, and set the baud to 115,200, then click OK.

      After a few seconds, a list of components will appear. Note this is for the full triggerscope, so we will only choose the TTL 1-8 Bank, and DAC 1 + DAC 2. Below is a basic chart showing what devices are supported on the mini vs the standard triggerscope.

        When prompted for the DAC voltages, only select 0-5V (default), and click OK.

          That’s it! Follow the manager to complete the install. Once done, you’ll have the common TTL output control, DAC control, blanking, sequencing and other features of a standard triggerscope!

          1. LED, laser, or other PWM control using Triggerscope

            It appears that more and more people want to use PWM control for illumination devices from Micro-Manager and other imaging software. PWM may be used for any number of applications, from high speed pulsing of an LED, or a laser, in order to reduce phototoxicity or just to control brightness, or to drive a DC motor at a varying speed, or to drive a device like a spinning disk to set the PRM. I figured I’d address this using the Triggerscope system controllers. rIn order to support PWM drive over an external device, I wanted a few useful functions to work in MM:

            • PWM duty cycle should be controlled form presets
            • PWM should be called to “off” from a TTL or other “shutter” style command
            • Once off, a similar “ttl on” type command should re-enable PWM at the alst used duty cycle
            • multiple output lines should be supported at different duty cycles.

            Version 407 of the Triggerscope firmware now supports this, and uses the existing driver available for these devices. I’ve made a short demo video showing how this works on an oscilloscope output. I’ll place an option for this on the store. Please get in touch with any questions or post here – thanks!

          2. Pt Grey Camera Driver for MicroManager unleashes low-cost microscopy

            Let’s say you want to build an imaging system, but you want to attach 2 cameras for time-correlated 2 channel imaging. The limiting factor for such an arrangement is usually cost, that cost being $10,000 USD per camera means $20,000 for such a setup! A result of this is most researchers end up not using time correlation at such an accuracy, and resort to filter cube switching or emission wheels. Enter the new release of Micro-Manager drivers for Pt. Grey cameras. Through the hard work of Nico Stuurman, Micro-Manager now supports most of the low cost USB cameras offered by this machine vision camera manufacturer. Kurt Thorn has an excellent report on his blog with performance data from one of Pt. Grey’s CMOS cameras.

            The key point? Most microscopy cameras start @ $6,000 USD, and go up from there. By comparison, Pt Grey cameras usually run less than $1,000 USD!

            So why is it that such a camera can cost 1/10 of a typical microscopy camera? The major cause is the ongoing market cycle of entrenched mature products and services, vs. disruptive technologies and products. Clayton Christensen explains the nature of this process in his excellent book, “The Innovator’s Dilemma“, but let’s look at the top 2 reasons for the price delta.

            Cooling: Most of the big camera manufacturers chase each other on performance specifications. If you’ve attempted to purchase one of these cameras through an on-site demo, you’ve likely heard the “spec war” sales pitch, wherein camera company A explains the important numeric advantages (quantum efficiency, read noise, dark current, etc)  over companies B, C etc. Of course, this rises out of a need to improve a camera’s performance as much as possible, to win sales. While this is all great for both product variation and for economic advantage (better product at a lower cost through competition), it assumes that the people driving these specs actually understand how important they are to the end user. In the past, dark noise was an easy problem to “one up” on performance. How? Simply cool the sensor! So peltier coolers (thermoelectric plates) were attached to the backside of sensors, with large radiators used to vent drawn heat on the back of the camera. This gave us heavy, large cameras with very low dark current of 0.03 electrons per pixel per second. But how does this relate to the average user? Normal exposure times are < 1 sec. Read noise levels on quiet cameras are ~ 3 electrons. So one would need to capture an image for an exposure time of 3 / 0.01 = 300 seconds, in order to reach a thermal issue with the camera! But the better spec gave an advantage to sales, and therefore this performance was considered standard in the industry, even though 99% of end users don’t need it.

             

            Peltier device

            Of course, other issues pop up when adding such extreme cooling. One is condensation. Because these chips would be cooled to -30c or lower, condensation loved to form on the face of the sensor, which obscures the image, and shorts the sensor. As a result, a vacuum sealed window must be placed around the sensor. Dry nitrogen may be back-filled into the chamber, but in the end, you have a chamber waiting for a leak. The manufacturing process is costly. All of this adds up to $$$$, which transfers down to the customer. Finally this trend is changing. Today, Hamamatsu, Pt Grey and others offer ambient (read un-cooled) camera options, resulting in substantial cost savings to customers.

            Example of ice on a sensor. This is what a typical low temperature camera will produce when active, and when a seal is broken. condensation freezes due to the low sensor temp, producing images which look like crystals, or water droplets at lower temps.
            Example of ice on a sensor. This is what a typical low temperature camera will produce when active, and when a seal is broken. condensation freezes due to the low sensor temp, producing images which look like crystals, or water droplets at lower temps.

            Manufacturing: CCD sensors were initially produced on accident. RAM designers found that configurations of chip layouts were light sensitive, and as a result discovered they could be used to detect light in an array. Soon after CCDs began a strong fabrication growth, conventional memory switch from serial addressed layouts to dynamically addressed layouts. This resulted in CCD manufacturers being able to only build CCD chips, and not other, newer forms of memory. Single-use costs of such facilities caused prices to stay relatively high, as how many end-users require monochrome sensors, high sensitivity, precision, etc etc? Most consumers of sensor technology want to see a pretty picture on a phone! So CCD sensor production became a high cost problem. CMOS technology unlocked this problem, allowing conventional memory production houses to build CMOS sensors. As sensor production expanded, “modular” sensor packages went from the exception to the rule for the majority of cameras sold today. In the past, camera companies purchased a “chip” which had only the sensor, and access pins attached to it. It was required for the camera company to add a window, seal or other protective assembly, readout electronics, etc. Beginning with the ICX series from Sony, things changed. Instead of purchasing only a sensor, you could purchase a pre-built package right from the sensor manufacturer, including a complete window, and in some cases, the ADC and clocks all ready for use. Both of these changes in how sensors are produced have given rise to two new entrants in the camera market – low cost camera companies, who do as minimal work as required to get a camera out for sale, and more manufacturing houses capable of producing sensors. All this adds up to more choice for the consumer at a lower, more competitive price.

            So what does this mean for you? Check out the Pt Grey camera line! It’ll save you a bundle on your imaging system, and may unlock your options for more multi-channel imaging!

            -Austin

          3. Shutter Configuration of TTL devices in Micromanager

            I made this video to show how to use both a state device shutter object and a group shutter object in micro-manager. Hopefully others can make use of it!

             

          4. Automated Capture and Save script for Micro-Manager

            I wrote this for a client, but figured others could make use of it. This code simply captures a number of images as defined by the user, and saves them to the specified folder without displaying them. This is useful if you don’t want all of the images open in memory during a timelapse.

            Simple Capture and Save Beanshell Script

            -Austin

             

             

             

          5. Triggerscope & Micro-Manager Demo LED

            With ASCB right around the corner, I’ve been looking for opportunities to showcase the controller, so I’m happy and grateful to announce that the TriggerScope16 will be demonstrated at the Open-Imaging Micro-Manager booth (#1312)  this year!

            Here’s a short video I made showing the new display which will be at the booth. The display uses a NeopIxel (WS2812) strip, housed in a 1″ square extrusion, capped with a milled acrylic rod.

             

             

          6. Acquisition Speed Comparison of MetaMorph, NIS Elements, Micro-Manager

            How fast can a typical imaging system really run? What factors affect this? While most research might not require rapid sequential capture, almost all experiments can benefiet from tight exposure/illumination timing, yet few microscope users are aware of timing delays injected into experiments by the control software they are using. So how much delay is caused by software? I’ve long wanted to look into this, and finally got the chance!

            In order to accomplish this, I programmed a microcontroller to accept commands from the Lumencor Spectra-X. This high power/high speed LED engine is popular for fluorescent excitation, as a result, almost every available software application can control it. I set up my code to measure the time in which a known shutter, or known wavelength command was received on the serial line (well, USB serial).

            The team at Technical instruments were kind enough to loan me the use of their equipment, so a generous thanks to Reese Allen and the entire Technical instrument staff!

            Experimental conditions were as follows:

            • All software packages were installed on a clean OS install of Win7/x64
            • Test machine was a Dell Precision series
            • Tests were performed by configuring the camera to run ~100fps. This was accomplished using a 4×4 binning, and an exposure of 9.8mS.
            • All software applications were set to send at minimum one shutter and one wavelength change per acquisition cycle. (i.e. 1 picture from the camera, + 1 wavelength change + open shutter, then switch wavelength and cycle shutter).
            • All applications were first tested in a “free run” mode, to confirm the camera configuration was capable of 100fps at minimum.
            • No other devices were installed for these tests.

            The results were quite interesting:

            Software
            NIS Elements V4.30
            Micro-Manager V1.4.22
            Metamorph V7.8.12
            Metamorph Streaming
            Average Overhead
            60mS
            71mS
            65mS
            11mS
            Max FPS
            16
            14
            15
            90

             

             

             

            Here are some videos showing each of the programs performing. You can see some timing variation (likely caused by my capture device) but the averages are easy to resolve, and they correlate to the speed seen on the captured image stacks.

            NIS Elements

            Micro-Manager

            MetaMorph

            What becomes quickly apparent is the influence of asynchronous device control using metamorph’s “Stream” function. This is making use of a patented computer-based device sequencing technique. This technique waits for a camera “event flag” (interrupt) to fire, and when it does, a pre-defined set of events occur which control devices. This is similar to what many external trigger devices do, such as a configured national instruments card , or a pulse oscillator, or the triggerscope. The key difference here is that an external card and/or device isn’t needed, this occurs within the PC itself.

            Some further thoughts:

            • Micromanager is a great open-source competitor to other pay-for solutions. Good speed performance for a low up-front cost! (the cost of setting it up!)
            • It’s interesting that this never really seems to come up for 90% of customers who purchase “high speed” devices. Either the exposure times needed for acquisition of dim signal are so long as to never reach the speed thresholds shown here, or the capture frequency needed for a given study doesn’t require these speeds, or some other cause, but in my experience this is rarely a complaint on behalf of clients. Why isn’t this a bigger problem?
            • Many, many devices can’t reach the speeds shown here. In my tests I was using an LED driver. LED’s should have a switch time in the <5mS range. The slowest components usually found on a common automated microscope are the filter wheels and turrets, which usually run at the 50ms range when fully loaded with filters. (that’s on the fast side). So is this the reason the problem isn’t exposed more often?
            • By far, the slowest components you’ll find for microscopy are found on automated microscopes. Shutter open/close times on a common scope (i.e. big 4 name brand scope) can be in the upwards of 100ms! Moving a big filter turret usually takes 200mS. Again, this begs the question of how important speed really is for the common researcher….
            • For those who want the fastest possible speeds, have no fear! I’ll be announcing some major improvements to my triggerscope soon, to include programmable high speed sequencing capability!

            -Austin

             

             

             

          7. ImageJ Counting Macro for Known Field Values

            Here’s a simple method to deal with varying intensities in a large run of images, assuming you have a known number of cells in a field. If I assume I should see, say, more than X cells per area, I can adjust my threshold to slowly increase it’s aggressiveness until that minimum counted value is met. The code can be downloaded as an imageJ macro here. but here’s a walk through of this simple script. My comments are preceded by a *.:

            rnum = 0; *this creates a new variable, or container, for our # of regions
            
             tval = 2000; *this is the starting object threshold value. 
             while (rnum<500) *this is a "while" loop. The loop runs until the argument is satisfied.
             { 
             setAutoThreshold("Default"); 
             setThreshold(tval, 4095); *note that tval = the minimum threshold value
             run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Nothing display clear add"); 
             rnum = roiManager("count"); 
             tval = tval - 100; *tval continues to become more aggressive in counting objects until the argument is met. 
             }

            Simple routines like these can reduce your headache factor by a large margin if you learn how to harness the power of macros!

            -Austin

             

             

             

             

          8. WHY YOU SHOULD ATTEND THE UCSF/QB3 Microscopy Course

            Over the course of my career, I’ve flown across the US to attend a variety of imaging related instructional courses, all on the eastern seaboard. We are all familiar with the Woods Hole courses, the AQLM course, and so forth. What has boggled my mind is that here I am in the SF Bay area, surrounded by arguably the most densely populated and diverse centers of biological science innovation on earth, and there’s no major course?

            I started pestering the owners of Technical Instruments about this one night, and they admitted the same question had long been on their minds. A few months later, we asked the NIC team at UCSF about it, and found to our surprise that they were already cooking something up. We offered to help as needed, and have been doing what we can to help support the course ever since.

            So, UCSF/QB3 has just published their official webpage for the inaugural Microscopy and Imaging Course for 2012. (They let me design the website, I hope you like it!)

            If you are a regular reader of my blog, I’ll assume you’re involved enough in imaging that you would stand to gain much from attending the course. This won’t be a “sit in classes all day” kind of deal. The course has been designed around a kinesthetic approach, with lectures taking roughly 50% of the time, and the other 50% being hands-on bench work.

            If you live far away, or are having a rough funding year, please apply for a stipend for either the course tuition and/or travel. One of the initial course goals is to host the most geographically and vocationally diverse student group possible. So if you are thinking, “my work doesn’t fit the norm for the life science community” or “I’m not from one of the major research centers”, then you should apply!

            I’ll be attending to support the course along with most of our outside team from TI. I hope to see you there!

            -Austin

          9. Updating Software? A pre-chaos checklist…

            A few years after your shiny new system is installed, you’ll inevitably look at it just like you look at a car. What was once running flawlessly now has a few bugs, some dust, is slower and generally worn in. So, at some point you’ll decide it’s time for an upgrade. This may consist of new or updated hardware, probably a PC and software, but for now let’s assume all we are going to do is patch the software.

            Most software packages depend on a licensing scheme in order to run an update. If you have uManager, this won’t be a problem, but most commonly I work with MetaMorph and Elements, so I’ll be covering those exclusively.

            What version do I have?

            If you have Meta and you want to check your version and it’s capabilities, you can either call the office, or check the software update site here.

            If you have Nikon Elements, you can view your info by selecting the Elements program folder from the start menu, then clicking “Hasp Info”. Here’s what my hasp info looked like:

            If this was a consumer key, it would show an update expiration date (the date at which, once passed, new versions need to be purchased) and list the modules you own.

            Once you’ve decided on upgrade options etc, it’s time to look at what devices are installed on your system. I like to categorize devices based on how they communicate with the computer, as this is the primary factor in determining compatibility problems.

            • Serial, or USB to Serial devices and triggered devices  – Serial devices will be connected via a 9-Pin cable, and will use a COM port on the computer. You can check COM ports using windows device manager. USB falls into two general categories – Serial Emulators or direct drivers. USB to Serial Emulated devices simply create a fake serial port at the device side, so when you plug the device in and power it, you’ll see a new COM port appear in your ports list under windows device manager. Some systems, like the Sutter 10-3, use a driver which allows you to select either VCP (Virtual Com Port) or driver-only. Triggered devices use TTL signaling to communicate, and typically are connected via BNC cables to either another device or a custom board on the PC, so this could mean life is easy or hard, depending on what you have.
            • USB Driver Devices – Any device which, once loaded, appears in the windows device manager under it’s own category, uses a direct driver. A good example would be a Ti-E microscope. You’ll find the scope appear under “Imaging Devices”. While generally speaking, USB connected devices are straightforward to work with, it would be prudent to confirm that the firmware of the device, and the driver version for the device, are both compatible with the new version of software you’ll be installing.
            • PCI/PCIe Card Devices – Cameras usually fall into this category more than anything else, but there are devices such as an Andor Revolution Laser Combiner, or a Mosaic Illumination system, that also require the use of a card installed in the computer. For these devices it’s important to check firmware and driver support for your software upgrade, and it’s extremely important to consider the card type, it’s height requirements, and it’s connector (like PCI vs. PCie x16 etc) when purchasing a new computer.

            Note the "Virtual Com Port" vs. the standard "communications port". The former is a USB to Serial Adapter.

            Once you’ve collected the above info for each device which is run through your imaging software, you can go through a straightforward checklist of the required communication items for that device. Keep in mind that for most software companies, they build a driver for a given instrument at a single point in time, and don’t update that driver until there is a good reason to do so. Version changes between the software, firmware, and drivers may cause problems, so we’ll investigate this entire chain for our devices:

            1. What is the version number of the software you’ll be upgrading to?
            2. For that version of software, what are the driver versions required for your devices? In Meta, you can view the Supported Hardware page, to check the minimum version for your device. Nikon has a support document, which can be found on the download site (enter any username, and your Hasp ID for the password), under “Device/Camera/Firmware Documents, or just click this link after logging in.
            3. If your device driver needs to be upgraded, does the firmware in your device need an upgrade as well? This can be investigated by contacting the device manufacturer.
            4. Is either the device manufacturer, or the software developer, aware of known major bugs or issues with the versions you’ll be upgrading to? Normally there are always a few bugs, the question is whether or not they’ll be a problem for your work.
            5. If you are considering moving from an x32 to an x64 system, make sure to check for 100% support in x64, I’ll be writing more on this on a separate post, as it’s a constant problem for me right now.

             

            Example of a Supported device on Meta's hardware page. Note this device says it is not supported in Windows x64!

            Armed with the answers to the above questions, you’ll be well prepared to perform an upgrade on your instrument! As always, you may wish to do this yourself, or pay your local sales rep to take on this headache. As a general rule software upgrades are a lot of work, and provide a chance to break an otherwise functional system, so service and sales reps are understandably wary of upgrades. You can help your rep a lot by bring this info to them at the beginning of the upgrade process (or at least providing the version #’s and device types on your system).

            This process will obviously take some time to complete, but it’s a very small investment to reduce the chance of the system going down due to a half-update, or performing the update only to find some major bug which will render the system unusable! You’ll never guess how I learned to be wary of this…:-) Ultimately, software updates can provide new capability, fix bugs on the device or software side, and are an important aspect to the overall maintenance of an instrument. With proper planning, the operation can go from chaos to an enjoyable experience.

            – Austin

             

             

             

             

             

          10. Voltage output from NIS Elements, MetaMorph or uManager for under $200

            USB-6008 connected to my multimeter

            I posted briefly about this a while back, in my explanation of the demise of the parallel port. I finally got my hands on a National Instruments USB-6008 box, and have found the unit to be 100% compatible with any NI-DAQ controlling application. What follows is an example of how to set this up using NIS Elements.

            First – what types of devices could be controlled with this?

            • AOTF Controllers (Spectral, Neos, Etc.)
            • Single Shutters (Uniblitz Etc)
            • Piezo Z Controllers (ASI, MCL)
            • Directly driven 0-5v lasers
            • Monochromaters
            • LED Light Engines (Lumencor/89 North)

            So – this thing is great when compared to the PCI cards normally used for numerous reasons:

            • Cost – This is ~$160 USD, vs. the PCI/PCIe cards running $1,500+
            • Size – This box is quite small, doesn’t require a huge cable or breakout box, and doesn’t occupy a slot on the PC
            • Portable – this will work on a mini form factor PC, or a laptop (which is what I used for this post), instead of requiring a full size tower

            Installation:

            Install is a snap. The only hard thing to do is place the pin indication stickers in the correct orientation on the box. If you mess this up you can always refer to the manual, but the little sticker strips included with the box make field-modification much easier. After this run the NI installer and reboot. Finally, connect the USB cable. The box will appear, and if you like, you can launch one of the NI test apps to run the device.

            In Elements, we’ll re-run the installer and check the “National instruments” hardware group, then select “NI DAQ”.

            Next, open Elements, open the devices window, and add the NI Device.

            Once we add the device, and click configure, we can define what each of the inputs and outputs do. Here I’ve selected a 2 line AOTF.

            After you’ve dialed in the settings you want, close the window(s) and if you don’t see the new device control panel, right click and select “acquisition controls” to find it. In my case the AOTF Settings window popped up after closing the device window.

            I also  made a short guide to using this box in elements via the Youtube video below. ***In the video I mention this thing costs $130, which is incorrect. It’s listed on the NI site as $168 as of today. Also I have yet to test more than 1 unit, but will be doing so shortly…

            httpv://www.youtube.com/watch?v=poKZjRgWdhQ

            One point of discussion is devices that require a 0-10v range. I’m looking into using a small powered op-amp chip and maybe packaging it into a small box for sale, or at least I’ll write up a how-to on using one, for people that need this voltage range. Luckily most of the devices out there can accept 5v or 10v input. Overall I’m happy to see NI is moving beyond PCI and PCIe bus cards. USB based boxes like these lower the acquisition cost for the customer, provide everything we need in the life science world concerning speed, and open up access to a wide array of devices. I’m looking forward to using this box on future systems!

          11. *UPDATED* Micro-Manager Tethered to a Nikon Digital SLR

            ***UPDATE 3/3/2014***

            After a few requests for a report on x64 capability using this tethering technique, I tried installing the NK Remote software on a rather fresh copy of Windows 7×64 – it did not communicate with the camera at all. On the other hand, the open source application “DigiCamControl“, worked perfectly. Now, as far as micro-manager goes, there isn’t a connection from DigiCamControl to micro-manager. So – short term solution is to run the proposed setup below on an x32 system – if anyone gets x64 working please post here!!! -Austin

            So I had a customer interested in a macro application for scanning. In some cases, applications like these don’t require a telecentric optical system such as the AZ-100, nor do they fit into a typical stereo microscope application. So, what to do? Well, when your object for imaging is too large for a microscope, one option may be a macro lens on a digital camera. Something like this:

            Copy stand for SLR

            This type of system will allow for a stable focusing and zoom setup, but is limited in magnification power and light control. In some cases though, this is the way to go.

            The next problem is that of focal and positional control. No microscopy device control software available, such as elements or metamorph, supports non-scientific grade cameras. So, how do we position a specimen under this camera in an automated fashion? Well, it turns out micro-manager has a plugin available for such work, and it’s available in the nightly builds here .

            What you end up with is a camera that can be controlled from a laptop, along with a stage, z motor and other automated imaging hardware. Here’s an example of my setup running on a windows 7 x64 laptop and a D80.

            D80 and Win7 x64

            Requirements

            This setup requires the following items:

            1. Suitable camera and lens (see below)

            2. Copystand for camera.

            3. Computer for control.

            4. External power supply for camera or a battery extension (more for ease of use but I consider it a requirement).

            5. USB Cable to camera.

            6. Control Software for interfacing to uManager. This is pay-for software, found here. The software currently ranges from $90-180.

            7. A right angle view finder isn’t required, if you don’t mind a stiff neck!

            Setup:

            So, follow the instructions found here for setup. My summary of setup, which took a whopping 5 minutes (this is amazingly quick for open source software!) went as follows:

            1. Download Breeze Systems trial for NKRemote & Install.

            2. Download nightly uManager build & Install.

            3. Set camera to PTP mode.

            4. Run NKRemote and snap image to confirm communication with camera.

            5. Run uManager. Edit hardware seup using the “Setup hardware” tool and removed the demo camera, and added the NikonDSLR.

            6. started snapping images! Here is an example of running in uManager (click on the picture for a higher res version):

            Nikon D-80 acquiring images in uManager

            What cameras are supported:

            All of the basic DSLR models from Nikon are included with the NKRemote software. Tethercam is the driver used for the uManager side, and it states an “incomplete list” of cameras as follows:

            Nikon D7000, Nikon D90, Nikon D5000, Nikon D300, Nikon D300s, Nikon D700, Nikon D3X, Nikon D3s, Nikon D3, Nikon D200, Nikon D80.

            Lenses to Use:

            Some lenses that work as portrait lenses like a Nikon 50mm will work adequately as macro lenses. On the other hand, it’s recommended to shell out the extra cash for a well-made macro lens, such as this one. The nice thing about working with commonly available photo gear is that in many cases you can even rent lenses to see what works best for the job at hand.

            This was a fun and quick test and I am excited to see how this capability is used for macro work in the future!

            -Austin

          Social Media Auto Publish Powered By : XYZScripts.com