Package qupath.lib.images
Class ImageData<T>
java.lang.Object
qupath.lib.images.ImageData<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
EventListener
,PathObjectHierarchyListener
,WorkflowListener
Class that brings together the main data in connection with the analysis of a single image.
Currently, this is really the server (to access the image & its pixels) and the object hierarchy that represents detections. In addition, there is an ImageType - as some options may change depending on this.
One particularly significant example is that of Brightfield images in pathology, for which stain vectors are often required for effective stain separation.
- Author:
- Pete Bankhead
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum representing possible image types. -
Constructor Summary
ConstructorDescriptionImageData
(ImageServer<T> server) Create a new ImageData with ImageType.UNKNOWN and a new PathObjectHierarchy.ImageData
(ImageServer<T> server, ImageData.ImageType type) Create a new ImageData with a specified type and creating a new object hierarchy.ImageData
(ImageServer<T> server, PathObjectHierarchy hierarchy) Create a new ImageData with ImageType.UNKNOWN.ImageData
(ImageServer<T> server, PathObjectHierarchy hierarchy, ImageData.ImageType type) Create a new ImageData with a specified object hierarchy and type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new property change listener.Get the stains defined for this image, or null if this is not a brightfield image suitable for color deconvolution.Get the object hierarchy.Get a workflow representing a history of the processing steps applied to the ImageData.Get the image typeGet the last path used to save this object;Get an unmodifiable map representing all known properties for this ImageData.getProperty
(String key) Get a specified property.Get the ImageServer.Get the path of the ImageServer.void
Notify listeners of a change in the hierarchy or its objects.boolean
Returns true if the image type is set to brightfield.boolean
Returns true if changes have been recorded since the last time this object was notified that it was saved.boolean
Returns true if the image type is set to fluorescence.removeProperty
(String key) Remove a specified property.void
Remove a property change listener.void
setChanged
(boolean isChanged) SetisChanged()
status.void
Set the color deconvolution stain vectors for the current image type.void
Set the image type.void
setLastSavedPath
(String path, boolean resetChanged) Set the last path used to save this object;setProperty
(String key, Object value) Set a property.toString()
void
updateServerMetadata
(ImageServerMetadata newMetadata) Update the ImageServer metadata.void
workflowUpdated
(Workflow workflow) Called whenever a Workflow has been updated in some way, such as a new step added.
-
Constructor Details
-
ImageData
Create a new ImageData with a specified object hierarchy and type.- Parameters:
server
-hierarchy
-type
-
-
ImageData
Create a new ImageData with a specified type and creating a new object hierarchy.- Parameters:
server
-type
-
-
ImageData
Create a new ImageData with ImageType.UNKNOWN.- Parameters:
server
-hierarchy
-
-
ImageData
Create a new ImageData with ImageType.UNKNOWN and a new PathObjectHierarchy.- Parameters:
server
-
-
-
Method Details
-
getHistoryWorkflow
Get a workflow representing a history of the processing steps applied to the ImageData.- Returns:
-
setColorDeconvolutionStains
Set the color deconvolution stain vectors for the current image type.If the type is not brightfield, an IllegalArgumentException is thrown.
- Parameters:
stains
-
-
updateServerMetadata
Update the ImageServer metadata. The benefit of using this method rather than manipulating the ImageServer directly is that it will fire a property change.- Parameters:
newMetadata
-
-
isBrightfield
public boolean isBrightfield()Returns true if the image type is set to brightfield.- Returns:
-
isFluorescence
public boolean isFluorescence()Returns true if the image type is set to fluorescence.- Returns:
-
setImageType
Set the image type.- Parameters:
type
-
-
getServer
Get the ImageServer.- Returns:
-
getServerPath
Get the path of the ImageServer.- Returns:
-
getHierarchy
Get the object hierarchy.- Returns:
-
getImageType
Get the image type- Returns:
-
getColorDeconvolutionStains
Get the stains defined for this image, or null if this is not a brightfield image suitable for color deconvolution.- Returns:
-
addPropertyChangeListener
Add a new property change listener.- Parameters:
listener
-
-
removePropertyChangeListener
Remove a property change listener.- Parameters:
listener
-
-
getProperty
Get a specified property.- Parameters:
key
-- Returns:
-
setProperty
Set a property. Note that if properties are Serializable, they will be included in associated data files - otherwise they are stored only transiently.- Parameters:
key
-value
-- Returns:
-
removeProperty
Remove a specified property.- Parameters:
key
-- Returns:
-
getProperties
Get an unmodifiable map representing all known properties for this ImageData.- Returns:
-
getLastSavedPath
Get the last path used to save this object;- Returns:
-
isChanged
public boolean isChanged()Returns true if changes have been recorded since the last time this object was notified that it was saved.- Returns:
- See Also:
-
setChanged
public void setChanged(boolean isChanged) SetisChanged()
status.- Parameters:
isChanged
-
-
setLastSavedPath
Set the last path used to save this object;- Parameters:
path
-resetChanged
- If true, then the isChanged() flag will be reset to false;
-
hierarchyChanged
Description copied from interface:PathObjectHierarchyListener
Notify listeners of a change in the hierarchy or its objects.- Specified by:
hierarchyChanged
in interfacePathObjectHierarchyListener
- Parameters:
event
-
-
workflowUpdated
Description copied from interface:WorkflowListener
Called whenever a Workflow has been updated in some way, such as a new step added.- Specified by:
workflowUpdated
in interfaceWorkflowListener
- Parameters:
workflow
-
-
toString
-