ShapeLogic is an open source toolkit for declarative programming, image processing and computer vision.
ShapeLogic has 2 applications: The Color Particle Analyzer will find and categorize particles on a relatively uniform background then make a report of geometric properties for each of the particles. The main application is for recognizing cells in medical image processing. The Letter Matcher is a general categorizer for skeletonized lines.
Code hosted on http://code.google.com/p/shapelogic/. From there you can download both source files and binary distributions.
Join the ShapeLogic mailing list for announcements, questions, bug reports, suggestions and feature requests. You can help improving the stability of ShapeLogic by filing a bug report.
The first ShapeLogic implementation is in Java. ShapeLogic C++ was started in September 2008.
Started in ShapeLogic 1.5 the categorization in the Color Particle Analyzer and the Letter Matcher, can either be done with handwritten rules or generated by machine learning. The first machine learning technique in ShapeLogic is a multi-layer feed forward neural network that is trained externally but run internally.
ShapeLogic is a library for
While ShapeLogic's declarative programming system was initially developed for image processing and computer vision, it is widely applicable. It is currently difficult to combine declarative programming and image processing. ShapeLogic is intended as basic plumbing software that turns a logic engine or a neural network into a simple plugin component to ease entry into vision and image analysis. ShapeLogic also fills gaps missing from current Java image processing libraries, and uses a commercially friendly license.
ShapeLogic 1.6 contains a Color Particle Analyzer.
Here is an example particle image embryos.jpg
Here is the result of running the non-customized particle analyzer on it.
The categories for the particles are only examples, it is easy to setup different rules for categorizing particles.
In ShapeLogic 1.7 train a neural network to categorize specific cells.
ShapeLogic 1.6 also contains the second version of a color particle counter. It also prints a smaller report of the particle's properties.
To run as a library for functional and declarative programming there are no requirements.
To run as an ImageJ plugin ShapeLogic uses the following libraries:
You can run all current image processing algorithms outside ImageJ, using just a BufferedImage should you want to embed ShapeLogic in your application.
These are used in unit tests, builds or old versions of image processing functionalities:
ShapeLogic C++ started as an attempt to port some algorithms from ShapeLogic Java. ImageJ makes image processing programming very accessible under Java. While there are great open source libraries in C++ there did not appear to be anything like ImageJ with an commercially friendly OSS license. Before algorithms could be ported from ShapeLogic Java some of the functionality of ImageJ had to be established. Simplicity of programming is a main concern.
This was mainly a question of finding the best OSS C++ libraries and getting them to work together. After a good deal of experimenting this was the libraries that were chosen:
The neural network need to be trained externally and you need override a class to import the weights. This override is simple but does require some knowledge of Java.
For more up to date information on ongoing development work look at these
Here are 2 other test image for the particle analyzer. They are taken from the sample images from ImageJ.