Open slidebook .sldy files in Python

Overview

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)
You might also like...
A python script for compiling and executing .cc files

Debug And Run A python script for compiling and executing .cc files Example dbrun fname.cc [DEBUG MODE] Compiling fname.cc with C++17 ------------

Python library for parsing Godot scene files

Godot Parser This is a python library for parsing Godot scene (.tscn) and resource (.tres) files. It's intended to make it easier to automate certain

Svg-turtle - Use the Python turtle to write SVG files

SaVaGe Turtle Use the Python turtle to write SVG files If you're using the Pytho

Python package for handling and analyzing PSRFITS files

PyPulse A pure-Python package for handling and analyzing PSRFITS files. Read the documentation here. This is an alternate code base from PSRCHIVE. Req

A python script to decrypt media files encrypted using the Android application 'Secret Calculator Photo Vault'. Supports brute force of PIN also.

A python script to decrypt media files encrypted using the Android application 'Secret Calculator Photo Vault'. Supports brute force of PIN also.

🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python 🏆 A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which alerts the user regarding open slots in the vicinity!

cowin_notifier With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which

sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

Comments
  • Fix loading of histogram data for slide scans

    Fix loading of histogram data for slide scans

    For some reason, slide scans fail when loading the histogram summaries. A fix to skip this step is added at https://github.com/instituteofcancerresearch/slidebook-python/blob/7bf6906dffd53d2b0326ab4ea0f81ce1e5c234e6/sld/slidebook.py#L18-L24

    opened by adamltyson 0
  • Load timelapse images as single array using dask

    Load timelapse images as single array using dask

    Rather than loading N arrays into memory, concatenate using dask, e.g.:

    import numpy as np
    import dask.array as da
     
    a = np.memmap('a.array', dtype='float64', mode='r', shape=( 5000,1000))
    b = np.memmap('b.array', dtype='float64', mode='r', shape=(15000,1000))
    
    c = da.concatenate([a, b], axis=0)
    

    from https://stackoverflow.com/a/68138351

    opened by adamltyson 1
Owner
The Institute of Cancer Research
The Institute of Cancer Research is making the discoveries that defeat cancer. We're the UK's top academic research centre, a postgrad college, and a charity.
The Institute of Cancer Research
Python library to natively send files to Trash (or Recycle bin) on all platforms.

Send2Trash -- Send files to trash on all platforms Send2Trash is a small package that sends files to the Trash (or Recycle Bin) natively and on all pl

Andrew Senetar 224 Jan 4, 2023
List of short Codeforces problems with a statement of 1000 characters or less. Python script and data files included.

Shortest problems on Codeforces List of Codeforces problems with a short problem statement of 1000 characters or less. Sorted for each rating level. B

null 32 Dec 24, 2022
These are After Effects and Python files that were made in the process of creating the video for the contest.

spirograph These are After Effects and Python files that were made in the process of creating the video for the contest. In the python file you can qu

null 91 Dec 7, 2022
python scripts and other files to generate induction encoder PCBs in Kicad

induction_encoder python scripts and other files to generate induction encoder PCBs in Kicad Targeting the Renesas IPS2200 encoder chips.

Taylor Alexander 8 Feb 16, 2022
This Python script can enumerate all URLs present in robots.txt files, and test whether they can be accessed or not.

Robots.txt tester With this script, you can enumerate all URLs present in robots.txt files, and test whether you can access them or not. Setup Clone t

Podalirius 32 Oct 10, 2022
Python plugin/extra to load data files from an external source (such as AWS S3) to a local directory

Data Loader Plugin - Python Table of Content (ToC) Data Loader Plugin - Python Table of Content (ToC) Overview References Python module Python virtual

Cloud Helpers 2 Jan 10, 2022
Make pack up python files easier.

python-easy-pack make pack up python files easier. 目前只提供了中文环境 如何使用? 将index.py复制到你的项目文件夹,或者把.py文件拷贝到这个文件夹。 打开你的cmd或者powershell 切换到程序所在目录,输入python index

null 2 Dec 15, 2021
A Python Based Utility for Processing GST-Return JSON Files to Multiple Formats

GSTR 1/2A Utility by Shan.tk Open Source GSTR 1/GSTR 2A JSON to Excel utility based on Python. Useful for Auditors in Verifying GSTR 1 Return Invoices

Sudharshan TK 1 Oct 8, 2022
A very terrible python-based programming language that uses folders instead of text files

PYFolders by Lewis L. Foster PYFolders is a very terrible python-based programming language that uses folders instead of regular text files. In this r

Lewis L. Foster 5 Jan 8, 2022
Python library for creating and parsing HSReplay XML files

python-hsreplay A python module for HSReplay support. https://hearthsim.info/hsreplay/ Installation The library is available on PyPI. pip install hsre

HearthSim 45 Mar 28, 2022