Package qupath.imagej.gui.scripts
Class ImageJScriptRunner
java.lang.Object
qupath.imagej.gui.scripts.ImageJScriptRunner
Class to run ImageJ macros and scripts.
- Since:
- v0.6.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing the objects that the script should be applied to.static classstatic classClass to store parameters used to run ImageJ macros or scripts from QuPath.static enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageJScriptRunner.Builderbuilder()Create a new builder for an instance ofImageJScriptRunner.static ImageJScriptRunner.BuilderCreate a new builder for an instance ofImageJScriptRunner, initializing using the provided parameters.static qupath.lib.objects.PathObjectcreateDetectionOrPointAnnotation(qupath.lib.roi.interfaces.ROI roi) Function to create an annotation object from anyPointsROI, and detection object from any otherROI.static ImageJScriptRunnerCreate a script runner from a JSON representation ofImageJScriptRunner.ImageJScriptParameters.static ImageJScriptRunnerCreate a script runner from a map representation ofImageJScriptRunner.ImageJScriptParameters.static ImageJScriptRunnerCreate a script runner from the specified parameters.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 specifiedImageJScriptRunner.ApplyToObjectsvalue.static voidExample program to log a script.voidrun()Run the script for the 'current' image data, as requested fromQP.voidrun(qupath.lib.images.ImageData<BufferedImage> imageData) Run the script for the specified image data.voidtest()Test the script for the 'current' image data, as requested fromQP.voidtest(qupath.lib.images.ImageData<BufferedImage> imageData) Test the script for the specified image data.
-
Constructor Details
-
ImageJScriptRunner
-
-
Method Details
-
fromParams
Create a script runner from the specified parameters.- Parameters:
params-- Returns:
-
fromJson
Create a script runner from a JSON representation ofImageJScriptRunner.ImageJScriptParameters.- Parameters:
json-- Returns:
-
fromMap
Create a script runner from a map representation ofImageJScriptRunner.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 fromQP.- See Also:
-
run
Run the script for the specified image data.- See Also:
-
test
public void test()Test the script for the 'current' image data, as requested fromQP.- See Also:
-
test
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 specifiedImageJScriptRunner.ApplyToObjectsvalue.- Parameters:
hierarchy-applyTo-- Returns:
- a list of all objects that are compatible with the type
-
main
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 anyPointsROI, and detection object from any otherROI.- Parameters:
roi- the input ROI (must not be null)- Returns:
- a new object with the specified ROI
-
builder
Create a new builder for an instance ofImageJScriptRunner.- Returns:
-
builder
Create a new builder for an instance ofImageJScriptRunner, initializing using the provided parameters.- Returns:
-