Skip to main content

A package for converting images from cellSens VSI format to tiled, pyramidal TIFF

Project description

vsi2tif

License DOI Open In Colab

Tool for converting WSIs from Olympus' cellSens VSI to Generic TIFF.

To quickly get started, see these notebooks (Ubuntu Linux, macOS) for installing the tool, converting your first image, and verifying that the image works with OpenSlide.

Continuous integration

Build Type Status
Integration Tests CI
Unit Tests CI
Linting Checks CI

Requirements

To run the tool, you need to configure bftools and vips. To do that, follow the instructions below for the operating system of interest:

Ubuntu

  1. Download bftools (click here)

  2. Install vips and JDK

sudo apt update
sudo apt-get install openjdk-8-jdk
sudo apt install libvips-tools

macOS

  1. Download bftools (click here)

  2. Install vips and JDK

brew install --cask zulu@8
brew install vips

Windows

To install bftools and vips, I recommend using Powershell as much as possible to automate the installation steps.

  1. Download bftools (click here)

  2. Download vips binary from Windows from here or use wget or similar

https://github.com/libvips/build-win64-mxe/releases/download/v8.15.3/vips-dev-w64-all-8.15.3.zip
  1. Uncompress downloaded file and place it at an appropriate place, like at home
unzip ~/Downloads/vips-dev-w64-all-8.15.3.zip
mv ~/Downloads/vips-dev-w64-all-8.15.3/vips-dev-8.15/ ~/vips-dev-8.15/
  1. Add path to vips.exe to the PATH (requires powershell administrator)
$Env:PATH += ";$HOME/vips-dev-8.15/bin/"

Installation

Install from PyPI:

pip install vsi2tif

Alternatively, install from source:

pip install git+https://github.com/andreped/vsi2tif

Usage

The conversion tool is available through a command line interface (CLI).

Example for converting a single WSI:

vsi2tif -i /path/to/olympus/image.vsi -o /path/to/converted/image.tif -b /path/to/bftools/bfconvert

Here is an example to perform batch conversion of a folder of WSIs:

vsi2tif -i /path/to/olympus/wsis/ -o /path/to/converted/wsis/directory/ -b /path/to/bftools/bfconvert

Comprehensive CLI documentation can be seen below:

usage: vsi2tif [-h] -i INPUT -o OUTPUT -b BFCONVERT [-c COMPRESSION] [-s TILESIZE] [-q QUALITY] [-m MAX_MEM] [-v VERBOSE] [--remove-name-spaces] [-p PLANE]

vsi2tif - simple tool for converting images from cellSens VSI to Generic TIFF

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        folder with input files
  -o OUTPUT, --output OUTPUT
                        folder for output files
  -b BFCONVERT, --bfconvert BFCONVERT
                        path to bfconvert tool
  -c COMPRESSION, --compression COMPRESSION
                        compression technique for final image - default 'jpeg'
  -s TILESIZE, --tilesize TILESIZE
                        tile size to use during both conversion steps - default 1024
  -q QUALITY, --quality QUALITY
                        compression quality used with JPEG compression - default 87
  -m MAX_MEM, --max-mem MAX_MEM
                        set maximum memory in the java vm - default 32
  -v VERBOSE, --verbose VERBOSE
                        set verbosity level - default 1
  --remove-name-spaces  replace spaces in filename with underscores in batch mode
  -p PLANE, --plane PLANE
                        which image plane to convert image from. If set to -1, all series are converted and the largest is kept - default 0

License

This project has MIT license.

How to cite DOI

If you found this tool useful in your research, please cite the following:

@software{pedersen2024vsi2tif,
  author       = {André Pedersen and David Bouget and Sebastian Krossa and Erik Smistad},
  title        = {{andreped/vsi2tif: v0.1.4}},
  month        = sep,
  year         = 2024,
  publisher    = {Zenodo},
  version      = {v0.1.4},
  doi          = {10.5281/zenodo.13745169},
  url          = {https://doi.org/10.5281/zenodo.13745169}
}

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

vsi2tif-0.1.5.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

vsi2tif-0.1.5-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file vsi2tif-0.1.5.tar.gz.

File metadata

  • Download URL: vsi2tif-0.1.5.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for vsi2tif-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e86a9c112f7aedde8bcf36c1ee3b958bac43b75fbf82d79b422bcc6f4f357686
MD5 775088f803f8b01a3572d66f09edb2b0
BLAKE2b-256 c69d8807fa57bb8d7549faa0ff90f56d83e74513d4e52612aedc3b14edd3b569

See more details on using hashes here.

File details

Details for the file vsi2tif-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: vsi2tif-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for vsi2tif-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 745e513078d1ec0221742c91613f7966099ef58398db7160b000a9206d35bd57
MD5 11e0dbef436e0b69834b9a0c51dbe716
BLAKE2b-256 6ecb730d3df9fa5f0bda9af9c158e7043714b2fc3a2bd4ca2dfc20b1f45266c8

See more details on using hashes here.

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