Cell Counter

Author: Kurt De Vos
University of Sheffield, Academic Neurology
kurt.devos at iop.kcl.ac.uk
Source: Included in cell_counter.jar, and is released under the GNU General Public License.
Installation: Download cell_counter.jar to the plugins folder, or subfolder, restart ImageJ, and there will be a new "Cell Counter" command in the Plugins menu or submenu.
Bugs: May not work correctly after using Load Markers to load more than 8 counter types from an XML file. Opens off-screen on 1024 pixel wide and smaller monitors.
Description: This plugin will open a new cell counter GUI. On the left are the counter types and counters, on the right the action buttons.


  • Initialize: Initializes the current image or stack for counting, this will create a duplicate image/stack titled "counter window" - when keep original is checked, the source image remains open
  • Add: adds a counter type.
  • Remove: removes the last counter type.
  • Delete mode: toggles between insert and delete mode. When checked, the marker of the currently selected type closest to the mouse cursor will be deleted when you click.
  • Delete: delete the last placed marker.
  • Reset: reset all counters to 0.
  • Results: Shows the counter results in the ImageJ results table. In case of a stack the counts per slice and the totals are displayed.
  • Save Markers: Exports the marker data to an XML file - Only available when running java 1.4 or higher
  • Load Markers: Loads stored marker data from an XML file - - Only available when running java 1.4 or higher
  • Export Image: Makes a copy of the counter image with the markers written on it (only the current slice is copied in case of a stack)
  • Measure...: Measures the pixel value at each marker and displays a result window showing: Type - Slice - X coordinate - Y coordinate - Pixel Value
Open the Cell Counter plugin and the image/stack you want to count (if the Cell Counter plugin is already open you don't need to open a new instance). Click initialize, now you are ready to count features.
Note that at any time you can add types or remove them. Select the type you want to count, and count by clicking on the feature in the image. A colored number corresponding to the type you are counting will be displayed on the image every time you click, and the corresponding counter is updated.

Add the following macros to ImageJ/macros/StartupMacros.txt, restart ImageJ, and you will be able to change the counter type by pressing "1", "2", "3", etc.

  macro "Type 1 [1]" {call("CellCounter.setType", "1");}
  macro "Type 2 [2]" {call("CellCounter.setType", "2");}
  macro "Type 3 [3]" {call("CellCounter.setType", "3");}
  macro "Type 4 [4]" {call("CellCounter.setType", "4");}
  macro "Type 5 [5]" {call("CellCounter.setType", "5");}
  macro "Type 6 [6]" {call("CellCounter.setType", "6");}
  macro "Type 7 [7]" {call("CellCounter.setType", "7");}
  macro "Type 8 [8]" {call("CellCounter.setType", "8");}
History: 2001/10/17: first version
2002/02/01: bug fixes
2004/06/26: upgraded to work with ImageJ 1.32
2005/12/27: version 2
2006/02/02: No longer requires Java 5.0
2006/02/14: Added "Save Markers" and "Load Markers" buttons
2006/03/06: Added "Export Image" and "Measure" buttons
2006/03/12: Add "Show Numbers" checkbox
2008/02/29: Updated to work with Grid plugin
2008/08/27: Added "Show All" checkbox; works with hyperstacks and composite color images
2008/09/02: Added setType() method to support macros
2008/09/22: Out of focus markers displayed as outlines
2009/07/01: Fixed "Load Markers" bug
2010/12/07: Uses less memory

|Plugins | Home |