Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter

        adams.data.filter.AbstractFilter.FilterJob<T extends adams.data.container.DataContainer>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String CENTROID_X
      the X of the centroid.
      static String CENTROID_Y
      the Y of the centroid.
      protected int m_NumIterations
      the number of iterations to perform.
      protected double m_ShrinkFactor
      the factor to shrink the heatmap after each iteration.
      • Fields inherited from class adams.data.filter.AbstractFilter

        m_DontUpdateID
      • 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
      HeatmapCentroid()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected Heatmap findCentroid​(Heatmap data)
      Finds the centroid.
      int getNumIterations()
      Returns the number of iterations for finding the centroid.
      double getShrinkFactor()
      Returns the factor to shrink the heatmap with after each iteration
      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.
      String globalInfo()
      Returns a string describing the object.
      String numIterationsTipText()
      Returns the tip text for this property.
      protected Heatmap processData​(Heatmap data)
      Performs the actual filtering.
      void setNumIterations​(int value)
      Sets the number of iterations for finding the centroid.
      void setShrinkFactor​(double value)
      Sets the factor to shrink the heatmap with after each iteration.
      String shrinkFactorTipText()
      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 interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel, setLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
    • Field Detail

      • 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.
    • Constructor Detail

      • HeatmapCentroid

        public HeatmapCentroid()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.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:
        getTechnicalInformation in interface adams.core.TechnicalInformationHandler
        Returns:
        the technical information about this class
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.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
      • processData

        protected Heatmap processData​(Heatmap data)
        Performs the actual filtering.
        Specified by:
        processData in class adams.data.filter.AbstractFilter<Heatmap>
        Parameters:
        data - the data to filter
        Returns:
        the filtered data