Whole Slide Image (WSI) conversion for brightfield histology images
Project description
wsic
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.
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)
E.g. JPEG XL compressed
Zarr / NGFF (single array or pyramid group of arrays)
Write image data to:
Tiled / Pyramid Generic TIFF
OME-TIFF
JP2
Pyramid Zarr (NGFF)
Custom tile size
Compression codecs
Lossless repackaging / transcoding (to zarr/NGFF) from:
SVS (JPEG compressed)
OME-TIFF (single image, JPEG and JPEG2000 (J2K) compressed)
Generic Tiled TIFF (JPEG, JPEG2000, and WebP compressed)
DICOM WSI (JPEG and JPEG2000 (J2K) compressed)
Dependencies
numpy
zarr
click (CLI)
Optional Dependencies
OpenSlide and openslide-python (reading OpenSlide Formats)
tifffile (reading tiled TIFFs)
wsidicom (reading DICOM WSI)
tqdm (progress bars)
scipy (faster pyramid downsampling)
opencv-python (even faster pyramid downsampling)
imagecodecs (additional codecs and transcoding)
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.
biofromats2raw
Convert from Bio-Formats formats to zarr.
isyntax2raw
Convert from Philips’ iSyntax format to a zarr.
wsidicomiser
Convert OpenSlide images to WSI DICOM.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.