Package: wsic
wsicWhole 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:wsicconvert[OPTIONS]ConvertaWSI.

Options:-i,--in-pathPATHPathtoWSItoreadfrom.-o,--out-pathPATHThepathtooutputto.-t,--tile-size<INTEGERINTEGER>...Thesizeofthetilestowrite.-rt,--read-tile-size<INTEGERINTEGER>...Thesizeofthetilestoread.-w,--workersINTEGERThenumberofworkerstouse.-c,--compression[blosc|deflate|jpegxl|jpeg-ls|jpeg|jpeg2000|lzw|png|webp|zstd]Thecompressiontouse.-cl,--compression-levelINTEGERThecompressionleveltouse.-d,--downsampleINTEGERThedownsamplefactortouse.-mpp,--microns-per-pixel<FLOATFLOAT>...Themicronsperpixeltouse.-ome,--ome/--no-omeSavewithOME-TIFFmetadata(OME-TIFFandNGFF).--overwrite/--no-overwriteWhethertooverwritetheoutputfile.-to,--timeoutFLOATTimeoutinsecondsforreadingatile.-W,--writer[auto|jp2|svs|tiff|zarr]Thewritertouse.Overrideswriterdetectedbyoutputfileextension.-s,--store[dir|ndir|zip|sqlite]Thestoretouse(zarr/NGFFonly).Defaultstondir(nesteddirectory).-h,--helpShowthismessageandexit.Getting StartedFor basic usage see the documentation page"How do
I...?".FeaturesReading and writing several container formats.Support for a wide range of compression codecs.Custom tile sizeLossless repackaging / transcoding (to zarr/NGFF or TIFF) 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)Read Container FormatsOpenSlideFormats: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
(tifffilesupported
formats)Tiled with various codecs: e.g. JPEG XL, JPEG 2000, WebP, and zstd.RGB/brightfieldOME-TIFF.JP2(viaglymurandOpenJPEG)Including Omnyx JP2 files.ZarrSingle array.Group of (multiresolution) arrays.NGFF v0.4.DICOM WSI(viawsidicom)DICOM VL Whole Slide Image IODs.Write Container FormatsTIFFGeneric Tiled / Pyramid TIFFOME-TIFFSVSJP2Zarr (NGFF v0.4)DICOM (.dcm)Other ToolsThere are many other great tools in this space. Below are some other
tools for converting WSIs.bfconvertPart of the Bio-Formats command line tools. Uses bioformats to convert
from many formats to OME-TIFF.https://www.openmicroscopy.org/bio-formats/downloads/biofromats2rawConvert from Bio-Formats formats to zarr.https://github.com/glencoesoftware/bioformats2rawisyntax2rawConvert from Philips' iSyntax format to a zarr.https://github.com/glencoesoftware/isyntax2rawwsidicomiserConvert OpenSlide images to WSI DICOM.https://github.com/sectra-medical/wsidicomizerCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.9.0 (2023-05-25)Update documentation.Bump dependencies.Improved validation of TIFF write arguments.Add ability to speciy store when writing Zarr e.g. zarr.SQliteStore.Update CLI:New-sargment forconvertto specify store for zarr.Bug fixes:Fix MPP writing for .dcm files.Fix parsing of NGFF metadata (zattrs JSON), including getting MPP.0.8.2 (2023-04-02)Bug fixes:Fix issue whereDICOMWSIReaderrequired user input at init.Fix level offset when printing the level number duringTIFFWriterpyramid building.Refactor slowDICOMWSIReaderinit warning and only warn from the main process.0.8.0 (2023-04-01)Add DICOM writer.Avoid decoding entire TIFF before conversion starts.TIFFReader can now expose a dask array view (using tiffile Zarr view
underneath).Add overwrite option to transcode CLI mode.Refactor to use persistent worker subprocesses. This avoids recreating
the reader object for each region read. For some reader such as
DICOMWSIReader this significantly improves performance.General refactoring and code cleanup.Bug fixes:Fix writing MPP for SVSWriter.Remove OpenSlide thumbnail generation method. This would cause the
process to run out of memory for some files and the base
implementation works just as well without this memory issue.0.7.0 (2022-12-15)Normalise TIFF array axes (to YXC order) when reading using tiffile.Bug fixes:Fix reading/writing JP2 resoluion metadata (vres/hres are in m not
cm).Join child processes when finishing writing / exiting.Copy the reader tile size for transcode mode.Return None for MPP when JP2 has no resolution box.Set resolution units to cm when writing TIFFs.Use the MPP from the reader when writing JP2.Add a zarr intermediate for JP2 writing (allows different read and
write tile sizes).0.6.1 (2022-10-21)Select Writer class based on file extension from CLI.Bug fixes:Fix writing MPP to NGFF v0.4.Change coordinate transformation ordering.Fix reading TIFF resolution tag. Previously only the numerator of
the resolution fraction was being read.Other minor bug fixes.0.6.0 (2022-10-03)Add ability to write resolution metadata to JP2. Thanks to
@quintusdias for helping get this implemented in glymur.Remove QOI codec code as this is not included in imagecodes. Thanks to
Christoph Gohlke for adding this.Add a "How do I?" documentation page.0.5.1 (2022-06-27)Bug fixes:Fix parsing of OpenSlide MPP to float.0.5.0 (2022-06-25)Add ability to transcode/repackage to a TIFF file (from DICOM or SVS).RefactorZarrReaderWriterto seperateZarrWriterandZarrReader.Bug fixes:Fix thumbnaiul generation for zarr.Fix NGFF metadataCoordinateTransformationfield default factor.0.4.0 (2022-06-20)Add ability to write JPEG compressed SVS files.Add support for thumbnail generation and a CLI command.Swap from strings to enums for codecs and color spaces.0.3.0 (2022-05-13)Remove unused CLI debug option.Add generation of OME-NGFF metadata (JSON .zattrs file).Add timeout when copying tiles to prevent indefinite hanging.Improve joining/termination of child processes at shutdown.Use the TIFF resolution tag if present.Addget_tilemethod to allReaderclasses.Update supported Python versions to 3.8, 3.9, 3.10.Bug fixes:Fix and issue with concatenation of pyramid downsamples.Add a custom Queue class for multiprocessing on macOS.Fix handling ofpyramid_downsamplesargument whenNone.0.2.0 (2022-03-22)Add Support To Read DICOM WSI and transform to zarr.0.1.0 (2022-02-22)First release on PyPI.