Java / ImageJ Code
Java source code for the programming examples in this book. Many other example plugins can be found on the official ImageJ web site. The ImageJ Short Reference (Appendix C of this book) can be found here.
License
This software is released under the terms of the GNU Lesser General Public License (LGPL).
Download
>> complete source code (single ZIP file)
Source code for individual chapters:
CHAP | ZIP | PROG | DESCRIPTION |
3 | 3.1 | invert 8-bit grayscale images | |
4 | 4.1 | compute the histogram for 8-bit grayscale images | |
|
| 4.2 | compute a "binned" histogram |
|
| 4.3 | create and display a new image in ImageJ |
5 | 5.1 | increase image contrast | |
| 5.2 | linear histogram equalization | |
|
| 5.3 | histogram matching, histogram specification |
| 5.4 | gamma correction | |
| 5.5–6 | alpha blending | |
6 | 6.1 | 3x3 averaging (box) filter | |
| 6.2 | linear 3x3 smoothing filter | |
| 6.3 | linear MxN filter | |
| 6.4 | compute a 1D Gaussian filter kernel | |
| 6.5 | 3x3 median filter | |
7 | 7.1 | unsharp-mask filter | |
8 | D.1 | Harris corner detector | |
9 | 9.1 | Hough transform for straight lines | |
10 | — | morphological filters for binary images with various structuring elements: box, disk, free-form | |
11 | 11.1 | region labeling in 4 versions: flood-filling (recursive, depth-first, breadth-first), sequential region labeling | |
| D.2 | combined region labeling and contour following | |
| 11.2 | contour tracing | |
| 11.3 | computing moments | |
|
| 11.4 | computing projections |
12 | 12.1 | processing RGB color images with bit operations | |
| 12.2 | processing RGB color images without bit operations | |
| 12.3 | processing index images (increasing brightness) | |
| 12.4 | converting index images to RGB full color images | |
| 12.5 | desaturating RGB color images | |
| 12.6–7 | RGB/HSV conversion and back | |
| 12.8–9 | RGB/HLS conversion and back | |
| 12.10–11 | Java implementation of L*a*b*-color space | |
| 12.12 | counting colors in RGB images | |
| 12.13 | computing combined color histograms | |
13 | 13.1 | one-dimensional DFT for data vectors of arbitrary length (2 versions) | |
14 | — | two-dimensional DFT for images of arbitrary size | |
15 | 15.1 | one-dimensional DCT | |
| — | two-dimensional DCT | |
16 | — | geometric mappings (Affine Mapping, Projective Mapping, Bilinear Mapping, Twirl Mapping, Ripple Mapping, Sphere Mapping) | |
| pixel interpolation (Nearest-Neighbor, Bilinear, Bicubic) | ||
17 | 17.1–2 | template matching for intensity images using local correlation coefficient | |
| — | template matching for binary images using Distance transform and Chamfer algorithm | |
App. B | — | utility methods: mod() and duplicating arbitrary arrays | |
App. C | C.1 | direct pixel access example | |
| C.2 | converting ImagePlus objects | |
| C.3 | animation example (updating and redisplaying an image) | |
| C.4–5 | stack example – alpha blending | |
| C.6 | working with non-rectangular regions of interest (ROIs) | |
| C.7 | use of image properties | |
| C.8 | use of GenericDialog |