Vips.Image.openslideload (original) (raw)

Constructor

VipsImageopenslideload

Declaration [src]


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

Description [src]

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.

By default, the output of this operator is RGBA. Set rgb to enable RGB output.

Optional arguments

This constructor is not directly available to language bindings.

Parameters

filename

Type: 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

Type: VipsImage

Decompressed image.

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

...

Type: ``

NULL-terminated list of optional named arguments.

Return value

Type: int

0 on success, -1 on error.