Class ImageJMacroRunner

All Implemented Interfaces:
PathPlugin<BufferedImage>

public class ImageJMacroRunner extends AbstractPlugin<BufferedImage>
QuPath plugin for running ImageJ macros & returning detected regions. TODO: Support script recording.
Author:
Pete Bankhead
  • Constructor Details

    • ImageJMacroRunner

      public ImageJMacroRunner(QuPathGUI qupath)
      Constructor.
      Parameters:
      qupath - QuPath instance where the command should be installed.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: PathPlugin
      Get the name of the plugin for display.

      This should be descriptive and, above all, short - as it may be used for menu item names & dialog box titles.

      Returns:
    • getDescription

      public String getDescription()
      Description copied from interface: PathPlugin
      Get a brief description of the plugin's purpose & operation.

      If no description is provided, this may return null.

      Returns:
    • runPlugin

      public boolean runPlugin(TaskRunner runner, ImageData<BufferedImage> imageData, String arg)
      Description copied from interface: PathPlugin
      Run the plugin. A PluginRunner may be provided that this plugin can use to update the user on its progress.

      Note: This command should block until it has completed processing.

      Specified by:
      runPlugin in interface PathPlugin<BufferedImage>
      Overrides:
      runPlugin in class AbstractPlugin<BufferedImage>
      Parameters:
      runner -
      arg -
      Returns:
    • parseArgument

      protected boolean parseArgument(ImageData<BufferedImage> 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<BufferedImage>
      Parameters:
      imageData -
      arg -
      Returns:
    • getLastResultsDescription

      public String getLastResultsDescription()
      Description copied from interface: PathPlugin
      (Optional) short one-line description of the results, e.g. to say how many objects detected. GUIs may choose to display this on a label during interactive processing.
      Returns:
    • getSupportedParentObjectClasses

      protected Collection<Class<? extends PathObject>> getSupportedParentObjectClasses()
    • addRunnableTasks

      protected void addRunnableTasks(ImageData<BufferedImage> imageData, PathObject parentObject, List<Runnable> tasks)
      Description copied from class: AbstractPlugin
      For a specified parent object, generate a task to run. In practice, this method can be overridden to return anything/nothing if getTasks is overridden instead.
      Specified by:
      addRunnableTasks in class AbstractPlugin<BufferedImage>
      Parameters:
      imageData -
      parentObject -
      tasks -
    • getParentObjects

      protected Collection<? extends PathObject> getParentObjects(ImageData<BufferedImage> imageData)
      Description copied from class: AbstractPlugin
      Get a collection of objects to process, based on the contents of the PluginRunner. This could (for example) return the selected object, the root object, all detection objects... depending upon what the plugin does. Each object this returns will be passed to addRunnableTasks to create a task to run. In practice, this method can be overridden to return anything/nothing if getTasks is overridden instead.
      Specified by:
      getParentObjects in class AbstractPlugin<BufferedImage>
      Parameters:
      imageData -
      Returns: