Package qupath.lib.gui.commands
Class InteractiveObjectImporter
java.lang.Object
qupath.lib.gui.commands.InteractiveObjectImporter
Static methods to import object(s) from different sources.
- Author:
- Melvin Gelbard, Pete Bankhead
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataFormat
Get aDataFormat
suitable for storing GeoJSON data on a clipboard.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.static boolean
promptToImportObjectsFromFile
(ImageData<BufferedImage> imageData, File file) Prompt to import objects read from a file.static boolean
promptToImportObjectsProjectEntry
(ImageData<BufferedImage> imageData, ProjectImageEntry<?> entry) Prompt to import objects from a project entry.static boolean
promptToPasteObjectsFromClipboard
(ImageData<BufferedImage> imageData) Prompt to paste objects from the system clipboard, if possible.static List
<PathObject> readObjectsFromClipboard
(ImageData<BufferedImage> imageData) Try to read objects from the system clipboard.
-
Field Details
-
MIME_TYPE_GEOJSON
Mime type for GeoJson- See Also:
-
-
Method Details
-
getGeoJsonDataFormat
Get aDataFormat
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 addedentry
- 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
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
Prompt to import objects read from a file.- Parameters:
imageData
- the image to add the objects tofile
- 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 hierarchypathObjects
- the new objects to add- Returns:
- true if objects were added to the hierarchy, false otherwise (including if the pathobject list is empty)
-