Class SimpleBlockFill
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
-
- adams.flow.transformer.negativeregions.SimpleBlockFill
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,Serializable
public class SimpleBlockFill extends AbstractNegativeRegionsGenerator
Finds largest blocks from starting points on grid.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANNOTATION
the value for annotation.protected ObjectFinder
m_Finder
the object finder to use.protected int
m_NumCols
the number of columns.protected int
m_NumRows
the number of rows.protected double
m_ScaleFactor
the scale factor to use on the image size.static int
NEGATIVE
the value for a negative region.-
Fields inherited from class adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description SimpleBlockFill()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected LocatedObjects
doGenerateRegions(AbstractImageContainer cont)
Generates the negative regions.protected void
fillInArea(IntArrayMatrixView matrix, LocatedObject obj, int color)
Fills in the area of the object with the specified color.String
finderTipText()
Returns the tip text for this property.protected void
findExtent(IntArrayMatrixView matrix, int s, int t, boolean horizontal, int[] ext)
Finds the largest horizontal or vertical extent from the specified position without hitting an annotation.ObjectFinder
getFinder()
Returns the object finder in use.int
getNumCols()
Returns the number of columns in the grid.int
getNumRows()
Returns the number of rows in the grid.double
getScaleFactor()
Returns the scale factor for the image.String
globalInfo()
Returns a string describing the object.protected boolean
isValidExtent(int[] ext)
Checks whether the extent is valid.String
numColsTipText()
Returns the tip text for this property.String
numRowsTipText()
Returns the tip text for this property.String
scaleFactorTipText()
Returns the tip text for this property.void
setFinder(ObjectFinder value)
Sets the object finder to use.void
setNumCols(int value)
Sets the number of columns in the grid.void
setNumRows(int value)
Sets the number of rows in the grid.void
setScaleFactor(double value)
Sets the scale factor for the image.-
Methods inherited from class adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
check, generateRegions, getQuickInfo, isStopped, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
ANNOTATION
public static final int ANNOTATION
the value for annotation.
-
NEGATIVE
public static final int NEGATIVE
the value for a negative region.
-
m_Finder
protected ObjectFinder m_Finder
the object finder to use.
-
m_NumCols
protected int m_NumCols
the number of columns.
-
m_NumRows
protected int m_NumRows
the number of rows.
-
m_ScaleFactor
protected double m_ScaleFactor
the scale factor to use on the image size.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setFinder
public void setFinder(ObjectFinder value)
Sets the object finder to use.- Parameters:
value
- the finder
-
getFinder
public ObjectFinder getFinder()
Returns the object finder in use.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumCols
public void setNumCols(int value)
Sets the number of columns in the grid.- Parameters:
value
- the number
-
getNumCols
public int getNumCols()
Returns the number of columns in the grid.- Returns:
- the number
-
numColsTipText
public String numColsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumRows
public void setNumRows(int value)
Sets the number of rows in the grid.- Parameters:
value
- the number
-
getNumRows
public int getNumRows()
Returns the number of rows in the grid.- Returns:
- the number
-
numRowsTipText
public String numRowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setScaleFactor
public void setScaleFactor(double value)
Sets the scale factor for the image.- Parameters:
value
- the factor
-
getScaleFactor
public double getScaleFactor()
Returns the scale factor for the image.- Returns:
- the factor
-
scaleFactorTipText
public String scaleFactorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
findExtent
protected void findExtent(IntArrayMatrixView matrix, int s, int t, boolean horizontal, int[] ext)
Finds the largest horizontal or vertical extent from the specified position without hitting an annotation.- Parameters:
matrix
- the matrix with the annotationss
- the x starting pointt
- the y starting pointhorizontal
- whether to determine extent horizontally or verticallyext
- for storing the largest extent
-
isValidExtent
protected boolean isValidExtent(int[] ext)
Checks whether the extent is valid.- Parameters:
ext
- the extent to check- Returns:
- true if valid
-
fillInArea
protected void fillInArea(IntArrayMatrixView matrix, LocatedObject obj, int color)
Fills in the area of the object with the specified color.- Parameters:
matrix
- the matrix to updateobj
- the object to fill incolor
- the color to use
-
doGenerateRegions
protected LocatedObjects doGenerateRegions(AbstractImageContainer cont)
Generates the negative regions.- Specified by:
doGenerateRegions
in classAbstractNegativeRegionsGenerator
- Parameters:
cont
- the image container to generate the regions for- Returns:
- the generated regions
-
-