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
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.
Source Distribution
slidebook-python-0.0.1.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for slidebook_python-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24fb8795cd635a5ad80cd80f79433fb202b6716e86b632f95ec59bc7d052a0b |
|
MD5 | d3bc9c1568c9df10a3fafedddd45e056 |
|
BLAKE2b-256 | 9ef44cf440041a41154c5461b80afba7cefaf749e742b01fcefeb659f59fd1aa |