ratiopath.tiling.annotations
annotations_intersection(tree, roi)
Get the intersection of annotations with the region of interest (ROI).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tree
|
STRtree
|
The spatial index of annotation geometries. |
required |
roi
|
BaseGeometry
|
The region of interest geometry. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseGeometry |
BaseGeometry
|
The intersection of annotations with the ROI. |
Source code in ratiopath/tiling/annotations.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
shift_roi(roi, coordinate, downsample)
Shift the region of interest (ROI) for a specific tile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roi
|
BaseGeometry
|
The current region of interest geometry. |
required |
coordinate
|
NDArray[int64]
|
The coordinates of the tile to shift the ROI for. |
required |
downsample
|
float
|
The downsampling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
BaseGeometry |
BaseGeometry
|
The shifted region of interest geometry. |
Source code in ratiopath/tiling/annotations.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
tile_annotations(annotations, roi, coordinates, downsample)
Yield annotated tiles from the annotation tree.
Annotations are assumed to be at level 0. Yielded geometries are transformed to the same level as the ROI and tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
annotations
|
Iterable[BaseGeometry]
|
The list of annotation geometries. |
required |
roi
|
BaseGeometry
|
The region of interest geometry. |
required |
coordinates
|
Iterable[NDArray[int64]]
|
The iterable of coordinates of the tiles. |
required |
downsample
|
float
|
The downsampling factor. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
BaseGeometry |
BaseGeometry
|
The annotated tile geometry. |
Source code in ratiopath/tiling/annotations.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |