Function

Vipsopenslideload

Declaration [src]

int
vips_openslideload (
  const char* filename,
  VipsImage** out,
  ...
)

Description [src]

Optional arguments:

  • level: %gint, load this level
  • associated: %gchararray, load this associated image
  • attach_associated: %gboolean, attach all associated images as metadata
  • autocrop: %gboolean, crop to image bounds

Read a virtual slide supported by the OpenSlide library into a VIPS image. OpenSlide supports images in Aperio, Hamamatsu, MIRAX, Sakura, Trestle, and Ventana formats.

To facilitate zooming, virtual slide formats include multiple scaled-down versions of the high-resolution image. These are typically called “levels”. By default, vips_openslideload() reads the highest-resolution level (level 0). Set level to the level number you want.

In addition to the slide image itself, virtual slide formats sometimes include additional images, such as a scan of the slide’s barcode. OpenSlide calls these “associated images”. To read an associated image, set associated to the image’s name. A slide’s associated images are listed in the “slide-associated-images” metadata item.

If you set attach_associated, then all associated images are attached as metadata items. Use vips_image_get_image() on out to retrieve them. Images are attached as “openslide-associated-XXXXX”, where XXXXX is the name of the associated image.

The output of this operator is always RGBA.

See also: vips_image_new_from_file().

This function is not directly available to language bindings

Parameters

filename const char*
 

File to load.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
out VipsImage
 

Decompressed image.

 The argument will be set by the function.
 The called function takes ownership of the data, and is responsible for freeing it.
...
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.