Class AbstractInteractivePlugin<T>

java.lang.Object
qupath.lib.plugins.AbstractPlugin<T>
qupath.lib.plugins.AbstractInteractivePlugin<T>
Type Parameters:
T -
All Implemented Interfaces:
PathInteractivePlugin<T>, PathPlugin<T>
Direct Known Subclasses:
AbstractDetectionPlugin, CoherenceFeaturePlugin, DelaunayClusteringPlugin, DilateAnnotationPlugin, FillAnnotationHolesPlugin, FindConvexHullDetectionsPlugin, HaralickFeaturesPlugin, IntensityFeaturesPlugin, LocalBinaryPatternsPlugin, RefineAnnotationsPlugin, ShapeFeaturesPlugin, SmoothFeaturesPlugin, SplitAnnotationsPlugin, SubcellularDetection, TMADearrayerPluginIJ

public abstract class AbstractInteractivePlugin<T> extends AbstractPlugin<T> implements PathInteractivePlugin<T>
Abstract class to help with implementing an interactive plugin.
Author:
Pete Bankhead
  • Field Details

  • Constructor Details

    • AbstractInteractivePlugin

      public AbstractInteractivePlugin()
  • Method Details

    • getDefaultParameterList

      public abstract ParameterList getDefaultParameterList(ImageData<T> imageData)
      This should return a default ParameterList containing any information that is needed to repeat the task exactly.
      Specified by:
      getDefaultParameterList in interface PathInteractivePlugin<T>
      Parameters:
      imageData -
      Returns:
    • alwaysPromptForObjects

      public boolean alwaysPromptForObjects()
      Description copied from interface: PathInteractivePlugin
      If this returns true, then a prompt is requested every time the command is run - even if there are valid parent objects already selected.
      Specified by:
      alwaysPromptForObjects in interface PathInteractivePlugin<T>
      Returns:
    • getParameterList

      protected ParameterList getParameterList(ImageData<T> imageData)
      Get a reference to a ParameterList stored internally, and which will be used for analysis.

      If there is no list presently available, getDefaultParameterList will be called.

      If there is a list available, it will be returned.

      The reason for needing this in addition to getDefaultParameterList, is that parseArgument could modify the internal ParameterList that will actually be used, while getDefaultParameterList is useful when creating GUIs and ensuring that there is always a sensible starting point.

      Parameters:
      imageData - image data for which the parameters should be generated. This may influence which parameters are shown.
      Returns:
    • parseArgument

      protected boolean parseArgument(ImageData<T> imageData, String arg)
      Description copied from class: AbstractPlugin
      Parse the input argument, returning 'true' if the argument is valid and it's possible to run the plugin.

      This is called from within runPlugin. If it returns 'true', getTasks will be called and then runTasks will submit these to the plugin runner to run. If it returns 'false', runPlugin will immediately abort and return false as well. Since this could result in some internal variables changed (e.g. a ParameterList), implementing classes can't be assumed to be thread-safe; plugins should be created and called from a single thread, although they may use multiple threads (via a PluginRunner) to complete their tasks.

      Specified by:
      parseArgument in class AbstractPlugin<T>
      Parameters:
      imageData -
      arg -
      Returns:
    • getLoggableParameters

      protected ParameterList getLoggableParameters(ImageData<T> imageData)
      Get a copy of the current parameter list (with empty parameters removed) suitable for logging. Subclasses might choose to append extra parameters here, which aren't part of the main list (e.g. because they shouldn't be included in any automatically created dialog box)
      Parameters:
      imageData -
      Returns: