<?xml version='1.0'?>
<!DOCTYPE art SYSTEM 'http://www.biomedcentral.com/xml/article.dtd'>
<art>
   <ui>1475-925X-2-13</ui>
   <ji>1475-925X</ji>
   <fm>
      <dochead>Research</dochead>
      <bibl>
         <title>
            <p>ScanImage: Flexible software for operating laser scanning microscopes</p>
         </title>
         <aug>
            <au id="A1">
               <snm>Pologruto</snm>
               <mi>A</mi>
               <fnm>Thomas</fnm>
               <insr iid="I1"/>
               <insr iid="I2"/>
               <email>pologrut@cshl.org</email>
            </au>
            <au id="A2">
               <snm>Sabatini</snm>
               <mi>L</mi>
               <fnm>Bernardo</fnm>
               <insr iid="I1"/>
               <insr iid="I3"/>
               <email>bernardo_sabatini@hms.harvard.edu</email>
            </au>
            <au id="A3" ca="yes">
               <snm>Svoboda</snm>
               <fnm>Karel</fnm>
               <insr iid="I1"/>
               <email>svoboda@cshl.org</email>
            </au>
         </aug>
         <insg>
            <ins id="I1">
               <p>Howard Hughes Medical Institute, Cold Spring Harbor Laboratory, Cold Spring Harbor, NY 11724, USA</p>
            </ins>
            <ins id="I2">
               <p>Graduate Program in Biophysics, Harvard University, Cambridge, MA 02138, USA</p>
            </ins>
            <ins id="I3">
               <p>Present Address: Department of Neurobiology, Harvard Medical School, Boston, MA 02115, USA</p>
            </ins>
         </insg>
         <source>BioMedical Engineering OnLine</source>
         <issn>1475-925X</issn>
         <pubdate>2003</pubdate>
         <volume>2</volume>
         <issue>1</issue>
         <fpage>13</fpage>
         <url>http://www.biomedical-engineering-online.com/content/2/1/13</url>
         <xrefbib>
            <pubidlist>
               <pubid idtype="doi">10.1186/1475-925X-2-13</pubid>
               <pubid idtype="pmpid">12801419</pubid>
            </pubidlist>
         </xrefbib>
      </bibl>
      <history>
         <rec>
            <date>
               <day>9</day>
               <month>2</month>
               <year>2003</year>
            </date>
         </rec>
         <acc>
            <date>
               <day>17</day>
               <month>5</month>
               <year>2003</year>
            </date>
         </acc>
         <pub>
            <date>
               <day>17</day>
               <month>5</month>
               <year>2003</year>
            </date>
         </pub>
      </history>
      <cpyrt>
         <year>2003</year>
         <collab>Pologruto et al; licensee BioMed Central Ltd. This is an Open Access article: verbatim copying and redistribution of this article are permitted in all media for any purpose, provided this notice is preserved along with the article's original URL.</collab>
      </cpyrt>
      <abs>
         <sec>
            <st>
               <p>Abstract</p>
            </st>
            <sec>
               <st>
                  <p>Background</p>
               </st>
               <p>Laser scanning microscopy is a powerful tool for analyzing the structure and function of biological specimens. Although numerous commercial laser scanning microscopes exist, some of the more interesting and challenging applications demand custom design. A major impediment to custom design is the difficulty of building custom data acquisition hardware and writing the complex software required to run the laser scanning microscope.</p>
            </sec>
            <sec>
               <st>
                  <p>Results</p>
               </st>
               <p>We describe a simple, software-based approach to operating a laser scanning microscope without the need for custom data acquisition hardware. Data acquisition and control of laser scanning are achieved through standard data acquisition boards. The entire burden of signal integration and image processing is placed on the CPU of the computer. We quantitate the effectiveness of our data acquisition and signal conditioning algorithm under a variety of conditions. We implement our approach in an open source software package (<it>ScanImage</it>) and describe its functionality.</p>
            </sec>
            <sec>
               <st>
                  <p>Conclusions</p>
               </st>
               <p>We present <it>ScanImage</it>, software to run a flexible laser scanning microscope that allows easy custom design.</p>
            </sec>
         </sec>
      </abs>
   </fm>
   <bdy>
      <sec>
         <st>
            <p>Background</p>
         </st>
         <p>Laser scanning microscopies (LSM) include some of the most important imaging modalities in biology. For example, confocal laser scanning microscopy (CLSM) is the tool of choice for high-resolution fluorescence microscopy in cultured and fixed tissue preparations <abbrgrp><abbr bid="B1">1</abbr><abbr bid="B2">2</abbr><abbr bid="B3">3</abbr></abbrgrp>. Two-photon excitation laser scanning microscopy (2PLSM) is ideal for fluorescence microscopy in scattering media, such as living skin and brain tissue <abbrgrp><abbr bid="B4">4</abbr><abbr bid="B5">5</abbr></abbrgrp>.</p>
         <p>Historically, new developments and applications of laser scanning microscopy have been limited primarily by the availability of new hardware. The development of suitable laser light sources and powerful data acquisition systems running on desktop computers brought CLSM to fruition <abbrgrp><abbr bid="B3">3</abbr></abbrgrp>. In the case of 2PLSM, the development of mode-locked pulsed light sources operating in the red and near IR spectral range <abbrgrp><abbr bid="B6">6</abbr></abbrgrp> made it practical <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>.</p>
         <p>Several lines of commercial CLSMs and 2PLSMs are available. A manufacturer typically will offer one principal model and allow the customer to choose between different versions and options. Fundamentally, in terms of optics and software, a single general purpose design is offered. However, exciting applications demand specialized design. Often these applications include some of the most promising experimental developments. Currently, most hardware components of CLSMs and 2PLSMs (lasers, optics, scanning mirrors, detectors, and computers) are mature and readily available. The development of cutting edge applications using custom design is often limited by the availability of suitable software to control laser scanning microscopes.</p>
         <p>In our laboratory we have written flexible software to control LSMs (<it>ScanImage</it>). In a LSM, a signal (typically fluorescence) is detected as a focused laser beam is scanned across a sample. The signal emitted from within a number of tiny, contiguous regions (called pixels) <abbrgrp><abbr bid="B3">3</abbr><abbr bid="B7">7</abbr></abbrgrp> is collected over short time intervals (the pixel time, <it>T</it><sub>p</sub>). The integrated signal is converted to a digital pixel value and the collection of all the pixels from the scanned region defines the image. The location of the pixel in the image is determined by the location of the laser at the time of acquisition. Synchronization of the position of the laser beam and the signal collection is therefore essential for imaging.</p>
         <p>In order to time scanning and acquisition precisely and to achieve high performance in terms of signal-to-noise ratio, on-line averaging, and real-time image refresh, many commercially available laser-scanning microscopes (e.g. Olympus Fluoview&#8482;, Olympus America Inc., Melville, NY; Bio-Rad Radiance 2100&#8482;, Bio-Rad Laboratories, Hercules, CA) use proprietary signal conditioning electronics and data acquisition boards. Commercial systems are suitable for many applications and have also been customized for specific experimental needs <abbrgrp><abbr bid="B4">4</abbr><abbr bid="B8">8</abbr><abbr bid="B9">9</abbr><abbr bid="B10">10</abbr></abbrgrp>. However, complete custom design is often more advantageous and cost effective <abbrgrp><abbr bid="B11">11</abbr><abbr bid="B12">12</abbr><abbr bid="B13">13</abbr></abbrgrp>. Two major impediments to custom design are the specialized software and hardware required for laser scanning microscopy.</p>
         <p>Here we present a software package called <it>ScanImage </it>for collection of laser-scanned images that functions at a high level without the need for elaborate custom hardware <abbrgrp><abbr bid="B14">14</abbr><abbr bid="B15">15</abbr></abbrgrp>. The key idea is to use fast data acquisition boards and CPU-based numeric computations to perform most of the tasks that are accomplished by DSP boards and analog integrators in typical commercial systems. Thus <it>ScanImage </it>simplifies the design and construction of custom microscopes. An additional advantage is that <it>ScanImage </it>is written in MATLAB (version 6.1 or later; MathWorks Inc., Natick, MA), and thus already fully integrated into a high-level image analysis environment.</p>
      </sec>
      <sec>
         <st>
            <p>Results and Discussion</p>
         </st>
         <sec>
            <st>
               <p>Description of ScanImage</p>
            </st>
            <p><it>ScanImage </it>controls a laser-scanning microscope (Figure <figr fid="F1">1A</figr>). It is written entirely in MATLAB and makes use of standard multifunction boards (e.g. National Instruments, Austin, TX) for data acquisition and control of scanning. The software generates the analog voltage waveforms to drive the scan mirrors, acquires the raw data from the photomultiplier tubes (PMTs), and processes these signals to produce images. <it>ScanImage </it>controls three input channels (12-bits each) simultaneously, and the software is written to be easily expandable to the maximum number of channels the data acquisition (DAQ) board supports and that the CPU can process efficiently. The computer bus speed dictates the number of samples that can be acquired before an overflow of the input buffer occurs, while the CPU speed and bus speed combine to determine the rate of data processing and ultimately the refresh rate of images on the screen. Virtually no customized data acquisition hardware is required for either scan mirror motion or data acquisition.</p>
            <fig id="F1">
               <title>
                  <p>Figure 1</p>
               </title>
               <caption>
                  <p>Wiring Diagram and Performance Benchmarking for <it>ScanImage</it></p>
               </caption>
               <text>
                  <p><b>Wiring Diagram and Performance Benchmarking for <it>ScanImage </it></b><b>A) </b>Typical wiring diagram for a microscope running <it>ScanImage</it>. Scanning, data acquisition, and laser shuttering are accomplished by a single data acquisition board (PCI 6110, National Instruments). Stage and Z-focus motors are controlled through a Sutter 3-axis motor controller (Sutter MP285) that is programmed through a serial communications (COM) port. <b>B) </b>Performance of <it>ScanImage</it>. We computed the realtime fraction as the average time it took <it>ScanImage </it>to process and display the acquired data (i.e. a stripe; see Figure <figr fid="F2">2</figr>) normalized to the acquisition time for that portion of data. Values were averaged over 20 frames acquired at each configuration. The realtime fraction was computed using an 800 MHz Pentium III computer with 512 MB of RAM. A realtime fraction above one indicates the software was able to run in realtime (i.e. <it>ScanImage </it>had completed processing and displaying all of the previously collected data before the next portion of data was fully acquired). For realtime fractions less than one, the display lags the acquisition but no data is lost. The low realtime fraction when acquiring 16 lines per frame on multiple channels indicates that we are approaching the fundamental speed limit for graphics updates.</p>
               </text>
               <graphic file="1475-925X-2-13-1"/>
            </fig>
            <p>Typical pixel times in biological laser scanning microscopy are > 2 &#956;s (the pixel time depends on the pixels per line and the time per line; see Figure <figr fid="F2">2</figr> for more information on the image construction algorithm). We have benchmarked <it>ScanImage </it>while acquiring three channels simultaneously with ~3 &#956;s pixel times (Figure <figr fid="F1">1B</figr>). Under these demanding conditions, <it>ScanImage </it>updates and saves the images with minimal delay from the time they are actually obtained (Figure <figr fid="F1">1B</figr>). The actual size of the image (in microns) depends on the microscope optics and the angles navigated by the scan mirrors.</p>
            <fig id="F2">
               <title>
                  <p>Figure 2</p>
               </title>
               <caption>
                  <p>Image Construction and Signal Processing in <it>ScanImage</it></p>
               </caption>
               <text>
                  <p><b>Image Construction and Signal Processing in <it>ScanImage </it></b><b>A) </b>Schematic depicting the algorithm of image creation in <it>ScanImage</it>. Pixels are constructed by summing the PMT voltage over the pixel time T<sub>p</sub>. To achieve fast (i.e. realtime) refresh rates we break the acquisition of an image down into a set of stripes acquired and displayed in succession. The stripes are concatenated to form the entire image. <b>B) </b>Further details of image construction in <it>ScanImage</it>. <b>a) </b>Mirror position signal delivered by <it>ScanImage </it>(blue trace) and the actual mirror position (red trace) for two lines of acquisition (PMT voltage shown in gray). <b>b) </b>Definitions of acquisition parameters. The flyback (purple) and line delay (red) regions of the acquired PMT signal are discarded from final image data, which keeps only the fill fraction (blue) of the PMT voltage for image construction. Because the scan mirrors have inertia, their actual position lags the set position by ~7% of the scan period, which is corrected by the cusp delay (green). <b>c) </b><it>ScanImage </it>retains the data acquired during the linear portions of the scan (blue) and discards the intervening data (red). <b>d) </b>Samples are summed to form the pixels in the final image.</p>
               </text>
               <graphic file="1475-925X-2-13-2"/>
            </fig>
            <p>We have chosen MATLAB as our development environment for its powerful numerical manipulation abilities and data acquisition (DAQ) engine. The DAQ engine directly communicates with the acquisition board and presents a flexible, object-oriented environment in which to construct DAQ software. In many scientific and engineering communities, MATLAB has become the dominant language for desktop numerical computing <abbrgrp><abbr bid="B16">16</abbr></abbrgrp>. Integration of custom written analysis functions and incorporation of additional software is much more tractable for novice programmers in MATLAB, simplifying much of the experimental design process.</p>
         </sec>
         <sec>
            <st>
               <p>Data Acquisition in ScanImage</p>
            </st>
            <p>The signal from the detector (typically a PMT) is a current that needs to be converted to a voltage before acquisition. This conversion can be done with a standard amplifier <abbrgrp><abbr bid="B17">17</abbr></abbrgrp> (see Stanford Research Systems, Sunnyvale, CA for examples) equipped with a low pass filter. The roll-off frequency of the filter has to be &lt;0.5 <it>f</it><sub>s</sub>, where <it>f</it><sub>s </sub>is the rate at which the detector signal is sampled. In <it>ScanImage </it>we compromise between the degradation in the signal-to-noise ratio due to limited sampling of the signal and the increasing computational load placed on the CPU with higher sample rates.</p>
            <p>With current computer hardware we operate <it>ScanImage </it>with <it>f</it><sub>s </sub>= 1.25 MHz. This sampling frequency allows nearly ideal imaging (in terms of apparent quantum efficiency and bleedthrough between pixels, discussed below) for pixel times as short as 3 &#956;s. An appropriate roll-off frequency would be ~300&#8211;500 kHz. In the future, faster computer architectures will allow more rapid sampling and number crunching and hence shorter pixel times. The sampled data is streamed to memory. An overview of the image construction algorithm used in <it>ScanImage </it>is shown in Figure <figr fid="F2">2A</figr>.</p>
            <p>Sampled data are summed in real-time over the pixel times. Once the data is collected, it is compared with the output signals to the scan mirrors. The position of the scan mirrors dictates where the pixels lie in the final image. The mirror driver electronics (see Cambridge Technology, Cambridge, MA for examples) and the command voltage output to the drivers from the DAQ board determine the mirror position. During a cycle of the mirror motion useful data are collected only when the mirrors are moving at constant velocity (i.e. linear voltage versus time regime; see Figure <figr fid="F2">2B</figr>). Data acquired when the mirrors are turning around or flying back to their starting positions (flyback) are removed (Figure <figr fid="F2">2B</figr>; figure caption for details).</p>
            <p>The timing for image formation requires synchronization of the mirror scan forms and the data acquisition engine. This is achieved by triggering data acquisition and data output using a TTL trigger generated by the DAQ board (i.e. under the control of a software panel). This mechanism for triggering also allows <it>ScanImage </it>to be externally triggered by a TTL from another application or hardware device. Appropriate sampling rates and output rates are hard-coded in <it>ScanImage</it>, while many other acquisition parameters can be chosen based on the demands of particular applications.</p>
         </sec>
         <sec>
            <st>
               <p>Quality of the Images Collected by ScanImage</p>
            </st>
            <p>We evaluated the performance of our signal conditioning method (Figures <figr fid="F2">2</figr> &amp;<figr fid="F3">3</figr>). We compared the variability of the integral of a simulated PMT signal to the variability of the signal sum computed at a fixed sample rate as is done in <it>ScanImage </it>(see Figure <figr fid="F2">2B</figr> for details). In simulations the PMT voltage was modeled as a Poisson process with mean photon rate of 0.5 photons per &#956;s. Each single-photon pulse was Gaussian with unit amplitude and 2.35 &#956;s full-width-at-half-maximum (FWHM) <abbrgrp><abbr bid="B18">18</abbr></abbrgrp>. Each simulated pulse was constructed at 500 MHz. A 20 ms waveform was created by summing Poisson-distributed pulses and dividing them into 2000 pixel intervals (duration 10 &#956;s). Each of these intervals constituted a trial in the analysis of variability described below. Trials were sampled at 200 kHz to 5 MHz in 100 kHz steps. A typical trial sampled at different rates is shown in the inset of Figure <figr fid="F3">3A</figr>.</p>
            <fig id="F3">
               <title>
                  <p>Figure 3</p>
               </title>
               <caption>
                  <p>Image Quality in <it>ScanImage</it></p>
               </caption>
               <text>
                  <p><b>Image Quality in <it>ScanImage </it></b><b>A) </b>Apparent quantum efficiency as a function of sampling rate in <it>ScanImage </it>for a single-photon-pulse with a 2.35 &#956;s FWHM and unit amplitude. The red trace shows the apparent quantum efficiency (<graphic file="1475-925X-2-13-i1.gif"/>) of the signal (see inset) determined by digital integration. The black trace shows <graphic file="1475-925X-2-13-i1.gif"/> sampled at 200 kHz to 5 MHz. <graphic file="1475-925X-2-13-i1.gif"/> approaches 1 as the sample rate approaches 1 MHz. The blue points are the normalized apparent quantum efficiencies from an actual PMT illuminated by a constant light source (data pre-filtered at 330 kHz). <it>ScanImage </it>uses a sample rate of 1.25 MHz (arrow), which yields nearly ideal signal-to-noise <graphic file="1475-925X-2-13-i1.gif"/> &#8776; 1. This analysis is only valid for pulses that are al least 2.35 &#956;s in duration. <b>Inset: </b>20-&#956;s pulse interval comprised of 2.35-&#956;s events sampled at different rates. <b>B) </b>Histogram of the events in the pixel interval (bars) and Poisson fit (line). <b>C) </b>Model of bleedthrough of photons from adjacent pixels. A single-photon-pulse with a 2.5 &#956;s FWHM was placed randomly in pixel intervals of widths 2 to 10 &#956;s. The number of trials at each pixel interval was 10,000. The percent bleedthrough equaled 100*(1 - IPP/IEP) where IEP is the integral of the entire pulse and IPP is the integral of the region of the pulse that fell in the pixel interval. Shown is the mean value of the percent bleedthrough for each pixel time normalized with respect to the pulse width (Pixel Interval/Pulse Width). The error bars (SEM) were smaller than the marker points and were omitted.</p>
               </text>
               <graphic file="1475-925X-2-13-3"/>
            </fig>
            <p>How does the signal to noise ratio vary with sampling frequency? A useful measure of the quality of the signal is the coefficient of variance (CV<sub>y</sub>). CV<sub>y </sub>is the ratio of the standard deviation (&#963;<sub>y</sub>) to the mean (<graphic file="1475-925X-2-13-i2.gif"/>) of the signal summed over a pixel interval (<it>y</it>). CV<sub>y </sub>is related to the apparent quantum efficiency (<graphic file="1475-925X-2-13-i1.gif"/>) of the acquisition system and the mean number of pulses per pixel interval (<graphic file="1475-925X-2-13-i3.gif"/>) by <b>Equation 1</b>:</p>
            <p>
               <graphic file="1475-925X-2-13-i4.gif"/>
            </p>
            <p><graphic file="1475-925X-2-13-i1.gif"/> is inversely related to the noise introduced by the signal conditioning in addition to the inherent shot noise of the light source and multiplicative noise due to the variable pulse-amplitude distribution <abbrgrp><abbr bid="B19">19</abbr></abbrgrp>. For optimal sampling with uniform pulse amplitudes, <graphic file="1475-925X-2-13-i1.gif"/> will be 1 since <graphic file="1475-925X-2-13-i5.gif"/> = <graphic file="1475-925X-2-13-i2.gif"/> = <graphic file="1475-925X-2-13-i3.gif"/> (see <b>Equation 1</b>); this can be accomplished by direct integration of the signal (Figure <figr fid="F3">3A</figr>, red line). Thus we can interpret any reduction in <graphic file="1475-925X-2-13-i1.gif"/> from 1 as a decrease of the signal-to-noise ratio (SNR) of the system.</p>
            <p>We verified our simulation by fitting the histogram of the number of events (N) to a Poisson model (Figure <figr fid="F3">3B</figr>). This analysis yielded a mean value for <graphic file="1475-925X-2-13-i3.gif"/> = 4.96 &#177; .09 (p &lt; .05) photons per pixel interval (10 &#956;s duration) as expected. We then analyzed the trials sampled at different frequencies to determine the effects of finite sample frequency on <graphic file="1475-925X-2-13-i1.gif"/>. Variation of the pulse amplitudes can be modeled directly by convolving the pulse amplitude distribution with our model, but does not alter the optimal signaling criteria; it merely reduces the maximum value of <graphic file="1475-925X-2-13-i1.gif"/> to a value lower than 1 <abbrgrp><abbr bid="B18">18</abbr></abbrgrp>.</p>
            <p><graphic file="1475-925X-2-13-i1.gif"/> was computed at each sample rate from the simulated pulses (Figure <figr fid="F3">3A</figr>). Note that the digital integrator shows nearly ideal behavior (<graphic file="1475-925X-2-13-i1.gif"/> &#8776; 1). As expected, for low sampling frequencies <graphic file="1475-925X-2-13-i1.gif"/> is small, reflecting the fact that data (single photon events) are missed by the sampling scheme. <graphic file="1475-925X-2-13-i1.gif"/> increases with sample rate until it approaches 1 around the Nyquist limit of 1 MHz (i.e. since we simulated the PMT voltage with 2.35 &#956;s pulses). We repeated this analysis with data coming from an actual PMT filtered at ~330 KHz (blue points in Figure <figr fid="F3">3A</figr>). The lower filtering frequency broadens the pulses (3&#8211;4 &#956;s FWHM) and hence increases the performance of our algorithm at lower sample rates. At 1.25 MHz, the image has an essentially ideal <graphic file="1475-925X-2-13-i1.gif"/>.</p>
            <p>We also modeled the expected bleedthrough of photons from adjacent pixels (Figure <figr fid="F3">3C</figr>). A simulated test pulse with a FWHM of 2.5 &#956;s was placed randomly in pixel intervals of widths 2 to 10 &#956;s. The percent bleedthrough was calculated as the percentage of the area of the pulse that fell outside of the pixel interval in which it was placed. We see that the bleedthrough for the shortest pixel times recommended (~3.0 &#956;s) is ~10%. Longer pixel times under normal imaging conditions (Pixel Interval/Pulse Width ~2) yield a bleedthrough of only ~6%.</p>
            <p>Currently <it>ScanImage </it>performs well with a 1.25 MHz acquisition rate and a 330 kHz filter frequency (blue points and arrow in Figure <figr fid="F3">3A</figr>) depending on the application. Using sampling rates above 1.25 MHz (together with higher filter frequencies) is currently an issue of bus and CPU speed as mentioned. The sample rate can be adjusted manually in the software to a multiple of 1.25 MHz (e.g. 2.5 MHz) without any corruption of image quality. This yields an effective range of pixel times of 2&#8211;3-&#956;s. Pixel times as low as 2 &#956;s are feasible with a 500 kHz filter acquiring at 1 ms per line.</p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Conclusions</p>
         </st>
         <p>We have shown that our algorithm creates digital images with near-ideal noise properties and realtime refresh rates.</p>
         <sec>
            <st>
               <p>ScanImage Features</p>
            </st>
            <p>We now briefly describe the software that we have created to turn the data acquisition algorithm into a full image acquisition program. The features presented here can be easily extended through the MATLAB interface. The wiring diagram for a LSM using <it>ScanImage </it>is given in Figure <figr fid="F1">1A</figr>.</p>
         </sec>
         <sec>
            <st>
               <p>Multi-Channel Acquisition</p>
            </st>
            <p>Many applications, including quantitative calcium imaging, can involve the use of two dyes with different spectral properties (e.g. green calcium sensitive, Fluo-4, and red calcium insensitive, Alexa Fluor-594) <abbrgrp><abbr bid="B15">15</abbr></abbrgrp>. Optics can be easily designed to separate and simultaneously collect both of the emitted wavelengths in separate channels. We have integrated support for processing 3 separate fluorescence channels independently in <it>ScanImage</it>. The data are collected, processed, and displayed simultaneously in real time (Figure <figr fid="F1">1B</figr>).</p>
         </sec>
         <sec>
            <st>
               <p>3-Dimensional Image Acquisition</p>
            </st>
            <p>The microscope focus is under the control of <it>ScanImage </it>allowing automated collection of stacks of images from different focal planes. These stacks can be set and collected easily in <it>ScanImage </it>using any configuration. Kalman filtering can be implemented per focal plane for noise reduction.</p>
         </sec>
         <sec>
            <st>
               <p>Structure of Acquired Data</p>
            </st>
            <p><it>ScanImage </it>stores data in TIF files for easy portability and compatibility. TIF files can include multiple frames for storage of three-dimensional, multi-channel, and time series data in the same file. The pixel intensities are saved as 16-bit unsigned integers, exploiting the full dynamic range of the detector and DAQ boards. Different acquisition channels are interleaved. The experimental details are written into a header string that is placed into the <it>ImageDescription </it>field of the generic TIF header, and can be accessed via the standard header reading modules included in all image-processing programs, including MATLAB.</p>
         </sec>
         <sec>
            <st>
               <p>Automation of Stage Controls</p>
            </st>
            <p>LSM often involves finding the region (or regions) of interest (ROIs) in a complex and large specimen. The ability to select and save ROIs can help in the design of complex imaging experiments. <it>ScanImage </it>allows the user to define an arbitrary number of ROIs for imaging. <it>ScanImage </it>uses its control of the stage and focus to automate collection of focal stacks of data as well as for saving and retrieving ROIs. Through a system of experimental cycles it is possible to select multiple ROIs and image them in succession at a selected repetition rate any number of times.</p>
         </sec>
         <sec>
            <st>
               <p>Focus Interface</p>
            </st>
            <p>Before data acquisition the structure to be imaged needs to be located. For this purpose a rapid acquisition mode is necessary where the user can observe the image in realtime as the specimen and focal positions move. <it>ScanImage </it>includes a focus mode to accomplish this. The image seen in focus mode is identical to the one that will be acquired. Multiple channels can be focused simultaneously in realtime. Image zooming and rotation are accomplished in the focus mode by changing the signal output to the mirrors.</p>
         </sec>
         <sec>
            <st>
               <p>Modular Design of ScanImage: User Functions</p>
            </st>
            <p>One of the key advantages of <it>ScanImage </it>is the user-friendly development environment, MATLAB. Users can easily develop and test data analysis functions off-line and incorporate them into the software without fear of interfering with the data acquisition. A flowchart of <it>ScanImage </it>from a programming perspective is given in Figure <figr fid="F4">4A</figr> and a screenshot of the software is shown in Figure <figr fid="F4">4B</figr>.</p>
            <fig id="F4">
               <title>
                  <p>Figure 4</p>
               </title>
               <caption>
                  <p>Flowchart and Screenshot of <it>ScanImage</it></p>
               </caption>
               <text>
                  <p><b>Flowchart and Screenshot of <it>ScanImage </it></b><b>A) </b><it>ScanImage </it>uses a series of text files to remember configurations for different microscopes, users, and experimental configurations. Each aspect of the software and the associated files is detailed in the <it>ScanImage </it>manual. <b>B) </b>A screenshot of <it>ScanImage </it>acquiring data from 2 channels simultaneously.</p>
               </text>
               <graphic file="1475-925X-2-13-4"/>
            </fig>
            <p>Any MATLAB function can be automatically executed after an image is acquired to aid in analysis of the experiment while it is being conducted (see <it>ScanImage </it>manual for details). In addition to MATLAB functions, programmers can compile C and Fortran code and run it with MATLAB calls in the same user function.</p>
         </sec>
         <sec>
            <st>
               <p>Modular Design of ScanImage: Controlling Additional Devices</p>
            </st>
            <p>From a programming perspective, the code allows the generation of custom graphical interfaces that can be incorporated easily into <it>ScanImage </it>(see Figure <figr fid="F4">4A</figr>). As an example, additional serial ports may need to be integrated to run other optical equipment. A GUI can be constructed with its own initialization file and run in parallel to <it>ScanImage </it>(see the <it>ScanImage </it>manual for details). This GUI can use the same convenient tools for handling GUIs that <it>ScanImage </it>uses while offering the programmer flexibility in both design and development.</p>
         </sec>
         <sec>
            <st>
               <p>Availability and Distribution</p>
            </st>
            <p><it>ScanImage </it>is freely available as OSI Certified open source software. The license can be found in the <it>ScanImage </it>folder in the ScanImageLicense.txt file. All terms of the license, including details on referencing <it>ScanImage </it>in published reports, must be followed when using <it>ScanImage</it>.</p>
            <p>The software and documentation on installation are available from: <url>http://svobodalab.cshl.edu/software_main.html</url>.</p>
            <p>Please email any questions or suggestions about the software to <email>scanimage@cshl.edu</email></p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>Methods</p>
         </st>
         <sec>
            <st>
               <p>Programming</p>
            </st>
            <p>All programming and benchmarking was done in MATLAB 6.1 running on a Windows 2000 Professional PC with an 800 MHz Pentium III processor and 512 MB of RAM.</p>
         </sec>
      </sec>
      <sec>
         <st>
            <p>List of Abbreviations</p>
         </st>
         <p>2PLSM two-photon excitation laser scanning microscopy</p>
         <p>CLSM confocal laser scanning microscopy</p>
         <p>DAQ data acquisition</p>
         <p>CPU central processing unit</p>
         <p>TTL transistor-transistor logic</p>
         <p>PMT photo-multiplier tube</p>
         <p>GUI graphical user interface</p>
         <p>SNR signal-to-noise-ratio</p>
         <p>LUT look-up table</p>
         <p>DSP digital signal processing</p>
         <p>COM communications port</p>
         <p>FWHM full-width-at-half-maximum</p>
         <p>SEM standard error of the mean</p>
         <p>RAM random access memory</p>
      </sec>
      <sec>
         <st>
            <p>Author's Contributions</p>
         </st>
         <p>BLS and KS conceived and planned this project. TAP and BLS wrote the majority of the code, with contributions from KS. Simulations and experiments were performed by TAP with KS. TAP and KS drafted the manuscript.</p>
      </sec>
   </bdy>
   <bm>
      <ack>
         <sec>
            <st>
               <p>Acknowledgements</p>
            </st>
            <p>We thank Brian Chen, Karen Zito, and Josh Trachtenberg for beta-testing early versions of <it>ScanImage</it>. We thank Ryohei Yasuda for helpful comments on the analysis. We thank Gordon Shepherd, Karen Zito, and Thomas Oertner for helpful comments on the manuscript.</p>
            <p>This work was funded in part by a grant from the National Institutes of Health (Grant# R01 EB01464-01).</p>
         </sec>
      </ack>
      <refgrp>
         <bibl id="B1">
            <title>
               <p>Intrinsic circuitry involving the local axon collaterals of corticothalamic projection cells in mouse Sm1 cortex</p>
            </title>
            <aug>
               <au>
                  <snm>White</snm>
                  <fnm>EL</fnm>
               </au>
               <au>
                  <snm>Keller</snm>
                  <fnm>A</fnm>
               </au>
            </aug>
            <source>J Comp Neurol</source>
            <pubdate>1987</pubdate>
            <volume>1987</volume>
            <fpage>13</fpage>
            <lpage>26</lpage>
         </bibl>
         <bibl id="B2">
            <title>
               <p>An improved, no moving parts video rate confocal microscope</p>
            </title>
            <aug>
               <au>
                  <snm>Goldstein</snm>
                  <fnm>SR</fnm>
               </au>
               <au>
                  <snm>Hubin</snm>
                  <fnm>T</fnm>
               </au>
               <au>
                  <snm>Smith</snm>
                  <fnm>TG</fnm>
               </au>
            </aug>
            <source>Micron and Microscopica Acta</source>
            <pubdate>1992</pubdate>
            <volume>23</volume>
            <fpage>437</fpage>
            <lpage>442</lpage>
            <xrefbib>
               <pubid idtype="doi">10.1016/0739-6260(92)90019-A</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B3">
            <title>
               <p>Handbook of Biological Confocal Microscopy</p>
            </title>
            <aug>
               <au>
                  <snm>Pawley</snm>
                  <fnm>JB</fnm>
               </au>
               <au>
                  <cnm>ed</cnm>
               </au>
            </aug>
            <source>Plenum Press: New York</source>
            <edition>3</edition>
            <pubdate>1995</pubdate>
         </bibl>
         <bibl id="B4">
            <title>
               <p>Two-photon laser scanning microscopy</p>
            </title>
            <aug>
               <au>
                  <snm>Denk</snm>
                  <fnm>W</fnm>
               </au>
               <au>
                  <snm>Strickler</snm>
                  <fnm>JH</fnm>
               </au>
               <au>
                  <snm>Webb</snm>
                  <fnm>WW</fnm>
               </au>
            </aug>
            <source>Science</source>
            <pubdate>1990</pubdate>
            <volume>248</volume>
            <fpage>73</fpage>
            <lpage>76</lpage>
            <xrefbib>
               <pubid idtype="pmpid">2321027</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B5">
            <title>
               <p>Photon upmanship: why multiphoton imaging is more than a gimmick</p>
            </title>
            <aug>
               <au>
                  <snm>Denk</snm>
                  <fnm>W</fnm>
               </au>
               <au>
                  <snm>Svoboda</snm>
                  <fnm>K</fnm>
               </au>
            </aug>
            <source>Neuron</source>
            <pubdate>1997</pubdate>
            <volume>18</volume>
            <fpage>351</fpage>
            <lpage>357</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1016/S0896-6273(00)81237-4</pubid>
                  <pubid idtype="pmpid" link="fulltext">9115730</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B6">
            <title>
               <p>Selected Papers on Ultrafast Laser Technology</p>
            </title>
            <aug>
               <au>
                  <snm>Gosnell</snm>
                  <fnm>TR</fnm>
               </au>
               <au>
                  <snm>Taylor</snm>
                  <fnm>AJ</fnm>
               </au>
               <au>
                  <cnm>eds</cnm>
               </au>
            </aug>
            <source>Milestone Series. SPIE Press: Bellingham, WA</source>
            <pubdate>1991</pubdate>
         </bibl>
         <bibl id="B7">
            <title>
               <p>Practical laser-scanning confocal light microscopy: Obtaining optimal performance from your instrument</p>
            </title>
            <aug>
               <au>
                  <snm>Pawley</snm>
                  <fnm>JBaCV</fnm>
               </au>
            </aug>
            <source>in Cell Biology: A Laboratory handbook</source>
            <publisher>Academic Press: New York</publisher>
            <editor>Celis JE</editor>
            <pubdate>1994</pubdate>
            <fpage>44</fpage>
            <lpage>64</lpage>
         </bibl>
         <bibl id="B8">
            <title>
               <p>A custom-made two-photon microscope and deconvolution system</p>
            </title>
            <aug>
               <au>
                  <snm>Majewska</snm>
                  <fnm>A</fnm>
               </au>
               <au>
                  <snm>Yiu</snm>
                  <fnm>G</fnm>
               </au>
               <au>
                  <snm>Yuste</snm>
                  <fnm>R</fnm>
               </au>
            </aug>
            <source>Pflugers Arch</source>
            <pubdate>2000</pubdate>
            <volume>441</volume>
            <issue>2&#8211;3</issue>
            <fpage>398</fpage>
            <lpage>408</lpage>
            <xrefbib>
               <pubid idtype="pmpid" link="fulltext">11211128</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B9">
            <title>
               <p>Multi-photon laser scanning microscopy using an acoustic optical deflector</p>
            </title>
            <aug>
               <au>
                  <snm>Lechleiter</snm>
                  <fnm>JD</fnm>
               </au>
               <au>
                  <snm/>
                  <fnm>LDT</fnm>
               </au>
               <au>
                  <snm>Sieneart</snm>
                  <fnm>I</fnm>
               </au>
            </aug>
            <source>Biophysical Journal</source>
            <pubdate>2002</pubdate>
            <volume>83</volume>
            <issue>4</issue>
            <fpage>2292</fpage>
            <lpage>2299</lpage>
            <xrefbib>
               <pubid idtype="pmpid" link="fulltext">12324446</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B10">
            <title>
               <p>Anatomical and functional imaging of neurons using 2-photon laser scanning microscopy</p>
            </title>
            <aug>
               <au>
                  <snm>Denk</snm>
                  <fnm>W</fnm>
               </au>
               <etal/>
            </aug>
            <source>J Neurosci Meth</source>
            <pubdate>1994</pubdate>
            <volume>54</volume>
            <fpage>151</fpage>
            <lpage>162</lpage>
            <xrefbib>
               <pubid idtype="doi">10.1016/0165-0270(94)90189-9</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B11">
            <title>
               <p>High-resolution imaging of synaptic structure with a simple confocal microscope</p>
            </title>
            <aug>
               <au>
                  <snm>Lichtman</snm>
                  <fnm>JW</fnm>
               </au>
               <au>
                  <snm>Sunderland</snm>
                  <fnm>WJ</fnm>
               </au>
               <au>
                  <snm>Wilkinson</snm>
                  <fnm>RS</fnm>
               </au>
            </aug>
            <source>New Biol</source>
            <pubdate>1989</pubdate>
            <volume>1</volume>
            <issue>1</issue>
            <fpage>75</fpage>
            <lpage>82</lpage>
            <xrefbib>
               <pubid idtype="pmpid">2488274</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B12">
            <title>
               <p>Principles, design and construction of a two photon scanning microscope for in vitro and in vivo studies</p>
            </title>
            <aug>
               <au>
                  <snm>Tsai</snm>
                  <fnm>PS</fnm>
               </au>
               <etal/>
            </aug>
            <source>In Methods for In Vivo Optical Imaging</source>
            <publisher>CRC Press</publisher>
            <editor>Frostig R</editor>
            <pubdate>2002</pubdate>
            <fpage>113</fpage>
            <lpage>171</lpage>
         </bibl>
         <bibl id="B13">
            <title>
               <p>Two-photon imaging in living brain slices</p>
            </title>
            <aug>
               <au>
                  <snm>Mainen</snm>
                  <fnm>ZF</fnm>
               </au>
               <etal/>
            </aug>
            <source>Methods</source>
            <pubdate>1999</pubdate>
            <volume>18</volume>
            <fpage>231</fpage>
            <lpage>239</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1006/meth.1999.0776</pubid>
                  <pubid idtype="pmpid" link="fulltext">10356355</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B14">
            <title>
               <p>Long-term in vivo imaging of experience-dependent synaptic plasticity in adult cortex</p>
            </title>
            <aug>
               <au>
                  <snm>Trachtenberg</snm>
                  <fnm>JT</fnm>
               </au>
               <etal/>
            </aug>
            <source>Nature</source>
            <pubdate>2002</pubdate>
            <volume>420</volume>
            <issue>6917</issue>
            <fpage>788</fpage>
            <lpage>94</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1038/nature01273</pubid>
                  <pubid idtype="pmpid" link="fulltext">12490942</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
         <bibl id="B15">
            <title>
               <p>Facilitation at single synapses probed with optical quantal analysis</p>
            </title>
            <aug>
               <au>
                  <snm>Oertner</snm>
                  <fnm>TG</fnm>
               </au>
               <etal/>
            </aug>
            <source>Nat Neurosci</source>
            <pubdate>2002</pubdate>
            <volume>5</volume>
            <fpage>657</fpage>
            <lpage>664</lpage>
            <xrefbib>
               <pubid idtype="pmpid" link="fulltext">12055631</pubid>
            </xrefbib>
         </bibl>
         <bibl id="B16">
            <title>
               <p>MultiMatlab: MATLAB on multiple processors</p>
            </title>
            <aug>
               <au>
                  <snm>Trefethen</snm>
                  <fnm>E</fnm>
               </au>
               <etal/>
            </aug>
            <source>Cornell Theory Center</source>
            <pubdate>1996</pubdate>
            <fpage>96</fpage>
            <lpage>239</lpage>
         </bibl>
         <bibl id="B17">
            <title>
               <p>The Art of Electronics</p>
            </title>
            <aug>
               <au>
                  <snm>Horowitz</snm>
                  <fnm>P</fnm>
               </au>
               <au>
                  <snm>Hill</snm>
                  <fnm>W</fnm>
               </au>
            </aug>
            <source>Cambridge: Cambridge University Press</source>
            <edition>2</edition>
            <pubdate>1989</pubdate>
            <fpage>1125</fpage>
         </bibl>
         <bibl id="B18">
            <title>
               <p>Experimental and theoretical comparison of photon-counting and current measurements of light intensity</p>
            </title>
            <aug>
               <au>
                  <snm>Jones</snm>
                  <fnm>R</fnm>
               </au>
               <au>
                  <snm>OIiver</snm>
                  <fnm>CJ</fnm>
               </au>
               <au>
                  <snm>Pike</snm>
                  <fnm>ER</fnm>
               </au>
            </aug>
            <source>Appl Opt</source>
            <pubdate>1970</pubdate>
            <volume>10</volume>
            <fpage>1673</fpage>
            <lpage>1680</lpage>
         </bibl>
         <bibl id="B19">
            <title>
               <p>Fast scanning and efficient photodetection in a simple two-photon microscope</p>
            </title>
            <aug>
               <au>
                  <snm>Tan</snm>
                  <fnm>YP</fnm>
               </au>
               <etal/>
            </aug>
            <source>J Neurosci Methods</source>
            <pubdate>1999</pubdate>
            <volume>92</volume>
            <issue>1&#8211;2</issue>
            <fpage>123</fpage>
            <lpage>35</lpage>
            <xrefbib>
               <pubidlist>
                  <pubid idtype="doi">10.1016/S0165-0270(99)00103-X</pubid>
                  <pubid idtype="pmpid">10595710</pubid>
               </pubidlist>
            </xrefbib>
         </bibl>
      </refgrp>
   </bm>
</art>
