Class WaveformPlot<D extends PamDataUnit>

java.lang.Object
detectionPlotFX.plots.WaveformPlot<D>
All Implemented Interfaces:
DetectionPlot<D>
Direct Known Subclasses:
CTWaveformPlot, MTClassifierPane.RawDataPlot, RawWaveformPlot

public abstract class WaveformPlot<D extends PamDataUnit> extends Object implements DetectionPlot<D>
Functions to plot a waveform on a plot panel.
Author:
Jamie Macaulay
  • Constructor Details

    • WaveformPlot

      public WaveformPlot(DetectionPlotDisplay detectionPlotDisplay)
      Constructor for the waveform plot.
  • Method Details

    • getDetectionPlotDisplay

      public DetectionPlotDisplay getDetectionPlotDisplay()
    • setupPlot

      public void setupPlot()
      Description copied from interface: DetectionPlot
      Setup the plot. This may, for example, involve changing axis etc.
      Specified by:
      setupPlot in interface DetectionPlot<D extends PamDataUnit>
    • setupAxis

      public void setupAxis(D pamDetection, double sR, DetectionPlotProjector plotProjector)
      Called to set up the axis correctly before the plot is created
      Specified by:
      setupAxis in interface DetectionPlot<D extends PamDataUnit>
      Parameters:
      pamDetection - - the data of every channel. e.g. might be a waveform with each point representing a sample.
      sR - - the sample rate.
      waveform - - the waveforms of every channel. Each point represents one sample.
      pamAxis - - all the axis of the graph. this is in order TOP, RIGHT, BOTTOM, LEFT.
    • paintPlot

      public void paintPlot(D pamDetection, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector plotProjector, int flag)
      Paint the waveform on the canvas.
      Specified by:
      paintPlot in interface DetectionPlot<D extends PamDataUnit>
      Parameters:
      pamDetection - - the data of every channel. e.g. might be a waveform with each point representing a sample.
      gc - - the graphics handle to draw on.
      waveform - - the waveforms of every channel. Each point represents one sample.
      graphicsContext - - the graphics handle to draw on.
      pamAxis - - the PamAxis for the plot, x and y axis (time and some measure of amplitude. )
    • getYScale

      public static int getYScale(double[][] waveform)
      Get the yscale for plotting the waveform.
      Parameters:
      waveform -
      Returns:
    • getWaveform

      public abstract double[][] getWaveform(D pamDetection)
      Get the waveforms from a PamDetection
      Parameters:
      pamDetection - the detection
      Returns:
      the waveform for each channel
    • getEnvelope

      public abstract double[][] getEnvelope(D pamDetection)
      Get the hilbert transform for each click from a PamDetection
      Parameters:
      pamDetection - the detection
      Returns:
      the waveform for each channel
    • paintWaveform

      public void paintWaveform(double[][] waveform, javafx.scene.canvas.GraphicsContext g, javafx.scene.shape.Rectangle clipRect, DetectionPlotProjector projector, javafx.scene.paint.Color color)
      Paint the waveform.
      Parameters:
      waveform - - the waveform
      g - - the graphics context.
      clipRect -
      projector -
      color -
    • paintWaveform

      public static void paintWaveform(double[][] waveform, int channelBitMap, javafx.scene.canvas.GraphicsContext g, javafx.scene.shape.Rectangle clipRect, int minbin, int maxbin, double yScaleInfo, javafx.scene.paint.Color color, boolean singlePlot, boolean invert)
      Paint the waveform onto a graphics handle. The plot projector should be in samples.
      Parameters:
      waveform - - the waveform to paint.
      g - - the graphics handle
      clipRect - - the clip r
      minbin - - the minimum waveform bin to paint
      maxbin - - the maximum waveform bin to paint
      color - - the colour to pain as. If null then painted in standard PAM colours.
      invert - - true to invert the waveform. i.e. paint upside down
      currentDetection - - the current data unit.
    • getScaleInfo

      public DDScaleInfo getScaleInfo()
      Get the scale info
      Returns:
      the scale info.
    • getSettingsPane

      public javafx.scene.layout.Pane getSettingsPane()
      Description copied from interface: DetectionPlot
      Get the settings pane for the particular plot. This sits on the right hand side of the display inside a hiding pane.
      Specified by:
      getSettingsPane in interface DetectionPlot<D extends PamDataUnit>
      Returns:
      a pane with controls for changing settings in a node.
    • getWaveformSettingsPane

      public WaveformSettingsPane getWaveformSettingsPane()
      Get the waveform settings pane.
      Returns:
      - the waveform settings pane.
    • getWaveformPlotParams

      public WaveformPlotParams getWaveformPlotParams()
      Get the waveform plot params.
      Returns:
      the waveform plot.
    • reDrawLastUnit

      public void reDrawLastUnit()
      Repaint the current data unit.
    • getSampleRate

      public double getSampleRate()
      Get the sample rate in samples per second of the last data unit.
      Returns:
      the sample rate in samples per second.
    • setShowChannels

      public void setShowChannels(boolean show)
      Set the plot to show channels.
      Parameters:
      show - - true to show channels