Class ImageJScriptRunner

java.lang.Object
qupath.imagej.gui.scripts.ImageJScriptRunner

public class ImageJScriptRunner extends Object
Class to run ImageJ macros and scripts.
Since:
v0.6.0
  • Constructor Details

  • Method Details

    • fromParams

      Create a script runner from the specified parameters.
      Parameters:
      params -
      Returns:
    • fromJson

      public static ImageJScriptRunner fromJson(String json)
      Create a script runner from a JSON representation of ImageJScriptRunner.ImageJScriptParameters.
      Parameters:
      json -
      Returns:
    • fromMap

      public static ImageJScriptRunner fromMap(Map<String,?> paramMap)
      Create a script runner from a map representation of ImageJScriptRunner.ImageJScriptParameters.

      This method is mostly available for convenience when writing a Groovy script.

      Parameters:
      paramMap -
      Returns:
    • run

      public void run()
      Run the script for the 'current' image data, as requested from QP.
      See Also:
    • run

      public void run(qupath.lib.images.ImageData<BufferedImage> imageData)
      Run the script for the specified image data.
      See Also:
    • test

      public void test()
      Test the script for the 'current' image data, as requested from QP.
      See Also:
    • test

      public void test(qupath.lib.images.ImageData<BufferedImage> imageData)
      Test the script for the specified image data.

      Testing will run the script for no more than one parent object, and show the images within ImageJ. This is different from calling run(ImageData), which can process multiple parent objects and does not show images by default.

      See Also:
    • getObjectsToProcess

      public static List<qupath.lib.objects.PathObject> getObjectsToProcess(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy, ImageJScriptRunner.ApplyToObjects applyTo)
      Query which objects in a hierarchy would be used with the specified ImageJScriptRunner.ApplyToObjects value.
      Parameters:
      hierarchy -
      applyTo -
      Returns:
      a list of all objects that are compatible with the type
    • main

      public static void main(String[] args)
      Example program to log a script.
      Parameters:
      args -
    • createDetectionOrPointAnnotation

      public static qupath.lib.objects.PathObject createDetectionOrPointAnnotation(qupath.lib.roi.interfaces.ROI roi)
      Function to create an annotation object from any PointsROI, and detection object from any other ROI.
      Parameters:
      roi - the input ROI (must not be null)
      Returns:
      a new object with the specified ROI
    • builder

      public static ImageJScriptRunner.Builder builder()
      Create a new builder for an instance of ImageJScriptRunner.
      Returns:
    • builder

      Create a new builder for an instance of ImageJScriptRunner, initializing using the provided parameters.
      Returns: