TileDBOpenSlide
bioimg.openslide.TileDBOpenSlide(self, uri, *, attr=ATTR_NAME, config=None, ctx=None)
Attributes
Name | Description |
---|---|
dimensions | A (width, height) tuple for level 0 of the slide. |
level_count | Number of levels in the slide |
level_dimensions | A sequence of (width, height) tuples, one for each level of the slide. |
level_downsamples | A sequence of downsample factors for each level of the slide. |
levels | Sequence of level numbers in the slide. |
properties | Metadata about the slide |
Methods
Name | Description |
---|---|
get_best_level_for_downsample | Return the best level for displaying the given downsample filtering by factor. |
level_properties | Metadata about the given slide level |
read_level | Return an image containing the contents of the specified level as NumPy array. |
read_level_dask | Return an image containing the contents of the specified level as Dask array. |
read_region | Return an image containing the contents of the specified region as NumPy array. |
get_best_level_for_downsample
bioimg.openslide.TileDBOpenSlide.get_best_level_for_downsample(factor)
Return the best level for displaying the given downsample filtering by factor.
Parameters
Name | Type | Description | Default |
---|---|---|---|
factor |
float | The factor of downsamples. Above this value downsamples are filtered out. | required |
Returns
Type | Description |
---|---|
int | The number corresponding to a level |
level_properties
bioimg.openslide.TileDBOpenSlide.level_properties(level)
Metadata about the given slide level
read_level
bioimg.openslide.TileDBOpenSlide.read_level(level, to_original_axes=False)
Return an image containing the contents of the specified level as NumPy array.
Parameters
Name | Type | Description | Default |
---|---|---|---|
level |
int | the level number | required |
to_original_axes |
bool | If True return the image in the original axes, otherwise return it in YXC (height, width, channel) axes. | False |
read_level_dask
bioimg.openslide.TileDBOpenSlide.read_level_dask(level, to_original_axes=False)
Return an image containing the contents of the specified level as Dask array.
Parameters
Name | Type | Description | Default |
---|---|---|---|
level |
int | the level number | required |
to_original_axes |
bool | If True return the image in the original axes, otherwise return it in YXC (height, width, channel) axes. | False |
read_region
bioimg.openslide.TileDBOpenSlide.read_region(location, level, size)
Return an image containing the contents of the specified region as NumPy array.
Parameters
Name | Type | Description | Default |
---|---|---|---|
location |
Tuple[int, int] | (x, y) tuple giving the top left pixel in the level 0 reference frame | required |
level |
int | the level number | required |
size |
Tuple[int, int] | (width, height) tuple giving the region size | required |
Returns
Type | Description |
---|---|
np.ndarray | 3D (height, width, channel) Numpy array |