2002/10/11: First version
2002/11/05: Support for rectangular ROIs; different naming scheme of the resluting image
2003/08/13: Height map option; recordable
2004/03/15: Works with RGB stacks
2006/07/18: Added option of
using only one color for focusing (green) and copying the rest of the colors
along, which can be useful in human vision applications.
The plugin is a very simple algorithm of patching a *focused * image from a
stack of images corresponding to different focal planes. Plugin provides optional generation of
an 8-bit greyscale “height” map, i.e. image of heights at which focused elements are located. It is very important
that images in the stack are of the same brightness; otherwise pasting together
pieces of different images will create artificial edges.
Code for running this plugin from another plugin or from a macro can be generated using the
command recorder (Plugins/Macros/Record).
What the plugin does:
creates a 32-bit float copy of original stack of ROI or the whole image area
to preserve precision;
on 32-bit copy finds edges for each slice in a stack by running median 3×3
(to reduce noise) and then Sobel filter;
creates a “map” of how far the influence of edges extends; i.e. how far from
a focused edge we still think that the image is focused; this is done by taking
the maximum value in the neighborhood of the specified size;
for every pixel (x, y) based on the choice of the maximum “edge” value among
different slices in the “map” stack [the plugin] copies the pixel value from the
original image to the new image. if selected, sets the corresponding value in the “height” map to
the 255*i/stack_size, where i is the “focused” slice.
Plugin works on a currently active 8-bit or 16-bit grayscale stack and
accepts rectangular ROI; if no ROI is specified plugin works in the whole image.
It is possible to consequetively select a ROI and run plugin several times on
the same stack
with different kernel
sizes since ImageJ allows coexistence of several windows with same title at the
The size in pixels (odd integer > 1) of
the Maximum square filter is requested; trial and error would be the fastest way
to optimize the result. The final image is written to “Focused_”+<original stack
title – extension> window. The height map is written to “HeightMap_”+<original stack
title – extension> window. No changes are made to the original stack.
For more information see program code. The author would appreciate any
suggestions regarding the plugin (improvements, extensions, interface changes, etc.).
Author: Wayne Rasband (wsr at nih.gov) Source: Voxel_Counter.java Installation: Download Voxel_Counter.class to the plugins folder and restart ImageJ. Limitations: Requires an 8-bit stack. Description: This
Authors: Patrick Pirrotte & Jerome Mutterer (jerome.mutterer at ibmp-ulp.u-strasbg.fr) Jeff Brandenburg, Duke Center for In-Vivo Microscopy (jeffb at orion.duhs.duke.edu) History: 2003/03/28: First version 2005/08/15: Added
Author: Wayne Rasband (wsr at nih.gov) Date: 2002/01/10 Source: Stack_Inserter.java Installation: This plugin is built into ImageJ 1.43t and later as the Image>Stacks>Tools>Insert command. Description:
Author: Pedro Ramos-Cabrer (ramos at mpin-koeln.mpg.de) Based on Time Stamper by Wayne Rasband (https://rsb.info.nih.gov/ij/plugins/stamper.html) History: 2004/05/13: Initial version Source: Slice_Labeler.java Installation: Copy Slice_Labeler.class to the