Author: Wayne Rasband (wsr at nih.gov) History: 2010/12/01: First release
Source: ImageJ_Find_Max.java, Byte_Find_Max.java, Imglib_Find_Max.java, ImageScience_Find_Max.java and Pixlib_Find_Max.java. Installation: Drag and drop ImageJ_Find_Max.java, Byte_Find_Max.java, Imglib_Find_Max.java, ImageScience_Find_Max.java or Pixlib_Find_Max.java onto the "ImageJ" window and compile and run by pressing ctrl-r (File>Compile and Run). Description: I developed these plugin to compare the speed of various dimension and data type independent pixel access methods. What they do is find the first pixel in an image, stack or hyperstack that contains the maximum value and write to the Log window the maximum value, the location of the pixel and the processing rate in millions of pixels per second. In addition, they create a point selection at the location of the pixel and position the stack or hyperstack so that the image containing the pixel is displayed. The Imglib_Find_Max plugin requires Fiji, the ImageScience_Find_Max plugin requires Erik Meijering's imagescience library and the Pixlib_Find_Max plugin requires Dimiter Prodanov's pixlib.jar library.
The ImageJ_Find_Max plugin runs up to seven times faster on 64-bit versions of Java because the JIT compiler is able to inline the getf() method.
For best performance, run the plugins by selecting them from the Plugins menu. Run them repeatedly by pressing shift-r (Process>Repeat Command) for even better performance.
This is the Log window output created by running the ImageJ_Find_Max plugin on a 2.26 Ghz Intel Core 2 Duo with Java 1.6.0_22 (64-bit) on a 128MB (512x512x512) stack and then repeatedly pressing shift-r:
270.6 million pixels/secondThis is the output created by running the Imglib_Find_Max plugin on the same stack:
272.8 million pixels/second
767.0 million pixels/second
762.6 million pixels/second
699.1 million pixels/second
771.4 million pixels/second
67.8 million pixels/second
73.3 million pixels/second
72.9 million pixels/second
75.7 million pixels/second
77.2 million pixels/second
77.2 million pixels/second
Here is a plot of the results created using this ImageJ macro:
Here are the results from running the benchmarks on a 1024x1024x1 8-bit image:
And here are the results from running them on a 512x512x512 stack using a 32-bit version of Java: