Package qupath.lib.images.servers
Class SparseImageServer.SparseImageServerManager
java.lang.Object
qupath.lib.images.servers.SparseImageServer.SparseImageServerManager
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
SparseImageServer
public static class SparseImageServer.SparseImageServerManager
extends Object
implements AutoCloseable
Helper class for SparseImageServers, capable of returning the appropriate ImageServer for
different ImageRegions and different resolutions.
This also allows serialization/deserialization with JSON.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Get an unmodifiable collection for all available regions.getServer
(ImageRegion region, double downsample) Request the server for a specific downsample.
-
Constructor Details
-
SparseImageServerManager
public SparseImageServerManager()
-
-
Method Details
-
getRegions
Get an unmodifiable collection for all available regions.This can be used to iterate through regions to check which overlap a request.
- Returns:
-
getServer
public ImageServer<BufferedImage> getServer(ImageRegion region, double downsample) throws IOException Request the server for a specific downsample.Note that this does not aim to return a server for any arbitrary region; rather, a server must exist for the specified region and downsample, otherwise this will return
null
.- Parameters:
region
- specified region to which the server should correspond (must be found withingetRegions()
)downsample
- specified downsample for the server (must be found withingetDownsamples()
)- Returns:
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-