This is an adapter class for AnnotatedShape, working as an abstract base
class for classes that need to implement AnnotatedShape
Can make lazy init later
Make a stream that is using a Calc1 class to do a calculation, based on
a named input stream stored in a context.
Based on ListCalcStream1.
Uses lazy setup so input stream does not have to exist when stream is created.
There should be a way to say whether you have to calculate all the values
sequentially to use this.
Close to NamedListCalcStream1, but with no caching.
So the idea is that you should have a slice of the circle
Since it is circular it does not really make sense to talk about:
min and max
what is the equivalent
I guess start and end assuming that you go in normal direction of increasing angles.
ColorNorm is the scaled 1 norm in the color space.
The 1 norm is called the Taxicab norm or Manhattan norm.
It is then scaled down by the number of dimensions, so that the distance of
2 colors will be the same in gray and RGB space.
This could be changed to use scaling for the different component.
Analyzes a particle image in gray or RGB and group the particles according
to shape rules.
Find a place in the base class where there is a hook for this extended functionality.
Some of the methods can be moved to ColorParticleAnalyzer to remove dependency of ImageJ.
Handles Color Replace for individual pixel, used with wrapper to work on whole image.
Example of a PixelHandler that can be used to change a whole image.
ConfidenceArraySelector takes a double[] and creates a String.
Translates a double[] that could come from a neural network to either the
number of the one that is winning walue if any is or to a name for that.
When an expression returns a collection this does a count on it and does a
greater than comparison
It will also work when the expression is returning null and the expected number is 0.
This should read a csv file and parse it into objects of an
given class or into DynaBean
It assumes that the first time is the heading with the right name
the second line is the type of each field.
Method to override if you want to define your own rule set.
The default network is very simple it is marking particles Tall, Flat
based on their aspect ratio.
Method to override if you want to define your own rule set.
The default network is very simple it is marking particles Tall, Flat
based on their aspect ratio.
FFNeuralNetworkStream a feed forward neural network wrapped in a stream.
Streams involved:
ArrayOutputListStream: A list of names of input features that need to be streams
FFNeuralNetwork: Creates stream of double[] from the neural network
ConfidenceArrayListStream: Creat result stream of String
Which of these needs names? None of them.
It seems like the last stream will have the same output as the overall stream
is the overall then really needed? No.
There should probably be a stack of Streams.
This could possibly be a LISP list, no there is no advantage to this.
The whole think should be created lazily, but when it gets created, you can
directly pipe one into the next.
What should trigger the setup?
As long as the first have a lazy setup we should be fine and it does.
So the first should be any type of ListStream, while the next have to be
ListCalcStream1 or any ListStream with one input.
FilterCountTask is a new type of filter expression
The advantage of using this over the SimpleNumericTask is that you can do
boolean expression of the filter expressions
Might be deprecated since there are several classes that does a lowest level comparison
FilterCountTask is a new type of filter expression
The advantage of using this over the SimpleNumericTask is that you can do
boolean expression of the filter expressions
Count background pixels.
Should be called when only background have been segmented.
Not sure that this really makes sense, or I can assume that there is always 1 background.
If a named value cannot be found for a String key, instead
see if the first part of the string is the name of a class set in the context
if it is the name of a class that is an emum then try to see if rest is an legal value
In ImageJ this will return the byte if it is a byte gray else an
encoded RGB value.
This does not work well with BufferedImage that has a method to always
return the RGB.
I might have to subclass this in order to make an effective implementation.
The part of the image that is available in the pixels array.
A hook to only have part of the image active at the same time.
Returning null mean that the whole images is available in the pixels array.
Color vector to be used for color distance.
Should I use the center color or the mean color?
I will start by using the mean color.
I think that I will start without including the standard deviation.
Color vector to be used for color distance.
Should I use the center color or the mean color?
I will start by using the mean color.
I think that I will start without including the standard deviation.
I think that this need to be done differently for different types of polygons
For Polygon: Just go through lines and filter
For MultiLinePolygon: Run through both multi lines and independent lines
How do I get this unified?
Change so they have the same interface so now Polygon also return independent lines.
ColorAndVarianceI is a color aggregate with a mean color and a standard deviation.
ColorAndVarianceI is an interface for a color / gray implementations.
A mathematical norm and distance in different color spaces.
So it is a distance that conforms with the vector multiplication.
This does not just apply to the color itself but also to the standard deviation.
How do I present the combination in a simple way?
For gray I could make a vector of 2 integers.
For color I could make a vector of 4 or 6 integers.
Maybe I can use a 1 norm that is divided by the number of dimensions.
I am not sure that the variations in the std is as big and as important as
the color variations.
Maybe all I need to do is giving some weights as input.
Maybe I could even have one norm that worked with different dimensions, with
different weights.
A mathematical norm and distance in different color spaces.
So it is a distance that conforms with the vector multiplication.
This does not just apply to the color itself but also to the standard deviation.
How do I present the combination in a simple way?
For gray I could make a vector of 2 integers.
For color I could make a vector of 4 or 6 integers.
Maybe I can use a 1 norm that is divided by the number of dimensions.
I am not sure that the variations in the std is as big and as important as
the color variations.
Maybe all I need to do is giving some weights as input.
Maybe I could even have one norm that worked with different dimensions, with
different weights.
IColorEdgeArea is a color aggregate with a mean color and a standard deviation,
range and space.
ColorAndVarianceI is an interface for a color / gray implementations.
Interface for finding a ColorHypothesis in an image.
Maybe this should be changed to a stream later.
Do I need to know if this is a color or a gray image?
I do not think so.
Make a stream that is using a Calc1 class to do a calculation, based on
a named input stream stored in a context.
Uses lazy setup so input stream does not have to exist when stream is created.
There should be a way to say whether you have to calculate all the values
sequentially to use this.
Does numerical comparison of an expected value and a found value
Checks that calculated value is greater than the expected value
There are several version doing related tasks:
This is the simple version that does not do a size() operation for you
Shows how how to call one PlugInFilter from another.
Used to be called org.shapelogic.imageutil.PlugInFilterCaller_,
but that caused it to show up in the ImageJ memu.
This is important for unit testing.
Polygon is the bottom class for polygon works for points on any kind
Almost immutable: you can extend it by adding more
but you cannot change the element, and the underlying points are mutable.
Polygon() -
Constructor for class org.shapelogic.polygon.Polygon
Base class for all the spatially based point filters
In order to get the cut off vale you need to know the bounding box for the polygon
This is only know when the filter is actually run.
Should this be based on a BaseListStream, when there is no input?
Probably not.
How should they be generated?
I could say start by last number and add until you get one that does not
have any of the previous as divisors.
There can be a stop value:
start index default 0
If there are cases where you know the start and stop.
setup() -
Method in interface org.shapelogic.calculation.LazyCalc
Currently not super well define used for 2 purposes:
Reset: called from the outside if you want to reuse it
init: Called from the inside when calculation start to have everything setup
maybe the semantic could work for both?
TODO: This should be separated better.
Abstraction of ImageJ ImageProcessor.
This is an attempt to get Java BufferedImage to look like the ImageJ ImageProcessor.
They are not perfectly matched.
I think that I should make the assumption that this is either a
24 or 32 bit RGB
8 bit gray
And fail the creation if it is not.
Very thin abstraction around ImageJ.
You should be able to open based on different things.
What type of images should you have and how should the be accessible?
I think that maybe having a small subset of what is in an ImageJ
ImageProcessor should be enough for most things in ShapeLogic.
Properties to be Stream the universal calculation and logic unit.
This is going to replace the current Calc, so this should probably just be
renamed to Calc or LazyCalc.
Should I assume that null means absent of value?
That seems a little harsh.
Set this flag if the filter wants ImageJ, for non-rectangular
ROIs, to restore that part of the image that's inside the bounding
rectangle but outside of the ROI.
UNKNOWN means not tested for round, but treat as a multi line
NOT_ROUND means that it is tested for any of the round categories and it is not, treat it as a multi line
STRAIGHT lines combined to a straight line, say for an F
CIRCLE_ARCH_FORWARDS, from the first point move in increasing angle to get to second point
_points -
Variable in class org.shapelogic.polygon.Polygon