Class IJExtension

java.lang.Object
qupath.imagej.gui.IJExtension
All Implemented Interfaces:
qupath.lib.gui.extensions.QuPathExtension

public class IJExtension extends Object implements qupath.lib.gui.extensions.QuPathExtension
QuPath extension & associated static helper methods used to support integration of ImageJ with QuPath.
  • Property Summary

    Properties
    Type
    Property
    Description
    Property representing the path to a local ImageJ installation, or null if no path has been set.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Commands to install with the ImageJ extension.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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 to extractROI(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 Image
    getImageJIcon(int width, int height)
    Try to read the ImageJ icon from its jar.
    static ImageJ
    Get an instance of ImageJ, or start one, for interactive use (with GUI displayed).
    static String
    Get the path for a local ImageJ installation, if set.
     
    qupath.lib.common.Version
    Returns the version stored within this jar, because it is matched to the QuPath version.
    Property representing the path to a local ImageJ installation, or null if no path has been set.
    void
    installExtension(qupath.lib.gui.QuPathGUI qupath)
     
    static void
    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, wait

    Methods inherited from interface qupath.lib.gui.extensions.QuPathExtension

    getVersion
  • Property Details

  • Constructor Details

    • IJExtension

      public IJExtension()
  • Method Details

    • setImageJPath

      public static void setImageJPath(String path)
      Set the path for a local ImageJ installation, if required. This can be used to help load external ImageJ plugins.
      Parameters:
      path -
    • getImageJPath

      public static String getImageJPath()
      Get the path for a local ImageJ installation, if set.
      Returns:
    • imageJPathProperty

      public static StringProperty imageJPathProperty()
      Property representing the path to a local ImageJ installation, or null if no path has been set.
      Returns:
      See Also:
    • getImageJInstance

      public static ImageJ 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 image
      pathROI -
      request -
      setROI - true if a ROI should be converted to the closest matching ImageJ Roi & set on the image, false otherwise
      Returns:
      an ImagePlus wrapped in a PathImage to 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 to extractROI(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 requested
      pathObject - the primary object, which may have its ROI set on the image
      hierarchy - object hierarchy containing objects whose ROIs should be added to the ImagePlus overlay
      request - the region being requested
      setROI - 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 displayed
      filter - optional additional filter used to determine which objects will be included (may be used in combination with options)
      Returns:
    • getImageJIcon

      public static Image getImageJIcon(int width, int height)
      Try to read the ImageJ icon from its jar.
      Parameters:
      width -
      height -
      Returns:
    • installExtension

      public void installExtension(qupath.lib.gui.QuPathGUI qupath)
      Specified by:
      installExtension in interface qupath.lib.gui.extensions.QuPathExtension
    • getName

      public String getName()
      Specified by:
      getName in interface qupath.lib.gui.extensions.QuPathExtension
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface qupath.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:
      getQuPathVersion in interface qupath.lib.gui.extensions.QuPathExtension