Package qupath.lib.images.servers
Class ImageServerMetadata.Builder
java.lang.Object
qupath.lib.images.servers.ImageServerMetadata.Builder
- Enclosing class:
ImageServerMetadata
Builder to create a new
ImageServerMetadata
object.-
Constructor Summary
ConstructorDescriptionBuilder()
Minimal builder for a new ImageServerMetadata; further properties must be set.Builder
(Class<? extends ImageServer<?>> serverClass, String path, int width, int height) Builder for a new ImageServerMetadata; further properties must be set.Builder
(ImageServerMetadata metadata) Builder for a new ImageServerMetadata object that takes an existing metadata object as a starting point, but allows individual properties to be overridden. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build anImageServerMetadata
.channels
(Collection<ImageChannel> channels) Specify the image channels.Specify the interpretation of channels.classificationLabels
(Map<Integer, PathClass> classificationLabels) Specify the interpretation of classification labels.height
(int height) Specify the full-resolution image height.Specify resolution levels, where the largest image should come first.levelsFromDownsamples
(double... downsamples) Specify downsample values for pyramidal levels.magnification
(double magnification) Specify a magnification value for the highest-resolution image.Specify the maximum value supported by this image.Specify the minimum value supported by this image.Specify the image name.pixelSizeMicrons
(Number pixelWidthMicrons, Number pixelHeightMicrons) Specify the pixel sizes, in microns.Specify the bit-depth of the image.preferredTileSize
(int tileWidth, int tileHeight) Specify the preferred tile height and width.rgb
(boolean isRGB) Specify that the image stores pixels in (A)RGB form.sizeT
(int sizeT) Specify the number of time points.sizeZ
(int sizeZ) Specify the number of z-slices.timepoints
(TimeUnit timeUnit, double... timepoints) Specify the time unit and individual time points.width
(int width) Specify the full-resolution image width.zSpacingMicrons
(Number zSpacingMicrons) Specify the spacing between z-slices, in microns.
-
Constructor Details
-
Builder
Builder for a new ImageServerMetadata object that takes an existing metadata object as a starting point, but allows individual properties to be overridden.The existing metadata will be duplicated, therefore later changes in one metadata object will not be reflected in the other.
- Parameters:
metadata
-
-
Builder
public Builder()Minimal builder for a new ImageServerMetadata; further properties must be set. -
Builder
Builder for a new ImageServerMetadata; further properties must be set.- Parameters:
serverClass
-path
-width
-height
-
-
-
Method Details
-
width
Specify the full-resolution image width.- Parameters:
width
-- Returns:
-
height
Specify the full-resolution image height.- Parameters:
height
-- Returns:
-
minValue
Specify the minimum value supported by this image. If not provided, this will be taken from thePixelType
.- Parameters:
val
-- Returns:
- See Also:
-
maxValue
Specify the maximum value supported by this image. If not provided, this will be taken from thePixelType
. This purpose of this method is to support other effective bit-depths (e.g. 12-bit, 14-bit).- Parameters:
val
-- Returns:
- See Also:
-
channelType
Specify the interpretation of channels. If this isImageServerMetadata.ChannelType.CLASSIFICATION
it will also set the channels to be the default for this kind of server, i.e. a single channel withImageServerMetadata.DEFAULT_CLASSIFICATION_LABELS_CHANNEL
.- Parameters:
type
-- Returns:
-
classificationLabels
public ImageServerMetadata.Builder classificationLabels(Map<Integer, PathClass> classificationLabels) Specify the interpretation of classification labels. Only relevant forImageServerMetadata.ChannelType.CLASSIFICATION
.- Parameters:
classificationLabels
-- Returns:
-
rgb
Specify that the image stores pixels in (A)RGB form.- Parameters:
isRGB
-- Returns:
-
pixelType
Specify the bit-depth of the image.- Parameters:
pixelType
-- Returns:
-
levelsFromDownsamples
Specify downsample values for pyramidal levels. The appropriate image sizes will be computed based upon these.- Parameters:
downsamples
-- Returns:
- See Also:
-
levels
public ImageServerMetadata.Builder levels(Collection<ImageServerMetadata.ImageResolutionLevel> levels) Specify resolution levels, where the largest image should come first.Normally
level[0].width == width && level[0].height == height
, but this is not strictly required; for example, it is permissible for the server to supply only resolutions lower than the full image if these ought to be upsampled elsewhere.In other words, the
width
andheight
encode the size of the image as it should be interpreted, while thelevels
refer to the size of the rasters actually available here.- Parameters:
levels
-- Returns:
-
sizeZ
Specify the number of z-slices.- Parameters:
sizeZ
-- Returns:
-
sizeT
Specify the number of time points.- Parameters:
sizeT
-- Returns:
-
pixelSizeMicrons
public ImageServerMetadata.Builder pixelSizeMicrons(Number pixelWidthMicrons, Number pixelHeightMicrons) Specify the pixel sizes, in microns.- Parameters:
pixelWidthMicrons
-pixelHeightMicrons
-- Returns:
-
zSpacingMicrons
Specify the spacing between z-slices, in microns.- Parameters:
zSpacingMicrons
-- Returns:
-
timepoints
Specify the time unit and individual time points.- Parameters:
timeUnit
-timepoints
- time points, defined in terms of timeUnits.- Returns:
-
magnification
Specify a magnification value for the highest-resolution image.- Parameters:
magnification
-- Returns:
-
preferredTileSize
Specify the preferred tile height and width.- Parameters:
tileWidth
-tileHeight
-- Returns:
-
channels
Specify the image channels.- Parameters:
channels
-- Returns:
-
name
Specify the image name.- Parameters:
name
-- Returns:
-
build
Build anImageServerMetadata
. Note that the builder should only be used once. If a second builder is required, a new one should be initialized from an existing ImageServerMetadata object.- Returns:
-