Package qupath.lib.images.servers
Class ImageServerMetadata
java.lang.Object
qupath.lib.images.servers.ImageServerMetadata
Class for storing primary ImageServer metadata fields.
 
Can be used when the metadata needs to be adjusted (e.g. to correct erroneous pixel sizes).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder to create a newImageServerMetadataobject.static enumEnum representing possible channel (band) types for an image.static classWidth and height of each resolution in a multi-level image pyramid.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ImageChannelDefault channel to use with images where the channel type isImageServerMetadata.ChannelType.CLASSIFICATION.
- 
Method SummaryModifier and TypeMethodDescriptionDuplicate this metatadata.booleandoubleGet the averaged pixel size in microns, if available - or Double.NaN otherwise.getChannel(int n) Get the specified channel.Get an unmodifiable list of all channels.Get the channel type, which can be used to interpret the channels.Get map between labels and classification names.doublegetDownsampleForLevel(int level) Get the downsample factor for a specific resolution level.intGet the full-resolution image height.getLevel(int level) Get resolution information for a specified pyramidal level.Get an unmodifiable list containing the resolution levelsdoubleGet the magnification value, or Double.NaN if this is unavailable.Get the minimum value supported by this image.Get the minimum value supported by this image.getName()Get the image name.Get aPixelCalibrationobject representing the pixel size information for this metadata object.doubleGet the pixel height in microns, if available - or Double.NaN otherwise.Returns the bit-depth for individual pixels in the image.doubleGet the pixel width in microns, if available - or Double.NaN otherwise.double[]Request the preferred downsamples from the image metadata.intGet the preferred tile height, which can be used to optimize pixel requests for large images.intGet the preferred tile width, which can be used to optimize pixel requests for large images.intgetSizeC()Get the number of image channels.intgetSizeT()Get the number of time points.intgetSizeZ()Get the number of z-slices.doublegetTimepoint(int ind) Get the time point, defined ingetTimeUnit(), or Double.NaN if this is unknown.Get the time unit for a time series.intgetWidth()Get the full-resolution image width.doubleGet the z-spacing in microns, if available - or Double.NaN otherwise.inthashCode()booleanisCompatibleMetadata(ImageServerMetadata metadata) Returns true if a specified ImageServerMetadata is compatible with this one, that is it has the same path and dimensions (but possibly different pixel sizes, magnifications etc.).booleanisRGB()Returns true if the pixels are stored in (A)RGB form.intnLevels()Get the number of resolution levels.booleanReturns true if pixel width and height calibration information is available for the image.toString()booleanReturns true if z-spacing calibration information is available for the image.
- 
Field Details- 
DEFAULT_CLASSIFICATION_LABELS_CHANNELDefault channel to use with images where the channel type isImageServerMetadata.ChannelType.CLASSIFICATION.
 
- 
- 
Method Details- 
getPreferredDownsamplesArraypublic double[] getPreferredDownsamplesArray()Request the preferred downsamples from the image metadata.Note that this makes a defensive copy, and so should not be called often; it is generally preferably to request downsample values individually. - Returns:
 
- 
getLevelsGet an unmodifiable list containing the resolution levels- Returns:
 
- 
getWidthpublic int getWidth()Get the full-resolution image width.- Returns:
 
- 
getHeightpublic int getHeight()Get the full-resolution image height.- Returns:
 
- 
nLevelspublic int nLevels()Get the number of resolution levels. For a non-pyramidal image, this is 1.- Returns:
 
- 
getPixelCalibrationGet aPixelCalibrationobject representing the pixel size information for this metadata object.- Returns:
 
- 
getDownsampleForLevelpublic double getDownsampleForLevel(int level) Get the downsample factor for a specific resolution level.- Parameters:
- level-
- Returns:
 
- 
getLevelGet resolution information for a specified pyramidal level.- Parameters:
- level-
- Returns:
 
- 
isRGBpublic boolean isRGB()Returns true if the pixels are stored in (A)RGB form.- Returns:
 
- 
getPixelTypeReturns the bit-depth for individual pixels in the image.- Returns:
 
- 
getMinValueGet the minimum value supported by this image. By default, this is the lower bound of thePixelTypeunless otherwise specified.- Returns:
- See Also:
 
- 
getMaxValueGet the minimum value supported by this image. By default, this is the lower bound of thePixelTypeunless otherwise specified. This purpose of this method is to support other effective bit-depths (e.g. 12-bit, 14-bit).- Returns:
- See Also:
 
- 
pixelSizeCalibratedpublic boolean pixelSizeCalibrated()Returns true if pixel width and height calibration information is available for the image.- Returns:
 
- 
zSpacingCalibratedpublic boolean zSpacingCalibrated()Returns true if z-spacing calibration information is available for the image.- Returns:
 
- 
getAveragedPixelSizepublic double getAveragedPixelSize()Get the averaged pixel size in microns, if available - or Double.NaN otherwise.- Returns:
 
- 
getPixelWidthMicronspublic double getPixelWidthMicrons()Get the pixel width in microns, if available - or Double.NaN otherwise.- Returns:
 
- 
getPixelHeightMicronspublic double getPixelHeightMicrons()Get the pixel height in microns, if available - or Double.NaN otherwise.- Returns:
 
- 
getZSpacingMicronspublic double getZSpacingMicrons()Get the z-spacing in microns, if available - or Double.NaN otherwise.- Returns:
 
- 
getTimeUnitGet the time unit for a time series.- Returns:
 
- 
getTimepointpublic double getTimepoint(int ind) Get the time point, defined ingetTimeUnit(), or Double.NaN if this is unknown.- Parameters:
- ind-
- Returns:
 
- 
getSizeZpublic int getSizeZ()Get the number of z-slices.- Returns:
 
- 
getSizeTpublic int getSizeT()Get the number of time points.- Returns:
 
- 
getSizeCpublic int getSizeC()Get the number of image channels.- Returns:
 
- 
getMagnificationpublic double getMagnification()Get the magnification value, or Double.NaN if this is unavailable.- Returns:
 
- 
getPreferredTileWidthpublic int getPreferredTileWidth()Get the preferred tile width, which can be used to optimize pixel requests for large images.- Returns:
 
- 
getPreferredTileHeightpublic int getPreferredTileHeight()Get the preferred tile height, which can be used to optimize pixel requests for large images.- Returns:
 
- 
duplicateDuplicate this metatadata.- Returns:
 
- 
getNameGet the image name.- Returns:
 
- 
getChannelGet the specified channel.- Parameters:
- n- channel index, starting at 0.
- Returns:
 
- 
getChannelsGet an unmodifiable list of all channels.- Returns:
 
- 
getClassificationLabelsGet map between labels and classification names. This is relevant only where the channel type isImageServerMetadata.ChannelType.CLASSIFICATION, otherwise it returns an empty map.- Returns:
 
- 
getChannelTypeGet the channel type, which can be used to interpret the channels.- Returns:
 
- 
isCompatibleMetadataReturns true if a specified ImageServerMetadata is compatible with this one, that is it has the same path and dimensions (but possibly different pixel sizes, magnifications etc.).- Parameters:
- metadata-
- Returns:
 
- 
toString
- 
hashCodepublic int hashCode()
- 
equals
 
-