Class RoiExtractor

All Implemented Interfaces:
Detector, Device, Scannable, Configurable, Findable, gda.observable.IObservable, Serializable

public class RoiExtractor extends DetectorBase
Detector class that processes a 2-dimensional dataset from a detector and computes the sum over one or more ROIs. The readout value is an array containing the sum over each ROI.
See Also:
  • Constructor Details

    • RoiExtractor

      public RoiExtractor()
  • Method Details

    • getOutputFormatTemplate

      public String getOutputFormatTemplate()
    • setOutputFormatTemplate

      public void setOutputFormatTemplate(String outputFormatTemplate)
    • getDetector

      public Detector getDetector()
    • setDetector

      public void setDetector(Detector detector)
    • getOutputFormat

      public String[] getOutputFormat()
      Description copied from interface: Scannable
      Returns an array of strings which are the format strings to use when pretty printing parts of the output
      Specified by:
      getOutputFormat in interface Scannable
      Overrides:
      getOutputFormat in class ScannableBase
      Returns:
      string array
    • getExtraNames

      public String[] getExtraNames()
      Description copied from interface: Scannable
      Additional names for extra values that returned by getPosition().
      Specified by:
      getExtraNames in interface Scannable
      Overrides:
      getExtraNames in class ScannableBase
      Returns:
      array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
    • clearRois

      public void clearRois()
    • addRoi

      public void addRoi(String name, int startX, int startY, int endX, int endY)
      Add a new ROI to be processed
      Parameters:
      name -
      startX -
      startY -
      endX -
      endY -
    • getRois

      public List<ROIRegion> getRois()
      Returns:
      List of ROIs to be processed
    • readout

      public Object readout() throws DeviceException
      Readout the latest detector data, process the ROIs, and return an array of the ROI sum values.
      Returns:
      the data collected
      Throws:
      DeviceException
    • readoutDetectorData

      public org.eclipse.january.dataset.Dataset readoutDetectorData() throws DeviceException
      Readout latest detector data and extract a Dataset.
      Returns:
      Throws:
      DeviceException
    • isBusy

      public boolean isBusy() throws DeviceException
      Description copied from class: DetectorBase
      Check if the Scannable is moving/operating. default implementation is to call the getStatus method
      Specified by:
      isBusy in interface Scannable
      Overrides:
      isBusy in class DetectorBase
      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
      See Also:
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.
      Throws:
      DeviceException
    • getStatus

      public int getStatus() throws DeviceException
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Returns:
      BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
      Throws:
      DeviceException
    • createsOwnFiles

      public boolean createsOwnFiles() throws DeviceException
      Description copied from interface: Detector
      Returns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException