IMAGE PROCESSING Use of Software to Enhance Depth of … · By using readily available free...

5
BIOGRAPHY Jörg Piper obtained his medical doctorate from the University of Bonn, Germany. One field of his scientific activities has been directed to light microscopy applica- tions, especially reflection contrast, lumi- nance contrast and digital image process- ing. He has created several mathematical models for the three-dimensional quantita- tive analyses of opaque cellular specimens. Since 1998 he has collaborated with the Uni- versity of Oradea, Romania, as an associate and honorary professor. In Germany, he cur- rently works as a senior consultant for inter- nal medicine, angiology and diabetology. ABSTRACT By using readily available free software or shareware, the focal depth and sharpness in photomicrographic images can be enhanced dramatically. In this way, digital images containing three-dimensional infor- mation are achievable, comparable with scanning electron micrographs. Moreover, several parameters which determine the quality of light microscope images, such as the illumination and imaging modes, can also be improved. To do this, a vertical stack of images is taken consisting of several sin- gle images with different planes of focus. The single images are then superimposed using the software; only regions that are in focus contribute to the resulting recon- structed image. The resulting images do not have any indistinctness, and are indepen- dent of the vertical dimension of the speci- men and the magnification and focal depth of the objective. KEYWORDS light microscopy, photomicrography, three- dimensional reconstruction, depth of field, depth of focus, sharpness, digital image processing, image analysis software AUTHOR DETAILS Prof. Dr med. Jörg Piper, Clinic Meduna, Clara-Viebig-Strasse 4, D-56864 Bad Bertrich, Germany Tel: +49 (0) 2674 182 3184 Email: [email protected] Web: www.prof-piper.com Microscopy and Analysis 22(3):15-19 (EU), 2008 I MAGE P ROCESSING INTRODUCTION The limitations in depth of field and sharpness of focus are fundamental problems in light microscopy and photomicrography, especially at high magnifications and when the speci- men is relatively thick. It is well known that the depth of field of objective lenses decreases proportionally as their magnifying power increases. For example, as published by Hart [1], the depth of field of typical dry objectives is 55.5 μm for a 4 0.1 numerical aperture (NA) objective, 8.5 μm at 10 0.25 NA, 5.8 μm at 20 0.4 NA, 1.0 μm at 40 0.65 NA, 0.4 μm at 60 0.85 NA, and only 0.19 μm for a 100 0.95 NA objective. Thus it is usually impossible to obtain sharp focus over the full depth of a specimen. Additional indistinctness in digital images can result from spherical and chro- matic aberrations, unsteadiness in the visual accommodation, high ranges in local bright- ness and contrast, noise, and other artifacts. Two conventional techniques can be used to reveal the three-dimensional structure of a thick specimen: 1. One can use a low-magnifi- cation objective with a large depth of field, or 2. One can make a video clip of the multiple focal planes revealed as the stage (or objec- tive) is moved slowly up and down. In both methods, the resolution is lower than in still images taken at a higher magnification. Therefore, other techniques are desirable in order to create high-resolution images with maximized focal depth and optimized sharp- ness and resolving power. There are many pro- prietary software solutions that microscopists can purchase but there are also software solu- tions available free of charge. The application of some of the latter to produce digital images with a high depth of focus and sharpness are described in this article. MATERIALS AND METHODS Software Several free or shareware software solutions for image post-processing were tested by the author; the findings of other authors were additionally taken into account. The following software tools were considered: Combine Z 5 [2], Picolay [3], Helicon Focus [4], Registax [5], and Astrostack [6]. Combine Z 5, Helicon Focus, and Picolay are suitable for software-based three-dimensional reconstructions from high- resolution still images. Registax and Astrostack are used in astronomy to achieve a reduction in the noise and other artifacts associated with the production of still images of celestial bod- ies which are extracted from video sequences by averaging. Photomicrography All still images were taken by using digital cameras (Canon Powershot A 95 and Olympus Camedia C 7070) using a standard Zeiss stereo- microscope, or a Leica laboratory microscope equipped for examinations in transmitted light (brightfield, darkfield, phase contrast, interference contrast, and polarization) and a Leica industrial microscope suitable for inspec- Use of Software to Enhance Depth of Field and Improve Focus in Photomicrography Jörg Piper, Meduna-Klinik, Bad Bertrich, Germany MICROSCOPY AND ANALYSIS MAY 2008 15 Figure 1: Piece of antique miniature goldwork. Stereomicroscope image taken using epi-illumination, 2.5X objective, 10X ocular. Superposition of 9 single images using Combine Z 5 software. Horizontal field width (HFW) = 6 mm.

Transcript of IMAGE PROCESSING Use of Software to Enhance Depth of … · By using readily available free...

B I O G R A P H YJörg Piper obtained hismedical doctorate fromthe University of Bonn,Germany. One field ofhis scientific activitieshas been directed tolight microscopy applica-tions, especially reflection contrast, lumi-nance contrast and digital image process-ing. He has created several mathematicalmodels for the three-dimensional quantita-tive analyses of opaque cellular specimens.Since 1998 he has collaborated with the Uni-versity of Oradea, Romania, as an associateand honorary professor. In Germany, he cur-rently works as a senior consultant for inter-nal medicine, angiology and diabetology.

A B S T R A C TBy using readily available free software orshareware, the focal depth and sharpness inphotomicrographic images can beenhanced dramatically. In this way, digitalimages containing three-dimensional infor-mation are achievable, comparable withscanning electron micrographs. Moreover,several parameters which determine thequality of light microscope images, such asthe illumination and imaging modes, canalso be improved. To do this, a vertical stackof images is taken consisting of several sin-gle images with different planes of focus.The single images are then superimposedusing the software; only regions that are infocus contribute to the resulting recon-structed image. The resulting images do nothave any indistinctness, and are indepen-dent of the vertical dimension of the speci-men and the magnification and focal depthof the objective.

K E Y W O R D S light microscopy, photomicrography, three-dimensional reconstruction, depth of field,depth of focus, sharpness, digital image processing, image analysis software

A U T H O R D E TA I L SProf. Dr med. Jörg Piper, Clinic Meduna, Clara-Viebig-Strasse 4, D-56864 Bad Bertrich, GermanyTel: +49 (0) 2674 182 3184 Email: [email protected]: www.prof-piper.com

Microscopy and Analysis 22(3):15-19 (EU),2008

IM A G E PR O C E S S I N G

I N T R O D U C T I O NThe limitations in depth of field and sharpnessof focus are fundamental problems in lightmicroscopy and photomicrography, especiallyat high magnifications and when the speci-men is relatively thick. It is well known thatthe depth of field of objective lenses decreasesproportionally as their magnifying powerincreases. For example, as published by Hart[1], the depth of field of typical dry objectivesis 55.5 µm for a 43 0.1 numerical aperture(NA) objective, 8.5 µm at 103 0.25 NA, 5.8 µmat 203 0.4 NA, 1.0 µm at 403 0.65 NA, 0.4 µmat 603 0.85 NA, and only 0.19 µm for a 100 30.95 NA objective. Thus it is usually impossibleto obtain sharp focus over the full depth of aspecimen. Additional indistinctness in digitalimages can result from spherical and chro-matic aberrations, unsteadiness in the visualaccommodation, high ranges in local bright-ness and contrast, noise, and other artifacts.

Two conventional techniques can be used toreveal the three-dimensional structure of athick specimen: 1. One can use a low-magnifi-cation objective with a large depth of field, or2. One can make a video clip of the multiplefocal planes revealed as the stage (or objec-tive) is moved slowly up and down. In bothmethods, the resolution is lower than in stillimages taken at a higher magnification.

Therefore, other techniques are desirable inorder to create high-resolution images withmaximized focal depth and optimized sharp-ness and resolving power. There are many pro-

prietary software solutions that microscopistscan purchase but there are also software solu-tions available free of charge. The applicationof some of the latter to produce digital imageswith a high depth of focus and sharpness aredescribed in this article.

M AT E R I A L S A N D M E T H O D SSoftwareSeveral free or shareware software solutionsfor image post-processing were tested by theauthor; the findings of other authors wereadditionally taken into account. The followingsoftware tools were considered: Combine Z 5[2], Picolay [3], Helicon Focus [4], Registax [5],and Astrostack [6]. Combine Z 5, Helicon Focus,and Picolay are suitable for software-basedthree-dimensional reconstructions from high-resolution still images. Registax and Astrostackare used in astronomy to achieve a reductionin the noise and other artifacts associated withthe production of still images of celestial bod-ies which are extracted from video sequencesby averaging.

PhotomicrographyAll still images were taken by using digitalcameras (Canon Powershot A 95 and OlympusCamedia C 7070) using a standard Zeiss stereo-microscope, or a Leica laboratory microscopeequipped for examinations in transmittedlight (brightfield, darkfield, phase contrast,interference contrast, and polarization) and aLeica industrial microscope suitable for inspec-

Use of Software to Enhance Depth of Fieldand Improve Focus in PhotomicrographyJörg Piper, Meduna-Klinik, Bad Bertrich, Germany

MICROSCOPY AND ANALYSIS MAY 2008 15

