Coder Social home page Coder Social logo

openslide_sample's Introduction

MATLAB scripts

I wrote a couple MATLAB functions to decompose an SVS file into individual JPGs. This could be used to create an image hierarchy of the slide. See the example below to get started.

% required parameters
params.filename =  'path/to/file.svs';  % path to SVS file
params.n = 5;                           % take n samples per dimension (5x5 = 25 images)
params.d = 1000;                        % sub-sample size (reads in 1000 x 1000 pixels)

% optional parameters
params.out_dir = 'img/';                % change the output directory
params.resize = [256, 256];             % resize the images
params.r_begin = 20000;                 % change the starting y-pixel
params.c_begin = 30000;                 % change the starting x-pixel

decompose_file(params);

What is OpenSlide

OpenSlide provides a simple interface to read whole-slide images. The Python binding includes a Deep Zoom generator and a simple web-based viewer.

The library can read virtual slides in the following formats:

  • Aperio (.svs, .tif)
  • Hamamatsu (.vms, .vmu, .ndpi)
  • Leica (.scn)
  • MIRAX (.mrxs)
  • Philips (.tiff)
  • Sakura (.svslide)
  • Trestle (.tif)
  • Ventana (.bif, .tif)
  • Generic tiled TIFF (.tif)

Installing OpenSlide

I used the following steps to install OpenSlide for python on MacOS High Sierra (Version 10.13.6). See the OpenSlide download page for other options.

Install virtualenv

python3 -m pip install --user virtualenv

Create virtualenv

python3 -m virtualenv openslide-env

Activate virtualenv

source openslide-env/bin/activate

Install openslide with python bindings

brew install openslide		 # install openslide 
pip install openslide-python  # install python bindings

To deactivate virtualenv when finished

deactivate

openslide_sample's People

Contributors

jau35 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.