OpenSlide Usages
OpenSlide lib μ¬μ©λ°©λ²
μ¬μ©νλ λ©μλ€ μ€μμλ§ λ½μλ΄€λ€.
# OpenSlide_objλ₯Ό svs νμΌλ‘ μ½μ΄μμ λμ objλΌκ³ κ°μ νλ€.
OpenSlide_obj = openslide.OpenSlide(svs_path)
OpenSlide_obj.level_dimensions
# A list of (width, height) tuples, one for each level of the slide. level_dimensions[k] are the dimensions of level k
# ex. ((300, 300), (200, 200), (100, 100))
OpenSlide_obj.properties
# Metadata about the slide, in the form of a Mapping from OpenSlide property name to property value. Property values are always strings. OpenSlide provides some standard properties, plus additional properties that vary by slide format.
OpenSlide_obj.read_region(location, level, size)
# Return an RGBA Image containing the contents of the specified region.
# Unlike in the C interface, the image data is not premultiplied.
# ---------------------------------------------------------------------
# Parameters
# location (tuple) β (x, y) tuple giving the top left pixel in the level 0 reference frame
# level (int) β the level number
# size (tuple) β (width, height) tuple giving the region size
OpenSlide_obj.get_thumbnail(size)
# get_thumbnail(size)
# Return an Image containing an RGB thumbnail of the slide.
# ---------------------------------------------------------
# Parameters
# size (tuple) β the maximum size of the thumbnail as a (width, height) tuple
Leave a comment