Package qupath.lib.regions
Class RegionRequest
java.lang.Object
qupath.lib.regions.ImageRegion
qupath.lib.regions.RegionRequest
Class for defining an image region that can also be used to request these region from an 
ImageServer.
 
 In addition to the information contained within an ImageRegion, also contains the path to the image
 (and optionally an additional image name stored within it) and a downsample value.
- 
Method SummaryModifier and TypeMethodDescriptionstatic List<RegionRequest> createAllRequests(ImageServer<?> server, double downsample) Create requests for the full width and height of anImageServer, for all planes (z-slices and time points).static RegionRequestcreateInstance(String path, double downsample, int x, int y, int width, int height) Create a request for a region specified in terms of its bounding box, using the first z-slice and time point.static RegionRequestcreateInstance(String path, double downsample, int x, int y, int width, int height, int z, int t) Create a request for a region specified in terms of its bounding box, z-slice and time point.static RegionRequestcreateInstance(String path, double downsample, int x, int y, int width, int height, ImagePlane plane) Create a request for a region specified in terms of its bounding box andImagePlane.static RegionRequestcreateInstance(String path, double downsample, Collection<? extends ROI> rois) Create a request that contains the pixels of the specifiedROIs.static RegionRequestcreateInstance(String path, double downsample, ImageRegion region) Create a request corresponding to a specifiedImageRegion.static RegionRequestcreateInstance(String path, double downsample, ROI roi) Create a request that contains the pixels of the specifiedROI.static RegionRequestcreateInstance(String path, RegionRequest request) Create a request that matches another request but with a different path.static RegionRequestcreateInstance(ImageServer<?> server) Create a request for the full width and height of anImageServer, for the default plane (first z-slice, time point) and first resolution level downsample (usually 1, but not always).static RegionRequestcreateInstance(ImageServer<?> server, double downsample) Create a request for the full width and height of anImageServer, for the default plane (first z-slice, time point).booleandoubleGet the requested downsample factor, defining the resolution at which pixels should be returned.getPath()Get the requested ImageServer path, used as an identifier.inthashCode()intersect2D(int x, int y, int width, int height) Intersect to the specified 2D region.intersect2D(ImageRegion region) Intersect to the specified 2D region, ignoring z and t.booleanoverlapsRequest(RegionRequest request) Returns true if the region specified by this request overlaps with that of another request.pad2D(int xPad, int yPad) Add symmetric padding to the x and y dimensions of a request.Add symmetric padding to the x and y dimensions of a request.toString()translate(int dx, int dy) Create aRegionRequestequivalent to this one with the x and y coordinates updated by translation.updateDownsample(double downsample) Create aRegionRequestequivalent to this one with the updated downsample value.updatePath(String path) Create aRegionRequestequivalent to this one with the updated path.updateT(int t) Create aRegionRequestequivalent to this one with the updated t value.updateZ(int z) Create aRegionRequestequivalent to this one with the updated z value.Methods inherited from class qupath.lib.regions.ImageRegioncontains, createInstance, createInstance, createInstance, getHeight, getImagePlane, getMaxX, getMaxY, getMinX, getMinY, getPlane, getT, getWidth, getX, getY, getZ, intersects, intersects
- 
Method Details- 
toString- Overrides:
- toStringin class- ImageRegion
 
- 
createInstanceCreate a request for the full width and height of anImageServer, for the default plane (first z-slice, time point) and first resolution level downsample (usually 1, but not always).- Parameters:
- server-
- Returns:
 
- 
createInstanceCreate a request for the full width and height of anImageServer, for the default plane (first z-slice, time point).- Parameters:
- server-
- downsample-
- Returns:
 
- 
createAllRequestsCreate requests for the full width and height of anImageServer, for all planes (z-slices and time points).- Parameters:
- server-
- downsample-
- Returns:
 
- 
createInstanceCreate a request that contains the pixels of the specifiedROI. This is calculated using theROIbounding box.- Parameters:
- path-
- downsample-
- roi-
- Returns:
 
- 
createInstancepublic static RegionRequest createInstance(String path, double downsample, Collection<? extends ROI> rois) Create a request that contains the pixels of the specifiedROIs. This is calculated using theROIbounding boxes.- Parameters:
- path-
- downsample-
- rois-
- Returns:
- Throws:
- IllegalArgumentException- if the- ROIs do not all fall on the same- ImagePlane.
 
- 
createInstanceCreate a request that matches another request but with a different path.- Parameters:
- path-
- request-
- Returns:
 
- 
createInstanceCreate a request corresponding to a specifiedImageRegion. This may also be used to construct a request based on an existing request, but changing either the path or downsample.- Parameters:
- path-
- downsample-
- region-
- Returns:
 
- 
createInstancepublic static RegionRequest createInstance(String path, double downsample, int x, int y, int width, int height, int z, int t) Create a request for a region specified in terms of its bounding box, z-slice and time point.- Parameters:
- path-
- downsample-
- x-
- y-
- width-
- height-
- z-
- t-
- Returns:
 
- 
createInstancepublic static RegionRequest createInstance(String path, double downsample, int x, int y, int width, int height, ImagePlane plane) Create a request for a region specified in terms of its bounding box andImagePlane.- Parameters:
- path-
- downsample-
- x-
- y-
- width-
- height-
- plane-
- Returns:
 
- 
createInstancepublic static RegionRequest createInstance(String path, double downsample, int x, int y, int width, int height) Create a request for a region specified in terms of its bounding box, using the first z-slice and time point.- Parameters:
- path-
- downsample-
- x-
- y-
- width-
- height-
- Returns:
 
- 
overlapsRequestReturns true if the region specified by this request overlaps with that of another request. The test includes insuring that they refer to the same image by checking the paths are the same.- Parameters:
- request-
- Returns:
 
- 
getPathGet the requested ImageServer path, used as an identifier.- Returns:
- See Also:
 
- 
getDownsamplepublic double getDownsample()Get the requested downsample factor, defining the resolution at which pixels should be returned.- Returns:
 
- 
intersect2DIntersect to the specified 2D region, ignoring z and t.- Parameters:
- region- the region defining the x, y, width and height of the maximum permitted bounding box.
- Returns:
- the clipped RegionRequest, which may be this if no clipping is required.
 
- 
intersect2DIntersect to the specified 2D region.- Parameters:
- x- x-coordinate of the second region's bounding box
- y- y-coordinate of the second region's bounding box
- width- width of the second region's bounding box
- height- height of the second region's bounding box
- Returns:
- the clipped RegionRequest, which may be this if no clipping is required.
 
- 
updateZCreate aRegionRequestequivalent to this one with the updated z value.- Parameters:
- z- requested z position
- Returns:
- RegionRequestwith the specified z value (may be this object unchanged).
 
- 
updateTCreate aRegionRequestequivalent to this one with the updated t value.- Parameters:
- t- requested t position
- Returns:
- RegionRequestwith the specified t value (may be this object unchanged).
 
- 
updateDownsampleCreate aRegionRequestequivalent to this one with the updated downsample value.- Parameters:
- downsample- requested downsample position
- Returns:
- RegionRequestwith the specified downsample value (may be this object unchanged).
 
- 
updatePathCreate aRegionRequestequivalent to this one with the updated path.- Parameters:
- path- requested path position
- Returns:
- RegionRequestwith the specified path value (may be this object unchanged).
 
- 
translateCreate aRegionRequestequivalent to this one with the x and y coordinates updated by translation.- Parameters:
- dx- value to add to the x coordinate
- dy- value to add to the y coordinate
- Returns:
- RegionRequestwith the specified path value (may be this object unchanged).
 
- 
pad2DAdd symmetric padding to the x and y dimensions of a request.- Parameters:
- xPad- padding to add along the x dimension; the width will be adjusted by- xPad * 2
- yPad- padding to add along the y dimension; the height will be adjusted by- yPad * 2
- Returns:
- RegionRequestwith the specified padding (may be this object unchanged if the padding is zero).
 
- 
pad2DAdd symmetric padding to the x and y dimensions of a request.- Parameters:
- padding- padding to add
- Returns:
- RegionRequestwith the specified padding (may be this object unchanged if the padding is zero).
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- ImageRegion
 
- 
equals- Overrides:
- equalsin class- ImageRegion
 
 
-