support :level,associated in the vips7 openslide
the vips7 stub for openslide now supports :level,associated mode
options, eg:
$ header CMU-2.svs
CMU-2.svs: 19500x7615 uchar, 4 bands, rgb VipsImage (0x236a060)
$ header CMU-2.svs:2
CMU-2.svs:2: 4875x1903 uchar, 4 bands, rgb VipsImage (0x244c060)
$ header CMU-2.svs:,label
CMU-2.svs:,label: 387x463 uchar, 4 bands, rgb VipsImage (0xa2d060)
$ header CMU-2.svs:2,label
CMU-2.svs:2,label: 387x463 uchar, 4 bands, rgb VipsImage (0x1b23060)
2012-04-11 13:48:41 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import sys
|
2014-08-29 18:33:14 +02:00
|
|
|
|
2014-09-01 10:41:14 +02:00
|
|
|
#import logging
|
|
|
|
#logging.basicConfig(level = logging.DEBUG)
|
2014-08-29 18:33:14 +02:00
|
|
|
|
|
|
|
from gi.repository import Vips
|
support :level,associated in the vips7 openslide
the vips7 stub for openslide now supports :level,associated mode
options, eg:
$ header CMU-2.svs
CMU-2.svs: 19500x7615 uchar, 4 bands, rgb VipsImage (0x236a060)
$ header CMU-2.svs:2
CMU-2.svs:2: 4875x1903 uchar, 4 bands, rgb VipsImage (0x244c060)
$ header CMU-2.svs:,label
CMU-2.svs:,label: 387x463 uchar, 4 bands, rgb VipsImage (0xa2d060)
$ header CMU-2.svs:2,label
CMU-2.svs:2,label: 387x463 uchar, 4 bands, rgb VipsImage (0x1b23060)
2012-04-11 13:48:41 +02:00
|
|
|
from vips8 import vips
|
|
|
|
|
2014-08-29 18:33:14 +02:00
|
|
|
a = Vips.Image.new_from_file(sys.argv[1])
|
|
|
|
|
|
|
|
b = Vips.Image.new_from_file(sys.argv[2])
|
support :level,associated in the vips7 openslide
the vips7 stub for openslide now supports :level,associated mode
options, eg:
$ header CMU-2.svs
CMU-2.svs: 19500x7615 uchar, 4 bands, rgb VipsImage (0x236a060)
$ header CMU-2.svs:2
CMU-2.svs:2: 4875x1903 uchar, 4 bands, rgb VipsImage (0x244c060)
$ header CMU-2.svs:,label
CMU-2.svs:,label: 387x463 uchar, 4 bands, rgb VipsImage (0xa2d060)
$ header CMU-2.svs:2,label
CMU-2.svs:2,label: 387x463 uchar, 4 bands, rgb VipsImage (0x1b23060)
2012-04-11 13:48:41 +02:00
|
|
|
|
2014-09-01 16:28:55 +02:00
|
|
|
c = a.join(b, Vips.Direction.HORIZONTAL,
|
|
|
|
expand = True,
|
|
|
|
shim = 100,
|
|
|
|
align = Vips.Align.CENTRE,
|
|
|
|
background = [128, 255, 128])
|
support :level,associated in the vips7 openslide
the vips7 stub for openslide now supports :level,associated mode
options, eg:
$ header CMU-2.svs
CMU-2.svs: 19500x7615 uchar, 4 bands, rgb VipsImage (0x236a060)
$ header CMU-2.svs:2
CMU-2.svs:2: 4875x1903 uchar, 4 bands, rgb VipsImage (0x244c060)
$ header CMU-2.svs:,label
CMU-2.svs:,label: 387x463 uchar, 4 bands, rgb VipsImage (0xa2d060)
$ header CMU-2.svs:2,label
CMU-2.svs:2,label: 387x463 uchar, 4 bands, rgb VipsImage (0x1b23060)
2012-04-11 13:48:41 +02:00
|
|
|
|
2014-09-01 16:28:55 +02:00
|
|
|
c.write_to_file(sys.argv[3])
|