Class AbstractCalibratedAxesProvider

java.lang.Object
uk.ac.gda.client.live.stream.calibration.AbstractCalibratedAxesProvider
All Implemented Interfaces:
CalibratedAxesProvider
Direct Known Subclasses:
BeamPositionCalibration, CameraOffsetCalibration

public abstract class AbstractCalibratedAxesProvider extends Object implements CalibratedAxesProvider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    The width of each pixel of the camera, in the units used by the x-axis scannable.
    protected Scannable
    The scannable for the horizontal axis of the camera
    updates horizontal axis when x scannable moves
    protected double
    The height of each pixel of the camera in the units used by the y-axis scannable.
    protected Scannable
    The scannable for the vertical axis of the camera.
    updates vertical axis when y scannable moves
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractCalibratedAxesProvider(Scannable xAxisScannable, double xAxisPixelScaling, Scannable yAxisScannable, double yAxisPixelScaling)
    Creates a new instance of AbstractCalibratedAxesProvider
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when the stream connection has been established.
    protected abstract void
    Should be overridden to create two instances of classes implementing CalibratedAxesDatasetUpdater, one for each axis, which will create the datasets when the scannables move, image is resized, or a new frame is received.
    void
    Called when the stream connection has been closed.
    org.eclipse.january.dataset.IDataset
    Returns a calibrated horizontal axis.
    org.eclipse.january.dataset.IDataset
    Returns a calibrated vertical axis.
    void
    resizeStream(int[] newShape)
    Called when the stream data changes shape ([y, x])
    protected void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • xAxisScannable

      protected Scannable xAxisScannable
      The scannable for the horizontal axis of the camera
    • xAxisPixelScaling

      protected double xAxisPixelScaling
      The width of each pixel of the camera, in the units used by the x-axis scannable.
    • yAxisScannable

      protected Scannable yAxisScannable
      The scannable for the vertical axis of the camera.
    • yAxisPixelScaling

      protected double yAxisPixelScaling
      The height of each pixel of the camera in the units used by the y-axis scannable.
    • xAxisUpdater

      protected CalibratedAxesDatasetUpdater xAxisUpdater
      updates horizontal axis when x scannable moves
    • yAxisUpdater

      protected CalibratedAxesDatasetUpdater yAxisUpdater
      updates vertical axis when y scannable moves
  • Constructor Details

    • AbstractCalibratedAxesProvider

      protected AbstractCalibratedAxesProvider(Scannable xAxisScannable, double xAxisPixelScaling, Scannable yAxisScannable, double yAxisPixelScaling)
      Creates a new instance of AbstractCalibratedAxesProvider
      Parameters:
      xAxisScannable - The scannable for the horizontal axis of the camera
      xAxisPixelScaling - The width of each pixel of the camera, in the units used by the x-axis scannable
      yAxisScannable - The scannable for the vertical axis of the camera
      yAxisPixelScaling - The height of each pixel of the camera in the units used by the y-axis scannable
  • Method Details

    • connect

      public void connect()
      Description copied from interface: CalibratedAxesProvider
      Called when the stream connection has been established. There is no need to do work until this point
      Specified by:
      connect in interface CalibratedAxesProvider
    • disconnect

      public void disconnect()
      Description copied from interface: CalibratedAxesProvider
      Called when the stream connection has been closed. No more work is needed, listeners can be disposed, etc.
      Specified by:
      disconnect in interface CalibratedAxesProvider
    • getXAxisDataset

      public org.eclipse.january.dataset.IDataset getXAxisDataset()
      Description copied from interface: CalibratedAxesProvider
      Returns a calibrated horizontal axis. Called with each new frame.
      Specified by:
      getXAxisDataset in interface CalibratedAxesProvider
    • getYAxisDataset

      public org.eclipse.january.dataset.IDataset getYAxisDataset()
      Description copied from interface: CalibratedAxesProvider
      Returns a calibrated vertical axis. Called with each new frame.
      Specified by:
      getYAxisDataset in interface CalibratedAxesProvider
    • resizeStream

      public void resizeStream(int[] newShape)
      Description copied from interface: CalibratedAxesProvider
      Called when the stream data changes shape ([y, x])
      Specified by:
      resizeStream in interface CalibratedAxesProvider
    • updateDatasets

      protected void updateDatasets()
    • createAxesUpdaters

      protected abstract void createAxesUpdaters()
      Should be overridden to create two instances of classes implementing CalibratedAxesDatasetUpdater, one for each axis, which will create the datasets when the scannables move, image is resized, or a new frame is received. In your concrete class, you should call this once all required properties in set, using one of the following: 1. Create a constructor which calls it. 2. Set the init-method property on your spring bean. 3. Implement InitializingBean and create an afterPropertiesSet() method which calls it.