Authors: Audrey Karperien, Charles Sturt University (akarpe at sbcglobal.net)
Thomas R. Roy, University of Albert
History: 2005/05/24: Version 2.0a
2005/06/01: Bug fixes
2005/07/18: Bug fixes
2005/07/20: Bug fixes
Source: Contained in Hull_And_Circle.jar, which can be opened using a ZIP utility. Installation: Download Hull_And_Circle.jar to the plugins folder, or subfolder, restart ImageJ, and there well be a new Plugins/Shape Analysis/Hull And Circle command. Description: HullAndCircle is a plugin for ImageJ used for finding the convex hull and bounding circle of patterns in binary digital images. It is in the public domain. Values for the hull (e.g., the hull's circularity and its bounding circle's diameter) are returned in the results table. Other values are accessible within the code.
The essential algorithm is:
This plugin was originally conceived and developed by Audrey Karperien at Charles Sturt University in 2002-2004 as a subcomponent of a master's project supervised by Dr. Herbert Jelinek, Neuroscience Department, School of Community Health, Charles Sturt University, Australia. T.R. Roy, Computing Science, University of Alberta, Canada, a coauthor, provided the modified convex hull algorithms and helped develop the bounding circle algorithm. The algorithm for finding the bounding circle was developed originally in a larger plugin, then developed further using an idea posted by Xavier Draye to the ImageJ listserver.
- Find the convex hull
- Choose three points on it
- Try the largest span across the hull
- If that circle does not include all the points, use the triangle having the largest perimeter
- Finally, keep the chosen equation of the circle found by solving three equations simultaneously
The following macro generates a test image and then runs the Hull And Circle plugin:
nPoints = 40; blackBackground = false; if (isOpen("Plots")) { selectImage("Plots"); close(); } if (isOpen("copyPlots")) { selectImage("copyPlots"); close(); } if (blackBackground) { newImage("Plots", "8-bit Black", 512, 512, 1); for (i=0; i<nPoints; i++) putPixel(random()*300+50,random()*300+50, 255); } else { newImage("Plots", "8-bit White", 512, 512, 1); for (i=0; i<nPoints; i++) putPixel(random()*300+50,random()*300+50, 0); } run( "Hull And Circle");See Also: Innaconne, Geometry in Biological Systems.
Costa and Cesar, Shape Analysis and Classification, CRC Press, 2001
Examples: