Automated Segmentation and Morphometry of Cell and Tissue Structures. Selected Algorithms in ImageJ

This chapter covers selected aspects of the segmentation and measurements of spatial or temporal features (i.e. morphometry) of biological objects in biomedical (non-optical)1 and microscopic images. The term measurement refers to a succinct quantitative representation of image features over space and time. This implies the application of the act of geometric measurement to the raw imaging data, i.e. "morphometry". Measurements arise in a defined experimental context.


Introduction
This chapter covers selected aspects of the segmentation and measurements of spatial or temporal features (i.e. morphometry) of biological objects in biomedical (non-optical) 1 and microscopic images. The term measurement refers to a succinct quantitative representation of image features over space and time. This implies the application of the act of geometric measurement to the raw imaging data, i.e. "morphometry". Measurements arise in a defined experimental context.

Information complexity aspects
The life science experimentation strives to answer defined research questions via quantitative analysis of multiple experimental trials. This process can be described by a workflow 2 which starts by defining the research hypotheses or questions (Fig. 1). During the last stage the images are transformed into measurements, which are finally interpreted in the light of the original research question (Fig. 1).
A substantial decrease of the volume of output data occurs at each step of the so-described processing workflow. In contrast, this decrease is translated into an increase of the complexity of generated information (e.g. derived data). For example, if one takes a microscopic image representing a cell and measures its shape, then the raster image data (supposedly a matrix of width x height) transforms into a set of shape parameters, each one having a different semantic context (for example, neurite length, orientation, cell size). While in the raster data set the biological object is only implicitly present, in the derived data the representation of at least one attribute of the object under study is explicitly constructed (for example, the cell size). At this stage, the explicit information contained in the raw image about the illumination and staining distribution is lost. Therefore, the process of object (i.e. pattern) recognition and reconstruction is accompanied by irreversible reduction of the input information. At each step of the workflow the information in the previous step is transformed into contextual data, 1 The bioluminescence imaging methods will not be discussed here. 2 A workflow provides an abstracted view over the experiment being performed. It describes what procedures need to be enacted, but not necessarily all the details of how they will be executed.  Upon completion of the manipulations, the final specimens are collected and the raw data are acquired. Subsequent process of analysis leads to a decrease of the volume of the input data and an increase in their structural complexity.
called meta data. In such manner, the information complexity increase is also mapped to an increase of the complexity of the data structure.
Measurements, therefore, are reduced representations of the image features of interest, which have higher information complexity compared to the raw data. Due to the irreversible information loss introduced by the process of measurement, in order to be able to replicate the measurements given the original data, one needs an instance of the applied algorithm. Therefore, measurements are only implicitly "present" in images.

Biomedical imaging modalities
Processing and extraction of information from images have become indispensable aspects of the experimental workflow in life science research. Two major branches of imaging methods in life sciences can be discerned: microscopic imaging and biomedical imaging 3 .
Biomedical imaging integrates aspects of medicine, medical physics, biomedical engineering, and computer science. Notably, pre-clinical imaging comprises an assembly of techniques exploiting different physical modalities 4 : (i) micro-ultrasound, (ii) micro Photoacoustic tomography µPAT, (iii) micro Magnetic Resonance Imaging µMRI, (iv) micro Computed Tomography µCT, (v) micro Positron Emission Tomography µPET and (vi) micro Single Photon Emission Computed Tomography µSPECT. 3 The biomedical imaging can be narrowly defined as an assembly of imaging methods developed for the study of human disorders and diseases for the purposes of mechanism characterization and development of treatments in model organisms, i.e. pre-clinical imaging. 4 Since most of the work with animal models is done in rodent species the mirco aspect of the techniques is emphasized.

Drivers for biomedical imaging software development
The continuous improvement of biomedical imaging hardware enables development of novel imaging methods for acquisition and visualization. Novel imaging techniques progress in 3 main aspects: improvement of the signal-to-noise ratio, improvement of the spatial resolution, or adding new physical modalities to images. In microscopy, examples of the former can be given in laser scanning confocal (van Meer et al., 1987;White et al., 1987), spinning disc confocal (Nakano, 2002), wide-field deconvolution (Hiraoka et al., 1987) and multiphoton microscopes (Denk et al., 1990) ubiquitously used in cell and developmental biology. In non-optical imaging for example, the resolution in µMRI reached the order of 150 um, while different super-resolution microscopic approaches brought up the spatial resolution of microscopes to the order of 100 nm. Images having more than 3 dimensions (i.e. 3 spatial plus time, wavelength, orientation, decay times, etc) have become ubiquitous in biomedical imaging and life science microscopy.
Some examples can be also given in time-lapse microscopy, confocal microscopy (Canaria & Lansford, 2010), hyperspectral imaging (Marcsisin et al., 2010) and non-invasive imaging, such as MRI and PET. For example, contemporary tract reconstruction techniques in MRI require computations on 5D image datasets, representing position and orientation (Jonasson et al., 2005). As a result, developing novel image processing, data mining and database tools gained an increasing focus in the scientific community (Peng, 2008).

Biomedical imaging software
Each step of the experimental workflow typically requires the use of different hardware and software tools. Ideally, obtained raw data should be directly available for use in other applications either by remote instrument read-out or by transfer of the data upon application request. However, such ideal situation is far from reality and is inherently restricted by the heterogeneity of meta data describing different experiments. Other impeding factors are the limited interoperability between equipment vendor applications and the frequent incompatibility between proprietary data storage formats. As a result, the field of biomedical imaging suffers from considerable segmentation. There are numerous proprietary and open-source software products.

Proprietary software
Proprietary software for pre-clinical imaging is usually distributed with the specialized data acquisition hardware, such as MRI or PET scanners. Without being exhaustive, we could give several examples: The Paravision R package of Bruker is used to operate the Biospin TM MR scanner. The software performs image reconstruction, 3D visualization of the reconstructed images, computation of parametric image maps and morphometry. The IMALYTICS R package of Philips is used to analyze ultrasound, PET, CT, SPECT and MRI images (Fischer & Paulus, 2010). The package is targeted at the pharmaceutical industry and provides project-based workflows, rigid registration, segmentation and visualization. Advanced options are non-rigid registration, pharmacokinetic modeling and analysis of SPECT data.

185
Automated Segmentation and Morphometry of Cell and Tissue Structures. Selected Algorithms in ImageJ www.intechopen.com Amira is a general purpose package for imaging data rendering and 3D modeling and analysis. Among its processing capabilities can be included image filtering, segmentation, registration and morphing, deconvolution and tensor computation. Among its measurement capabilities can be included spatial measurements, densitometry, co-localization and statistics. Its functionality to an extent matches the one offered by the Fiji distribution of ImageJ.
Pre-clinical imaging systems usually do not comply with any specific standard regarding raw data storage. In contrast, each manufacturer usually develops a proprietary storage format, which makes it difficult to share data and distribute data processing efforts.
In the field of imaging for microscopy there are also several powerful commercial systems distributed by the microscopic equipment manufacturers; for example the AxioVision TM and ZEN TM systems of Carl Zeiss (Germany) or the Cell-R TM system of Olympus (Japan). They all provide image processing and measurement features to a varying extent. The most-popular specialized morphometry software packages are listed in the paragraphs below: Huygens is a package specialized in deconvolution, rendering and visualization developed by Scientific Volume Imaging, The Netherlands. Its advanced characteristics include estimation of the 3D point spread function from images and simulation of microscopic image formation. Image-Pro Plus is a package specialized in 2D and 3D image processing, enhancement, and analysis developed by Media Cybernetics, USA. Among its advanced capabilities can be counted image fusion, extended depth of view, object tracking, thresholding of color images and morphological segmentation. Its functionality closely matches the one developed in ImageJ. Imaris is a package for image rendering and visualization of 3D and 4D microscopy datasets of Bitplane Scientific Software, Switzerland. Its advanced capabilities include object fusion, illumination, segmentation and volume rendering. Its functionality to an extent matches the one offered by the Fiji distribution of ImageJ. MetaMorph is an advanced system for image processing and morphometry developed by Molecular Devices, USA. The advantages of the system include different filtering and segmentation algorithms and the integration between measurements and display of results. Its functionality closely matches the one developed in ImageJ. Volocity is a package of PerkinElmer (USA) for microscopic image rendering, interactive exploration, and analysis. Among the analysis options can be included colocalization, ratioed images, Fluorescence Recovery After Photobleaching (FRAP) and Fluorescence Resonance Energy Transfer (FRET). Its functionality closely matches the one offered by the McMaster's distribution of ImageJ.
In addition, general purpose data-processing languages, such as IDL R (ITT Visual Information Solutions, USA) and Matlab R (The Mathworks Inc, USA) computational environments are also used by the community.
A substantial and usual shortcoming of proprietary software is that the researcher is forced to use the offered package as a black box. In contrast, open-source implementations allow the researcher to critically examine the used approaches and the correctness of the implementation. Due to this, open-source solutions typically have faster development cycles including faster bug fixing. Consequently, to the authors' understanding they are preferable for development of new image processing and morphometric algorithms.

