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 enum
Enum representing the objects that the script should be applied to.static class
static class
Class to store parameters used to run ImageJ macros or scripts from QuPath.static enum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageJScriptRunner.Builder
builder()
Create a new builder for an instance ofImageJScriptRunner
.static ImageJScriptRunner.Builder
Create a new builder for an instance ofImageJScriptRunner
, initializing using the provided parameters.static PathObject
static ImageJScriptRunner
Create a script runner from a JSON representation ofImageJScriptRunner.ImageJScriptParameters
.static ImageJScriptRunner
Create a script runner from a map representation ofImageJScriptRunner.ImageJScriptParameters
.static ImageJScriptRunner
Create a script runner from the specified parameters.static List
<PathObject> getObjectsToProcess
(PathObjectHierarchy hierarchy, ImageJScriptRunner.ApplyToObjects applyTo) Query which objects in a hierarchy would be used with the specifiedImageJScriptRunner.ApplyToObjects
value.static void
Example program to log a script.void
run()
Run the script for the 'current' image data, as requested fromQP
.void
run
(ImageData<BufferedImage> imageData) Run the script for the specified image data.void
test()
Test the script for the 'current' image data, as requested fromQP
.void
test
(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<PathObject> getObjectsToProcess(PathObjectHierarchy hierarchy, ImageJScriptRunner.ApplyToObjects applyTo) Query which objects in a hierarchy would be used with the specifiedImageJScriptRunner.ApplyToObjects
value.- 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
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:
-