John-P / wsic

Whole Slide image (WSI) conversion for brightfield histology images
MIT License
33 stars 4 forks source link

wsic

Gitmoji image image

Python application Documentation
Status

image image image

Whole Slide Image (WSI) conversion for brightfield histology images.

Provides a command line interface (CLI) for easy convertion between formats:

Usage: wsic convert [OPTIONS]

  Convert a WSI.

Options:
  -i, --in-path PATH              Path to WSI to read from.
  -o, --out-path PATH             The path to output to.
  -t, --tile-size <INTEGER INTEGER>...
                                  The size of the tiles to write.
  -rt, --read-tile-size <INTEGER INTEGER>...
                                  The size of the tiles to read.
  -w, --workers INTEGER           The number of workers to use.
  -c, --compression [blosc|deflate|jpeg xl|jpeg-ls|jpeg|jpeg2000|lzw|png|webp|zstd]
                                  The compression to use.
  -cl, --compression-level INTEGER
                                  The compression level to use.
  -d, --downsample INTEGER        The downsample factor to use.
  -mpp, --microns-per-pixel <FLOAT FLOAT>...
                                  The microns per pixel to use.
  -ome, --ome / --no-ome          Save with OME-TIFF metadata (OME-TIFF and
                                  NGFF).
  --overwrite / --no-overwrite    Whether to overwrite the output file.
  -to, --timeout FLOAT            Timeout in seconds for reading a tile.
  -W, --writer [auto|jp2|svs|tiff|zarr]
                                  The writer to use. Overrides writer detected
                                  by output file extension.
  -s, --store [dir|ndir|zip|sqlite]
                                  The store to use (zarr/NGFF only). Defaults
                                  to ndir (nested directory).
  -h, --help                      Show this message and exit.

A demonstration of converting a JP2 file to a pyramid
TIFF.

Getting Started

For basic usage see the documentation page "How do I...?".

Features

Read Container Formats

Write Container Formats

Notes & FAQs

Python on Windows handles multiprocessing differenly to POSIX/UNIX-like systems. I suggest using the Windows Subsystem for Linux on Windows to ensure that wsic functions correctly and efficiently.

Other Tools

There are many other great tools in this space. Below are some other tools for converting WSIs.

  1. bfconvert Part of the Bio-Formats command line tools. Uses bioformats to convert from many formats to OME-TIFF.
  2. biofromats2raw Convert from Bio-Formats formats to zarr.
  3. isyntax2raw Convert from Philips' iSyntax format to a zarr using Philips' SDK.
  4. wsidicomiser Convert OpenSlide images to WSI DICOM.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.