Class LineProfile

All Implemented Interfaces:
PropertyChangeListener, EventListener, MarkingRequired, Drawable, Interactive, Measurable, Trackable

public class LineProfile extends TTrack implements MarkingRequired
A LineProfile measures pixel brightness along a line on a video image.
Author:
Douglas Brown
  • Field Details

    • MAX_SPREAD

      public static final int MAX_SPREAD
      The maximum allowed spread
      See Also:
    • dataVariables

      protected static final String[] dataVariables
    • fieldVariables

      protected static final String[] fieldVariables
    • formatVariables

      protected static final String[] formatVariables
    • formatMap

      protected static final Map<String,String[]> formatMap
    • formatDescriptionMap

      protected static final Map<String,String> formatDescriptionMap
    • allVariables

      protected static final ArrayList<String> allVariables
    • fixedLine

      protected boolean fixedLine
    • fixedLineItem

      protected JCheckBoxMenuItem fixedLineItem
    • orientationMenu

      protected JMenu orientationMenu
    • horizOrientationItem

      protected JMenuItem horizOrientationItem
    • xaxisOrientationItem

      protected JMenuItem xaxisOrientationItem
    • spread

      protected int spread
    • spreadLabel

      protected JLabel spreadLabel
    • spreadField

      protected IntegerField spreadField
    • isHorizontal

      protected boolean isHorizontal
    • loading

      protected boolean loading
    • showTimeData

      protected boolean showTimeData
    • datasetIndex

      protected int datasetIndex
    • unmarkedLabel

      protected JLabel unmarkedLabel
  • Constructor Details

    • LineProfile

      public LineProfile()
      Constructs a LineProfile.
  • Method Details

    • getFormatVariables

      public String[] getFormatVariables()
      Specified by:
      getFormatVariables in class TTrack
    • getFormatMap

      public Map<String,String[]> getFormatMap()
      Specified by:
      getFormatMap in class TTrack
    • getFormatDescMap

      public Map<String,String> getFormatDescMap()
      Specified by:
      getFormatDescMap in class TTrack
    • getBaseType

      public String getBaseType()
      Specified by:
      getBaseType in class TTrack
    • getVarDimsImpl

      public String getVarDimsImpl(String variable)
      Specified by:
      getVarDimsImpl in class TTrack
    • setFixed

      public void setFixed(boolean fixed)
      Sets the fixed property. When it is fixed, it is in the same position at all times.
      Parameters:
      fixed - true to fix the line
    • isFixed

      public boolean isFixed()
      Gets the fixed property.
      Returns:
      true if line is fixed
    • setSpread

      public void setSpread(int spread)
      Sets the spread. Spread determines how many pixels on each side of the line are given full weight in the average.
      Parameters:
      spread - the desired spread
    • getSpread

      public int getSpread()
      Gets the spread. Spread determines how many pixels on each side of the line are given full weight in the average.
      Returns:
      the spread
    • isMarkByDefault

      public boolean isMarkByDefault()
      Description copied from class: TTrack
      Gets the markByDefault property. When true, the mouse handler should mark a point whenever the active track reports itself incomplete.
      Overrides:
      isMarkByDefault in class TTrack
      Returns:
      true if this marks by default
    • requiresMarking

      public boolean requiresMarking()
      Implements MarkingRequired interface.
      Specified by:
      requiresMarking in interface MarkingRequired
    • draw

      public void draw(DrawingPanel panel, Graphics _g)
      Overrides TTrack draw method.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class TTrack
      Parameters:
      panel - the drawing panel requesting the drawing
      _g - the graphics context on which to draw
    • setTrailVisible

      public void setTrailVisible(boolean visible)
      Overrides TTrack setTrailVisible method to keep trails hidden.
      Overrides:
      setTrailVisible in class TTrack
      Parameters:
      visible - ignored
    • createStep

      public Step createStep(int n, double x, double y)
      Creates a new step.
      Specified by:
      createStep in class TTrack
      Parameters:
      n - the frame number
      x - the x coordinate in image space
      y - the y coordinate in image space
      Returns:
      the step
    • createStep

      public Step createStep(int n, double x1, double y1, double x2, double y2)
      Creates a new step or sets end positions of an existing step.
      Parameters:
      n - the frame number
      x1 - the x coordinate of end1 in image space
      y1 - the y coordinate of end1 in image space
      x2 - the x coordinate of end2 in image space
      y2 - the y coordinate of end2 in image space
      Returns:
      the step
    • deleteStep

      public Step deleteStep(int n)
      Overrides TTrack deleteStep method to prevent deletion.
      Overrides:
      deleteStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the deleted step
    • getStep

      public Step getStep(int n)
      Overrides TTrack getStep method to provide fixedLine behavior.
      Overrides:
      getStep in class TTrack
      Parameters:
      n - the frame number
      Returns:
      the step
    • isStepComplete

      public boolean isStepComplete(int n)
      Returns true if the step at the specified frame number is complete.
      Overrides:
      isStepComplete in class TTrack
      Parameters:
      n - the frame number
      Returns:
      true if the step is complete, otherwise false
    • getStepLength

      public int getStepLength()
      Gets the length of the steps created by this track.
      Specified by:
      getStepLength in class TTrack
      Returns:
      the footprint length
    • getFootprintLength

      public int getFootprintLength()
      Gets the length of the footprints required by this track.
      Specified by:
      getFootprintLength in class TTrack
      Returns:
      the footprint length
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Implements findInteractive method.
      Specified by:
      findInteractive in interface Interactive
      Overrides:
      findInteractive in class TTrack
      Parameters:
      panel - the drawing panel
      xpix - the x pixel position on the panel
      ypix - the y pixel position on the panel
      Returns:
      the first step or motion vector that is hit
    • refreshData

      protected void refreshData(DatasetManager data, TrackerPanel trackerPanel)
      Refreshes the data to display multiple variables (columns) for all pixels (rows).
      Overrides:
      refreshData in class TTrack
      Parameters:
      data - the DatasetManager
      trackerPanel - the tracker panel
    • clearColumns

      protected void clearColumns(DatasetManager data, int count, String[] dataVariables, String desc, double[][] validData, int len)
      Description copied from class: TTrack
      Refreshes data by clearing previous data and appending new valid data. Also refreshes data descriptions and initializes dataset names if needed.
      Overrides:
      clearColumns in class TTrack
      Parameters:
      data - the DatasetManager with datasets to refresh
      count - the number of datasets (columns) to refresh
      dataVariables - array of variable names (length=count+1 since 1st dataset includes indep var)
      desc - prefix of String resources defined in tracker.properties
      validData - array of data arrays to be appended (length=count+1 since last array is indep var)
      len - length of the data arrays
    • getData

      public DatasetManager getData(TrackerPanel panel, int datasetIndex)
      Description copied from class: TTrack
      Returns the DatasetManager for a specified Dataset index, if supported. This default implementation ignores the index.
      Overrides:
      getData in class TTrack
      Parameters:
      panel - the tracker panel
      Returns:
      the DatasetManager
    • setDatasetIndex

      protected void setDatasetIndex(int index)
    • isMultipleFrames

      protected boolean isMultipleFrames()
    • clearStepData

      protected void clearStepData()
    • getMenu

      public JMenu getMenu(TrackerPanel trackerPanel, JMenu menu0)
      Overrides TTrack getMenu method.
      Overrides:
      getMenu in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      menu0 - the menu. If null, a dynamic menu is returned that adds items only when selected
      Returns:
      a menu
    • getToolbarTrackComponents

      public ArrayList<Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
      Overrides TTrack getToolbarTrackComponents method.
      Overrides:
      getToolbarTrackComponents in class TTrack
      Parameters:
      trackerPanel - the tracker panel
      Returns:
      a collection of components
    • setFontLevel

      public void setFontLevel(int level)
      Description copied from class: TTrack
      Sets the font level.
      Overrides:
      setFontLevel in class TTrack
      Parameters:
      level - the desired font level
    • setTrackerPanel

      public void setTrackerPanel(TrackerPanel panel)
      Adds events for TrackerPanel.
      Overrides:
      setTrackerPanel in class TTrack
      Parameters:
      panel - the new TrackerPanel
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class TTrack
      Parameters:
      e - the property change event
    • toString

      public String toString()
      Overrides Object toString method.
      Overrides:
      toString in class TTrack
      Returns:
      the name of this track
    • refreshStep

      protected void refreshStep(LineProfileStep step)
      Refreshes a step by setting it equal to a keyframe step.
      Parameters:
      step - the step to refresh
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an ObjectLoader to save and load data for this class.
      Returns:
      the object loader