This page about the logic language from ShapeLogic 0.9 and forward.
For a broader introduction to the logic system see Declarative logic.
To change the categorizers used for particle analyzer or letter matcher you can override a class: DigitStreamVectorizer is an example showing what is needed to define a match of the digits working as a plugin from ImageJ. Starting in ShapeLogic 1.6 this could be done by using a categorizer setup file: shapelogic/src/test/resources/data/neuralnetwork/polygon_digit_recognizer_with_rules_print.txt. This has exactly the same effect.
========== def A pointCount == 5 holeCount == 1 tJunctionLeftCount == 1 tJunctionRightCount == 1 endpointBottomPointCount == 2 horizontalLineCount == 1 verticalLineCount == 0 endPointCount == 2 softPointCount == 0
The "def A" is saying apply this rule to the OH, object hypothesis, the letter A.
Each line has 3 elements:
rule("A", POINT_COUNT, "==", 5.); rule("A", HOLE_COUNT, "==", 1.); rule("A", T_JUNCTION_LEFT_POINT_COUNT,"==", 1.); rule("A", T_JUNCTION_RIGHT_POINT_COUNT,"==", 1.); rule("A", END_POINT_BOTTOM_POINT_COUNT, "==", 2.); rule("A", HORIZONTAL_LINE_COUNT, "==", 1.); rule("A", VERTICAL_LINE_COUNT, "==", 0.); rule("A", END_POINT_COUNT, "==", 2.); rule("A", SOFT_POINT_COUNT, "==", 0.);
Lazy streams have the following features
IoC hold potential but has not been used yet.
Make menu items in ImageJ's menu for opening and running a user defined rule database, without user defined Java code. Since it was so easy to define rules in Java this have been given lower priority than originally planned.
One possible problem with moving rules to Java 6 Scripting, is that this requires that the user downloads engine interface files from Sun. This would make the installation of ShapeLogic more complicated now it is just unpacking a zip and moving it into ImageJ's plugin dir.
The only scripting language that works out of the box is JavaScript. While that is a reasonable language the integration with Java is not so great especially not Java 5.
It is also possible to connect Groovy and Java outside Java 6 Scripting, but then it would not be uniform.