Package adams.data.filter
Class HeatmapCentroid
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<Heatmap>
-
- adams.data.filter.HeatmapCentroid
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.ShallowCopySupporter<adams.data.filter.Filter>,adams.core.SizeOfHandler,adams.core.TechnicalInformationHandler,adams.data.filter.Filter<Heatmap>,Serializable,Comparable
public class HeatmapCentroid extends adams.data.filter.AbstractFilter<Heatmap> implements adams.core.TechnicalInformationHandler
Computes the centroid of a heatmap and adds this to the heatmap's report.
It is possible to perform multiple iterations and each time with a shrunken heatmap. This is useful if the centroid cannot be computed reliably the first time.
For more information on the centroid calculation, see:
WikiPedia. Image moment.
BibTeX:@misc{missing_id, author = {WikiPedia}, title = {Image moment}, HTTP = {http://en.wikipedia.org/wiki/Image_moment} }
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-num-iterations <int> (property: numIterations) The number of iterations to perform for finding the centroid. default: 1 minimum: 1
-shrink-factor <double> (property: shrinkFactor) The factor to shrink the heatmap with after each iteration. default: 0.75 minimum: 0.0010 maximum: 0.999
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCENTROID_Xthe X of the centroid.static StringCENTROID_Ythe Y of the centroid.protected intm_NumIterationsthe number of iterations to perform.protected doublem_ShrinkFactorthe factor to shrink the heatmap after each iteration.
-
Constructor Summary
Constructors Constructor Description HeatmapCentroid()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected HeatmapfindCentroid(Heatmap data)Finds the centroid.intgetNumIterations()Returns the number of iterations for finding the centroid.doublegetShrinkFactor()Returns the factor to shrink the heatmap with after each iterationadams.core.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.StringglobalInfo()Returns a string describing the object.StringnumIterationsTipText()Returns the tip text for this property.protected HeatmapprocessData(Heatmap data)Performs the actual filtering.voidsetNumIterations(int value)Sets the number of iterations for finding the centroid.voidsetShrinkFactor(double value)Sets the factor to shrink the heatmap with after each iteration.StringshrinkFactorTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
CENTROID_X
public static final String CENTROID_X
the X of the centroid.- See Also:
- Constant Field Values
-
CENTROID_Y
public static final String CENTROID_Y
the Y of the centroid.- See Also:
- Constant Field Values
-
m_NumIterations
protected int m_NumIterations
the number of iterations to perform.
-
m_ShrinkFactor
protected double m_ShrinkFactor
the factor to shrink the heatmap after each iteration.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
getTechnicalInformation
public adams.core.TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceadams.core.TechnicalInformationHandler- Returns:
- the technical information about this class
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.data.filter.AbstractFilter<Heatmap>
-
setNumIterations
public void setNumIterations(int value)
Sets the number of iterations for finding the centroid.- Parameters:
value- the number of iterations
-
getNumIterations
public int getNumIterations()
Returns the number of iterations for finding the centroid.- Returns:
- the number of iterations
-
numIterationsTipText
public String numIterationsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShrinkFactor
public void setShrinkFactor(double value)
Sets the factor to shrink the heatmap with after each iteration.- Parameters:
value- the factor
-
getShrinkFactor
public double getShrinkFactor()
Returns the factor to shrink the heatmap with after each iteration- Returns:
- the factor
-
shrinkFactorTipText
public String shrinkFactorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
findCentroid
protected Heatmap findCentroid(Heatmap data)
Finds the centroid.- Parameters:
data- the data to find the centroid in- Returns:
- the data with the updated report
-
-