Class InteractiveObjectImporter

java.lang.Object
qupath.lib.gui.commands.InteractiveObjectImporter

public final class InteractiveObjectImporter extends Object
Static methods to import object(s) from different sources.
Author:
Melvin Gelbard, Pete Bankhead
  • Field Details

  • Method Details

    • getGeoJsonDataFormat

      public static DataFormat getGeoJsonDataFormat()
      Get a DataFormat suitable for storing GeoJSON data on a clipboard.
      Returns:
    • promptToImportObjectsProjectEntry

      public static boolean promptToImportObjectsProjectEntry(ImageData<BufferedImage> imageData, ProjectImageEntry<?> entry)
      Prompt to import objects from a project entry.
      Parameters:
      imageData - the image to which the objects should be added
      entry - the entry containing the objects to add
      Returns:
      true if objects were added, false otherwise
    • readObjectsFromClipboard

      public static List<PathObject> readObjectsFromClipboard(ImageData<BufferedImage> imageData) throws IOException, JsonSyntaxException, JsonParseException
      Try to read objects from the system clipboard.
      Parameters:
      imageData - the image to which the objects should be added
      Returns:
      true a list of objects read from the system clipboard, or empty list if none could be found
      Throws:
      IOException
      JsonSyntaxException
      JsonParseException
    • promptToPasteObjectsFromClipboard

      public static boolean promptToPasteObjectsFromClipboard(ImageData<BufferedImage> imageData)
      Prompt to paste objects from the system clipboard, if possible.
      Parameters:
      imageData - the image to which the objects should be added
      Returns:
      true if objects were added, false otherwise
    • promptToImportObjectsFromFile

      public static boolean promptToImportObjectsFromFile(ImageData<BufferedImage> imageData, File file)
      Prompt to import objects read from a file.
      Parameters:
      imageData - the image to add the objects to
      file - the file to read objects from; if null, a chooser will be shown
      Returns:
      true if objects were added, false otherwise
    • promptToImportObjects

      public static boolean promptToImportObjects(PathObjectHierarchy hierarchy, Collection<? extends PathObject> pathObjects)
      Import a collection of objects to an object hierarchy, prompting to confirm and asking whether to update IDs.
      Parameters:
      hierarchy - the object hierarchy
      pathObjects - the new objects to add
      Returns:
      true if objects were added to the hierarchy, false otherwise (including if the pathobject list is empty)