Comments (12)
Hello @EKami,
It looks like your libvips has been compiled without OpenSlide support. You'll need to rebuild with it enabled.
from pyvips.
Hello @jcupitt ,
Thanks for stepping in! Is there a particular flag I have to enable when compiling libvips to enable OpenSlide support? I can't find any.
Btw what I'm trying to achieve here is to load regions of the mirax WSI very fast from disk without loading the whole WSI into memory. I believe vips will help me reach that goal? I just want to confirm because so far I saw examples with TIFF and PNG files but not with Mirax.
Using OpenSlide directly and loading the WSI in memory give me this error coming from Pillow:
MemoryError: Integer overflow in ysize
And loading the image in chunks doesn't help either.
I hope somehow I'll be able to get past this error with Vips
from pyvips.
Just install openslide-dev
before trying to configure libvips. There's a line in the output of configure where it says whether openslide was detected.
Yes, libvips should do what you need. I see:
john@kiwi:~/pics/openslide/mrxs$ vipsheader CMU-1.mrxs
CMU-1.mrxs: 109240x220696 uchar, 4 bands, rgb, openslideload
john@kiwi:~/pics/openslide/mrxs$ time vips crop CMU-1.mrxs x.png 10000 10000 1000 1000
real 0m0.224s
user 0m0.208s
sys 0m0.028s
ie. it pulled a 1000 x 1000 PNG from a 100x x 200k pixel MRXS in 200ms.
from pyvips.
Thanks for your help.
Ok so on one of my mirax files I get:
(dl) ekami@ekami-Z270X-Ultra-Gaming:~/workspace/pathologywatch_driveD/BVKFSK$ vipsheader 1M03_11.04.2018_20.06.578.mrxs
1M03_11.04.2018_20.06.578.mrxs: 620x1482 uchar, 3 bands, srgb, jpegload
(dl) ekami@ekami-Z270X-Ultra-Gaming:~/workspace/pathologywatch_driveD/BVKFSK$ time vips crop 1M03_11.04.2018_20.06.578.mrxs x.png 100 100 100 100
real 0m0,012s
user 0m0,005s
sys 0m0,009s
So everything worked fine. But then I got the following error:
pyvips.error.Error: no such operation openslideload
VipsOperation: class "openslideload" not found
Traceback (most recent call last):
File "/home/ekami/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 167, in _get_type
if isinstance(o, t[0]):
ffi.error: struct _VipsOperation: wrong total size (cdef says 80, but C compiler says 96). fix it or use "...;" in the cdef for struct _VipsOperation to make it flexible
I solved it by reinstalling libvips with sudo apt install libvips
. Problem solved for now. Thanks @jcupitt :)
from pyvips.
Is there any quick way to figure out which libvips directory pyvips is using/pointing to?
I just built it again with openslide bindings, but I still don't see the pyvips.Image.loadopenslide coming up as a binding..
from pyvips.
Or perhaps I just don't know where in the pyvips interface vips_smartcrop () is exposted....
from pyvips.
It's openslideload
, though just new_from_file
should work.
from pyvips.
pyvips uses the standard library load system on your platform, so for linux you may need to changed LD_LIBRARY_PATH
or perhaps change dld.so.conf
, depending on your distro. On macOS you may need to change DYLD_LIBRARY_PATH
.
You can use version
to interrogate the library and get the version number:
>>> import pyvips
>>> pyvips.version(0)
8
>>> pyvips.version(1)
8
>>> pyvips.version(2)
0
So I have libvips 8.8.0.
from pyvips.
from pyvips.
Yes, it should work. I see:
john@kiwi:~/pics/openslide/mrxs$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
>>> x = pyvips.Image.new_from_file("CMU-1.mrxs", autocrop=True)
>>> x.width
68315
>>> x.height
94972
>>> x = pyvips.Image.openslideload("CMU-1.mrxs", autocrop=True)
>>> x.width
68315
from pyvips.
from pyvips.
You can have several libvipses installed, but you will need to set the env vars to get the right one picked up at runtime.
from pyvips.
Related Issues (20)
- ICC Profile Application on SVS and tiffsave hangs randomly
- High RAM usage with fetch when reading multiple WSI tiles HOT 2
- Slower first run, even without cache HOT 2
- using resource.setrlimit makes pyvips / liborc spit the dummy HOT 2
- Memory leaking with pdf HOT 21
- dzsave_target returns NoneType not list[] as in docs HOT 1
- Pyvips fetch returns bad image on .svs files HOT 4
- Reading in image a second time breaks on qptiff file HOT 6
- Documentation link to conda package HOT 1
- Create svs file with image pyramid, label and macro in pyvips? HOT 4
- Image merge stitch HOT 2
- `addalpha` has different behaviour compared to C HOT 1
- Error installing pyvips on Mac OS HOT 15
- draw_rect fill error HOT 2
- creating tiles of 16bit multiband (4 band) tiff image leaves black canvas HOT 4
- class "jxlsave" not found HOT 9
- Assertion failed: sp->cinfo.comm.is_decompressor HOT 3
- Help installing pyvips for jupyter HOT 5
- `TIFFFillTile: Read error` when writing a TIFF file on a per-tile basis. HOT 2
- Thumbnail creation taking too long HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvips.