Skip to content

slide2Tiles

Sander W. van der Laan edited this page Jan 8, 2024 · 1 revision

slide2Tiles is designed for cutting a whole slide images (WSI) into tiled images (tiles). It uses ImageMagick's convert and identify commands, as well as openslide-write-png for working with virtual slides. The tiles are created with specified dimensions (2000x2000 pixels) and overlap (0 pixels), and optionally, a mask can be provided to exclude certain parts of the slide.

Usage:

./slide2Tiles -f [IMG.ndpi] -l [LAYER]

Example 1: Specify the virtual slide and layer

./slide2Tiles -f slide.tif -l 2

Example 2: Keep empty tiles and provide a mask

./slide2Tiles --keep-empty --mask=mask.png --file=slide.tif

Example 3: Display a job list for parallel processing

find "$(pwd)" -iname "*tif" -type f -exec printf " $(command -v "./slide2Tiles")" \; -exec printf " --mask=" \; -exec bash -c "printf "{}" | sed 's/\.TIF$/.mask.png/g' " \; -exec echo " --file="{}" "

Argument(s):

  • -f, --file
    • Specifies the virtual slide to create tiles from.
  • -l, --layer
    • Forces a specific layer (default is 3).

Optional argument(s):

  • -m, --mask
    • Specifies the black mask for excluding parts of the virtual slide.
  • --height
    • Specifies the tile height in pixels (default is 2000).
  • --width
    • Specifies the tile width in pixels (default is 2000).
  • --overlap
    • Specifies the image overlap of adjacent tiles (default is 0).
  • --keep-empty
    • Does not delete empty tiles when found.
  • --outputsuffix
    • Specifies the output directory suffix.
  • --ignore-dependencies
    • Ignores all dependencies but gives a warning.
  • --verbose
    • Enables verbose output for debugging.
  • --help
    • Displays the help message.
  • --version
    • Displays version and license information.
Clone this wiki locally