Documentation for NIH Image coloc Last revised on June 15, 1999 This set of macros was designed to perform colocalization analysis of confocal microscope images of immunofluorescently labeled clusters of synaptic vesicle protein (SVP) with a population of axons labeled with a neuronal tracer. Although this particular application of the colocalization procedure is described in the following documentation, the method may be useful for performing colocalization analysis of stacks of optical sections of other material as well. A justification for the use of this object-based procedure instead of simpler analyses as well as a discussion of the more theoretical aspects of the procedure can be found in Silver, M.A. and Stryker, M.P. "A method for measuring colocalization of presynaptic markers with anatomically labeled axons using double label immunofluorescence and confocal microscopy", submitted April, 1999. This program will run on a Macintosh (PowerPC or later). It is a customized version of the public domain NIH Image program version 1.61 (developed at the U.S. National Institutes of Health and available on the Internet at http://rsb.info.nih.gov/nih-image/) This document assumes a working knowledge of NIH Image. If you are not familiar with NIH Image, documentation is available at http://rsb.info.nih.gov/nih-image/manual/contents.html The Image Processing Handbook, by John Russ, is an excellent introduction to image processing techniques. It is published by CRC Press (Boca Raton, FL). To start, you should have two stacks of images that correspond to stacks of optical sections collected on a confocal microscope. The stacks should each contain at least three slices, and the image type should be TIFF. One stack contains images of the synaptic vesicle protein label (referred to as the SVP stack), and the other contains images of labeled axons (referred to as the axon stack). The images should have dark signal (high pixel intensity values) against a light background (low pixel intensity values). If your images have light signal against a dark background, simply invert them. The procedure is designed to analyze only one slice in a pair of stacks. This focal plane of interest is called the reference slice, and colocalization in three dimensions will be performed by comparing pixel values in the reference slice to the slice immediately above and immediately below this reference slice. If you want to analyze more than one slice, the easiest way to do this is to run through the procedure again with the same pair of stacks but choose a different slice as the reference slice. Load the colocalization macros file. If you then pull down the Special menu, you will see a set of ten additional commands. Each of these ten commands can also be executed by pressing the appropriate function key (for example, key F1 will execute Trace Cell Bodies). The first step is to remove the cell bodies, blood vessels, and other portions of the field that do not contain synapses from consideration. It is only appropriate to make quantitative measures of synaptic density in the regions of the field that contain synapses, i.e., the neuropil. The percentage of the field that contains cell bodies will vary from section to section, and this variability can be eliminated by masking the pixels located within cell bodies, blood vessels, etc. and excluding them from further analysis. To accomplish this, open the SVP stack and select the slice that you have chosen for colocalization analysis (the focal plane of interest). Execute the Trace Cell Bodies macro. This will open a window containing the SVP label and automatically select the pencil tool. Using the pencil tool, trace all the portions of the field that you wish to mask. All traced regions must be completely closed loops (including regions that extend to the borders of the field). If you need to use the magnifying glass tool to zoom in on part of the image, simply reselect the pencil tool and continue tracing. Next, to mask the cell bodies, execute the Remove Cell Bodies macro. This will create a window that contains only the masked regions. A dialog box will appear which prompts you to provide a name for saving this image to disk. The intensity values for the pixels within the masked regions in the original image will then be set to zero, and the number of pixels contained within those regions will be stored by the program for future reference. Now you want to threshold the image. Thresholding allows separation of the signal from the background and is also a first step towards segmenting individual presynaptic sites from one another. The threshold should be a constant percentage of pixels in the neuropil (not in the entire image). For example, let's say you want to threshold the top 10% of the pixels and your image contains 400,000 pixels. However, only 300,000 of these pixels are located in the neuropil (100,000 were located in cell bodies, etc. and were masked by the Remove Cell Bodies macro). In this case, you will want to keep only those 30,000 pixels in the masked image that have the highest intensities. When you execute the Threshold macro, it will ask "How many pixels to be excluded?" The default is the number of pixels that you have masked during the removal of the cell bodies, blood vessels, etc. You will also be prompted to choose a percentage of neuropil pixels to be included above threshold. If you will be quantitatively comparing the amount of colocalization in different pairs of images, the threshold should be the same for all images that are being compared. The value of the threshold should be low enough so that most of the clusters of SVP label located in the reference slice are above threshold. However, it should not be so high that many of the clusters form large contiguous regions that will be very time consuming to segment from each other. Because there are variations of signal intensity between slices in a stack that are often not due to biological causes (differential penetration of antibody, photobleaching, light scattering, etc.), it is only appropriate to compare absolute intensity values in adjacent focal planes if these sources of variability can be removed. The macro to do this is called Match Histograms. Given a reference slice, the macro reassigns the intensity values of the pixels in the slices above and below the reference slice without changing the rank ordering of the pixels. After the macro is finished, the pixel intensity histograms of all the sections in the stack are identical to the histogram of the reference slice. This macro can take a few minutes to run (depending on the image size and the speed of the computer). You should save the stack of matched slices as they will be used later in the procedure. The only reliable method I have found to identify the portion of labeled axons that are located in the reference slice is to trace them manually. The macro called Trace Axons functions like the Trace Cell Bodies macro. Open the axon stack and then execute Trace Axons. Use the pencil to trace the portion of each axon branch that is located within the focal plane of interest (corresponding to the reference slice in the SVP stack). To exclude portions of the axons that are located above and below the focal plane of interest, move up and down through the slices of the stack (using the < and > keys) and only trace that part of the axon branch that has the most signal in the focal plane of interest. All traced axon segments need to be completely closed loops. Now execute Fill Axons. This macro will produce a single binary image in which the traced segments of axon branches are black (pixel value of 255) and all other pixels in the image are white (pixel value of 0). Save this image to disk. Although the thresholding procedure should effectively separate many of the presynaptic sites from one another, there will still be some neighboring clusters of synaptic vesicle protein label which are above threshold and form one contiguous object. These synapses need to segmented from each other so that colocalization analysis can be done on them as distinct objects. Since the majority of SVP label will be in regions of the reference slice that do not contain any labeled axon segments (and therefore have no chance of being colocalized with labeled axons), only those clusters of SVP label that are partially overlapping with labeled axon segments in the reference slice need to be segmented from one another. Open the SVP stack that was the output of the Match Histograms macro. Select the reference slice (using the < and > keys) and then execute Seed Synapses. The macro will prompt you to find the binarized axon image on disk. It will then create an image in which the SVP label is unchanged, but the axons are transparently overlaid on it and represented as green. This allows you to segment only those presynaptic sites that have some chance of being colocalized with the labeled axons. Using the pencil tool (which will draw in red), place a seed pixel into the center of each synapse that you want to test for colocalization. Unless your images are collected at very high magnification, you will probably want to zoom the image so that you can accurately place the seed pixel. After all of the seed pixels have been placed, execute Expand Seeds. This macro will radially expand these single pixels (also known as an iterative dilation) until they reach the boundary defined by the thresholding procedure or until they collide with an expanding seed pixel from an adjacent synapse. In this case, a one pixel wide boundary is drawn between the synapses, thereby segmenting them. This macro may take a few minutes to run. When it is finished, you will have the original post-Match Histograms stack, but the reference slice will only contain those expanded synapses that had a seed pixel placed in them. Now you are ready to do the colocalization. To be counted as colocalized, a presynaptic site must 1) be located in the reference slice, and 2) be located in an axon segment that has been identified by the Trace Axons macro. You can think of this as colocalization in the z-axis and the xy- plane, respectively. To decide whether the segmented presynaptic sites are located in the reference slice, execute the Determine Focal Plane macro. For each segmented synapse in the reference slice, the macro will compare the pixel intensities of the above threshold pixels in the reference slice to the intensities of the corresponding pixels in the slice located above the reference slice and then to the slice located below the reference slice. If the average pixel intensity is highest in the reference slice for a given segmented presynaptic site, the synapse is considered to be located in the reference slice and it is retained. If the average pixel intensity is higher above or below the reference slice, the synapse is probably not located in the reference slice. In this case, the signal that is present in the reference slice is due to out-of-focus scatter, and the synapse is eliminated from further analysis. The next step is to see if the presynaptic sites are located inside of axons. This is accomplished by the macro named Colocalize. When this macro is executed, you are prompted to locate the binarized axon image on the disk. You then need to input the colocalization stringency ("Minimum percentage colocalization?"). A value of 50 means that a given presynaptic site must have at least 50% of its pixels located within a binarized axon segment to be counted as colocalized. A value of 100 means that every pixel in the presynaptic site must be contained within a binarized axon segment. A parametric study of colocalization stringency showed that a colocalization stringency of 100% allowed for the optimal combination of elimination of false positive colocalizations and retention of actual colocalizations. Another way to think of this is that the signal-to-noise ratio was highest for a colocalization stringency of 100%. These data are presented in the manuscript by Silver and Stryker cited at the beginning of this document. You will also be prompted to set a minimum size criterion. This can serve to eliminate spurious colocalizations due to pixel noise. The criterion will depend on the pattern of SVP labeling in your tissue as well as the magnification used to collect the image. In general, your size criterion should approximate the size of the smallest presynaptic sites. Only those presynaptic sites which have a percentage of pixels within a binarized axon segment that is above threshold and which meet the size criterion will be retained and considered to be colocalized. The final output of the procedure is a single image called "colocalized particles" that contains the colocalized segmented thresholded presynaptic sites with their original pixel intensity values and all other pixel intensities set to zero (white). How you quantify the properties of your colocalized synapses is up to you. The Analyze Particles command in NIH Image allows for many quantitative measurements to be made on segmented objects. You may want to include the area, mean intensity, and x and y location of the colocalized synapses. In the final analysis, you will probably want to include normalization factors for 1) the amount of axon labeling in the field, and 2) the overall amount of SVP signal in the field. One example of how to do this is in the Silver and Stryker manuscript mentioned at the beginning of this document. If you have any questions or encounter any bugs while running this program, I would appreciate hearing about them at silver@phy.ucsf.edu Michael Silver Neuroscience Graduate Program University of California, San Francisco