ShapeLogic v 1.1 contains the first version of an automatic color and gray scale particle counter working without manual user intervention.
The particle counter in ShapeLogic v 1.1 has gone through limited testing, and seems to work well. Tweaking the parameters is a little clumsy. Users looking for a mature particle counter should probably wait for ShapeLogic v 1.2.
The particle counter was tested on the particle images from ImageJ:
embryos.jpg. The un-tweaked particle counter in ShapeLogic 1.1 found
particle count = 9
embryos.jpg contains 6 particles and a few shadows.
After changing the parameter setting it found
particle count = 5
which is the correct value since ShapeLogic 1.1 cannot split overlapping particles.
Cell_Colony.jpg. It is hard for a human to count the particles in this image but ShapeLogic v 1.1 gave a reasonable result.
blobs.gif. ShapeLogic v 1.1 did not recognize this as a particle image.
_iterations = 4; // K-mean iterations for color hypothesis _maxDistance = 90; // Distance between color in same color bucket _minPixelsInArea = 70; // Minimum number of pixels in particle
This information is available but there is no print report function in 1.1.
There is just one step. Under shapelogic menu click "Particle Counter".
A dialog will appear with the following information:
The particle counter algorithm in ShapeLogic 1.1 is relatively simple. It is setup to be expanded to handle more advanced algorithms. Here is the flow.
Here are the parameters you can set with their default values:
int _iterations = 2; // K-mean iterations for color hypothesis double _maxDistance = 50.; // Distance between color in same color bucket int _minPixelsInArea = 5; // Minimum number of pixels in particle
Tweaking the parameters is a little clumsy, currently this has be done from within the Java code.
Copy the following text into a file called CustomParticleCounter_.java:
import org.shapelogic.imageprocessing.BaseParticleCounter; import org.shapelogic.imageutil.PlugInFilterAdapter; /** CustomParticleCounter shows how customize the parameter settings. */ public class CustomParticleCounter_ extends PlugInFilterAdapter { public CustomParticleCounter_() { super(new BaseParticleCounter() { { _iterations = 4; // K-mean interations for color hypothesis _maxDistance = 90; // Distance between color in same color bucket _minPixelsInArea = 70; // Minimum number of pixels in particle } }); } }
CustomParticleCounter.class CustomParticleCounter_$1.class