Figure 1: Piece of antique miniature goldwork. Stereomicroscope image taken using epi-illumination, 2.5X objective, 10X ocular. Superposition of 9 single imagesusing Combine Z 5 software. Horizontal field width (HFW) = 6 mm.

tions using in epi-illumination (brightfield anddarkfield) and simultaneously applied trans-mitted light.

Procedures for 3D Image GenerationTo obtain a digital enhancement of the focaldepth, the stage of the microscope was movedup or down in tiny steps, so that the plane offocus passed across the specimen. In this way,a vertical stack or sequence of images wasobtained, each with a very shallow depth offield.

Sequences of single images were processedusing software as follows: colour saturation,white balance and brightness were read-justed, artifacts were reduced, and all imageswere properly aligned so that they were con-gruent with each other. Finally, the in-focusparts of all single images were selected andthen combined to make a final image (thereconstruction) that was completely in focus.

S O F T WA R E F E AT U R E S A N DB A S A L R E S U LT SThe software tools mentioned above can leadto different results as their algorithms differfrom each other. Thus, it can be helpful toobtain optimized reconstructions when a spec-imen is successively stacked by different soft-ware so that the most satisfying reconstruc-tion can be selected.

Combine Z 5This freeware leads to high quality resultsbased on three optional presets (macros):Do Stack is the standard macro for most pur-poses, promising very good results in mostcases.Do Average and Filter is an alternative presetleading to reconstructions with ultrahigh con-trast and sharpness. Stack Only is an easy working preset makingsuperpositions of single images without any

corrections or alignments. Therefore, thismacro can only be used when the respectivesingle images are properly prealigned. Pre-existing ultrahigh ranges in brightness andcontrast can be equalized with the help of thismacro when several images taken at differentexposures are superimposed

Two macros can be used for data saving:Save Frame/Picture As and Save Rectangle As.When the original image is saved at full size,both macros work in a nearly identical man-ner. The focal plane can differ marginallywhen an image is simultaneously saved as aframe/picture and as a rectangle. In this case,the final sharpness can be enhanced furtherwhen both reconstructed images (frame andrectangle) are stacked again in a second step(double stacking).

PicolayFive presets are implemented in this freeware

Figure 3: Stomach of a cricket. Superposition of 17single images using Combine Z 5 software.Polarization optics using a quarter lambdacompensator, 40X objective and 8X ocular.HFW: 0.15 mm.

MICROSCOPY AND ANALYSIS MAY 200816

Figure 2: Marginal detail of a starfish (Asteroid) arm revealed by superposition of six single images using Combine Z 5 software. A single primary image is shown on the left and the processed image on the right. Images taken on a stere-omicroscope using epi-illumination, 4X objective, and 10X ocular. HFW: 3 mm.

IM A G E PR O C E S S I N G

so that five separate reconstructions are cre-ated from each image sequence when stackedin an automatic run. This can result in an extra-ordinary variance of contrast effects.

First, an average of all images withenhanced sharpness and contrast was gener-ated. Second, a reconstruction was made con-taining the brightest pixels at each position.Third, a corresponding reconstruction was cre-ated based on the darkest pixels at all posi-tions. Then, an image with the sharpest areasin the stack was saved. Finally, all reconstruc-tions previously generated were superim-posed on each other.

Helicon FocusThis software is based on one preset leading to

Figure 4: A radiolarian. Superposition of8 single images using Picolaysoftware. Images taken using40X mirror objective, 5X ocular,axial illumination in luminancecontrast [7]. Diameter: circa0.25 mm.

MICROSCOPY AND ANALYSIS MAY 2008 17

Figure 6: Scales on the wing of a butter-fly. Superposition of 16 singleimages with multiple stackingusing Picolay and Combine Z 5software. Images taken with nocoverslip, using epi-illumina-tion, circular darkfield, 10Xobjective and 8X ocular. HFW: 1mm.

Figure 5: Head of a May bug. Superposi-tion of 11 single images usingCombine Z 5. Images takenusing a stereomicroscope, withepi-illumination, 1.6X objective,10X ocular. Horizontal fieldwidth (HFW) = 13 mm.

useful results, in most cases being comparablewith the macro Do Stack implemented in Com-bine Z 5. In Helicon Focus, the progress ofimage processing and the resulting recon-structed images are permanently presented inlife-view mode as high-resolution images.

RegistaxStill images up to about 2 megapixels in sizecan be superimposed by Registax. When thesize of the single image files was higher, thesoftware does not run. Moreover, the correct-ness of the alignment was worse when themicroscopical images were processed. It mustbe taken into account, as a potential reasonfor this, that Registax has been developed forvideo processing in astronomy.

