RunningDeepZoomTilerOnWindows

Mathieu Malaterre edited this page Dec 16, 2013 · 4 revisions

HOW-TO FOR deepzoom_tile.py:

The deepzoom_tile.py script (in the openslide-python-0.4.0 file under /examples/deepzoom) is a great script to produce static tiles in the Deep Zoom format. The Deep Zoom format was created by Microsoft for presenting large images over the Web. It works that way for large images, e. g. 50,000 x 50,000 pixels are cut into small images (tiles) with a size of e.g. 256 x 256. These can be requested by a client, e. g. Seadragon and viewed in a browser.

To get the python scripts working on Windows 32 BIT, you need:

  • openslide-python-0.4.0
  • Python 2.7 (NOT 3.1!)
  • openslide-win32 (or -win64)
  • Python PIL for Python 2.7

First, you install Python (it has a good Windows installer and will create a directory C:\Python27. Configure your windows path-variable (under control panel >> system...) that it contains C:\Python27 (just add it with a ; before it after the last entry), so you can run python on the DOS-prompt from everywhere. Then extract the openslide-python-0.4.0 archive. Extract the openslide-win32 archive and put all dll into your C:\windows\system32.

Now start your DOS-shell (cmd.exe, can be started by clicking on "Start >> enter "cmd" in the text field). Rename the directory openslide-python-0.4.0 to opslpy, so you don't have to type so much text. Put the directory under C:\opslpy. Go to your DOS prompt and type:

C:
cd \opslpy
python setup.py install

A couple of things will be installed. Now you can run your scripts under \examples\deepzoom by typing:

cd examples\deepzoom

Put a SVS-file in that directory, e. g. "test.svs" and type:

python deepzoom_tile.py test.svs test

Now the script will create a folder test_files and will put the zoom-level directories 0-n inside of it. The naming convention <name>_files is important for the Seadragon client, so don't change it. The folder with zoom level 0 will contain an image with a size of 1x1 px, the higher zoom levels will have larger images and then the tiles.

The script also has a couple of options that you can enter before entering the file name. The options are:

  • --overlap=x for the overlapping pixels
  • --format=(jpeg or png) for the format
  • --jobs=x --> number of CPU cores in your system
  • --output=x to specify the output directory
  • --viewer --> if a viewer should be included
  • --size=x --> size of the tiles.

That's it...