Page tree
Skip to end of metadata
Go to start of metadata

Images Servers and protocols

An image server (for us, IIPImage) is used in the Cytomine project to generate image tiles on the fly and communicate them through the HTTP protocol. He is equally used by the image viewer and by our Web API Cytomine.

Usually, the image server only manage the TIFF and JPEG2000 standards but, to meet our needs, we extended the list of supported formats with the OpenSlide librairy. These librairy provides a simple interface to read whole-slide image with the formats used by the mainly scanners used in the Cytomine project. These formats are :

  • Trestle (.tif)
  • Hamamatsu (.vms, .vmu)
  • Aperio (.svs, .tif)
  • MIRAX (.mrxs)

IIP protocol

 The IIPImage protocol is based on the Internet Imaging Protocol (http://iipimage.sourceforge.net/IIPv105.pdf). This protocol defines the different arguments than we can used in our requests foor the image server (path of the image, particular region, rotation, ...). With these informations, we are able to generate requests to display the objects as wanted with the data available in the DB of Cytomine.

Example

Here is an example of an annotation as registered in the database :

{
  "class": "be.cytomine.ontology.Annotation",
  "id": 12504,
  "name": "Annotation 12504",
  "location": "POLYGON ((7592.6666674016 9553.6665725709, 7620.6666674016 9568.6665725709, 7658.6666674016 9561.6665725709, 7666.6666674016 9561.6665725709, 7678.6666674016 9568.6665725709, 7692.6666674016 9568.6665725709, 7719.6666674016 9565.6665725709, 7762.6666674016 9541.6665725709, 7769.6666674016 9525.6665725709, 7778.6666674016 9471.6665725709, 7776.6666674016 9453.6665725709, 7783.6666674016 9445.6665725709, 7792.6666674016 9418.6665725709, 7802.6666674016 9362.6665725709, 7799.6666674016 9344.6665725709, 7805.6666674016 9336.6665725709, 7819.6666674016 9329.6665725709, 7817.6666674016 9297.6665725709, 7806.6666674016 9276.6665725709, 7804.6666674016 9246.6665725709, 7796.6666674016 9232.6665725709, 7788.6666674016 9227.6665725709, 7767.6666674016 9216.6665725709, 7747.6666674016 9211.6665725709, 7696.6666674016 9211.6665725709, 7669.6666674016 9219.6665725709, 7624.6666674016 9247.6665725709, 7565.6666674016 9327.6665725709, 7554.6666674016 9371.6665725709, 7539.6666674016 9384.6665725709, 7542.6666674016 9423.6665725709, 7535.6666674016 9434.6665725709, 7535.6666674016 9454.6665725709, 7543.6666674016 9471.6665725709, 7541.6666674016 9487.6665725709, 7551.6666674016 9516.6665725709, 7559.6666674016 9527.6665725709, 7592.6666674016 9553.6665725709))",
  "image": 1320,
  "imageFilename": "NEO_4_Curcu_INH_2.30_4_2_01.tif.vips.tif",
  "zoomLevel": -1,
  "channels": "null",
  "project": 57,
  "user": 14,
  "area": "49914 µm²",
  "perimeter": "688 µm",
  "centroid": {
    "x": 7679.009852213956,
    "y": 9392.88009507694
  },
  "created": "1317042560855",
  "updated": "1317203900754",
  "term":
  [
    4751
  ],
  "cropURL": "http://localhost:8080/api/annotation/12504/crop.jpg",
  "url": "http://localhost:8080/api/annotation/12504/crop.jpg",
  "imageURL": "http://localhost:8080/#tabs-image-57-1320-12504"
}

Into these informations, we have :

  • The id of the image on which the annotation has been made.
  • The height and width of this image (pixels) get with the above id.
  • The id of an image server containing this image. (NB : an image can be on multiple image servers to increase performance) and we can get the image path on the server (BASE_URL).

Now, we will use the geometry value of the previous annotation :

Geometry of an annotation with the WKT format
POLYGON ((7592.6666674016 9553.6665725709, 7620.6666674016 9568.6665725709, 7658.6666674016 9561.6665725709, 7666.6666674016 9561.6665725709, 7678.6666674016 9568.6665725709, 7692.6666674016 9568.6665725709, 7719.6666674016 9565.6665725709, 7762.6666674016 9541.6665725709, 7769.6666674016 9525.6665725709, 7778.6666674016 9471.6665725709, 7776.6666674016 9453.6665725709, 7783.6666674016 9445.6665725709, 7792.6666674016 9418.6665725709, 7802.6666674016 9362.6665725709, 7799.6666674016 9344.6665725709, 7805.6666674016 9336.6665725709, 7819.6666674016 9329.6665725709, 7817.6666674016 9297.6665725709, 7806.6666674016 9276.6665725709, 7804.6666674016 9246.6665725709, 7796.6666674016 9232.6665725709, 7788.6666674016 9227.6665725709, 7767.6666674016 9216.6665725709, 7747.6666674016 9211.6665725709, 7696.6666674016 9211.6665725709, 7669.6666674016 9219.6665725709, 7624.6666674016 9247.6665725709, 7565.6666674016 9327.6665725709, 7554.6666674016 9371.6665725709, 7539.6666674016 9384.6665725709, 7542.6666674016 9423.6665725709, 7535.6666674016 9434.6665725709, 7535.6666674016 9454.6665725709, 7543.6666674016 9471.6665725709, 7541.6666674016 9487.6665725709, 7551.6666674016 9516.6665725709, 7559.6666674016 9527.6665725709, 7592.6666674016 9553.6665725709))

With this value, we determine the surrounding box to have :

  • The X and Y coordinates of the top left corner of this box.
  • This width (cropW).
  • This Height (cropH)

Then, we determine the region of interest with, as an input, the image's width to be independent of the zoom level on this image.

* Computational details for IIPImage
#RGN_Y is the down inset value (positive) from 0 on the y axis at the max image resolution.
#RGN_X is the right inset value (positive) from 0 on the x axis at the max image resolution.
#RGN_H is the height of the image provided as response.
#RGN_W is the width of the image provided as response.
RGN_X : 1/(H/X)
RGN_Y : 1/(W/Y)
RGN_cropW : 1/(W/cropW)
RGN_cropH : 1/(H/cropH)

At least, we generate the URL of this image with the previous informations.

 ; URL = BASE_URL&RGN=RGN_Y,RGN_X,RGN_cropW,RGN_cropH&CVT=jpeg
 => http://is8.cytomine.be/fcgi-bin/iipsrv.fcgi?FIF=/media/datalvm/maree/Slides/LBTD/Olympus/study_NEO4/grp_Curcu_INH/converti/NEO_4_Curcu_INH_2.30_4_2_01.tif.vips.tif&RGN=0.3503999256,0.4660714286,0.0132068452,0.0199218750&CVT=jpeg

Zoomify

IIPImage also used others communication protocols as Zoomify. This protocol define a way to split an image between tiles and to arrange them into repository. Due to this tree view, it is easy to determine which tiles are required to displaying a particular region. This protocol is also used in our viewer, based on OpenLayers. Thus, we have to instantiate a Zoomify object in the visualition module with the image server adress and the path of the image to display, with a specification of the used protocol.

//Example of a generated URL using the zoomify protocol.
var url = http://is9.cytomine.be/fcgi-bin/iipsrv.fcgi?zoomify=/media/datalvm/maree/Slides/LBTD/Olympus/study_NEO4/grp_Curcu_INH/converti/NEO_4_Curcu_INH_2.30_4_2_01.tif.vips.tif/
//Instanciation d'une layer de type Zoomify
var baseLayer = new OpenLayers.Layer.Zoomify(
             "NEO_4_Curcu_INH_2.30_4_2_01",
             url,
             ...
         );

Multiple IIP servers :

Currently, in the way to support various format, we used multiple IIPImage servers depending on the image format.

IIP Image serverSupported formatsDescription
IIPOfficialTIFFThe official version of IIPImage based on a recent version of the github repository.
IIPJ2JPEG2000An older version of the official IIPImage which support JPEG2000 format with the Kakadu librairy.
IIPCytoNDPI, MRXS, SVS, ...A fork of the IIPImage which allow us to support various format with the OpenSlide librairy.
IIPVentanaVTIFFAn evolution of IIPCyto specially used for the Ventana TIFF format.

Each of these IIP server has it's own URL.

 

Bioformat :

We also use the Bioformat library to convert a large variety of format to the Ome TIFF format supported by Cytomine.
You can find the complete list here.

  • No labels