AstrostackAstrostack has been evaluated by anotherauthor [1]. According to published results, thequality of three-dimensional photomicro-graphic reconstructions was also lower whenthis software is compared with Combine Z 5and AutoMontage.

QUALITY OF RECONSTRUCT IONSThe results of this study show that the Com-bine Z 5, Picolay and Helicon Focus softwarewere highly suitable for satisfying reconstruc-tions. In most cases, single images were exactlyaligned and averaged. When an imagesequence was affected by a massive shifting,especially that seen in stereomicroscopy, Com-bine Z 5 might lead to the most correct align-

MICROSCOPY AND ANALYSIS MAY 200818

ment. With all software, the quality of recon-structions was constant over the full range ofmagnifications. The number of single imagesneeded for adequate superpositions rangedfrom around 4 to about 20 or 30, dependingon the specimen’s thickness, the magnificationand the depth of field.

The sizes of reconstructed images were usu-ally two- or four-fold higher than those of acorresponding single image. Thus, resolutionand sharpness can be drastically enhancedespecially when high-resolution single imageswere stacked.

Figures 1-5 demonstrate some typical resultsachieved using Combine Z 5 and Picolay, usingstereo and laboratory microscopes. The figuresshow two images in a doublet – one represen-tative singe image and the correspondingreconstruction from several images. It is plainto see that software-based reconstruction ofthree-dimensional objects leads to an extraor-dinary improvement of depth of field, highersharpness, and hence more visual information.Moreover, potential artifacts and localunevenness in brightness and contrast can bereduced.

S P E C I A L R E C O N S T R U C T I O NT E C H N I Q U E S In some situations, special techniques can beused for further improvements of three-dimensional reconstructions.

Double and Multiple StackingSharpness and focal depth can be oftenenhanced further when two or more separatereconstructions are made from an identicalview being superimposed on each other in asecond step. Of course, it is also possible to cre-ate the first stack with certain particular soft-ware and the following stack with another.Figure 6 shows the wing of a butterfly exam-ined in concentric epi-illumination (darkfield)arranged without a cover slip using a 103magnifying plan objective for epi-darkfield. Inthis specimen, some initial stacks made byPicolay led to reconstructions being nearly freefrom visible dust particles. These images werethen stacked again using Combine Z 5.

Sandwich TechniquesSpecimens can also be photographed andstacked in identical views when illuminated indifferent colours or different illuminatingmodes. In additional steps, the correspondingreconstructions can be superimposed to makesandwiches by double or multiple stacking.

For example, a specimen can be sequentiallyphotographed in bulb and flash light, or ingreen and blue light, so that different stacksare made based on different light sources.These reconstructions can then be superim-posed again. In this way new characteristics ofcolour contrast occur so that fine structures,especially at the margin of cell membranes,are accentuated as a result of the coincindenceof mixed illuminating light.

In the same way, a specimen can be pho-tographed using different illumination andthe respective image stacks can be sequentiallystacked again. Figure 7 shows a crystallization

of alum prepared in a thick layer without acoverslip. First, this specimen was pho-tographed in epi-darkfield, illuminated inwhite light. Second, it was simultaneously illu-minated in epi-darkfield and transmitted light(darkfield and brightfield). Three-dimensionalreconstructions were made for each light con-stellation. In separate steps, two or more ofthese reconstructions were superimposed oneach other again. As Figure 8 shows, a highvariance of contrasting effects results from thistechnique, showing more details of the struc-tures than were recognizable in the initialimages.

Monochromatic LightSharpness and resolution in image stacks canbe maximized by using monochromatic lightsince potential chromatic aberrations are com-pletely eliminated. In green light, interpola-tion artifacts are minimized in digital images,as the majority of pixels are sensitive to greenlight. Therefore, monochromatic green lightcan lead to optimal results when black and

Figure 7: Crystallization of alum. Superposition of 14 single images using Combine Z 5. Thick layer, no coverslip, epi-illumination, circular darkfield, 10X objec-tive and 6.3X ocular. HFW: 1.3 mm.

white digital images are required. Accordingto our tests, Combine Z 5 and Picolay weremostly not capable of superimposing singleimages taken in monochromatic green light,so that Helicon Focus had to be used.

Figure 9 shows an example of a phase-con-trast image taken using monochromatic greenlight (wavelength: 540 nm); three-dimensionalreconstructions were carried out in the origi-nal green colour and in black and white. Fig-ure 10 demonstrates the extraordinary highresolution of the monochromatic reconstruc-tions.

T I M E F O R I M A G E R E N D E R I N GWhen an up-to-date computer was used, allthe software tools produced the final imagesfrom a stack of high resolution images withina time ranging between a few seconds or sev-eral minutes.

According to the various measurements car-ried out, some characteristics emerged withregard to the processing time:•• When the size of single images was dou-

Figure 8:Crystallization of alum (same specimen as Figure 7). Superposition of 14 single images using Combine Z 5. Example of multiple stacking. Left: super-imposed transmitted darkfield and epi-darkfield. Right: Superposition of transmitted brightfield and epi-darkfield.

Figure 9: Human epithelial cell. Superposition of 11 single images using Helicon Focus. Left: single image. Centre: stack in green light. Right: black and white stack. Phase contrast, monochromatic green light, 100X oil objective, 12.5X ocular. HFW: 0.05 mm.

Figure 10: Detail of the stack from Figure 9 showing subcellular membranous structures. Top: monochromatic green light. Bottom: black and white image. HFW: circa 0.015 mm.

Number ofImages

Combine Z 5 and Picolay (seconds)

Helicon Focus(seconds)

2 40 204 50 258 80 4016 100 5025 160 8032 200 100

Table 1: Comparative measurements of theimage processing times in seconds(see text for further explanation).

IM A G E PR O C E S S I N G

MICROSCOPY AND ANALYSIS MAY 2008 19

bled, the processing time was mostly doubled,but in some cases it nearly tripled.•• The processing time increased nearly in

proportion to the number of single images.•• The processing time was also dependent

on the respective software and the presetselected by the user.

Table 1 gives an overview of some measure-ments carried out for JPG images in minimaldata compression, image size 3072 x 2304 pix-els (7.1 megapixels, 3.5-3.8 MB file size), usingan high-end laptop (Dell XPS M1710 Gamer,4096 MB RAM, Intel Core Duo 2.16 GHz CPU,NVIDIA Geforce Go 7950 GTX video card, andWindows XP). The data were comparable inCombine Z 5 (macro: Do Stack) and Picolay. InCombine Z 5, the preset Do Average and Filterworked about 25% faster. Helicon Focusneeded only half the processing time whencompared with the other software.

D I S C U S S I O NLimitations of sharpness in photomicrographscan be caused by shallow depth of field, largethickness of the specimen, loss of planarityand unsteadiness in the visual accommoda-tion. In digital photomicrography, furtherindistinctness can occur as a result of noiseand other artifacts or ultrahigh ranges in con-trast and brightness. This multifactorial indis-tinctness can be mitigated or eliminated bysoftware-based stacking techniques, leadingto excellent results in three-dimensional high-resolution imaging. In principle, the depth offield can be maximized infinitely when thescanning mode is adequately carried out.Other parameters which determinate theimage quality can also be optimized. Addi-tional sharpness and optical effects can beachieved by double or multiple stacking, sand-wich techniques and monochromatic light filters.

Within the range of light microscopicalmagnification, the reconstructed images canbe compared with those taken by scanningelectron microscopes. It must be pointed outthat one of the advantages of light micro-scopical 3D imaging is that specimens can bephotographed in their original colour.

According to our own evaluations andother findings, at least three software solu-tions will lead to excellent results: Combine Z5 (freeware), Picolay (freeware), and HeliconFocus (shareware). For routine applications,

Combine Z 5 and Picolay might be preferredas they are freeware that work perfectly andthat have more macros than Helicon Focus. Onthe other hand, in most cases Helicon Focus is necessary for image averaging in mono-chromatic light.

The time needed for processing ranges fromseconds to only a few minutes so that all thesoftware tools can be easily integrated intomost microscopical workflows.

R E F E R E N C E S 1. Hart, J. 3D microscopy and high-magnification macrophoto-

graphy: Digital reconstruction and depth-of-field expansion.University of Colorado. 2003. ww.crystalcanyons.net/pages/TechNotes/3DMicroMacro.shtm

2. Hedley, A. CombineZ 5. My software to combine pictures toincrease depth of focus. 2006.www.hadleyweb.pwp.blueyonder.co.uk/index.htm

3. Cyprionka, H. Picolay – freeware for generating improved images from picture series. 2007. www.picolay.de

4. Heliconsoft. Helicon Focus. 2007.www.heliconfocus.com/heliconfocus.html

5. Berrevoets, C. RegiStax. Free image processing software. 2006. http://registax.astronomy.net

6. InnoStack. Astrostack. 2006. www.astrostack.com7. Piper, J. Luminance contrast – a new visible light technique

for examining transparent specimens. Microscopy Today15(4):26-34, 2007.

©2008 John Wiley & Sons, Ltd