Skip to content

pathologyatlas/make-html-WSI

Repository files navigation

Convert .svs to .dzi and publish as or embed in a web page

These are the codes we use to:

install requirements

install VIPS

brew install vips

install openslide (seems to be optional)

brew install openslide
pip3 install openslide-python

download openseadragon

have your .svs image in working directory

use vips to convert .svs to .dzi

vips dzsave HE.svs HE

this runs a long time depending on file size

which generates

  • one file: HE.dzi

  • one folder: HE_files This folder contains multilevel images

open .dzi file with a textreader

<?xml version="1.0" encoding="UTF-8"?>
<Image xmlns="http://schemas.microsoft.com/deepzoom/2008"
  Format="jpeg"
  Overlap="1"
  TileSize="254"
  >
  <Size 
    Height="30580"
    Width="51792"
  />
</Image>

prepare HE.html file to read files in a web page

or minimum example in Details
<meta charset="utf-8"/>
<div id="openseadragon1" style="width: 100%; height: 95%;"></div>
<script src="./openseadragon/openseadragon.min.js"></script>
<script type="text/javascript">
 var viewer = OpenSeadragon({
 id: 'openseadragon1',
 prefixUrl : './openseadragon/images/',
 tileSources: {
 Image: {
Url: './HE_files/', // name of image folder
TileSize: '254', // see .dzi file
Overlap: '1', // see .dzi file
Format: 'jpeg', // see .dzi file
ServerFormat: 'Default', // optional
xmlns: 'http://schemas.microsoft.com/deepzoom/2009', // see .dzi file
Size: {
 Width: '51792', // see .dzi file
 Height: '30580' // see .dzi file
 } 
 }}});
</script>

embed in a web page

- [https://images.patolojiatlasi.com/template/HE.html](https://images.patolojiatlasi.com/template/HE.html)

- See Microscopy with viewer: 

<iframe src="https://images.patolojiatlasi.com/template/HE.html" width="100%" height="400px"></iframe>

further configurations

About

make html from whole slide image svs to dzi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published