Interface AutofocusPlugin

All Superinterfaces:
MMGenericPlugin, MMPlugin, org.scijava.plugin.SciJavaPlugin

public interface AutofocusPlugin extends MMPlugin
This interface is used for a java-based autofocus plugin. Properly compiled jars can be added to the mmplugins directory of Micro-Manager and they will be loaded into the autofocus menu. It also wraps autofocus devices implemented in C++ and exposed by the core, so both java and C++ based autofocus plugins can be used by this common interface.
  • Method Details

    • initialize

      void initialize()
      Initializes the plugin. Can be called multiple times, for instance after a change in hardware configuration. Conversely, the plugin can trust that the hardware never changes without a call to this function.
    • applySettings

      void applySettings()
      Pushes setting to the hardware or software autofocus.
    • saveSettings

      void saveSettings()
      Stores settings.
    • fullFocus

      double fullFocus() throws Exception
      Runs a full, one-shot autofocus protocol. Blocks until focusing is finished.
      Returns:
      focus score
      Throws:
      Exception - Mainly exceptions coming from the hardware.
    • incrementalFocus

      double incrementalFocus() throws Exception
      Runs a single, incremental focusing step.
      Returns:
      focus score
      Throws:
      Exception - Mainly exceptions coming from the hardware.
    • getNumberOfImages

      int getNumberOfImages()
      Returns the number of images acquired.
      Returns:
      number of images for autofocussing
    • getVerboseStatus

      String getVerboseStatus()
      Returns a detailed status of the autofocus plugin/device.
      Returns:
      description of the autofocus Status
    • getProperties

      org.micromanager.internal.utils.PropertyItem[] getProperties()
      Returns an array of the properties for this autofocus plugin.
      Returns:
      array with Property descriptors, representing MMCore data
    • getPropertyNames

      String[] getPropertyNames()
      Returns an array of the names of properties for this autofocus plugin.
      Returns:
      array with the names of properties for this autofocus plugin
    • getProperty

      org.micromanager.internal.utils.PropertyItem getProperty(String key) throws Exception
      Returns the name and value of properties for the autofocus plugin.
      Parameters:
      key - PropertyName for which we want the value
      Returns:
      value for given property
      Throws:
      Exception - thrown by MMCore when key is not found.
    • setProperty

      void setProperty(org.micromanager.internal.utils.PropertyItem p) throws Exception
      Sets the value of a particular property.
      Parameters:
      p - Property to be set
      Throws:
      Exception - Not sure what this may be
    • getPropertyValue

      String getPropertyValue(String name) throws Exception
      Gets the value of a named property.
      Parameters:
      name - named property
      Returns:
      value for the given property
      Throws:
      Exception - Not sure what this may indicate
    • setPropertyValue

      void setPropertyValue(String name, String value) throws Exception
      Sets the value of a named property.
      Parameters:
      name - PropertyName
      value - PropertyValue
      Throws:
      Exception - by MMCore
    • getCurrentFocusScore

      double getCurrentFocusScore()
      Returns the current focus "score" (goodness of focus).
      Returns:
      focus score (goodness of focus)
    • enableContinuousFocus

      void enableContinuousFocus(boolean enable) throws Exception
      Turns on continuous autofocus. Typically used by hardware autofocus devices such as the Nikon Perfect Focus (PFS).
      Parameters:
      enable - Switch on when true, off otherwise.
      Throws:
      Exception - Hardware may throw and exception
    • isContinuousFocusEnabled

      boolean isContinuousFocusEnabled() throws Exception
      Returns true if continuous autofocus has been enabled. Typically used by hardware autofocus devices such as the Nikon Perfect Focus (PFS).
      Returns:
      true if enabled, false otherwise
      Throws:
      Exception - May be thrown by the hardware
    • isContinuousFocusLocked

      boolean isContinuousFocusLocked() throws Exception
      Returns true if continuous autofocus is currently locked (successfully following the specimen). Typically used by hardware autofocus devices such as the Nikon Perfect Focus (PFS).
      Returns:
      true if locked
      Throws:
      Exception - thrown by MMCore
    • computeScore

      double computeScore(ij.process.ImageProcessor impro)
      Computes a focus score for the given image.
      Parameters:
      impro - ImageProcessor to be used in the calculation.
      Returns:
      calculated score