From a63f43554beee87131e7be5bc95fb7e20bfdb66c Mon Sep 17 00:00:00 2001
From: Benjamin Gilbert Aperio ( ARGOS ( DICOM ( Hamamatsu ( Huron ( Leica ( MIRAX ( Philips ( Images, such as label or macro images, which are associated with this
slide. This is a OpenSlide Python
.svs, .tif).avs).dcm).ndpi, .vms, .vmu).tif).scn).mrxs).tiff)Basic usageassociated_images¶
Mapping from image
-name to RGBA Image.Image.
Unlike in the C interface, these images are not premultiplied.
@@ -207,15 +209,15 @@None if not available.
ImageCmsProfile | None
+ImageCmsProfile | None
Return an RGBA Image containing the contents of
+read_region(location: tuple[int, int], level: int, size: tuple[int, int]) Image¶
+
Return an RGBA Image containing the contents of
the specified region.
Unlike in the C interface, the image data is not premultiplied.
Return an Image containing an RGB thumbnail of the
+get_thumbnail(size: tuple[int, int]) Image¶
+
Return an Image containing an RGB thumbnail of the
slide.
bytes object in
-Image.info['icc_profile']. If no
+Image.info['icc_profile']. If no
profile is available, the icc_profile dictionary key is absent.
To include the profile in an image file when saving the image to disk:
image.save(filename, icc_profile=image.info.get('icc_profile'))
To perform color conversions using the profile, import it into
-ImageCms. For example, to synthesize an sRGB profile
+ImageCms. For example, to synthesize an sRGB profile
and use it to transform an image for display, with the default rendering
intent of the image’s profile:
from io import BytesIO
@@ -310,8 +312,8 @@ Basic usageOpenSlide.color_profile, already parsed into an
-ImageCmsProfile object. You can save processing time
-by building an ImageCmsTransform for the slide and
+ImageCmsProfile object. You can save processing time
+by building an ImageCmsTransform for the slide and
reusing it for multiple slide regions:
toProfile = ImageCms.createProfile('sRGB')
intent = ImageCms.getDefaultIntent(slide.color_profile)
@@ -348,34 +350,50 @@ Caching¶
The openslide module provides attributes containing the names of
some commonly-used OpenSlide properties.
--
-openslide.PROPERTY_NAME_COMMENT¶
-The name of the property containing a slide’s comment, if any.
+-
+openslide.PROPERTY_NAME_BACKGROUND_COLOR¶
+The name of the property containing a slide’s background color, if any.
+It is represented as an RGB hex triplet.
--
-openslide.PROPERTY_NAME_VENDOR¶
-The name of the property containing an identification of the vendor.
+-
+openslide.PROPERTY_NAME_BARCODE¶
+The name of the property containing a slide’s barcode, if any.
--
-openslide.PROPERTY_NAME_QUICKHASH1¶
-The name of the property containing the “quickhash-1” sum.
+-
+openslide.PROPERTY_NAME_BOUNDS_HEIGHT¶
+The name of the property containing the height of the rectangle bounding
+the non-empty region of the slide, if available.
--
-openslide.PROPERTY_NAME_BACKGROUND_COLOR¶
-The name of the property containing a slide’s background color, if any.
-It is represented as an RGB hex triplet.
+-
+openslide.PROPERTY_NAME_BOUNDS_WIDTH¶
+The name of the property containing the width of the rectangle bounding
+the non-empty region of the slide, if available.
--
-openslide.PROPERTY_NAME_OBJECTIVE_POWER¶
-The name of the property containing a slide’s objective power, if known.
+-
+openslide.PROPERTY_NAME_BOUNDS_X¶
+The name of the property containing the X coordinate of the rectangle
+bounding the non-empty region of the slide, if available.
+
+
+
+-
+openslide.PROPERTY_NAME_BOUNDS_Y¶
+The name of the property containing the Y coordinate of the rectangle
+bounding the non-empty region of the slide, if available.
+
+
+
+-
+openslide.PROPERTY_NAME_COMMENT¶
+The name of the property containing a slide’s comment, if any.
@@ -393,31 +411,21 @@ Caching¶
--
-openslide.PROPERTY_NAME_BOUNDS_X¶
-The name of the property containing the X coordinate of the rectangle
-bounding the non-empty region of the slide, if available.
-
-
-
--
-openslide.PROPERTY_NAME_BOUNDS_Y¶
-The name of the property containing the Y coordinate of the rectangle
-bounding the non-empty region of the slide, if available.
+-
+openslide.PROPERTY_NAME_OBJECTIVE_POWER¶
+The name of the property containing a slide’s objective power, if known.
--
-openslide.PROPERTY_NAME_BOUNDS_WIDTH¶
-The name of the property containing the width of the rectangle bounding
-the non-empty region of the slide, if available.
+-
+openslide.PROPERTY_NAME_QUICKHASH1¶
+The name of the property containing the “quickhash-1” sum.
--
-openslide.PROPERTY_NAME_BOUNDS_HEIGHT¶
-The name of the property containing the height of the rectangle bounding
-the non-empty region of the slide, if available.
+-
+openslide.PROPERTY_NAME_VENDOR¶
+The name of the property containing an identification of the vendor.
@@ -459,12 +467,12 @@ Exceptions
-
-class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
-A wrapper around an Image object that provides an
+class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
+
A wrapper around an Image object that provides an
OpenSlide-compatible API.
- Parameters:
-file – a filename or Image object
+file – a filename or Image object
- Raises:
OSError – if the file cannot be opened
@@ -577,8 +585,8 @@ Exceptions
-
-get_tile(level: int, address: tuple[int, int]) Image¶
-Return an RGB Image for a tile.
+get_tile(level: int, address: tuple[int, int]) Image¶
+Return an RGB Image for a tile.
- Parameters:
@@ -684,17 +692,18 @@ Table of Contents
- Standard properties
-PROPERTY_NAME_COMMENT
-PROPERTY_NAME_VENDOR
-PROPERTY_NAME_QUICKHASH1
PROPERTY_NAME_BACKGROUND_COLOR
-PROPERTY_NAME_OBJECTIVE_POWER
-PROPERTY_NAME_MPP_X
-PROPERTY_NAME_MPP_Y
+PROPERTY_NAME_BARCODE
+PROPERTY_NAME_BOUNDS_HEIGHT
+PROPERTY_NAME_BOUNDS_WIDTH
PROPERTY_NAME_BOUNDS_X
PROPERTY_NAME_BOUNDS_Y
-PROPERTY_NAME_BOUNDS_WIDTH
-PROPERTY_NAME_BOUNDS_HEIGHT
+PROPERTY_NAME_COMMENT
+PROPERTY_NAME_MPP_X
+PROPERTY_NAME_MPP_Y
+PROPERTY_NAME_OBJECTIVE_POWER
+PROPERTY_NAME_QUICKHASH1
+PROPERTY_NAME_VENDOR
- Exceptions
@@ -745,13 +754,13 @@ This Page