Background
Implementation
Overview
Basic functions
tiffsplittiles
program);tifffastcrop
program);tiffmakemosaic
program);ndpisplit
program). The names of the created files are built on the name of the source file and incorporate the magnification and focus levels (and, in the case of mosaic pieces, the coordinates inside the mosaic).Mosaics
Usage
Standalone
ndpi2tiff
or ndpisplit
. We provide precompiled binaries where frequently-used options are turned on by default: e.g. ndpisplit-mJ.exe
produces a mosaic in JPEG format as with option -mJ
. The conversion result or mosaic can be found in the same directory as the original NDPI image.ImageJ integration
ndpisplit
program can be driven through the NDPITools
plugins in ImageJ with a point-and-click interface, so that previewing the content of a NDPI file at low resolution, selecting a portion, extracting it at high resolution and finally opening it in ImageJ to apply further treatments can be done in an easy and graphical way. Figure2 shows a screen shot of ImageJ 1.47 m after extraction of a rectangular zone from a NDPI file. Figure3 explains what happens when the NDPI file contains several levels of focalization: the preview image is displayed as a stack.
File > Open
command of versions 1.x of ImageJ is unable to open TIFF files with JPEG compression (one has to use plugins), this is way to produce mosaics which can be opened by click-and-drag onto the window or icon of ImageJ while still saving disk space thanks to efficient compression. Figure4 shows how the mosaic production options can be set inside ImageJ through the NDPITools plugins.
Results and discussion
Performance
Making a mosaic from a huge image
convert
command from ImageMagick (version 6.8.0-7 with quantum size 8 bits) was unable to complete the request. GraphicsMagick (gm convert-crop
; version 1.3.17 with quantum size 8 bits) completed the request in 70 min, using 25 GiB of disk space. tiffmakemosaic
from our LargeTIFFTools completed the request in 2.5 min.Converting NDPI into TIFF
a.ndpi
hereafter). On a 2.6 GHz Intel Core i7 Mac Mini computer with 16 GiB RAM, ndpisplit
extracted all 55 images (11 focus levels and 5 magnifications) as independent, single-image TIFF files with JPEG compression in 7.11 min. The size of the largest images was 180224×70144. The speed was limited only by the rate of I/O transfers since the CPU usage of this task was 1.38 min, out of which the system used 1.30 min. Executing again the same task straight after the first execution took only 0.57 min because the NDPI file was still in the cache of the operating system.b.ndpi
, and weighting 2.07 GiB (largest image: 103168×63232 pixels), was split into independent TIFF files in 2.2 min without swapping.a.ndpi
even at low resolution.a.ndpi
was converted into a multiple-images TIFF file with ndpi2tiff
. On the same computer as before, the conversion time was 7.0 min. Here again, the speed of the process is limited only by the rate of I/O transfers since the conversion took only 30 s if performed when the NDPI file was still in the cache of the operating system.-8
on the command line to ndpi2tiff
to request using the BigTIFF format extension. The specifications of this extension to the TIFF standard, discussed and published before 2008[33, 34], are supported by LibTIFF as of version 4.0.0[27], and therefore by the abundant image viewing and manipulation software which relies on LibTIFF. If the use of the BigTIFF format extension would have impeded the further exploitation of the produced TIFF file, we could have simply used ndpisplit
as above. Or we could have called the ndpi2tiff
command several times, each time requesting extraction of a subset of all images by specifying image numbers after the file name, separated with commas, as in a.ndpi,0,1,2,3,4
.Extracting a small region from a huge image
From a TIFF file
tifffastcrop
from our LargeTIFFTools and with several software tools, on increasingly large TIFF files. Tests were performed on a 2.6 GHz Intel Core i7 Mac Mini computer with 16 GB of RAM and used GraphicsMagick 1.3.17, ImageMagick 6.8.0-7 and the utility tiffcrop
from LibTIFF 4.0.3. Noticeably, when treating the largest image, GraphicsMagick needs 50 GiB of free disk space, whereas tifffastcrop
doesn’t need it.Image size (px) |
11264×4384
|
45056×17536
|
180224×70144
|
---|---|---|---|
tifffastcrop
| 0.30 s | 0.30 s | 0.30 s |
GraphicsMagick | 0.74 s | 23.6 s | >80 min |
ImageMagick | 1.18 s | 236 s | failed |
tiffcrop
| 0.50 s | failed | seg. fault |
From a NDPI file
a.ndpi
(size 180224×70144). On a 2.6 GHz Intel Core i7 Mac Mini computer with 16 GB of RAM, the execution time was 0.12 s for one extract, and in average 0.06 s per extract in a series of 20 extracts with locations drawn uniformly at random inside the whole image.Applications
Integration in digital pathology image servers or virtual slide systems
-
in WIDE[22], to deal with NDPI files. WIDE is an open-source biological and digital pathology image archiving and visualization system, which allows the remote user to see images stored in a remote library in a browser. In particular, thanks to the feature of high-speed extraction of a rectangular region by
ndpisplit
, WIDE saves costly disk space since it doesn’t need to store TIFF files converted from NDPI files in addition to the latter.
Exploiting a large set of digital slides
ndpisplit
in a batch work to convert them into standard TIFF files, which took only a few hours. The experimental -s
option of ndpisplit
was used to remove the blank filling between scanned regions, resulting in an important disk space saving and in smaller TIFF files (one for each scanned region) which where easier to manipulate afterwards. Then, for each sample, Preview.app and ImageJ were used to inspect the resulting images and manually select the regions of clinical interest. The corresponding extracts of the high magnification images were the subject of automated cell counting and other quantitative analyses using ImageJ. In particular, we collected quantitative data about edema or tissue hyperhydration[8]. This quantity needed a specific image analysis procedure which is not offered by standard morphometry software and, unlike cell density estimates, could not be retrieved by sampling a few fields of view in the microscope. Therefore, virtual microscopy and our tools were essential in this study.Study of a whole slide of brain tissue invaded by an oligodendroglioma
b.ndpi
weighted 2.07 GiB, with a high resolution image of 103168×63232 pixels, it was not possible to do the study in a straightforward way. We opened the file b.ndpi
as a preview image with the command Plugins > NDPITools > Preview NDPI...
and selected on it the left tissue sample. Then we used the command Plugins > NDPITools > Custom extract to TIFF / Mosaic...
and asked for extraction as a mosaic of 16 JPEG files, each one needing less than 1 GiB of RAM to open, and with an overlap of 60 pixels. This was completed within a few minutes. Then we applied an ImageJ macro to each of the 16 pieces to identify the dark cell nuclei (those with high chromatin content), based on thresholding the luminosity values of the pixels, as shown in Figure1. It produced text files with the coordinates and size of each cell nucleus.Conclusions
Windows (32 bits) | Windows(64 bits) | Linux | Mac OS X |
---|---|---|---|
483 | 542 | 217 | 285 |
Availability and requirements
-
Project name: LargeTIFFTools
-
Operating system(s): Platform independent
-
Programming language: C
-
Other requirements: libjpeg, libtiff
-
License: GNU GPLv3
-
Project name: NDPITools
-
Project home page: http://www.imnc.in2p3.fr/pagesperso/deroulers/software/ndpitools/
-
Operating system(s): Platform independent
-
Programming language: C
-
Other requirements: —
-
License: GNU GPLv3
-
Project name: NDPITools plugins for ImageJ
-
Project home page: http://www.imnc.in2p3.fr/pagesperso/deroulers/software/ndpitools/
-
Operating system(s): Platform independent
-
Programming language: Java
-
Other requirements: ImageJ 1.31s or higher, Ant, JAI 1.1.3
-
License: GNU GPLv3