Package qupath.lib.projects
Interface ProjectImageEntry<T>
- Type Parameters:
T
- Depends upon the project used; typically BufferedImage for QuPath
- All Superinterfaces:
MinimalMetadataStore
,UriResource
Class to represent an image entry within a project.
This stores the path to the image, and some optional metadata.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Deprecated.default boolean
containsMetadata
(String key) Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Get a description; this is free text describing the image.Get a path to the data for this image entry, or null if this entry is not stored on the local file system.getID()
Get a unique ID to represent this entry.Get a name that may be used for this entry.Access additional images associated with the project entry, e.g.default Collection
<String> Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.default String
Get a formatted string representation of the metadata map's contents.default String
getMetadataValue
(String key) Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Get the original image name, without any randomization.Get aImageServerBuilder.ServerBuilder
that can be used to open this image.Get a summary string representing this image entry.getTags()
Returns a modifiable set containing tag values.Request a thumbnail for the image.boolean
Check if this entry has savedImageData
already available.default String
putMetadataValue
(String key, String value) Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Read thePathObjectHierarchy
for this entry, or return an empty hierarchy if none is available.Read theImageData
associated with this entry, or create a new ImageData if none is currently present.default String
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.void
saveImageData
(ImageData<T> imageData) Save theImageData
for this entry using the default storage location for the project.void
setDescription
(String description) Set the description.void
setImageName
(String name) Set the image name for this project entry.void
setThumbnail
(T img) Set a thumbnail for the image.Methods inherited from interface qupath.lib.interfaces.MinimalMetadataStore
getMetadata
Methods inherited from interface qupath.lib.io.UriResource
getUris, getURIs, updateUris, updateURIs
-
Method Details
-
getID
String getID()Get a unique ID to represent this entry.- Returns:
-
setImageName
Set the image name for this project entry.- Parameters:
name
-
-
getImageName
String getImageName()Get a name that may be used for this entry.This may be derived automatically from the server path, or set explicitly to be something else. It may also be randomized to support blinded analysis.
- Returns:
- See Also:
-
getOriginalImageName
String getOriginalImageName()Get the original image name, without any randomization. Most UI elements should prefergetImageName()
to ensure that the randomization does its job.- Returns:
-
getEntryPath
Path getEntryPath()Get a path to the data for this image entry, or null if this entry is not stored on the local file system.If not null, the path may be a file or a directory and is not guaranteed to exist. Rather, it represents where the data for this entry either is or would be stored.
- Returns:
-
removeMetadataValue
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Remove a metadata value.- Parameters:
key
-- Returns:
-
getMetadataValue
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Request a metadata value.Note that this may return
null
.- Parameters:
key
-- Returns:
-
putMetadataValue
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Store a metadata value.This is intended as storage of short key-value pairs. Extended text should be stored under
setDescription
.- Parameters:
key
-value
-- Returns:
-
containsMetadata
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Check if a metadata value is present for a specified key.- Parameters:
key
-- Returns:
true
ifgetDescription()
does not return null or an empty string,false
otherwise.
-
getDescription
String getDescription()Get a description; this is free text describing the image.- Returns:
-
setDescription
Set the description.- Parameters:
description
-- See Also:
-
clearMetadata
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Remove all metadata. -
getMetadataMap
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Get an unmodifiable view of the underlying metadata map.- Returns:
-
getMetadataKeys
Deprecated.v0.6.0, useMinimalMetadataStore.getMetadata()
instead to directly access the metadata.Get an unmodifiable collection of the metadata map's keys.- Returns:
-
getServerBuilder
ImageServerBuilder.ServerBuilder<T> getServerBuilder()Get aImageServerBuilder.ServerBuilder
that can be used to open this image.- Returns:
-
readImageData
Read theImageData
associated with this entry, or create a new ImageData if none is currently present.If the full data is not needed, but rather only the objects
readHierarchy()
can be much faster.- Returns:
- Throws:
IOException
- See Also:
-
saveImageData
Save theImageData
for this entry using the default storage location for the project.- Parameters:
imageData
-- Throws:
IOException
-
readHierarchy
Read thePathObjectHierarchy
for this entry, or return an empty hierarchy if none is available.- Returns:
- Throws:
IOException
- See Also:
-
hasImageData
boolean hasImageData()Check if this entry has savedImageData
already available.- Returns:
-
getSummary
String getSummary()Get a summary string representing this image entry.- Returns:
-
getThumbnail
Request a thumbnail for the image.- Returns:
- a thumbnail if one has already been set, otherwise null.
- Throws:
IOException
-
setThumbnail
Set a thumbnail for the image. This will replace any existing thumbnail.- Parameters:
img
-- Throws:
IOException
-
getMetadataSummaryString
Get a formatted string representation of the metadata map's contents.- Returns:
-
getImages
ResourceManager.Manager<ImageServer<T>> getImages()Access additional images associated with the project entry, e.g. pixel classifications or aligned slides.- Returns:
-
getTags
Returns a modifiable set containing tag values.The returned set may or may not be thread-safe. Implementing classes must document the thread-safeness of the set.
- Returns:
- the set of tags of this entry
-
MinimalMetadataStore.getMetadata()
instead to directly access the metadata.