Very basic questions

Benjamin Gilbert bgilbert at cs.cmu.edu
Wed Mar 30 23:03:12 EDT 2016


On Wed, Mar 30, 2016 at 10:32:49PM +0000, Upadhyay, Vivek, M.D. via openslide-users wrote:
> I have downloaded Openslide and Openslide Python, but when I run the
> module I keep getting a "ImportError: No module named 'PIL'".
> 
> 1) How can I open OpenSlide Python on my computer (I use a mac)?

You have to install not only OpenSlide and OpenSlide Python, but all of the
libraries they depend upon.  It's possible to do that by hand, but quite a
bit of work.  On Mac OS X, the easiest alternative is to install OpenSlide
and OpenSlide Python from MacPorts <https://www.macports.org/>.  Follow the
website's instructions to install MacPorts, then
`sudo port install py-openslide`.  The web demo scripts (see below) will be
installed into /opt/local/share/doc/py27-openslide/examples/deepzoom.

> 2) How can I use OpenSlide on a website?

The general idea is that you convert a slide file into a Deep Zoom image
pyramid, which can then be displayed by the OpenSeadragon viewer running in
a web browser.  There are two general ways to do it:

- Dynamic tiling: Generate each Deep Zoom image tile when it is requested by
  a web browser.  This is useful if you have many slides which are rarely
  viewed, but it requires OpenSlide to be running on the web server.

- Static tiling: Generate the entire Deep Zoom pyramid in advance.  This is
  useful when the same few slides are viewed over and over.  It requires
  more computation up front, but then the tiles can be served by a generic
  web server without any custom code.

For basic implementations of each of these approaches, see the scripts in
the examples directory mentioned above.  deepzoom_server.py and
deepzoom_multiserver.py implement dynamic tiling, while deepzoom_tile.py
implements static tiling.  If you want a faster and higher-quality
implementation of deepzoom_tile.py, you can `port install vips` and use
`vips dzsave`, but then you'll need to supply your own HTML and JavaScript
code to load and configure OpenSeadragon.

--Benjamin Gilbert


More information about the openslide-users mailing list