Struct openslide_rs::OpenSlide

source ·
pub struct OpenSlide {
    pub properties: Properties,
    /* private fields */
}
Expand description

Openslide object is a simple wrapper around openslide_t “C” type. Implementation provides all functions available in the “C” API It contains also openslide and vendor specific properties found in WSI.

Note : As stated by the OpenSlide documentation, all function are thread-safe except close() For this reason OpenSlide implement the Drop trait which call close() automatically

Fields§

§properties: Properties

Implementations§

This method tries to open the slide at the given filename location.

This function can be expensive; avoid calling it unnecessarily. For example, a tile server should not create a new object on every tile request. Instead, it should maintain a cache of OpenSlide objects and reuse them when possible.

Quickly determine whether a whole slide image is recognized.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Get the number of levels in the whole slide image.

Get the dimensions of level 0 (the largest level).

This method returns the Size { width, height } number of pixels of the whole slide image at the specified level. Returns an error if the level is invalid

Get dimensions of all available levels

Get the downsampling factor of a given level.

Get all downsampling factors for all available levels.

Get the best level to use for displaying the given downsample factor.

Get the list of all available properties.

Get the value of a single property.

Copy pre-multiplied ARGB data from a whole slide image.

This function reads and decompresses a region of a whole slide image into a Vec

Args: offset: (x, y) coordinate (increasing downwards/to the right) of top left pixel position level: At which level to grab the region from size: (width, height) in pixels of the outputted region

Size of output Vec is Width * Height * 4 (RGBA pixels)

Get the list name of all available associated image.

Copy pre-multiplied ARGB data from a whole slide image.

This function reads and decompresses an associated image into an Vec

Args: name: name of the associated image we want to read

Size of output Vec is width * height * 4 (RGBA pixels)

Get the size of an associated image

Copy pre-multiplied ARGB data from a whole slide image.

This function reads and decompresses a region of a whole slide image into an RgbImage

Args: offset: (x, y) coordinate (increasing downwards/to the right) of top left pixel position level: At which level to grab the region from size: (width, height) in pixels of the outputted region

Copy pre-multiplied ARGB data from from an associated image..

This function reads and decompresses a region of a whole slide image into an RgbaImage

Args: offset: (x, y) coordinate (increasing downwards/to the right) of top left pixel position level: At which level to grab the region from size: (width, height) in pixels of the outputted region

Copy pre-multiplied ARGB data from an associated image.

This function reads and decompresses an associated image into an RgbaImage

Args: name: name of the associated image we want to read

Copy pre-multiplied ARGB data from an associated image.

This function reads and decompresses an associated image into an RgbaImage

Args: name: name of the associated image we want to read

Get a RGBA image thumbnail of desired size of the whole slide image. Args: size: (width, height) in pixels of the thumbnail

Get a RGB image thumbnail of desired size of the whole slide image. Args: size: (width, height) in pixels of the thumbnail

Get properties of the whole slide image through Properties struct.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.