Images obtained with traditional silver halide photographic techniques can be converted to digital images using film scanners. These wonderful devices are available of converting both colour slides and colour negatives into digital images. Unfortunately these scanners must be built to very high precision, and consequently, they are all rather expensive. Many people make the serious mistake of using ultra high speed colour negative film for about every standard photographic image that they take. The images from this type of film are extremely grainy, and the colour rendition is generally very inferior to slower film.
Whether the digital images are obtained directly as digital images, or whether they be obtained by scanning photographic slides or negatives, image processing techniques can often improve the images dramatically.
Most USB digital cameras can be mounted as drives to download their images directly to POSIX compliant devices. Many dedicated microscope cameras work best with POSIX operating systems, especially Linux systems. They often, however, require some sort of kernel module.
There are available microscope imaging attachments that send a continuous stream of images through the USB port, these usually are fairly low resolution, usually 640x480 pixels. When these cameras are being used, the images can be captured at any point using the ImageMagick "import" utility. These cameras are very sensitive to dim light, and image rate is quite rapid, so that one can capture images of moving organisms very easily, often producing images that are surprisingly spectacular. (One particularly inexpensive one is sold as the "DCM35". A linux kernel module called spca5xx is available which permits its use with late version Linux kernels.)
Scanners generally will work well on POSIX systems when the xsane system has been installed. Most scanners can simply be plugged into the USB port, and the xsane program will recognise them.
Digital Images and their Modification
Digital images can almost always be improved by image processing techniques. Computers replace darkrooms!
Image processing, like virtually all other computer tasks, can utilise either commercial or open source programs. The same situation obtains to image processing as obtains to all other areas, namely, the most bug free and stable programs are generally the free open source ones that have been in use for several years. The worst ones tend to be new free open source ones, and the (generally rather expensive) commercial ones lie somewhere in between. The commercial programs are usually, but certainly not always, better documented and are also often somewhat less user hostile, but they also generally have less capabilities. The latter is surprising to many--after all one would think that if one would have to pay for something one would naturally think it would have more capabilities than a free program that does the same thing.
The BSD, Linux, and other free Unix clones have a more or less standard interface called the POSIX standard, and all of these operating systems can use the basically free Xwindow system. X users have an enormous choice of Xwindow managers that provide dramatically different capabilities.
There are three free extraordinarily good image processing software packages for POSIX operating systems:
- 1. netpbm This is an enormous set of command line programs that can be used to interconvert virtually any common image formats, and can also perform certain image processing functions. This package has no provision for viewing images.
- 2. Image Magick This package can read many image formats, and perform several types of image processing functions. It has a very useful image display program called "display." It can read and write formats that have 16 bits/colour. There are at least two separate versions of this package being maintained at this point.
- 3. GIMP This program has been around for several years and is very stable. It has many extraordinary capabilities. Unfortunately it cannot read formats with more than 8 bits/colour. It takes "plug ins" that can add more capabilities than it already has. It is somewhat user hostile, and the documentation is not as great as it could be.
No matter how the image is obtained, it is best to have the primary image have as many bits per colour as possible. Although few, if any people can tell the difference between an image with 8 bits/colour from one with 16 bits/colour, images with more bits/colour contain more information that can be used by image processing programs when the final images are produced. When images with too few bits/colour are modified to stretch contrast, one may find that the images are highly unacceptable with no intermediate shades between quite bright and black! (Or no intermediate shades between quite dim and white.) Xsane normally can produce files in jpeg or pnm. The latter is GREATLY preferred, because saving images as jpeg results in some loss of original digital information, and may introduce unacceptable artifacts when image processing techniques are applied to the images. Most programs that produce and save jpeg images ask for a "quality" number. If you must use jpeg, use a "quality" near 100%.
Microscope images differ from images taken of most other subjects in a very important way, namely, the most important image characteristic is that it provide the best possible display of structures on the original subject. Faithful production of colours and relative visual effect often are of little concern. After all the original subjects are not even visible to the naked eye at all, and optical techniques such as phase contrast and the like have already dramatically altered the image. For images taken with phase systems it is often best to use just the green image, or to use a green light source and monochrome film if using conventional photography. Images of slides stained with a single colour dye generally reveal the most detail when the image is recorded monochrome near the wavelength of maximum absorption of the dye. For images taken at high magnification images taken in blue light are noticeably sharper than those taken in red.
HOW TO DO IT!
The first step after obtaining a digital image, whether from scanning a negative or slide, or from a digital device, is to examine it very carefully and see if it be apparent that any kind of image processing technique might improve it. If the image have more than 8 bits/colour, you may have to use the ImageMagick display program to do this. One should look for the following:
- 1. Should this image be kept as a colour image? (If, for example, this be an image taken with a phase contrast system using green light, it makes no sense to keep it as a coloured image since only the green channel has any image anyway.)
- 2. Is the contrast correct?
- 3. Is the image too dim or too bright?
- 4. Is the colour balance correct. Examine both light and dark areas. Unlike conventional photography one can modify both the contrast and the intensity of the individual primary colours. (red, green, and blue.)
- 5. Is the image sharp? Amazingly enough out of focus images can be processed to make them sharp again, but this often introduces artifacts such as halos around objects, and artifacts already in the image tend to get multiplied.
- 6. Might the image be improved by processing techniques that make certain features more visible even though this may make the resulting image visually very different from the original?
Very often one may find that the netpbm utilities, the ImageMagick utilities, and Gimp may all three be required to produce a really first rate image. It is always best to use gimp LAST, especially when the original image has more than 8 bits/colour.
It is good practise to store the original images on CDROMs and to store the final images separately. Before trying to modify the image, copy it to a working directory. If it be not in pnm format, it is probably best to convert it to this format first.
When it be apparent that a monochrome image would be better than a colour one, it is best to convert the image to monochrome before doing anything else. Generally it is best to use just one of the three colour channels. This requires that you separate the three colour channels that are in the original image file. The netpbm program "pamchannel" is supposed to do this, but it produces output only in pam format, and it does not seem to work properly with 64 bit linux. Unlike the other netpbm utilities, it is also needlessly user hostile. I could not find a program to decompose the standard ppm "P6" format to the standard pgm "P5" format that worked the way I wanted it to, so I wrote one myself, pnmdecompose. Click here to download it. You can compile it by simply typing "cc -o pnmdecompose pnmdecompose.c" It does not require any special libraries at all. After it is compiled, you can move the executable to /usr/local/bin. If you simply type pnmdecompose myfile.pnm it will produce three grey image files, one red, one green, and another blue. Do not attempt to use this program with an old computer using 64K segments, as it loads the entire image into memory. (My program can handle 16 bits/colour images.)
The image below shows the original image captured with a pcm35 imaging attachment. (cheek epithelial cells)