Class TileRequest
RegionRequest
, useful to precisely specify image tiles at a particular resolution.
Why?
Because downsamples can be defined with floating point precision, and are not always unambiguous when calculated as the ratios of pyramid level dimensions (i.e. different apparent horizontal and vertical scaling), a RegionRequest is too fuzzy a way to refer to a specific rectangle of pixels from a specific pyramid level. Rounding errors can easily occur, and different image readers might respond differently to the same request.
Consequently, TileRequests provide a means to reproducibly define coordinates at pyramid levels and not only the full resolution image space. They wrap a RegionRequest, because this is still used for caching purposes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TileRequest
createInstance
(String path, int level, double downsample, ImageRegion tileRegion) Create a new tile request for a specified region, downsample and resolution level.static TileRequest
createInstance
(ImageServer<?> server, int level, ImageRegion tileRegion) Create a new tile request for a specified region and resolution level of an image.boolean
double
Get the downsample value for this tile.int
Get the height of the bounding box for this tile in the full resolution image.Get the ImagePlane for this request.int
Get the width of the bounding box for this tile in the full resolution image.int
Get the x-coordinate of the bounding box for this tile in the full resolution image.int
Get the y-coordinate of the bounding box for this tile in the full resolution image.int
getLevel()
Get the resolution level.getPlane()
Deprecated.Get the RegionRequest that this tile represents.int
getT()
Get the time point index for this request.int
Get the height of the bounding box for this tile at the tile resolution.int
Get the width of the bounding box for this tile at the tile resolution.int
getTileX()
Get the x-coordinate of the bounding box for this tile at the tile resolution.int
getTileY()
Get the y-coordinate of the bounding box for this tile at the tile resolution.int
getZ()
Get the z-slice index for this request.int
hashCode()
toString()
-
Method Details
-
createInstance
Create a new tile request for a specified region and resolution level of an image.Most of the time this should not be needed: use
ImageServer.getTileRequestManager()
instead to get the tiles that are actually available for an image.- Parameters:
server
-level
-tileRegion
-- Returns:
- See Also:
-
createInstance
public static TileRequest createInstance(String path, int level, double downsample, ImageRegion tileRegion) Create a new tile request for a specified region, downsample and resolution level.Most of the time this should not be needed: use
ImageServer.getTileRequestManager()
instead.In cases where a new
TileRequest
is necessary, it is better to usecreateInstance(ImageServer, int, ImageRegion)
where possible. The current method exists for cases where aTileRequest
is a useful data structure but it isn't associated with a specific image.- Parameters:
path
-level
-downsample
-tileRegion
-- Returns:
- See Also:
-
getRegionRequest
Get the RegionRequest that this tile represents.- Returns:
-
getDownsample
public double getDownsample()Get the downsample value for this tile.- Returns:
-
getLevel
public int getLevel()Get the resolution level.- Returns:
-
getImageX
public int getImageX()Get the x-coordinate of the bounding box for this tile in the full resolution image.- Returns:
-
getImageY
public int getImageY()Get the y-coordinate of the bounding box for this tile in the full resolution image.- Returns:
-
getImageWidth
public int getImageWidth()Get the width of the bounding box for this tile in the full resolution image.- Returns:
-
getImageHeight
public int getImageHeight()Get the height of the bounding box for this tile in the full resolution image.- Returns:
-
getTileX
public int getTileX()Get the x-coordinate of the bounding box for this tile at the tile resolution.- Returns:
-
getTileY
public int getTileY()Get the y-coordinate of the bounding box for this tile at the tile resolution.- Returns:
-
getTileWidth
public int getTileWidth()Get the width of the bounding box for this tile at the tile resolution.- Returns:
-
getTileHeight
public int getTileHeight()Get the height of the bounding box for this tile at the tile resolution.- Returns:
-
getZ
public int getZ()Get the z-slice index for this request.- Returns:
-
getT
public int getT()Get the time point index for this request.- Returns:
-
getImagePlane
Get the ImagePlane for this request.- Returns:
- Since:
- v0.4.0 (replaces
getPlane()
for better consistency with other classes)
-
getPlane
Deprecated.v0.4.0 usegetImagePlane()
instead (changed for better consistency with other classes)Get the ImagePlane for this request.- Returns:
-
hashCode
public int hashCode() -
equals
-
toString
-
getImagePlane()
instead (changed for better consistency with other classes)