<<

CHAPTER

65,000 Shades of : Use of Digital Image Files in Light Microscopy 13 Sidney L. Shaw* and Edward H. Hinchcliffe{ *Biology Department, Indiana University, Bloomington, Indiana, and Department of Biology, University of North Carolina, Chapel Hill, North Carolina, USA { Cellular Dynamics Section, Hormel Institute, University of Minnesota, Austin, Minnesota, USA

CHAPTER OUTLINE Introduction...... 318 13.1 What is An Image File?...... 320 13.2 Bit Depth ...... 320 13.3 File Formats...... 322 13.4 Sampling and Spatial Resolution...... 325 13.5 Color...... 325 13.6 Converting RGB to CMYK ...... 327 13.7 Compression...... 329 13.8 Video Files ...... 329 13.9 Video ...... 331 13.10 Choosing a ...... 332 13.10.1 Real Results ...... 334 Conclusions...... 335 Acknowledgments ...... 335 References ...... 336

Abstract Computers dominate image capture and analysis in modern light microscopy. The out- put of an imaging experiment is a binary coded file, called an image file, which contains the spatial, temporal and intensity information present in the sample. Understanding what comprises an image file, and how these files are generated is necessary in order to optimize the use of the digital light microscope. In this chapter, we discuss , and the various components of these files, such as bit-depth, sampling rate, , and compression, from the perspective of the non-computer scientist.

Methods in Cell Biology, Volume 114 ISSN 0091-679X 317 Copyright © 2013 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/B978-0-12-407761-4.00013-0 318 CHAPTER 13 Use of Digital Image Files in Light Microscopy

We also discuss the problem of proprietary file formats, and how these often are incom- patible with certain types of imaging software. We present several solutions to this issue. Finally, we present the use of digital movie formats, compression routines, and provide some real world examples for optimizing the generation of digital movies.

INTRODUCTION Digital microscopy is the recording of an image generated through the microscope into a binary coded file. Like photomicrography and cinemicrography, digital image files provide a permanent record of observations made in the microscope (Furness, 1997). Unlike these analog recording modes, digital micrographs can easily be as- sembled into sequences, to represent motion, or into projections to visualize spatial information in three dimensions, without having to first copy and convert these images into a digital format. The ultimate expression of the medium is the presen- tation of time-lapse motion picture sequences of 3D reconstructions (so-called 4D microscopy; see Salmon et al., 1998; Thomas, DeVries, Hardin & White, 1996). In addition to representing purely visual information from a specimen, digital microscopy image files also contain quantitative temporal and spatial information, relating to the behavior, and/or specific events within cells. This is particularly pow- erful when using sophisticated fluorescent probes to detect and analyze individual molecules in vivo. The images contain quantitative data relating to protein concen- tration, enzyme kinetics, cellular dynamics, etc. To maximize the use of the digital microscope as a quantitative instrument, the temporal, spatial, and biochemical in- formation obtained must be output into a form that can be analyzed, searched, shared, published in journals, displayed on websites, and presented at meetings. Mishandling the collection and storage of information contained within digital image files often leads to unfortunate outcomes. Thus, it becomes an important task to plan for the generation, manipulation, and storage of image-based data. Most biologists have limited training in computer science or in areas of image pro- cessing. Often, the use of computers for biological imaging follows an “oral” tradition based on colleagues or collaborators. While such an approach can propagate useful information, it can also perpetuate misconceptions leading to bad digital habits. In many settings, standard protocols for a laboratory are developed without planning for storage, analysis, or eventual publication. The result is that digital imaging is not optimized, when it easily could be. The following chapter will deal with image files from the standpoint of a noncomputer scientist/graphics artist. The emphasis will be on understanding basic concepts and providing the individual biology researcher with the tools to make informed decisions about generating, manipulating, and storing graphics image files. To begin, it is useful to consider the trajectory of your image data from initial collection to final publication. The majority of the images taken in the research lab- oratory are still used for the purpose of visually comparing a control to an experimen- tal condition. The images can be from live cells or fixed material, 2D or 3D volumes, single frames, or time-lapse series. In each case, a collection of images will be taken Introduction 319

and stored as digital files for later review where the conditions of the experiment and details of the microscopy should be recorded, information that is referred to as “meta- data,” a topic that will be touched on later in this chapter. From these stored files, some level of analysis will be performed through human evaluations, often with con- siderable postprocessing of the original images for contrast and noise abatement or for creating 3D projections or movies. In limited cases, the image data will be sub- jected to more complicated analytical schemes using computational tools to extract numerical data (Cardullo & Hinchcliffe, 2007; Jaqaman et al., 2008; Walczak, Rizk, & Shaw, 2010; Waters, 2009). It is important that the processing and analytical steps be carefully recorded, as these need to be reported during publication. Finally, a select set of micrographs will be developed for presentations and for publication, with explicit instruction from a journal about format and resolution. All of the images should then be archived in a manner that permits search and retrieval in a manner consistent with laboratory notebooks and other data. A key point to consider when generating and using digital image files is that the original, unprocessed images are data, a record of experimental results. These should be maintained as such, in an unmanipulated form. Any image-processing steps should be saved as a separate file, containing a processed image or a set of images. The same holds true for figures for presentation and/or publication, which are in es- sence “graphics.” Though these graphics will contain images and measurements made from the data, they are separate and must be treated as such. In other words, files generated as graphics should never be used to generate data. Measurements should be made only from primary data files. All of this data are collected using imaging software, and the software available has an enormous impact on how the data are captured, analyzed, and stored. In broad terms, there are two types of software commercially available for digital microscopy. The first is purpose written to drive an individual instrument and is usually provided as part of a “turn-key” imaging system. Often such software is tied to a particular instru- ment manufacturer and can only rarely interface with other instruments. This type of software can range from the basic, picture-taking packages designed for general dig- ital photomicrography use, to highly sophisticated software, capable of analytical and quantitative measurements. The second type of software is designed primarily as an analytical tool and purpose built to work with most imaging platforms. This type of software is often capable of driving numerous devices from a wide range of manufac- turers, such as microscopes, automated stages, cameras or other detectors, illumina- tion and shuttering units, galvanometers, and laser-bleaching and -ablation devices. Because of their ability to interface with multiple instruments, such software packages offer great flexibility, and are used to drive many custom-built imaging systems. The choice of which type of system to choose is often based on capabilities and expertise in the lab or institute, as well as on budget considerations. There is another type of software available called openware, freeware, or shareware. These packages are freely downloadable and are maintained and updated by a body of users. Packages such as the image-processing software ImageJ (http:// rsbweb.nih.gov/ij/), formerly known as NIH Image for and Scion Imaging for Windows, and the automated microscope control software MicroManager 320 CHAPTER 13 Use of Digital Image Files in Light Microscopy

(mManager: http://valelab.ucsf.edu/MM/MMwiki/) are powerful tool that allow the user to drive image capture and analysis (Schneider, Rasband, & Eliceiri, 2012; Shaw, Salmon, & Quatrano, 1995). The only major difference between freeware and commercially available software packages is the availability of support versus cost to the researcher. On the shareware side, updates and added capabilities are determined by those users that can sit down and write the software. In the case of commercial pack- ages, updates are dependent on users purchasing software licenses. Both routes can be used successfully, and the choice to use shareware is largely dependent on the level of computer science literacy in an individual laboratory; the cost of commercial software weighed against the time involved in obtaining support for the shareware (Wiley & Michaels, 2004).

13.1 WHAT IS AN IMAGE FILE? The basic unit of digital imaging is an image file. Files can contain a simple image, or a complex, multiple-dimension experiment. An image is saved as a computer graphics file in one of two broad formats: (i) vector graphics and (ii) raster graphics (also called files). Vector graphics—commonly generated by drawing or plot- ting programs—consist of lines, curves, polygons, and other shapes that are specified mathematically to generate an image. Regions of these images are filled with grada- tions of gray or color. The advantage of a vector representation is that it exists with- out a defined spatial scale. To rescale the image, the computer recalculates the dimensions of each shape and redraws the image with sharp outlines and discrete tones. This format is ideal for representing diagrams and text where text does not lose resolution when output in different formats or resized. Vector-based graphics are not typically used for saving light microscopy data except in special cases, such as PALM and STORM, where the positions of individual molecules have been de- termined computationally and output as positions in space. The major form of graphics file used for microscopy data is the raster graphic or bitmap image. The graphical information is saved and displayed as a grid of discrete picture elements (pixels). Because the intensity values at each point in the image are assigned to an independent pixel within the grid, are the preferred way to store complex, continuous-tone images such as photographs (Fig. 13.1). Unlike vec- tor graphics, a raster file has a fixed spatial scale. Rescaling the image requires either that the individual pixel elements change size or that the data are interpolated to cre- ate more or fewer pixels. Typical raster file formats include TIFF, DICOM, PICT, Joint Photographic Experts Group (JPEG), Graphics Interchange Format (GIF), and BMP. There are also raster graphics files associated with software packages, referred to a proprietary file formats (PFFs), which will be discussed later.

13.2 BIT DEPTH The light intensity in the optical image is sampled or qualitized at each pixel position to create a digital intensity value or gray level. Just like spatial sampling, the sam- pling density determines with what fidelity the primary image data are captured. 13.2 Bit Depth 321

A

B Image Intensity Histogram 20000

18000

16000

14000

12000

10000 Frequency 8000

6000

4000

2000

0 0 4096 8192 12288 16384 20480 24576 28672 32768 36864 40960 45056 49152 53248 57344 61440 Intensity Level FIGURE 13.1 The raster image. (A) A grayscale image of chromosomes in a mitotic BSC-1 cell, labeled with DAPI. (B) The image intensity histogram for the image in (A). This 16-bit image has 65,535 gray levels, plus pure (0). The majority of pixel intensities are close to black, representing the dark areas. 322 CHAPTER 13 Use of Digital Image Files in Light Microscopy

In this case, the fidelity of the data refers to how well the signal-to-noise ratio of the detector has been preserved in the recorded image. Digitizing an optical image means that the relative differences in light intensity are converted to relative intensity levels by some form of analog to digital converter (ADC). In simplest terms, an image de- tector, such as a CCD camera or a photomultiplier tube, converts photons comprising the image into electrons, and reads them out to an ADC as a voltage (Hinchcliffe & Sluder, 2003). The ADC acts like a series of binary gates where at each gate, the ADC decides whether the voltage is greater than or less than a particular value. If the voltage is greater than that value, a “1” is sent to the computer and the gate value is subtracted from the voltage. If the voltage is less than that value, a “0” is assigned. The voltage then goes on to the next gate and the process is repeated. If a series of gates are set up in the ADC, where each gate value is half of the previous gate value, then the voltage gets divided into ever smaller amounts, corresponding ever smaller intensity differ- ences. Collecting the output from an ADC with 4 gates would produce values from “0000” to “1111,” corresponding to 24 possible intensity levels. Each binary value therefore constitutes a bit for the computer processor where the maximum intensity value of “1111” is reconstituted in this 4-bit sample as “8þ4þ2þ1” or 15 out of a total range of 16 values (0–15). An ADC with 8 V dividing gates yields 28 possible values (0–255) where the first bit, often termed the “most significant bit” is 128 rather than 8 for the 4-bit image. The bit depth of an image file determines how many intensity levels can be stored for each pixel, but it does not guarantee that the differences in gray levels are mean- ingful (Shaw, 2006). Contemporary computers store and process information in 8-bit increments termed bytes. Therefore, monochrome raster graphics are typically saved as 8-bit (256 gray levels) or 16-bit (65,536 gray levels) image files where each pixel is assigned one or two bytes of information, respectively. Digital cameras, photomul- tiplier tubes, the amplifiers that stream the voltage from the detector to the ADC, and the ADC itself all introduce errors in the form of extraneous electrons when record- ing the image to file. The variation in voltage “signal” caused by these stochastic errors constitutes an electronic “noise” that interferes with our ability to determine real differences between pixel intensity values after quantization. As the mean value of the electronic noise gets close to a particular ADC gate value, the decision to make that bit a “1” or a “0” becomes somewhat arbitrary.

13.3 FILE FORMATS Selecting an image for storing your image data depends upon several con- siderations: the purpose of the graphics being represented, the file size, the imaging platform used, and the software available to manipulate the images. Commercial vendors commonly create machine or company-specific file types for the purpose of recording machine-specific parameters into the image data file. These so-called “metadata” are often used for specific postprocessing or visualization tasks where, 13.3 File Formats 323

for example, the excitation and emission wavelengths are used to false color the im- age or the number of pixels per micron are used to generate scale bars. Converting your images from a PFF to a new file type that can be opened and manipulated across multiple software platforms will almost always eliminate the metadata and can ruin the primary image data if you are not careful to select an appropriate file type. There are several tools available to do this. Many proprietary files are now shared between imaging platforms, and some manufacturers offer a data viewing feature. There are also shareware software packages that will convert various PFFs to more common file formats (Linkert et al., 2010). These file types are significantly different from the JPEG and GIF files used more commonly in Websites and presentations. TIFF The Tagged Image File Format saves the image data without compression and with the option of encoding metadata into the first part of the file called the file header. TIFF is an excellent choice for saving and manipulating graphics files, particularly when these images will be utilized by several applications. TIFF images work equally well with grayscale or color images (Kay & Levine, 1992). TIFF files are often the basis for proprietary image file formats found in commercially available image capture and analysis programs, and most of these programs will output as 8-bit (grayscale), 16-bit (grayscale), or 24-bit (RGB) TIFF images. can be saved uncompressed, or use a variety of compression regimes, including LZW compression, or JPEG compression (so-called JIFFs). TIFF is an excellent format to archive image data, because it is not software specific, and can be imported and opened by a variety of programs. JPEG Short for Joint Photographic Experts Group, JPEG is a ubiquitous file format for the distribution of digital images (see www.JPEG.org). Its major advantage is in the ability to provide outstanding visual images, particularly photographs, which can be highly compressed. JPEG is designed to exploit the limitations of the human vision: variations in brightness are perceived more than discrete changes in color (or grayscale). JPEG is intended for images that will be viewed by people and are an ideal format to use to present high-quality images with minimal file size (e.g., on a Website or in transferring images back and forth by e-mail or FTP). At its extreme, JPEG can represent an image using around one bit per pixel for storage, yet to the eye, this image looks indistinguishable from the original (see Kay & Levine, 1992). JPEG images are not designed for computer vision: the errors introduced by JPEG—even if they are invisible to the eye—make unsuitable for quantitative analysis. This is compounded by the fact that JPEG files lack pixel intensity: the JPEG image looks fine to the eye but may lack some of the pixel-by-pixel information necessary for quantitative analysis (see Fig. 13.3). It is important to note that saving an image as a JPEG—even at the highest setting—introduces lossey file compression; information is discarded as the file is saved. For this reason, it is not recommended 324 CHAPTER 13 Use of Digital Image Files in Light Microscopy

that image files be archived as JPEGs, unless quantitative data are not required. Again, JPEGs are for graphics and presentation, not for analysis or archiving.

GIF GIF is well suited for exchanging images between different programs, particularly across the web. Originally designed by CompuServe for this purpose, the GIF format has largely been replaced by the use of JPEG, particularly in the transfer of photographic images. However, JPEG will not completely replace GIF; for some types of images, GIF is superior in image quality, file size, or both. JPEG is superior to GIF for storing full-color or grayscale images of “realistic” scenes, such as photographs and continuous-tone images. Subtle variations in color are represented with less space by JPEG than by GIF, and yet, still provide a faithful representation. In JPEG, sharp edges tend to be blurred unless a high- quality setting is used. GIF is better for images with fewer colors, such as line drawings and simple cartoons that have sharp edges. GIF is only available in 256 color (not true color). Animated GIF images remain the standard for solid- color motion graphics output to the web, and the term GIF has been coopted to describe a short animation on the interweb, often depicting a politician or member of the entertainment community. Some of these animations can be quite humorous. For the scientist, these can be used to depict an animated graphic on a website.

BMP Device-Independent Bitmap file is known as the BMP file. This is the standard Microsoft Windows raster file format. While it does not have many features, it can work for moving image around, especially between programs. When this is done, if it is best to convert the final image to another format, such as TIFF. Such conversions do not lead to image degradation, like that seen when converting a JPEG or GIF to a TIFF. BMP files are also used as the “desktop” image for Microsoft Windows (see Windows folder).

Proprietary file formats Written to take advantage of a particular software package, PFF are usually based on TIFF architecture and include metadata (automatically generated by the imaging system) and notes input by the user. PFF files are ideal when working in the closed architecture of a commercial software package, where they allow ease of use and integration of software features (false coloring, scale bars, stored point spread functions for deconvolution, flat field corrections, background subtracts). Where PFFs have been problematic is in the use of cross-platforms, when system A cannot open a file from system B. There are several remedies for this. Many software packages now allow for opening and reading of cross-platform files, and many PFFs are open architecture, meaning that they can be utilized by multiple programs. 13.5 Color 325

13.4 SAMPLING AND SPATIAL RESOLUTION Converting what we see in the microscope into a digital bitmap or raster file requires that we sample the image intensity as discrete points in space. The density of samples taken per area determines how much of the available resolution we capture in the file up to the resolution limits of the optical system. Since the aperture of the microscope lens system typically limits the resolvable information from the specimen, oversam- pling the image by using many more pixels per area than necessary only increases the file size and does not produce a better quality image (Inoue & Spring, 1997). When referring to bitmap files, the resolution of the image file is typically specified as the final number of points that subdivide the raster image (e.g., 256256 or 512512) or simply as pixels per line of printed material (usually pixels per inch or ppi)oras pixels per unit length of monitor (usually as dots per inch or dpi) (see Inoue & Spring, 1997 for in-depth discussion of monitor resolution). Thus, an 800 1000 image with a resolution of 150 ppi translates into a bitmap of 12001500 pixels. As the ppi or dpi increases, the size of each pixel to be displayed or printed gets smaller and vice versa. Changing the size of a bitmap or raster image, where each pixel (of known dimen- sions) is mapped to a particular region of a fixed grid, must be handled carefully so that the original image data are not corrupted (Fig. 13.2). For electronic media, where the pixel size is not determined by a printed dot size, changing the size of the image ultimately requires changing the number of pixels. For example, a bitmap that is 500500 pixels will yield a 500 500 image at 100 ppi. If this image is increased in size to 1000 1000, the bitmap must be converted to 10001000 pixels. The soft- ware used to rescale the image (such as Adobe Photoshop Adobe Systems Inc., Mountain View, CA) will typically redisplay the image at the new size without changing the actual dpi or ppi of the saved image data. However, if that image has been interpolated to 10001000 pixels, and saved as such, these data no longer constitute the raw scientific data that was captured at the microscope. Decreasing image size follows the same general rule. Many different methods have been developed for interpolating to larger or smal- ler image sizes (see Kay & Levine, 1992), but all interpolation methods change your primary data. As journals continue to redefine their publication requirements for im- age data, it is critical that scientists creating figures in primarily vector-based (e.g. Adobe Illustrator) and raster-based (e.g. ImageJ, Adobe Photoshop) software clearly understand how their data are being altered through the process. All image manip- ulations should be reported with the figure to point out when evidentiary material used for a scientific claim is dependent upon image rescaling or processing.

13.5 COLOR It is helpful to understand some basics of color theory in order to be able to properly manipulate color image files. Colors can be described in terms of their hue, satura- tion, and intensity (also referred to as luminosity). Hue denotes the color of an object (technically, hue represents the position on a standard color wheel, expressed in 326 CHAPTER 13 Use of Digital Image Files in Light Microscopy

FIGURE 13.2 Re-sampling and interpolation. (A) Original image of a CHO cell stained with antibodies to a-tubulin. (B) The same image after it has been down-sampled and then re-sample to the original size. (A0/B0) Blowups of selected regions of (A and B). Note that the microtubules appear jagged, there is pixelation and the overall quality of the image in (B0) is poor. The interpolation routine for this demonstration was deliberately chosen to give poor results; most interpolation methods do much better.

degrees between 0 and 360). Compare the hue of a pair of dark cotton blue jeans with that in a pair of sky blue polyester Ban Lon pants. Saturation is the amount of pure white in the color. For example, the blue in a brand new pair of jeans is very satu- rated, whereas the blue in an old pair (or a pair that has been subjected to acid wash) is much less saturated. Intensity or luminosity denotes the brightness of an object: a 13.6 Converting RGB to CMYK 327

pair of blue jeans observed in bright sunlight will look different from the same pair of jeans in a dimly lit blues club, “round midnight.” There are two common (albeit not exclusive) methods that can be used to repre- sent color in graphic image files. The first method is RGB, which mixes red, green, and blue light together in varying proportions. This is referred to as additive color, because adding all three colors in equal intensities creates white. It is easy to picture an RGB image as the overlaying of three-colored transparencies (one red, one green, and one blue); where the colors overlap, they create complementary colors such as , , and . In an RGB image file, each pixel is assigned a specific intensity for each of the three different color channels. If the bit depth for each chan- nel is set to 8, then this image is said to be 24-bit RGB, or 24-bit color (38-bits/ channel). The result is 16.7 million color variations (often called 24-bit true color). True color has become the standard display mode of most computer monitors. Note: some color display systems support 32-bit true color display. This is 24-bit RGB plus an 8-bit alpha channel that functions as a mask to specify how an individual pixel’s colors should/will be merged when colors are overlaid. This alpha channel is crucial for transparent regions of an image and special effects. Also, many video cards sup- port 32-bit giga color (10 bits per channel RGB, plus a 2-bit alpha channel). This type of color representation is intended to give even more color information per channel, and the expense of transparency (often an Alpha channel is only needed for digital “fine” art, where transparent regions of the image are critical). The second method commonly used to represent color in digital image files is called CMYK (cyan, magenta, yellow, and black; K represents black, so as not to be confused with blue). In CMYK images, the colors are subtractive. This is easiest to understand if thought of as ink printed onto a white piece of paper. Indeed, the use of CMYK inks is the standard mode for commercial color —including that for scientific journals—and is called four-color process printing (see below). If all four colors are overlaid in sufficient and equal amounts, then the resulting image is true black. If there is no ink (i.e. no color), then the page is white. In a CMYK image file, each pixel is assigned a percentage value for each of its four different color chan- nels. If the bit depth for each channel is set to 8 (the standard), then this file is said to be 32-bit color (not to be confused with 32-bit true color—see above).

13.6 CONVERTING RGB TO CMYK The range of colors generated by each method (RGB or CMYK) is referred to as the color gamut of that method (see Inoue & Spring, 1997). Because RGB and CMYK use different methods to reproduce color, the hues in RGB files may be slightly different from those represented in CMYK files. Also, CMYK has a smaller gamut of colors than RGB. The difference in color gamut between an RGB and a CMYK file is often blamed for the disappointing hues/saturation/intensity seen in multico- lor digital microscopy images that have been converted from RGB to CMYK for publication in print journals. However, most, if not all color micrographs are 328 CHAPTER 13 Use of Digital Image Files in Light Microscopy

essentially grayscale images that subsequently have been pseudocolored to provide color information. As such, the gradations of red, green, and blue tones in these images are not subtle enough to cause the real problems observed during intercon- version from RGB to CMYK. In fact, the interconversion of most digital images from RGB to CMYK does not present color management problems. This can be demonstrated by converting a digital photograph of family or loved ones (or both) from RGB to CMYK: the result is pleasing and true to the original image. The real problem for digital micrography (and cause for the less-than-optimal images gen- erated) has its basis in the very nature of multiwavelength fluorescence micro- graphs themselves (see below). Fluorescence images are composed of bright regions (where the fluorochrome is present) and a black background (where the fluorochrome is absent). In RGB mode, these types of images overlay very well, resulting in characteristic multichannel fluo- rescence micrographs. Where there is fluorescence overlap, there is a color shift to a complementary color; this color shift is often used to assay for colocalization of can- didate molecules (i.e., red on green produces yellow). Remember that in an RGB image file, black represents the absence of pixel intensity. Therefore, where there is no overlap, the individual fluorochromes are contrasted with the pure black back- ground. When output onto a RGB computer screen, these multicolor RGB fluores- cence images are striking: they have deep, saturated colors and are combined with a rich, black background. However, when such an image is converted from RGB to CMYK for printing in a journal, the image becomes weak and sickly. This is the re- sult of the switch from an additive color scheme (RGB) to a subtractive scheme (CMYK). The black background, which in RGB is the absence of intensity (no pixels), is converted to CMYK, which is represented by maximum pixel intensities for these regions (remember, the pure black regions in CMYK images are made up of equal percentages of C, M, Y, and K intensities for each pixel). After conversion, this black “ink” is overlaid onto the position of each fluorochrome present in the other layers. The effect is that the CMYK black regions act like a gray filter over the fluo- rescent image. The result is that the intensity of each “bright” pixel is diminished: also, the hue and the saturation of each pixel become altered. To make matters worse, during the conversion from RGB to CMYK, the regions of the image that appear dark may be made up of varying intensities of C, M, Y, or K—they may not be true black. These pixels could be a dark maroon, a hunter green, a midnight blue, or a very deep golden brown. When each of these colors is highly saturated and has a faint intensity, the result is almost black. Thus, differing levels of color—masquerading as black—will be overlaid on the original pseudocolored im- age and change the hue, saturation, and intensity of individual pixel within the image, often in an unpredictable and uncontrollable fashion. When preparing multicolor fluorescent images for publication, there are several ways to get around the unfortunate situation brought about by the conversion from RGB to CMYK. One way is to start by manipulating each color “layer” as an RGB image, until the desired intensities are found. Then the image is “flattened,” and the layers are merged together. By flattening the image, the black pixels of the top layer 13.8 Video Files 329

are discarded. Once the image has been flattened, it can be converted from RGB to CMYK. Thus, those pesky “black” pixels from the upper layer are gone, and the image will convert to CMYK with relatively high fidelity.

13.7 COMPRESSION Because raster graphics require information to be saved for each pixel, bitmap files can be very large. This is particularly true for images that are 1000 pixels1000 pixels or larger (so-called mega pixel images). The size of these files also increases as the bit depth increases for each pixel. Large file sizes put stains on computer pro- cessing power, memory capacity, and storage (see Bertrand, 2001). One way to deal with the increase in file size is to introduce compression. To compress a file, the com- puter looks for patterns within the bitmap and tries to represent these patterns with as little information as possible. In addition, movie file formats also can use temporal compression, which looks for similarities between frames. When a file is compressed, the computer can preserve all the original pixel infor- mation and represent this information in the resulting uncompressed image. This is said to be , and the savings in file size come from how the in- formation is processed and stored. Alternatively, the computer can discard informa- tion deemed irrelevant to be able to represent the final image. This is said to be lossey compression. For digital microscopy, the use of compression—and the selection of a compres- sion scheme—depends upon the requirements of the image and the imaging system. As a rule, it is best to acquire images with as little compression as possible (none at all would be best). Data analysis involving pixel intensities should be done on uncom- pressed files. These large files can be archived as is. The image can then be converted to a file type that supports compression, such as JPEG (Fig. 13.3). This is convenient for publishing on the Web or transferring via e-mail.

13.8 VIDEO FILES In order to record dynamic changes in living cells, video records can be captured. Frames are captured at a specified interval, and a time-lapse sequence is generated. Such a technique is called time-lapse video microscopy. However, video actually refers to analog magnetic tape capture at 30 frames/s. Thus, it may be more accurate to describe digital motion picture capture from the microscope as digital cinemicro- graphy rather than digital video. However, digital video microscopy persists as a standard term. Video microscopy is used when the details of a series of events are required for analysis. Temporal analysis (relative to some fiduciary, such as a cell cycle tran- sition event like nuclear envelope breakdown, or anaphase onset) or a terminal phenotype determination (cell division, cell death, cell movement) makes video 330 CHAPTER 13 Use of Digital Image Files in Light Microscopy

FIGURE 13.3 The effect of JPEG compression on image quality. Two cells labeled with a nuclear stain were imaged using a fluorescence microscope and saved as a TIFF file using . The file was then converted to a grayscale TIFF or JPEGs using a range of compression settings (maximum, high, medium, and low). Top panels show the original and converted micrographs, bottom panels show a 3D image intensity graphic of the bitmap. Notice that the image does not appear degraded, and that the image intensities for the original and converted images does not appear degraded until the lowest JPEG setting is used.

files particularly important. While there is a current emphasis on fluorescence mi- croscopy, phase contrast and DIC imaging modes work great with video micros- copy, and video microscope systems are easy and cost effective to assemble (see Durcan et al., 2008; Hinchcliffe, 2005; Salmon et al., 1998; Shaw et al., 1995). The file format(s) used to store these digital motion picture sequences are in es- sence a series of raster graphics files, but with significant features. The most impor- tant are key frames and codecs (compression/decompression routines). Features that 13.9 Video Codecs 331

are common to motion picture (movie) file formats include the ability to change im- age size, frame rate, bit depth, and codecs. Often, file formats are defined by the codec that they use (like Moving Picture Experts Group, MPEG or H.264). AVI is considered the video standard for Windows. It is a special case of the Resource . AVI is defined by Microsoft and is the most common format for audio/video data on the PC. AVI is an example of a de facto standard. For more information, see http://www. jmcgowan.com/avi.html. QuickTime Apple’s video format, it also works well for PCs. This file type is well suited to editing and has similarities to the MP4 file format. MPEG MPEG is a version of JPEG for motion picture that allows significant compression of video files. MPEG makes extensive use of compression key frames, and therefore, requires more processing time. MPEG-1, layer 3 is an that provides significant compression of audio files. These files are known as MP3. MPEG-4 is the standardized format for DVDs. MPEG-4/part 14 or MP4 is the latest version of an ever-evolving group of file formats and specifications http://mpeg.chiariglione.org/. TIFF sequence This gives the ability of TIFF files to play as a motion picture sequence. The quality of TIFF sequences (or TIFF stacks) makes them particularly suited for quantitative analysis. However, this does introduce size limitations: the file size of TIFF stacks can be very large.

13.9 VIDEO CODECS Because motion picture file formats have the potential to be very large (current video files in our lab are reaching 10s of gigabits), there is a great deal of emphasis on com- pression of the motion picture information. Video files present unique problems when being compressed. The image changes over time. Thus, there must be compres- sion within an individual frame (spatial compression) just as in a conventional graphics file. In addition, the compression routine must have the ability to find sim- ilar regions within the images of the series as they change over time (called temporal compression). In digital video, there are three interactive features of compression routines that need to be dealt with: (i) compression of the information—for storage; (ii) decompression of the file—to allow viewing of the movie; and (iii) compression 332 CHAPTER 13 Use of Digital Image Files in Light Microscopy

key frames—signposts placed throughout the video file that allow the program to compare changes from frame to frame and minimize the amount of data that needs to be stored in the first place (see below). Codecs can be symmetric or asymmetric. In a symmetric codec, compression and decompression occur at the same rate. Asymmetric codecs take more time to com- press than decompress. This has an advantage in playback, but requires more time during video production. Central to any codec is the use of compression key frames. In a video sequence where very little changes (such as in many cinemicrography ex- periments), the computer will use unchanged regions of the image from frame to frame, and only have to describe the new (changing) regions. The compression rou- tine references each frame on the previous one. When the scene changes entirely, a new reference frame must be generated. These reference frames are called key frames. Codecs insert key frames at varying intervals, and some codecs allow key frames to be inserted manually. For the video microscopist, key frames only come into play when the scene rapidly changes (a switch to a different imaging contrast mode during the experiment). Otherwise, the key frames specified by the codec can usually handle subtle changes. A unique problem arises when video clips from different sources (and clips orig- inally produced with different codecs) are pieced together into a final movie. If the final output is then saved with compression again, the clip is said to be recompressed. This does not provide any saving in file size and usually leads to degradation of the image, often in unpredictable ways. In order to ensure that video files are not recom- pressed, it is best to save an image sequence without compression, and only introduce a compression routine when the final movie is constructed. It is important to note that video files require the proper codec to be decoded, that is, readout. As video codecs are constantly evolving, older files either need to be con- verted to a new format, or legacy codecs need to be maintained. Otherwise, video files can be rendered useless. Many older codecs can be found on the web, but it is a good idea to archive them, along with important video files, for future use. There are too many codecs available to list here. However, one—H.264/MPEG-4 part 10 or —is the current standard for BluRay disks and was developed by the ITU Telecommunication Standardization Sector (http:// www.itu.int/en/ITU-T/Pages/default.aspx). This has become the default codec for generating QuickTime movies in many commercial imaging software packages.

13.10 CHOOSING A CODEC There are a wide variety of video codecs available, and many of them are standard components of the Windows or Apple operating systems. Other codecs are provided as part of commercially available video editing programs, such as Adobe Premiere, Apple QuickTime, or Final Cut. Most commercial and freeware digital imaging soft- ware packages have the ability to output image sequences as AVIs or QuickTime movies. These are just as often designed to use one particular codec (usually 13.10 Choosing a Codec 333

H.264). Finally, there are codecs that are designed to work with a specific software application or as part of hardware-based compression. Each of these compression routines is designed for a specific purpose, and there is no one best codec for video use. In order to optimize the output of digital cinemicrography, it is important to em- pirically determine which codec will work for a particular application. What follows is a simple, step-by-step protocol for determining the suitability of a particular codec for an individual application.

1. Identify that program which will be used to play the final sequence (i.e., will this movie be for presentation in Microsoft PowerPoint, for playback from the web, or as a movie for temporal analysis in the lab). The final output program will determine which codec will work best. 2. Select a short sample movie to use as a test. This movie should be a clip taken from a candidate sequence of the type to be displayed (i.e. time-lapse of GFP or phase contrast). Match the bitmap dimensions to the output program (i.e. at least 640480 for videos, 320240 for web applications). These changes are made in the video editing software (see documentation provided with this software). The test clip should show examples of the type of detail needed in the final movie, but should be on the order of 5–40 MB (depending on the computer used). The small file size will facilitate rapid compression and playback. It is important that this test clip should be made from a sequence that was not previously compressed, otherwise recompression will occur. 3. Using a video editing program (such as Adobe Premiere or Apple QuickTime), convert the clip to a compressed form using a specific codec. For each codec, compress the clip with a range of compression settings (often referred to as “quality” setting) from best to worst. These setting are often represented as a number from 1 to 10 (10 being the highest quality and least compression). Alternatively, the quality setting may be a percentage (100% being the best quality and least compression). Start with four separate setting 100%, 50%, 25%, and 5%. Note the initial file size for the clip and the file size after compression, along with the time it takes to compress the file for each setting. 4. Open the resulting clips in the final output program (such as PowerPoint) and play each clip back, as it will be for the final presentation. Look for pixelation (indicative of too much spatial compression) or jerky play (too much temporal compression). Note the lowest setting which still provides an acceptable image. 5. For each setting, compare the four separate values for compression of this file: (i) degree of compression (change in file size from uncompressed to compressed), (ii) time of compression, (iii) quality of the image, and (iv) quality of the playback. 6. Repeat using another codec. By comparing the four criteria for a range of settings for each codec, the optimal codec and settings for a particular sequence file type can be found (Fig. 13.4). The trade-off is file size (storage) versus file quality (playback). The time it takes to compress the image is secondary, but does impact 334 CHAPTER 13 Use of Digital Image Files in Light Microscopy

FIGURE 13.4 Selecting the appropriate compression/decompression routine (codec). A series of frames from a time series of a mitotic BSC-1 cell expressing a-tubulin-GFP and imaged with spinning disk confocal microscopy. This cell has assembled a tetrapolar spindle and proceeds through anaphase. This sequence was saved as a SlideBook file, with a final file size of 7.8 MB. The file was then saved using two different codecs. (A) Frames from the sequence saved as a QuickTime using H.264 (100% setting) and (B) as an AVI using the Intel 5.10 codec, and a range of compression settings. Compression settings are: (B) 100%, (C) 50%, and (D) 25%. Resulting file size for the entire compressed movie is shown in the right. There is little or no image degradation using H.264 compression. In the Indeo 5.10-compressed AVI files, there is noticeable degradation of the image, particularly, in the dark regions of the background.

the ability to manipulate the digital motion picture sequences. Remember, different codecs will be optimal for different file types. It is best to empirically determine the best codec for each sequence type (i.e., contrast mode or model system).

13.10.1 Real results Using the protocol outlined above, a real cinemicrography digital file was generated and subjected to compression using two separate codecs, H.264 and Intel Indeo 5.10. For H.264, the highest quality was used, but this results in a fairly small file size. For Indeo 5.10, three different quality settings used employed (100%, 50%, and 25%). Acknowledgments 335

The sample is a BSC-1 cell expressing a-tubulin-GFP (Hornick et al., 2008, 2011; Fig. 13.4). This cell was imaged using a Leica DM RXA2 microscope (Leica Microsystems, Deerfield, IL), equipped with a Yokagawa CSU-10 spinning disk, a Hammamatsu 9100 EM-CCD camera (Hammamatsu Photonics, Bridgewater, NJ), and SlideBook software (Intelligent Imaging Innovations, Denver, CO). The result- ing AVI file was 31 frames, was saved without compression and ended up 7.8 MB in size; each frame being 512512 pixels, and 16 bit. The times it took to compress each movie file were measured: they were all about 1 min. The movie files were then analyzed for quality. An series of select frames from each compression routine is presented in Fig. 13.4. For the H.264 codec, the 100% setting resulted in a file size of 615 KB, which is a compression of 12.5 times over the original cropped movie! Using Indeo Video 5.10, the 100% setting resulted in a file that is 750 KB, a com- pression of 10.4 times the original cropped file. In the case of Indeo Video 5.10, the 50% setting did not result in significant image degradation and yielded a file of 150 KB, a compression of five times that of the 100% setting. Further compression with this codec to 25% only trimmed 30 KB of the image size. Thus, for this movie file, 50% compression with Intel Indeo Video 5.10 gives the smallest file size a whopping 52 compression! However, close inspection reveals significant image artifacts in the Indeo-compressed files. The H.264 codec does not generate these artifacts.

CONCLUSIONS With the rebirth of light microscopy as an analytical and quantitative tool, the use and manipulation of digital graphics files has become essential for the cell/molecular bi- ologist. Digital imaging has largely replaced 35-mm photography as a way to record micrographs. The basics of computer imaging can be mastered in little or no time. When used properly, digital image files allow for quantitative measurements of cel- lular activities. Proper use entails generating files with high bit depth (16 bit), and saving the files uncompressed. Images with lower bit depth (8 bit) can be used for presentation, and these files can be saved with compression to facilitate easy shar- ing and use in presentations.

Acknowledgments We thank Katie Buchanan, Bill Burnip, Rich Cardullo, Paul Goodwin, Paul Jantzen, Karl Kil- born, Colin Monks, and Dee Sharma for providing helpful comments on the presentation of this material during the Analytical and Quantitative Light Microscopy (AQLM) course in Woods Hole. Both S. L. S. and E. H. H. are graduates of the 1995 AQLM course, and we would like to thank Dr. Ken Spring for his insight and humor during that course. Work in the authors’ labs is supported by research grants from the National Science Foundation and National In- stitutes of General Medicine. 336 CHAPTER 13 Use of Digital Image Files in Light Microscopy

References Bertrand, C. A. (2001). Color by numbers: Imaging large data. Science, 293, 1335–1336. Cardullo, R. A., & Hinchcliffe, E. H. (2007). Digital manipulation of fluorescence images: Noise reduction, contrast enhancement, and feature extraction. Methods in Cell Biology, 81, 318–340. Durcan, T., Halpin, E., Rao, T., Collins, N., Tribble, E., Hornick, J., et al. (2008). Tektin 2 is required for central spindle microtubule organization and the completion of cytokinesis. The Journal of Cell Biology, 181, 595–603. Furness, P. (1997). The use of digital images in pathology. Journal of Pathology, 183, 253–263. Hinchcliffe, E. H. (2005). Using long-term time-lapse imaging of mammalian cell cycle pro- gression for laboratory instruction and analysis. Cell Biology Education, 4, 284–290. Hinchcliffe, E. H., & Sluder, G. (2003). Do not (mis-) adjust your set: Maintaining specimen detail in the video microscope. Methods in Cell Biology, 72, 65–85. Hornick, J. E., Bader, J. R., Tribble, E. K., Trimble, K., Breunig, J. S., Halpin, E. S., et al. (2008). Live-cell analysis of mitotic spindle formation in taxol-treated cells. Cell Motility and the Cytoskeleton, 65, 595–613. Hornick, J. E., Mader, C. C., Tribble, E. K., Bagne, C. C., Vaughan, K. T., Shaw, S. L., et al. (2011). Amphiastral mitotic spindle assembly in vertebrate cells lacking centrosomes. Current Biology, 21, 598–605. Inoue, S., & Spring, K. R. (1997). Video microscopy: The fundamentals (2nd ed.). New York: Plenum Press, 741. Jaqaman, K., Loerke, D., Mettlen, M., Kuwata, H., Grinstein, S., Schmid, S. L., et al. (2008). Robust single-particle tracking in live-cell time-lapse sequences. Nature Methods, 5, 695–702. Kay, D. C., & Levine, J. R. (1992). Graphics file formats. Pennsylvania: Windcrest/McGraw- Hill Blue Ridge Summit, 278. Linkert, M., Rueden, C. T., Allan, C., Burel, J.-M., Moore, W., Patterson, A., et al. (2010). Metadata matters: Access to image data in the real world. The Journal of Cell Biology, 189, 777–782. Salmon, E. D., Shaw, S. L., Waters, J., Waterman-Storer, C. M., Maddox, P. S., Yeh, E., et al. (1998). A high-resolution multimode digital microscope system. Methods in Cell Biology, 56, 185–215. Schneider, C. A., Rasband, W. S., & Eliceiri, K. W. (2012). NIH Image to ImageJ: 25 years of image analysis. Nature Methods, 9, 671–675. Shaw, S. L. (2006). Imaging the live plant cell. The Plant Journal, 45, 573–598. Shaw, S. L., Salmon, E. D., & Quatrano, R. (1995). Digital photography for the light microscope: Results with a gated, video-rate CCD camera and NIH-image software. Biotechniques, 19, 946–955. Thomas, C., DeVries, P., Hardin, J., & White, J. (1996). Four-dimensional imaging: Computer visualizations of 3D movements in living specimens. Science, 273, 603–607. Walczak, C. E., Rizk, R. S., & Shaw, S. L. (2010). The use of fluorescence redistribution after photobleaching for analysis of cellular microtubule dynamics. Methods in Cell Biology, 97, 35–52. Waters, J. C. (2009). Accuracy and precision in quantitative fluorescence microscopy. The Journal of Cell Biology, 185, 1135–1148. Wiley, H. S., & Michaels, G. S. (2004). Should software hold data hostage? Nature Biotech- nology, 22, 1037–1038.