Appearance
Coordinates
All spatial geometry uses full-resolution level-0 slide pixels: origin at the top left, X increases right, Y increases down. GeoJSON is used as a geometry container; it is not geographic RFC 7946 longitude/latitude.
A region/bounds tuple is (x,y,width,height), with pixel-edge bounds, positive extents, and no implicit clipping outside the slide. It is not (left,top,right,bottom). Region reads accept fractional bounds and return a transform for that exact field of view.
Slide.mpp is (mpp_x,mpp_y) from actual openslide.mpp-x/y properties. Missing/invalid axes are None; objective-power metadata is not used to invent MPP. target_mpp rendering requires both axes. Generic imaging does not enforce the community contribution sampling contract.
Pyramid metadata includes level dimensions and OpenSlide downsample factors. Automatic selection chooses the coarsest level whose downsample is no greater than the requested pixel scale on either axis, retaining adequate detail. A missing/coarse pyramid can make a large region read exceed the native-read budget: request a smaller region or lower-resolution available level.
For a preview of region (x,y,w,h) and size (W,H):
python
preview_x = (slide_x - x) * W / w
preview_y = (slide_y - y) * H / h
slide_x = x + preview_x * w / W
slide_y = y + preview_y * h / HTransform metadata lives in image.info['microscope'] and MCP's transform; it is not embedded in saved image files. Saving a raster uses explicit bounds to preserve the same relationship. A model's patch-relative polygon must be scaled/translated explicitly before adding it as level-0 geometry. The library does not guess model coordinate conventions.
centroids_from_labels(mask, bounds=...) is an explicit pixel-center conversion and returns IDs plus positions; it does not create a layer or choose a representation.