Package qupath.imagej.gui
Class IJExtension
java.lang.Object
qupath.imagej.gui.IJExtension
- All Implemented Interfaces:
qupath.lib.gui.extensions.QuPathExtension
QuPath extension & associated static helper methods used to support integration of ImageJ with QuPath.
-
Property Summary
PropertiesTypePropertyDescriptionstatic StringPropertyProperty representing the path to a local ImageJ installation, or null if no path has been set. -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCommands to install with the ImageJ extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OverlayextractOverlay(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy, qupath.lib.regions.RegionRequest request, qupath.lib.gui.viewer.OverlayOptions options, Predicate<qupath.lib.objects.PathObject> filter) Extract an ImageJ overlay for the specified region.static qupath.lib.images.PathImage<ImagePlus> extractROI(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.objects.PathObject pathObject, qupath.lib.regions.RegionRequest request, boolean setROI) Similar toextractROI(ImageServer, ROI, RegionRequest, boolean), except that the title of the ImagePlus is set according to the parent object type (which is used to get the ROI).static qupath.lib.images.PathImage<ImagePlus> extractROI(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.roi.interfaces.ROI pathROI, qupath.lib.regions.RegionRequest request, boolean setROI) Extract a region of interest from an image as an ImageJ ImagePlus.static qupath.lib.images.PathImage<ImagePlus> extractROIWithOverlay(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.objects.PathObject pathObject, qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy, qupath.lib.regions.RegionRequest request, boolean setROI, qupath.lib.gui.viewer.OverlayOptions options) Extract an image region as an ImagePlus, optionally setting ImageJ Rois corresponding to QuPath objects.static ImagegetImageJIcon(int width, int height) Try to read the ImageJ icon from its jar.static ImageJGet an instance of ImageJ, or start one, for interactive use (with GUI displayed).static StringGet the path for a local ImageJ installation, if set.getName()qupath.lib.common.VersionReturns the version stored within this jar, because it is matched to the QuPath version.static StringPropertyProperty representing the path to a local ImageJ installation, or null if no path has been set.voidinstallExtension(qupath.lib.gui.QuPathGUI qupath) static voidsetImageJPath(String path) Set the path for a local ImageJ installation, if required.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface qupath.lib.gui.extensions.QuPathExtension
getVersion
-
Property Details
-
imageJPath
Property representing the path to a local ImageJ installation, or null if no path has been set.- See Also:
-
-
Constructor Details
-
IJExtension
public IJExtension()
-
-
Method Details
-
setImageJPath
Set the path for a local ImageJ installation, if required. This can be used to help load external ImageJ plugins.- Parameters:
path-
-
getImageJPath
Get the path for a local ImageJ installation, if set.- Returns:
-
imageJPathProperty
Property representing the path to a local ImageJ installation, or null if no path has been set.- Returns:
- See Also:
-
getImageJInstance
Get an instance of ImageJ, or start one, for interactive use (with GUI displayed).- Returns:
- an ImageJ instance, or null if ImageJ could not be started
-
extractROI
public static qupath.lib.images.PathImage<ImagePlus> extractROI(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.roi.interfaces.ROI pathROI, qupath.lib.regions.RegionRequest request, boolean setROI) throws IOException Extract a region of interest from an image as an ImageJ ImagePlus.- Parameters:
server- the imagepathROI-request-setROI- true if a ROI should be converted to the closest matching ImageJRoi& set on the image, false otherwise- Returns:
- an
ImagePluswrapped in aPathImageto give additional calibration information - Throws:
IOException
-
extractROI
public static qupath.lib.images.PathImage<ImagePlus> extractROI(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.objects.PathObject pathObject, qupath.lib.regions.RegionRequest request, boolean setROI) throws IOException Similar toextractROI(ImageServer, ROI, RegionRequest, boolean), except that the title of the ImagePlus is set according to the parent object type (which is used to get the ROI). Specifically, if a TMA core is passed as a parent, then the core name will be included in the title.- Parameters:
server-pathObject-request-setROI-- Returns:
- Throws:
IOException- See Also:
-
extractROIWithOverlay
public static qupath.lib.images.PathImage<ImagePlus> extractROIWithOverlay(qupath.lib.images.servers.ImageServer<BufferedImage> server, qupath.lib.objects.PathObject pathObject, qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy, qupath.lib.regions.RegionRequest request, boolean setROI, qupath.lib.gui.viewer.OverlayOptions options) throws IOException Extract an image region as an ImagePlus, optionally setting ImageJ Rois corresponding to QuPath objects.- Parameters:
server- server from which pixels should be requestedpathObject- the primary object, which may have its ROI set on the imagehierarchy- object hierarchy containing objects whose ROIs should be added to the ImagePlus overlayrequest- the region being requestedsetROI- if true, the ROI of the pathObject will be set on the image as the 'main' ROI (i.e. not an overlay)options- options determining which kinds of objects will have ROIs added, to match with the display in the QuPath viewer- Returns:
- Throws:
IOException
-
extractOverlay
public static Overlay extractOverlay(qupath.lib.objects.hierarchy.PathObjectHierarchy hierarchy, qupath.lib.regions.RegionRequest request, qupath.lib.gui.viewer.OverlayOptions options, Predicate<qupath.lib.objects.PathObject> filter) Extract an ImageJ overlay for the specified region.- Parameters:
hierarchy-request-options- options to control which objects are being displayedfilter- optional additional filter used to determine which objects will be included (may be used in combination with options)- Returns:
-
getImageJIcon
Try to read the ImageJ icon from its jar.- Parameters:
width-height-- Returns:
-
installExtension
public void installExtension(qupath.lib.gui.QuPathGUI qupath) - Specified by:
installExtensionin interfacequpath.lib.gui.extensions.QuPathExtension
-
getName
- Specified by:
getNamein interfacequpath.lib.gui.extensions.QuPathExtension
-
getDescription
- Specified by:
getDescriptionin interfacequpath.lib.gui.extensions.QuPathExtension
-
getQuPathVersion
public qupath.lib.common.Version getQuPathVersion()Returns the version stored within this jar, because it is matched to the QuPath version.- Specified by:
getQuPathVersionin interfacequpath.lib.gui.extensions.QuPathExtension
-