Class CsvCameraOffsetCalibration

java.lang.Object
uk.ac.gda.client.live.stream.calibration.CsvCameraOffsetCalibration
All Implemented Interfaces:
CalibratedAxesProvider

public class CsvCameraOffsetCalibration extends Object implements CalibratedAxesProvider
Creates a new CameraOffsetCalibration with values provided by a CSV file. Reads a CSV file containing the calibration parameters, updates the CSV file with updated parameters from the GUI and creates a new CameraOffsetCalibration with the new values.
  • Constructor Details

    • CsvCameraOffsetCalibration

      public CsvCameraOffsetCalibration(Scannable xAxis, Scannable yAxis, double xOffsetDefault, double yOffsetDefault, double xPixelScalingDefault, double yPixelScalingDefault, String csvFilePath)
  • Method Details

    • updateCalibrator

      public void updateCalibrator(String calibrationName, double xOffset, double yOffset, double xPixelScaling, double yPixelScaling)
      New CalibrationAxesProvider object is created from values updated from the supplied values. CSV file containing Camera Offset parameters is updated with the new values in a new row.
      Parameters:
      calibrationName - time when values were updated
      xOffset - offset of camera in x axis
      yOffset - offset of camera in y axis
      xPixelScaling - number of pixels per scannable unit in x axis
      yPixelScaling - number of pixels per scannable unit in y axis
    • getxOffset

      public double getxOffset()
    • getyOffset

      public double getyOffset()
    • getxPixelScaling

      public double getxPixelScaling()
    • getyPixelScaling

      public double getyPixelScaling()
    • 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