I have a whole-slide-images (.svs format) which are scanned at 20x. For my problem, I would like to upscale the slides to 40x along with the slide metadata. I tried it by the combination of the openslide, NumPy, cv2, and vips
command. For a smaller size of slides, I can achieve this but for larger size slides I can't. Is there a straightforward way available to achieve this?
I followed following steps
- open slide and NumPy to read the slide.
- cv2 to create the png upscaled .png image.
- vips vips2tiff command to convert .png to .svs file.
I would just use libvips
resize
. For example:80s and 680mb of memory to make
x.tif
, a tiled, pyramidal, jpeg-compressed TIFF. libvips can't write SVS files, but this will be pretty close. By default it'll do the upsize with a bicubic interpolator.In Python you'd use pyvips: