Package qupath.imagej.gui.scripts
Class ImageJScriptRunner.Builder
java.lang.Object
qupath.imagej.gui.scripts.ImageJScriptRunner.Builder
- Enclosing class:
- ImageJScriptRunner
- 
Method SummaryModifier and TypeMethodDescriptionRequest that the script is stored in the workflow history when it is run for anImageData.addToWorkflow(boolean doAdd) Optionally request that the script is stored in the workflow history when it is run for anImageData.applyToObjects(ImageJScriptRunner.ApplyToObjects objectType) Specify the objects that the script should be applied to.build()Build a newImageJScriptRunnerwith the parameters specified in this builder.channelIndices(int... inds) Optionally specify a subset of image channels to pass to ImageJ.channelNames(String... names) Optionally specify a subset of image channels to pass to ImageJ, based on channel names.channels(Collection<? extends ColorTransforms.ColorTransform> channels) Optionally specify channels to pass to ImageJ.channels(ColorTransforms.ColorTransform channel, ColorTransforms.ColorTransform... channels) Optionally specify channels to pass to ImageJ.Request that the child objects are removed from any objects that are passed to the script runner.clearChildObjects(boolean doClear) Optionally request that the child objects are removed from any objects that are passed to the script runner.closeOpenImages(boolean doClose) Request that any images left open after the macro are closed.downsample(DownsampleCalculator downsample) Specify how images should be downsampled when passing them to ImageJ.Specify the path to a file containing the script or macro.fixedDownsample(double downsample) Use a fixed downsample value when passing images to ImageJ.groovyText(String groovy) Specify the exact text for an ImageJ macro.Specify the exact text for an ImageJ macro.maxDimension(int maxDim) Resize images to have a width and height ≤ a specified value when passing images to ImageJ.nThreads(int nThreads) Specify the number of parallel threads to use.Convert Rois on the overlay of the current image at the end of the script to QuPath annotation objects.Convert Rois on the overlay of the current image at the end of the script to QuPath detection objects.Convert Rois on the overlay of the current image at the end of the script to the specified QuPath object type.Convert Rois on the overlay of the current image at the end of the script to QuPath tile objects.padding(int padding) Specify how much padding to add around the ROI.pixelSize(PixelCalibration targetCalibration) Resize images to have a target pixel value when passing images to ImageJ.pixelSizeMicrons(double pixelSizeMicrons) Resize images to have a target pixel value in µm when passing images to ImageJ.Convert any active Roi at the end of the script to a QuPath annotation object.Convert any active Roi at the end of the script to a QuPath detection object.Convert any active Roi at the end of the script to the specified QuPath object type.Convert any active Roi at the end of the script to a QuPath tile object.scriptEngine(String scriptEngine) Specify the name of any script engine to use.scriptFile(File file) Specify a file containing the script or macro.scriptFile(Path path) Specify a path to the script or macro.Add any QuPath objects within the field of view to an ImageJ overlay.setImageJOverlay(boolean doSet) Optionally add any QuPath objects within the field of view to an ImageJ overlay.Set the ROI for the QuPath object being set as a Roi on the ImagePlus.setImageJRoi(boolean doSet) Optionally set the ROI for the QuPath object being set as a Roi on the ImagePlus.taskRunner(TaskRunner taskRunner) Provide an optional task runner.Specify the exact text for the script or macro.
- 
Method Details- 
macroTextSpecify the exact text for an ImageJ macro. This is equivalent totext(String)and also setting the scripting language to specify that we have an ImageJ macro.- Parameters:
- macroText-
- Returns:
- this builder
- See Also:
 
- 
groovyTextSpecify the exact text for an ImageJ macro. This is equivalent totext(String)and also setting the scripting language to specify that we have a Groovy script.- Parameters:
- groovy-
- Returns:
- this builder
- See Also:
 
- 
textSpecify the exact text for the script or macro.- Parameters:
- script-
- Returns:
- this builder
- See Also:
 
- 
fileSpecify the path to a file containing the script or macro. The file extension will be used to determine the scripting language (the default is to assume an ImageJ macro).- Parameters:
- path-
- Returns:
- this builder
- Throws:
- IOException- if the script cannot be read
- See Also:
 
- 
scriptFileSpecify a file containing the script or macro. The file extension will be used to determine the scripting language (the default is to assume an ImageJ macro).- Parameters:
- file-
- Returns:
- this builder
- Throws:
- IOException- if the script cannot be read
- See Also:
 
- 
scriptFileSpecify a path to the script or macro. The file extension will be used to determine the scripting language (the default is to assume an ImageJ macro).- Parameters:
- path-
- Returns:
- this builder
- Throws:
- IOException- if the script cannot be read
- See Also:
 
- 
scriptEngineSpecify the name of any script engine to use. By default, the script is assumed to be an ImageJ macro. This parameter can be used to run a script written with another JSR 223-supported scripting language.- Parameters:
- scriptEngine-
- Returns:
- this builder
 
- 
setImageJRoiSet the ROI for the QuPath object being set as a Roi on the ImagePlus.- Returns:
- this builder
 
- 
setImageJRoiOptionally set the ROI for the QuPath object being set as a Roi on the ImagePlus.- Parameters:
- doSet-
- Returns:
- this builder
 
- 
setImageJOverlayAdd any QuPath objects within the field of view to an ImageJ overlay.- Returns:
- this builder
 
- 
setImageJOverlayOptionally add any QuPath objects within the field of view to an ImageJ overlay.- Parameters:
- doSet-
- Returns:
- this builder
 
- 
closeOpenImagesRequest that any images left open after the macro are closed.- Parameters:
- doClose-
- Returns:
- this builder
 
- 
roiToDetectionConvert any active Roi at the end of the script to a QuPath detection object.- Returns:
- this builder
 
- 
roiToAnnotationConvert any active Roi at the end of the script to a QuPath annotation object.- Returns:
- this builder
 
- 
roiToTileConvert any active Roi at the end of the script to a QuPath tile object.- Returns:
- this builder
 
- 
roiToObjectConvert any active Roi at the end of the script to the specified QuPath object type.- Returns:
- this builder
 
- 
overlayToAnnotationsConvert Rois on the overlay of the current image at the end of the script to QuPath annotation objects.- Returns:
- this builder
 
- 
overlayToDetectionsConvert Rois on the overlay of the current image at the end of the script to QuPath detection objects.- Returns:
- this builder
 
- 
overlayToTilesConvert Rois on the overlay of the current image at the end of the script to QuPath tile objects.- Returns:
- this builder
 
- 
overlayToObjectsConvert Rois on the overlay of the current image at the end of the script to the specified QuPath object type.- Returns:
- this builder
 
- 
clearChildObjectsRequest that the child objects are removed from any objects that are passed to the script runner. This is usually desirable when adding new objects, to avoid duplicate objects being created by accident if the script is run multiple times.- Returns:
- this builder
 
- 
clearChildObjectsOptionally request that the child objects are removed from any objects that are passed to the script runner. This is usually desirable when adding new objects, to avoid duplicate objects being created by accident if the script is run multiple times.- Parameters:
- doClear-
- Returns:
- this builder
 
- 
addToWorkflowRequest that the script is stored in the workflow history when it is run for anImageData. This is useful to enable the script to be run in the future from a 'regular' Groovy script in QuPath.- Returns:
- this builder
 
- 
addToWorkflowOptionally request that the script is stored in the workflow history when it is run for anImageData. This is useful to enable the script to be run in the future from a 'regular' Groovy script in QuPath.- Parameters:
- doAdd-
- Returns:
- this builder
 
- 
applyToObjectsSpecify the objects that the script should be applied to.- Parameters:
- objectType-
- Returns:
- this builder
 
- 
fixedDownsampleUse a fixed downsample value when passing images to ImageJ.- Parameters:
- downsample-
- Returns:
- this builder
 
- 
maxDimensionResize images to have a width and height ≤ a specified value when passing images to ImageJ.- Parameters:
- maxDim-
- Returns:
- this builder
 
- 
pixelSizeMicronsResize images to have a target pixel value in µm when passing images to ImageJ.- Parameters:
- pixelSizeMicrons-
- Returns:
- this builder
 
- 
pixelSizeResize images to have a target pixel value when passing images to ImageJ.- Parameters:
- targetCalibration-
- Returns:
- this builder
 
- 
downsampleSpecify how images should be downsampled when passing them to ImageJ.- Parameters:
- downsample-
- Returns:
- this builder
 
- 
paddingSpecify how much padding to add around the ROI.- Parameters:
- padding- number of pixels of padding to add (should be ≥ 0)
- Returns:
- this builder
 
- 
nThreadsSpecify the number of parallel threads to use. This value is only used if aTaskRunnerhas not be provided.- Parameters:
- nThreads-
- Returns:
- this builder
- See Also:
 
- 
taskRunnerProvide an optional task runner. This can be used to show a progress dialog or log output.- Parameters:
- taskRunner-
- Returns:
- this builder
- See Also:
 
- 
channelIndicesOptionally specify a subset of image channels to pass to ImageJ.- Parameters:
- inds- channel indices (zero-based)
- Returns:
- this builder
 
- 
channelNamesOptionally specify a subset of image channels to pass to ImageJ, based on channel names.- Parameters:
- names- channel names
- Returns:
- this builder
 
- 
channelspublic ImageJScriptRunner.Builder channels(ColorTransforms.ColorTransform channel, ColorTransforms.ColorTransform... channels) Optionally specify channels to pass to ImageJ.- Parameters:
- channel- the first channel to use
- channels- any additional channels
- Returns:
- this builder
 
- 
channelspublic ImageJScriptRunner.Builder channels(Collection<? extends ColorTransforms.ColorTransform> channels) Optionally specify channels to pass to ImageJ.- Parameters:
- channels- the channels to use
- Returns:
- this builder
 
- 
buildBuild a newImageJScriptRunnerwith the parameters specified in this builder.- Returns:
 
 
-