Class CropToCentroid

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable

    public class CropToCentroid
    extends AbstractFilteredHeatmapCrop
    Generates a cropped heatmap centered around the centroid calculated on the pre-filtered data.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -filter <adams.data.filter.AbstractFilter> (property: filter)
        Pre-filters the heatmap.
        default: adams.data.filter.HeatmapThreshold -threshold adams.data.filter.heatmapthreshold.Manual
     
    -height <int> (property: height)
        The height of the cropped region.
        default: 240
        minimum: 1
     
    -width <int> (property: width)
        The width of the cropped region.
        default: 320
        minimum: 1
     
    -centroid <adams.data.filter.HeatmapCentroid> (property: centroid)
        The centroid filter to use.
        default: adams.data.filter.HeatmapCentroid
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Height

        protected int m_Height
        the height of the crop region around the centroid.
      • m_Width

        protected int m_Width
        the width of the crop region around the centroid.
    • Constructor Detail

      • CropToCentroid

        public CropToCentroid()
    • 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
      • 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 AbstractFilteredHeatmapCrop
      • setHeight

        public void setHeight​(int value)
        Sets the height of the submap.
        Parameters:
        value - the height
      • getHeight

        public int getHeight()
        Returns the height start the submap from.
        Returns:
        the height
      • heightTipText

        public String heightTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setWidth

        public void setWidth​(int value)
        Sets the width of the submap.
        Parameters:
        value - the width
      • getWidth

        public int getWidth()
        Returns the width start the submap from.
        Returns:
        the width
      • widthTipText

        public String widthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCentroid

        public void setCentroid​(HeatmapCentroid value)
        Sets the centroid filter.
        Parameters:
        value - the filter
      • getCentroid

        public HeatmapCentroid getCentroid()
        Returns the centroid filter.
        Returns:
        the filter
      • centroidTipText

        public String centroidTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doCrop

        protected Heatmap doCrop​(Heatmap filtered,
                                 Heatmap original)
        Performs the actual cropping, using the pre-filtered heatmap to manipulate the original heatmap.
        Specified by:
        doCrop in class AbstractFilteredHeatmapCrop
        Parameters:
        filtered - the pre-filtered heatmap
        original - the original heatmap
        Returns:
        the final data
      • crop

        public static Heatmap crop​(Heatmap original,
                                   int centroidY,
                                   int centroidX,
                                   int height,
                                   int width)
        Crops the heatmap around the centroid stored in the heatmap's report.
        Parameters:
        original - the heatmap, with the centroid information
        centroidY - the Y position of the centroid
        centroidX - the X position of the centroid
        height - the new height of the heatmap
        width - the new width of the heatmap
        Returns:
        the cropped heatmap