Skip to main content

Whole Slide Image (WSI) conversion for brightfield histology images

Project description

wsic

Gitmoji https://img.shields.io/badge/code%20style-black-000000.svg https://app.travis-ci.com/John-P/wsic.svg?branch=main https://codecov.io/gh/John-P/wsic/branch/main/graph/badge.svg?token=ICCWDKJG5J Documentation Status https://img.shields.io/pypi/v/wsic https://deepsource.io/gh/John-P/wsic.svg/?label=active+issues&show_trend=true&token=D-sO1mhzQv1n9FPl0RFaAfGt

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

Note: This is in early development and there will likely be frequent and breaking changes.

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

Usage: wsic convert [OPTIONS]

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 [deflate|webp|jpeg|jpeg2000]
                                  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-XML).
  --overwrite / --no-overwrite    Whether to overwrite the output file.
  -h, --help                      Show this message and exit.
A demonstration of converting a JP2 file to a pyramid TIFF.

Features

  • Read image data from:

    • OpenSlide Formats:

      • Aperio SVS (.svs)

      • Hamamatsu (.vms, .vmu, .ndpi)

      • Leica (.scn)

      • Mirax MRXS (.mrxs)

      • Sakura (.svslide)

      • Trestle (.tif)

      • Ventana (.bif, .tif)

      • Generic tiled TIFF (.tif; DEFLATE, JPEG, and Webp compressed)

    • Other Tiled TIFFs (tifffile supported formats)

    • OME-TIFF

    • JP2 (via glymur and OpenJPEG)

    • Zarr (single array or pyramid group of arrays)

    • DICOM WSI (via wsidicom)

  • Write image data to:

    • Tiled / Pyramid Generic TIFF

    • OME-TIFF

    • JP2

    • Pyramid Zarr

  • Custom tile size

  • Compression codecs

  • Lossless binary repackaging / transcoding mode (experimental) to zarr from:

    • SVS (JPEG / J2K compressed)

    • OME-TIFF (single image and JPEG / J2K compressed)

    • DICOM WSI (JPEG / J2K compressed)

Dependencies

  • numpy

  • zarr

  • click (CLI)

Optional Dependencies

To-Dos

For a list of To-Dos see the project board.

Other Tools

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

bfconvert

Part of the Bio-Formats command line tools. Uses bioformats to convert from many formats to OME-TIFF.

https://www.openmicroscopy.org/bio-formats/downloads/

biofromats2raw

Convert from Bio-Formats formats to zarr.

https://github.com/glencoesoftware/bioformats2raw

isyntax2raw

Convert from Philips’ iSyntax format to a zarr.

https://github.com/glencoesoftware/isyntax2raw

wsidicomiser

Convert OpenSlide images to WSI DICOM.

https://github.com/sectra-medical/wsidicomizer

Credits

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

History

0.1.0 (2022-02-22)

  • First release on PyPI.

0.2.0 (2022-03-22)

  • Add Support To Read DICOM WSI and transform to zarr.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wsic-0.3.0.tar.gz (16.4 MB view hashes)

Uploaded Source

Built Distribution

wsic-0.3.0-py2.py3-none-any.whl (32.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page