Open source software
There are numerous open-source programs for biomedical image processing. This can be attributed in part to the fact that in the past every imaging center developed its own analysis tools. Traditionally, many image processing algorithms were developed in C or C++. Attempts to overcome the fragmentation of the field of C/C++ programs were funded in 1990s by NIH in USA, which lead to the development of the general-purpose platforms for image visualization -VTK (Visualization Toolkit), and image registration and filtering -ITK (Insight Toolkit) which are currently supported by Kitware Inc (Ibanez et al., 2005). Both sets of libraries are implemented in C++ and require sophisticated building systems. However, their use in life-science microscopy is very limited.
While C/C++ platforms dominated the field before the year 2000, the evolution of Java and the continuous improvement of its performance in the last 10 years made it a language of choice for scientific software. Among the advantages of Java can be counted its portability across platforms; the richness of the available functionality; the extended user base including academic, commercial and community end-users and developers; its automated multi-threading and its object-oriented architecture.
The analysis packages having more extensive functionality are listed in Table 1 (Ciliberti, 2009

Analysis suites
BioImage Suite provides image editing, voxel classification, deformable user-interactive segmentation, rigid and non-rigid registration, modules for Diffusion Tensor Imaging (DTI) analysis and General Linear Model (GLM) functionality for fMRI analysis (Papademetris et al., 2008). Seg3D is a volume segmentation and processing tool, which is distributed under the MIT License and is developed by the NIH Center for Integrative Biomedical Computing at the University of Utah. The data are organized in multiple layered volumes supporting either manual or filter-based segmentation and annotation. 3D Slicer is a software package for visualization and image annotation (Pieper et al., 2004).
Present versions of 3D Slicer provide a workflow engine, command-line and GUI interfaces and scripting. The packages is distributed under BSD-style license. Mango is a Java 3D-based program which supports image registration, surface rendering and analysis (statistics and profiling) (Lancaster & Martinez, 2007). It also provides extensibility via plugins and high level API.

187
Automated Segmentation and Morphometry of Cell and Tissue Structures. Selected Algorithms in ImageJ www.intechopen.com FSL is a set of command line and GUI image analysis and statistical tools for fMRI, structural MRI and DTI analysis (Smith et al., 2004). FSL is written mainly by members of the Analysis Group, FMRIB, Oxford University, UK. It is distributed under non for profit use license.

Specialized tool-sets
Among the specialized tools, two main application areas can be discerned: DTI analysis and fMRI.
Diffusion Tensor Imaging -MedINRIA is a program based on VTK and ITK, which is developed by INRIA in France (Fillard et al., 2009). It is specialized in DTI and fiber tracking, tensor visualization and image registration. fMRI -SPM is a software package designed for the analysis of brain imaging data sequences.
The sequences can be a series of images from different cohorts, or time-series from the same subject. The current release is designed for the analysis of fMRI, PET and SPECT data. SPM is developed by the Functional Imaging Laboratory at University College London, UK (Ashburner et al., 2010). It is based on the proprietary MATLAB R (The MathWorks, Inc) environment. The FreeSurfer program provides reconstruction of the brain cortical surface from structural MRI data, and overlay of functional MRI maps. CARET is a software program for the structural and functional analysis of the cerebral and cerebellar cortex. The name is an abbreviation from Computerized Anatomical Reconstruction Toolkit. AFNI is an environment for processing and displaying functional MRI data 5 .

ImageJ in the big picture
ImageJ is a public domain image processing program written in Java. Since its inception in 1997 ImageJ has evolved to become a standard analytical tool in life science imaging. It has an open architecture providing extensibility via 3 rd party Java modules (called plugins) and scripting macros. It is developed by Wayne Raspband since 1997 and expanded via contributed software code by an international group of contributors (Abramoff et al., 2004;Collins, 2007). Plugins are distributed together with their source code under various licences determined by the pluing authors. Occasionally, some plugins are included in the main body of the program.
ImageJ supports a large number of file formats either natively or through the plugin extensions, for example using the Bio-Formats library 6 .
There are several popular plugin distributions and collections. The most popular distributions are listed in the next paragraphs: NIH's plugin collection is historically the 1 st plugin collection. It is hosted on the ImageJ web site itself 7 . Main categories include acquisition, analysis, color processing, filters, segmentation, graphics, input/output, stacks, utilities and links to developers's sites. Fiji is a plugin distribution aimed at microscopic applications in Neuroscience. It is developed and maintained since 2008 with the support of the Max Planck Institute of Molecular Cell Biology and Genetics (MPI-CBG), Dresden, Germany. The collection includes plugins and libraries for neurite tracing (Longair et al., 2011), 3D reconstructions, trainable interactive segmentation (Schindelin, 2008) and mathematical morphology . It also comes with several additional scripting engines such as Jython and JRuby and Java enhancements like Java 3D. Every plugin included in the collection has a user manual. The McMaster's University plugin collection 8 is aimed at fluorescent microscopy applications. There are specialized plugins for collocalization analysis, spectral and iterative deconvolution for image denoising (Dougherty, 2005) including parallel implmentations 9 . The distribution includes a user manual. The CRP Tudor's plugin collection is structured around the documentation Wiki web site 10 and is hosted and maintained with the support of the Public Research Centre Henri Tudor, Luxembourg. It is a general purpose collection. Different categories include: filtering, color processing, morphometry and processing, segmentation and others. Every plugin included in the collection has a user manual and a history page.
It should be noted that some of the contributed plugins are present in all plugin distributions; while others are only distribution-specific.
While developed more for microscopic analysis ImageJ can be also used as a tool for visualization and measurements of pre-clinical imaging data. Key features of ImageJ are its support of (i) different modes of segmentation, (ii) the advanced image editing, (iii) the advanced filtering and processing capabilities and (iv) the well-established user and developer communities.
ImageJ can also produce derived results plots. Supported modalities are linear and surface plots. The basic measurement types in ImageJ are: areas, diameters, perimeters, angles, circularity, coordinates in 2D and 3D, intensities, and calibrated pixel values. Finally, ImageJ can also produce image and measurement statistics. A complete user guide of ImageJ is maintained by T. Ferreira and W. Rasband since 2010 (Ferreira & Rasband, 2010). What makes ImageJ superior to most of the specialized biomedical imaging programs are its capabilities: • to support add-on functionality via plugins; • to implement several scripting languages, such as its native macro script and JavaScript; • to provide extensive measurement functions (e.g. morphometry and statistics).
• to run without modification on multiple operation systems.

Applications of ImageJ in MRI
Although historically analysis of non-optical biomedical images was one of the first applications of ImageJ there are still not so many algorithms for such types of images. Recently, however, with the spread of common non-optical biomedical imaging modalities the demand to use ImageJ for processing of such data has grown .
The most common MRI techniques map the distribution of hydrogen atoms in different tissues. The primary contrast mechanisms exploit relaxation of the atomic magnetization: spin-lattice relaxation, characterized by the relaxation time T1, i.e T1-contrast, and spin-spin relaxation, characterized by the relaxation time T2, i.e. T2-contrast. MRI can be used for non-invasive monitoring of models of human diseases, such as traumatic brain edema, stroke or spinal cord injury. Such monitoring requires development of differential contrasting techniques either for T1 or for T2.
Parametric mapping functionality for ImageJ 3D and 4D datasets is provided by the MRI Processor plugin made available from the ImageJ documentation Wiki website . The plugin calculates parametric maps based on reconstructed MR images. Such parametric maps are derived images where each pixel value represents a parametric fit to time varying data sequence. Parametric maps are, for example, T1, T2 and proton density maps. Data fitting is available using either the Levenberg-Marquardt or the Simplex algorithm. Currently supported types are T2 and T1 maps. Unique features of the plugin are (i) the possibility to fit multicomponent exponential models, (ii) the support of 4D data sets and (iii) the support of arbitrary closed Regions of Interest (ROIs). The T2-map functionality has been already validated against the Paravision 4.0 software. The T2 maps are computed by fitting of the MRI dataset to the equation: where M xy is the transverse field magnetization component and ǫ is the offset term introduced by the unsigned pixel representation. The T1 maps are computed by fitting of the dataset to the equation: where M z is the longitudinal field magnetization component and ǫ is the offset term introduced by the unsigned pixel representation.

Selected Morphometric algorithms
Cell and tissue structures can be segmented in a variety of ways. For a successful image segmentation it is important to have prior knowledge of the image composition, i.e. the texture properties of the background and the objects of interest. In general, a typical algorithm includes the following stages: • preprocessing steps, which decrease the spatial variation of the image • thresholding, which produces one or more binary masks • masking or Region of interest (ROI) selection • postprocessing steps, for example including second thresholding or parametric fitting • final measurement of volume, area, angles, etc.
Image processing algorithms can be classified based on the spatial (temporal) transformations which they introduce into the image. Point operations transform an input pixel into an output value. An example for such an operation can be given by histogramming or contrast adjustment. Zonal operations transform all the pixels in a certain spatially-or temporallyconnected neighborhood into some output. Such neighborhoods are, for example, defined by structuring elements or convolution kernels. Map operations compute output image based on 2 or more input images. For example masking, addition and subtraction of images are such operations.
In the next sections we describe protocols based on granulometric filtering (a class of morphological filters), differential contrast enhancement, area thresholding, or distance map transforms.

Thresholding
Thresholding is performed using a labeling operator Tr. By definition, Tr labels a pixel in the image only if its intensity g exceeds certain value T min : where 1 is the binary pixel label denoting the foreground value and g -the pixel intensity at the co-ordinates vector x. There are different ways to propose a T min value based on zonal or regional statistical variables. Some of the most popular methods include Otsu, maximal entropy and percentile thresholding. A good review on thresholding techniques can be found in Sezgin & Sankur (2004).

Local area thresholding
The local area thresholding is a regional image operation depending on the parameter α.I fi t is assumed that this ROI represents predominantly the image texture, α acts as a sensitivity parameter that determines the overall proportion of the "noise" pixels in the ROI. If so determined threshold level is extended to the overall image then a signal to noise ratio, SNR can be calculated as whereḡ is the mean intensity of the image.

191
Automated Segmentation and Morphometry of Cell and Tissue Structures. Selected Algorithms in ImageJ www.intechopen.com The action of a parametric thresholding operator Tr α is conditioned on the ratio between the area of the labeled pixels and the total ROI area: where A ROI denotes the ROI area, T min is the locally-computed threshold level and H() the cumulative histogram of the ROI (Prodanov & Feirabend, 2008).

Granulometric filtering
The algorithm is implemented as an ImageJ plugin. Particles of different sizes can be extracted from an image if two images from a granulometric image sequence are subtracted (see Appendix 12). Accordingly, the granulometric filtering is defined as: where • denotes morphological opening and SE is a structuring element defining the neighborhood around a pixel.

Differential Contrast Enhancement
The algorithm assumes that one of the images samples only background I background while the other samples background and objects of interest I objects . Further, it is assumed that the histograms of the background and the objects overlap to an extent so that it is not-possible to separate them by thresholding. The contrast of the image (channel) of interest is rescaled with a coefficient assuring that 0 / ∈ Con f idence 95 [I background − I objects ]. This condition is achieved if the original image is contrast-rescaled by a factor where P 95 denotes the 95 th percentile of the empirical pixel intensity distribution and E[] denotes the expectation. Next, to obtain the objects, the contrast-rescaled image is subtracted from the objects image in order to produce an output image R.

Distance map transformations
Distance map are produced from binary images. The map is an image derived from the original image where every pixel in the background is assigned the shortest possible distance to a foreground pixel given a certain metrics. The most popular distance maps are derived from the city-block (e.g. having diamond equidistant contours), the chessboard (e.g. having square equidistant contours) or the euclidean (e.g. having circular equidistant contours) metrics. In mathematical terms: where 1 denotes the foreground label, x and p denote pixel coordinates, and g denotes intensity. From this equation a naive implementation can be derived directly. However, its execution time scales very badly with the image size and is of little practical use. ImageJ implements an approximate Euclidean distance map algorithm as part of its EDM plugin. The EDM algorithm is similar to the 8SSEDT in Leymarie & Levine (1992). The algorithm provides a fast approximation of the EDM, with the deviation from a full calculation being between -0.09 and 0.

Spatial distribution of labeled cells around a lesion site
Distance distribution of cell structures around an object can be used to demonstrate spatially-distributed effects or interactions. The distance from an arbitrary pixel set (for example a connected ROI representing the objects of interest) can be computed using the (approximate) Euclidean distance map transformation. In such case, the quantity of the effect (e.g. the amount of immuno-reactivity) can be given by the support volume. Since the area of a ring enclosed by two equidistant levels in the distance map increases monotonously with distance, to allow for comparison one needs to normalize the integral intensity by the ring area. Such normalization produces so called support volume density, having the same mathematical expression as the mean intensity inside the ring formed between 2 concentric contours: where A r denotes the are of the ring.
The algorithm is demonstrated on images produced from transversal cortical histological slices stained for ED1 (microglial cell marker) and GFAP (astrocytic cell marker). The principle of the algorithm is similar to the previous work of Blacher et al. (2001), which employed distance maps to determine the effects of small molecules (Blacher et al., 2001) or enzymes (Chabottaux et al., 2006) on vascularization. In contrast to the works of Blacher et al., we did not attempt segmenting individual glial cells, since their processi form an overlapping mesh.
The application, which is presented here, is the measurement of the amount and distribution of glial cells in a histological section encompassing an implanted microelectrode. Following chronic implantation, the brain matter around the electrode forms glial scar spanning about 500 um from the electrode (review in Polikov et al. (2005)). Shortly after implantation, the astroglial and microglial cells undergo activation and hypertrophy and invade the region of primary injury. The distribution of glial cells around a lesion in the brain can be used to measure the extent of reactive gliosis and compare effects of treatments with anitinflammatory agents after such an implantation. In particular, such distributions can be used to study the brain tissue response to chronically implanted silicon microelectrode arrays (Welkenhuysen, 2011).
Confocal images were acquired on LSM5 Pascal confocal microscope (Carl Zeiss Microimaging GmbH, Germany) using Plan Apochromat 5x/0.16 objective. The images were composed of 2 acquisition channels (having 8-bit dynamic range each) for demonstration of Alexa-444 (green LUT) and Alexa-568 emission (red LUT), respectively. The implant side was centered in the field of view (Fig. 3A). Exposure times were optimized to provide best compromise between cell contrast and saturation fraction. Images were imported in ImageJ using the LSM Reader plugin.

Outline of the algorithm
The following algorithm was used for computation of the binary mask from the ED1 image: 1. Perform Gaussian filtering, kernel diameter 5 pixels; 2. Perform morphological erosion with SE of d=5 pixels; 3. Perform morphological dilation with SE of d=10 pixels; 4. Do median thresholding (Doyle, 1962) (Fig. 3B). 5. Do magic wand selection from a point in the lesion site. 6. Clear the non selected area. 7. This mask is then transformed by Euclidean distance mapping and serially thresholded at increasing distances.
The resulting ring-like images are then overlaid in turn onto the GFAP image (Fig. 3D).
Proposed approach can be used to investigate the factors which contribute to the loss of signal in chronic microelectrode recordings. From the side of the brain this phenomenon can be caused by (i) spatial shift caused by the formation of the glial scar, (ii) neuronal cell death around the implanted probe or (iii) silencing of the surrounding neurons (review in Braeken & Prodanov (2010)). Activation of microglial cells results in a substantial increase in their phagocytic capacity. So-described process could lead to changes of the neuronal activity of the remaining neurons and may lead to atrophy or cell death of the neuronal cell bodies and axons, respectively. This in turn increases the variability of recorded bioelectrical signals and impedes the interpretation of the acquired physiological data. Moreover, the glial scar in the brain has growth-inhibitory properties for the regenerating axons, which could additionally impede the signal readout.

Morphometry of cultured neurons
To establish the dose-or time-dependence of a specific pharmacological effect often a large number of different experimental groups are needed. This rapidly increases the number of individual samples to be evaluated. Because of the high variability of the localizations of synapses on dendrites and the clustering of boutons, the stereological assumption of homogeneity of spatial distribution is violated. Therefore, complete dendritic trees are counted. To facilitate counting in cell cultures we have developed a reproducible and robust method for automatic identification and morphometry of synaptic boutons . The method is further illustrated with identification of synaptic boutons marked for synapsin I immuno-fluoresecence from micro-island cultures of neocortical neurons.

Imaging protocol
Micro island cortical cultures were prepared from embryonic day 18 murine embryos. Cultures were stained with antibodies against a marker for dendrites, microtubule-associated protein 2 (MAP-2), and a marker for synaptic vesicles, synapsin I. Cultures were fixed by 4% paraformaldehyde, washed with 0.1M Phosphate buffered saline (PBS) and incubated in 0.1% Triton X-100 followed by 4% fetal calf serum for 20 minutes. After washing with PBS, cultures were incubated for 1 hour at room temperature in a mixture containing 0.1% Triton X-100, mouse monoclonal anti-MAP-2, 1:200 (Boehringer, Alkmaar, The Netherlands) and rabbit polyclonal anti-synapsin I, 1:1000 antibodies diluted in PBS. After washing with PBS, the cells were incubated for 1 hour at room temperature in secondary antibodies conjugated to anti-rabbit-Cy5 or anti-mouse-Alexa546 (Molecular Probes, Oregon, USA). Finally, the slides were washed in PBS and cover-slipped with Dabco-Mowiol .
Samples were analyzed on a Zeiss 510 Meta confocal microscope (Carl Zeiss, Heidelberg, Germany). A set of high-resolution digital images of different cultures was recorded at a resolution of 4.45 pixels per µm. Images were acquired on 2 channels -cyan, comprising anti-synapsin staining and red, comprising anti-MAP-2 staining.

Outline of the algorithm
The algorithm employed in the study can be outlined in the following main steps: 1. Perform granulometry of the image and compute its granulometric size density G(d) (Appendix 12). 2. Identify the scale of interest by the pattern of the peaks in G(d); select low bound I low = S • E low and high bound images I high = S • E high and subtract the images. 3. Construct the binary "mask" using the k-means clustering segmentation algorithm. 4. Delete irrelevant structures by superimposing the mask on the original image using bit-plane logical AND operation (masking). 5. Threshold the resulting image using the area thresholding (Sec. 5.2). 6. Construct disjoint grains from the pixels that are above the threshold based on their 8-connected neighborhoods. 7. Enumerate and measure the grains constructed in this way. Produce derivative images where the identification numbers of the positive fibers are visible.
The algorithm was applied to the synapsin channel of every image. The identified boutons were numbered and their areas, equivalent diameters, and planar co-ordinates were automatically measured and recorded. The final measurements were uploaded in the LabIS system using the SQL Results plugin (see Sec. 10.3). As the fluorescent patches in the real images were round, granulometry was performed with a family of flat disk-shaped SEs ranging from d=1 to d=25 (0.2 µm -5.6 µm). For the construction of I low values of either d low =3 or d low =5 were selected depending on the amount of debris in an image; d high =11 was selected as a parameter for I high . Based on the discrimination of dark background, auto-fluorescing cell mass, and synapsin positive grains three brightness classes were used during k-means clustering. During the area thresholding, sufficient overlap of the thresholded particles with the actual synapsin grains was typically achieved for α = 0.8. The brightest class was selected for the construction of the mask. A typical result of the detection procedure is presented in Fig. 4B.
An advantage of the proposed automated approach is that, apart from the number of synaptic boutons in a light microscopic image, it also allows to be measured morphological characteristics such as area, circularity, and maximal diameter.

Spatial mapping of tracer-filled axons
Specific populations of myelinated nerve fibers can be investigated by retrograde tracing from a muscle followed by morphometric assessment of the labeled fibers at different anatomical levels. Transversal sections of so-labeled nerves would then represent spatial maps of the specific muscle representations (Fig. 5). To facilitate such mapping studies we have developed a reproducible approach for image segmentation and morphometry (Prodanov & Feirabend, 2008).
Gastrocnemius muscles of adult rats were injected under anesthesia with the retrograde tracer Fluoro-Gold. After a survival period of 3 days, the sciatic nerves and spinal roots were harvested and fixed in 4% paraformaldehyde.

Imaging protocol
The samples were sectioned at 14 µm, mounted on glass slides and inspected on an Axioplan (Carl Zeiss Microimaging GmmbH, Germany) fluorescence microscopes. The fluorescent signal from the specimens was recorded on 2 channels. Fluoro-Gold signal was recorded using a standard filter set for DAPI (4',6-Diamidino-2-phenylindole) detection (excitation 320 -370 nm), see The following procedure was employed to identify the Fluoro-Gold-positive fibers. Due to the excitation characteristics of Fluoro-Gold its signal was absent from the FITC channel ( Fig.  5/FITC). Therefore, it was possible to isolate the Fluoro-Gold using the DCE implemented as the Channel Filter plugin. For the optimal differential brightness enhancement a thin rectangle ROI was drawn across the image and the intensities of the pixels were averaged in the direction perpendicular to the larger side of the rectangle and the input images were transformed according to Eq. 5.6.

Outline of the algorithm
The algorithm employed in the study can be outlined in the following main steps: 1. Perform DCE (Sec. 5.4).

Perform granulometry on the resulting image and compute G(d).
3. Identify the scale of interest by the pattern of the peaks in G(d); select I low = S • E low and I high = S • E high and subtract the images. 4. Interactively threshold the resulting image. 5. Construct disjoint grains from the pixels that are above the threshold based on their 8-connected neighborhoods. 6. Enumerate and measure the grains constructed in this way. Produce derivative images where the identification numbers of the positive fibers are visible.
Spatial maps obtained in this way were uploaded to LabIS using the SQL Results plugin. The data were imported to Matlab and the spatial distribution of the Fluoro-Gold-positive axons was further studied on demand using custom code (Prodanov & Feirabend, 2008;Prodanov et al., 2007).

Outlook
Presented algorithms can be developed further in two directions.
Parallelization: As the sizes of available images increase and the parallel computer architectures become increasingly available a logical step would be the development of parallel implementations. Such parallelizations can be especially useful in zonal and map algorithms where the same elementary operations are repeated multiple times on different pixels. Notably we expect substantial speedups for image convolutions and morphology operations. Parallelization can be implemented either using general purpose semi-automatic parallelization libraries, or optimized at a low level for the specific algorithms. Multidimensionality: Another direction for future development is the support of multidimensional kernels and structuring elements in zonal operations. Multidimensional imaging data are increasingly used in life sciences but at present they are not well supported by the data model in ImageJ, which assumes at best a collection of loosely-coupled 2D images. Such support can be achieved by development of a multidimensional data model in combination with generic zonal image transform algorithms.
It is expected that the development and support of ImageJ will continue in the future as the user and developer base of the program is growing and there are structured institutional efforts to sustain and support this trend. Therefore, both directions will be pursued further in the context of ImageJ and the developed plugins and libraries will be made available to the user community.

Management of the information flow
Until recently, management of the data produced along the life science workflow (Fig. 1) was not perceived as a pressing issue in the academic environments. Traditionally, the scientific publications were considered as the only sufficient reports of the experimental findings. However, the scale of current imaging experiments and the volumes of data generated by them would also require persistent data management and collaboration solutions. This is a situation already recognized in brain mapping studies (Bjaalie, 2002). On the second place, sharing of raw data and code gains momentum in Neuroscience. The exchange of raw imaging data between groups offers the opportunity to differently re-analyze previously collected data and encourage new interpretations (Eckersley et al., 2003). While something new for Neurosciences such practices are common in other fields like Physics and to some extend in Bioinformatics, i.e. in Proteomics. With the increase of experimental complexity and the article size restrictions imposed by the scientific publishers, frequently essential experimental details are omitted from the final peer reviewed publications. This eventually impedes the reproduction of the original experiments and could eventually lead to unnecessary reproduction of experiments and waste of time and resources. In contrast, data sharing can reduce the experimental and analytical errors. However, both high-level data archiving and the raw data sharing will have limited utility if they are not backed by information system solutions on the research laboratory level.
In the following sections we present an integrated information system for image measurements, LabIS. The system was publicly demonstrated for the first time at the 6 th FENS Forum of European Neuroscicence, although developmental versions existed since 2004. Previous versions of the system supported data analyzed in publications about: motor endplate distributions in (Prodanov, 2006;Prodanov et al., 2005); synaptic boutons morphometry in (Prodanov, 2006;Prodanov et al., 2006); peripheral axon spatial distributions in (Prodanov, 2006;Prodanov & Feirabend, 2008;Prodanov et al., 2007). Development of LabIS has the objectives to automate (i) the process of storage, annotation and querying of image measurements and (ii) to provide means for data sharing with 3 rd party applications utilizing measurement data (Prodanov, 2008). A developmental snapshot of the system is available through the website Sourceforge.net at http://labinfsyst.sourceforge.net/.

System realization
LabIS realizes 3-tier architecture with a relational database back-end and an application logic middle tier realizing web-based user interface for reporting and annotation and a web service communication layer. LabIS is a distributed Internet and intranet application. It can be accessed (i) through the web user interface by a web browser, (ii) through web-service or (iii) database clients (Fig. 6). LabIS is based on commonly-accepted open-source software technologies and open communication and data storage protocols. In order to enforce data organization in a structured manner, LabIS realizes a centralized data storage model. LabIS is designed and developed in a modular manner and the data model for communication with 3 rd party applications is also extendable.
Interaction with users is executed via dynamically-generated web pages. All user-interface modules are organized in a similar manner: users can generate reports, enter data or annotate already present database records. The Project planning module is used for management of the records of research projects. The users can perform tasks, such as deployment of new and/or changing the state or the attributes of ongoing projects. Groups of results can be organized in results collections. The Subject management module manages the records for experimental animals. The users can perform tasks, such as registration of new subjects/animals, editing of records, introduction of new species etc. The subjects can be assigned to projects and to experimental groups. Dynamic reports can be generated for arbitrary periods. The Manipulation management module manages the records for performed manipulations. The users can perform tasks, such as registration and editing of manipulations. Dynamic reports can be generated for arbitrary periods. The Image Measurements and Morphometry module manages uploaded measurement records. Uploaded measurements can be associated to a project, an experimental subject, experimental group, sample, result collection, or paired to other measurements. The measurements can be queried by the name of the measured image, by the internal ID or simply browsed. There are possibilities for flexible reporting of the performed measurements. The Administration module manages the user roles, the maintenance of the database, and the system configuration. The users can also define custom ontologies.
It should be noted that LabIS is not a raw image database. The raw images are let to reside in remote repositories, such as on a local client file system or 3 rd party file server, while only references to them are stored centrally. In contrast, the imaging meta data and the produced measurements are stored centrally in the relational database. Such an approach provides a definite advantage for the integration of 3 rd party imaging data, such as large scale digital atlases. It also increases the portability of the system since its entire database can be easily copied from one host to another. Most notable characteristics of LabIS are the possibilities to annotate and collate measurements and its interoperability with 3 rd party software. In this Fig. 6. LabIS user interface and data upload clients The information system can be accessed through the web user interface by a web browser. The user interface of the ImageJ SQL access plugin for measurement upload and annotation is overlaid onto a web browser window displaying the Morphometry module.
context, interactions with LabIS are executed either by exchange of structured messages over the web or by database queries in an intranet.

Annotations of measurements
Measurement type annotations Uploaded measurements can be annotated by ontology entries. Support of 3 rd party ontologies is provided using the publicly available Ontology Lookup Service (OLS) registry web site 11 . This support is realized on 2 levels: (i) individual measurement types can be annotated with ontology keys, for example using the Unit Ontology; (ii) the complex measurement objects can be annotated using terms of any of the ontologies supported by OLS. The integration with OLS is transparent for the user and is realized using a cascade of client and 3 rd party server calls. This is an example of mixed client-server interoperability. Spatial annotations LabIS provides also atlas mapping and registration functionality. Major features include the possibility to associate a Results collection to an atlas and to map individual measurement entries of the collection to the atlas imaging space. An example is demonstrated in Fig. 7 where some measurements are mapped to a rat coronal histological atlas. This is achieved by integration with public atlas datasets, for example those available at Brain Maps web site 12 (Mikula et al., 2007) .

Interoperability
Interoperability with 3 rd party software is realized both on the client and server sides.
ImageJ can directly upload measurements to LabIS via specialized plugin clients. In such way, the entire image processing functionality of ImageJ can be made available to the end user. The user can perform arbitrary measurements using any type of built-in or customized ImageJ plugins. After the end of the measurement session this object together with a JPEG-encoded thumbnail view of the active image are upload either using the SQL client or using the web service client. Known measurement unit types are associated automatically to terms in 3 rd party ontologies, i.e. the Unit Ontology. If a new measurement type is encountered it is also automatically included in the database. Such a new type can be later annotated using the web UI and the ontology terms lookup service. The GUI front-end clients were implemented as a set of plugins: the SQL Results plugin and web-service plugins SOAP Results and JSON Results plugins. The SQL-plugin implements a MySQL client that interacts directly with the database server. It is intended for use in intranet environments. The web-service plugins interact with the Object Server interfaces of LabIS (Fig. 6). This functionality is an example of interoperability on the client side. Matlab R can directly query LabIS via its web-service interface. Since its R2007 version, Matlab R provides client functionality for web services. The generation of client scripts is fully automated and transparent to the end-user by the service discovery mechanisms.
On the application level, advantages of the system are the use of open communication standards and the integration of server and client technologies, which are transparent for the end-user. On the system level, advantages of LabIS are the extendable data model, the independence of a particular programming language and the scalability of the component technologies. On the level of exploitation and deployment, advantages of the system are the use of open-source platforms, which are available as standard hosting options in the most web hosting services.

Summary
This chapter presents several techniques for morphometry of microscopic and non-optical images. The main focus of the manuscript is the automation of image processing and measurement steps along the experimental workflow. Main algorithms are implemented as either plugins or macros for the public domain image processing program ImageJ. We present several generic processing and segmentation techniques, which can be used in a variety of applications.
Notably, the utility of mathematical morphology was demonstrated in several image filtering and segmentation algorithmic steps. Morphology-based Granulometric filtering was used to facilitate segmentation of globular structures, such as synaptic boutons or cross sections of axons. In the first application, morphological granulometry was used to estimate size of synaptic boutons, which are then segmented by means of granulometric filtering followed by thresholding. Using this approach quantitative effects of different treatments of cell cultures can be measured. In the second application, Differential Contrast Enhancement and granulometry were used to segment images of fluorescent tracer filled axons. An additional application of the morphological image simplification were the preprocessing steps in the analysis of astroglial distribution.
The computation of spatial parametric maps was demonstrated in the context of MRI data sets. Such maps are produced by parametric fitting to time-varying spatial measurements.
The utility of the Local Area Thresholding was demonstrated in the context of segmentation of histological images. The Differential Contrast Enhancement algorithm can be used to reduce bleed-through artifacts from a background channel to a signal channel. Presented algorithm was used in the context of image enhancement in fluorescent tracer studies.
The utility of distance transform for analysis of spatial distribution of objects was demonstrated in the context of estimation of radial distributions of the glial fraction of the neuropil.
In addition, we also present an information system, which is capable of managing the measurements uploaded from ImageJ. The system provides a structured information context for querying and retrieval of primary morphometric information, which goes beyond acquisition metadata. In such way, the increase of the information complexity along the experimental workflow is supported. The system is a step towards providing the link between the raw image, the performed measurements and their meaning in the context of the experiment.

A. Mathematical morphology
Mathematical morphology is a branch of mathematics applicable to image processing. Morphology operators are a class of zonal operations where the pixels of a certain neighborhood (Structure Element) are combined to produce a single output value. Principal operations in mathematical morphology are erosion, dilation, opening and closing (Matheron, 1975;Serra, 1982).
Grey level images can be represented by 3D geometric bodies (called umbras) where the elevation conventionally signifies intensity. Morphology operations of gray level images can be constructed from ordering and ranking of the pixels. If S(x) is the umbra of the image S and E(x) is a Structuring Elements (SEs) set, erosion (⊖) and dilation (⊕) are defined by: whereÊ is the complement of the structure element and x or b denote vector coordinates.
Opening is defined as I • E =(I ⊖ E) ⊕ E and closing as I • E =(I ⊖ E) ⊕ E.
An example of the four major morphological operations is given in Fig. 8.
As seen from their definition, erosion and closing increase the number of dark pixels and decrease image brightness, while dilation and opening do the opposite.
Sizes of different objects present in an image can be collectively studied by the operation of granulometry, introduced by Matheron (1975).
In a way similar to sieving grains, pixels comprising an image are "sieved" according to their connectivity imposed by a certain SE. Granulometry is formally defined as a set of openings by a family of SEs, characterized by certain scale parameter d. In the case of closings, the set  where d denotes the proportionality parameter of the homothety. By convention G 0 (S)=S and for negative d opening is replaced by closing.
For greyscale images, the measure of the interaction with SE is the support volume removed after opening. This can be expressed by the granulometric (size) density distribution: where g is the intensity. The support volume is estimated from the image histogram H = {h(g)}. In particular, for unsigned 8-bit images g ∈ [0, 255] and Gray-level morphological operations erosion, dilation, opening and closing are implemented as a plugins for ImageJ. The present book gives an exceptional overview of molecular imaging. Practical approach represents the red thread through the whole book, covering at the same time detailed background information that goes very deep into molecular as well as cellular level. Ideas how molecular imaging will develop in the near future present a special delicacy. This should be of special interest as the contributors are members of leading research groups from all over the world.