Skip to main content

Open slidebook .sldy files in Python

Project description

Work in progress

slidebook-python

Open slidebook .sldy files in Python

To install

slidebook-python requires Python >= 3.9

pip install slidebook-python

To use

from sld import SlideBook
sld = SlideBook("/path/to/file.sldy")

# How many acquisitions
print(sld.number_acquisitions)
# 4

# How many channels in first acquisition
print(sld.images[0].num_channels)

# Get data from channel 0 of the second acquisition
data = sld.images[1].data["ch_0"]

To visualise in napari

N.B. napari plugin is in development

import napari
import numpy as np
from sld import SlideBook
sld = SlideBook("/path/to/file.sldy")
viewer = napari.Viewer()
viewer.add_image((np.squeeze(sld.images[0].data["ch_0"])), name="Channel 0")
viewer.add_image((np.squeeze(sld.images[0].data["ch_1"])), name="Channel 1")
napari.run()

By default, Slidebook will not load image data into memory. To force this, use mmap_mode=None:

sld = SlideBook("/path/to/file.sldy", mmap_mode=None)

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

slidebook-python-0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

slidebook_python-0.0.2-py2.py3-none-any.whl (4.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file slidebook-python-0.0.2.tar.gz.

File metadata

  • Download URL: slidebook-python-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for slidebook-python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0d18366397447242758a9d0690e5e855bc07b824bdb5fc2392e4eb14aa258a29
MD5 ae32f0e4a8c9a1e101da28b80c7882c2
BLAKE2b-256 0f176dc91bad9aca7f2a0004b8d17bf6e2b63c5dd583f55f9dccdf84a2f6f028

See more details on using hashes here.

File details

Details for the file slidebook_python-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: slidebook_python-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for slidebook_python-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f57ed020037105df5c9ad87bfa7fe3b46b74910faba339a3c562e9ea97ec24f7
MD5 4284866f56563b20fe3c943e69221481
BLAKE2b-256 6e6af4b1b08c780b249a44fca7bf408c1822d491659a99b4b4d625ee0c62d69d

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