|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.imageutil.BaseImageOperation org.shapelogic.imageprocessing.BaseParticleCounter
public class BaseParticleCounter
ParticleCounter count number of particles in a particle image.
This is using the SBSegmentation that is also used by Segmenter.
In this base implementation:
Find a color hypothesis.
Set everything in the background color into one segment.
Segment the rest into normal segments regardless of color.
If this is overridden then there can be more segments in the background color.
How do I know what is background colored?
Field Summary | |
---|---|
protected int |
_backgroundArea
|
protected java.lang.Integer |
_backgroundColor
|
protected int |
_backgroundCount
|
protected double |
_boundingBoxArea
|
protected ListStream<java.lang.String> |
_categorizer
|
protected ColorHypothesis |
_colorHypothesis
|
protected IColorHypothesisFinder |
_colorHypothesisFinder
|
protected java.util.Map |
_context
|
protected boolean |
_countOnly
|
protected boolean |
_displayInternalInfo
|
protected boolean |
_displayTable
|
protected java.lang.Integer |
_inputColor
|
protected int |
_iterations
|
protected double |
_maxDistance
|
protected int |
_maxPixelsInArea
|
protected int |
_minPixelsInArea
|
protected boolean |
_modifying
Modifying colors |
protected int |
_paintBackground
|
protected int |
_paintForground
|
protected RecursiveContext |
_parentContext
|
protected java.lang.Integer |
_particleCount
|
protected java.lang.Boolean |
_particleImage
|
protected java.util.List<IColorAndVariance> |
_particlesFiltered
|
protected java.util.List<IColorAndVariance> |
_particlesOrig
|
protected java.lang.Integer |
_referenceColor
|
protected boolean |
_saveArea
Create a IColorAndVariance, area for each particle. |
protected SBSegmentation |
_segmentation
|
protected boolean |
_toMask
|
protected boolean |
_useReferenceAsBackground
|
protected static int |
ITERATIONS_DEFAULTS
|
protected static double |
MAX_DISTANCE_DEFAULTS
|
protected static int |
MAX_PIXELS_IN_AREA_DEFAULTS
|
protected static int |
MIN_PIXELS_IN_AREA_DEFAULTS
|
Fields inherited from class org.shapelogic.imageutil.BaseImageOperation |
---|
_arg, _guiWrapper, _image, _keyValueParser, _setupReturnValue |
Constructor Summary | |
---|---|
BaseParticleCounter()
|
Method Summary | |
---|---|
protected void |
categorizeStreams()
Analyzes particles and group them. |
protected void |
customStreamDefinitions()
Define extra streams and also extra columns. |
protected void |
defaultColumnDefinitions()
Setup all the stream and other needed things. |
protected void |
defaultStreamDefinitions()
Define extra streams and also extra columns. |
void |
displayInternalInfo()
|
protected void |
displayResultsTable()
|
protected boolean |
findBackground()
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. |
protected void |
findColorHypothesis()
Everything related to setting the background color. |
IColorHypothesisFinder |
getColorHypothesisFinder()
|
java.util.Map |
getContext()
|
double |
getImageArea()
|
java.lang.Integer |
getInputColor()
|
java.lang.StringBuffer |
getInternalInfo()
|
int |
getIterations()
|
double |
getMaxDistance()
|
int |
getMinPixelsInArea()
|
RecursiveContext |
getParentContext()
|
int |
getParticleCount()
|
java.util.List<IColorAndVariance> |
getParticleFiltered()
|
SBSegmentation |
getSegmentation()
|
java.lang.String |
getStatus()
|
protected void |
globalFilter()
Filter particles on size and other global criteria. |
protected void |
init()
Setup all the needed factory methods based on what type the image has. |
boolean |
isParticleImage()
This is not fine tuned. |
boolean |
isUseReferenceAsBackground()
|
protected void |
populateResultsTable()
Populate the table with the streams. |
protected boolean |
populateResultsTableRow(int index)
Populate one row of the result table with the default fields. |
protected void |
populateResultsTableRowCustom(int index)
Populate one row of the result table with the extra fields. |
void |
run()
|
protected void |
segment()
|
void |
setColorHypothesisFinder(IColorHypothesisFinder colorHypothesisFinder)
|
void |
setDisplayTable(boolean table)
|
void |
setInputColor(java.lang.Integer color)
|
void |
setIterations(int iterations)
|
void |
setMaxDistance(double maxDistance)
|
void |
setMinPixelsInArea(int minPixelsInArea)
|
void |
setToMask(boolean toMask)
|
protected void |
setupTableBuilder()
|
void |
setUseReferenceAsBackground(boolean referenceAsBackground)
|
protected void |
showResultDialog()
|
Methods inherited from class org.shapelogic.imageutil.BaseImageOperation |
---|
getGuiWrapper, getImage, getKeyValueParser, getSetupReturnValue, isImageValid, setArg, setGuiWrapper, setKeyValueParser, setSetupReturnValue, setup, showAbout, showMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.shapelogic.imageutil.ImageOperation |
---|
getGuiWrapper, getImage, getKeyValueParser, getSetupReturnValue, isImageValid, setArg, setGuiWrapper, setKeyValueParser, setSetupReturnValue, setup, showAbout, showMessage |
Field Detail |
---|
protected static final int ITERATIONS_DEFAULTS
protected static final double MAX_DISTANCE_DEFAULTS
protected static final int MIN_PIXELS_IN_AREA_DEFAULTS
protected static final int MAX_PIXELS_IN_AREA_DEFAULTS
protected java.lang.Boolean _particleImage
protected boolean _modifying
protected SBSegmentation _segmentation
protected boolean _saveArea
protected IColorHypothesisFinder _colorHypothesisFinder
protected ColorHypothesis _colorHypothesis
protected int _backgroundArea
protected int _backgroundCount
protected java.lang.Integer _particleCount
protected double _boundingBoxArea
protected int _iterations
protected double _maxDistance
protected int _minPixelsInArea
protected int _maxPixelsInArea
protected boolean _displayTable
protected boolean _countOnly
protected boolean _toMask
protected boolean _displayInternalInfo
protected java.util.List<IColorAndVariance> _particlesOrig
protected java.util.List<IColorAndVariance> _particlesFiltered
protected ListStream<java.lang.String> _categorizer
protected java.lang.Integer _inputColor
protected java.lang.Integer _backgroundColor
protected java.lang.Integer _referenceColor
protected boolean _useReferenceAsBackground
protected java.util.Map _context
protected RecursiveContext _parentContext
protected int _paintForground
protected int _paintBackground
Constructor Detail |
---|
public BaseParticleCounter()
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
protected void findColorHypothesis()
protected void segment()
protected void globalFilter()
protected void defaultStreamDefinitions()
protected void customStreamDefinitions()
protected void setupTableBuilder()
protected void categorizeStreams()
protected void defaultColumnDefinitions()
protected void populateResultsTable()
protected boolean populateResultsTableRow(int index)
protected void populateResultsTableRowCustom(int index)
protected void displayResultsTable()
protected void showResultDialog()
public void displayInternalInfo()
public java.lang.StringBuffer getInternalInfo()
protected void init() throws java.lang.Exception
java.lang.Exception
public java.lang.String getStatus()
getStatus
in interface IParticleCounter
public SBSegmentation getSegmentation()
getSegmentation
in interface IParticleCounter
public boolean isParticleImage()
isParticleImage
in interface IParticleCounter
protected boolean findBackground()
public double getImageArea()
public int getParticleCount()
getParticleCount
in interface IParticleCounter
public java.util.List<IColorAndVariance> getParticleFiltered()
public IColorHypothesisFinder getColorHypothesisFinder()
getColorHypothesisFinder
in interface IParticleCounter
public void setColorHypothesisFinder(IColorHypothesisFinder colorHypothesisFinder)
setColorHypothesisFinder
in interface IParticleCounter
public double getMaxDistance()
getMaxDistance
in interface IParticleCounter
public void setMaxDistance(double maxDistance)
setMaxDistance
in interface IParticleCounter
public int getMinPixelsInArea()
getMinPixelsInArea
in interface IParticleCounter
public void setMinPixelsInArea(int minPixelsInArea)
setMinPixelsInArea
in interface IParticleCounter
public int getIterations()
getIterations
in interface IParticleCounter
public void setIterations(int iterations)
setIterations
in interface IParticleCounter
public void setDisplayTable(boolean table)
public java.lang.Integer getInputColor()
public void setInputColor(java.lang.Integer color)
public boolean isUseReferenceAsBackground()
public void setUseReferenceAsBackground(boolean referenceAsBackground)
public java.util.Map getContext()
getContext
in interface RecursiveContext
public RecursiveContext getParentContext()
getParentContext
in interface RecursiveContext
public void setToMask(boolean toMask)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |