Python bindings for libisyntax
Project description
pyisyntax
A Python library for working with pathology images in the iSyntax file format, powered by libisyntax.
Usage
Read and display a region of the WSI via Pillow.
from isyntax import ISyntax
import PIL.Image
with ISyntax.open("my_file.isyntax") as isyntax:
# Read pixels from the specified region into a numpy array
pixels = isyntax.read_region(500, 500, 400, 200, level=4)
# Convert numpy array into a PIL image
pil_image = PIL.Image.fromarray(pixels)
# Show the image
pil_image.show()
Extract and save the associated macro image.
from isyntax import ISyntax
with ISyntax.open("my_file.isyntax") as isyntax:
# The macro image will be returned as compressed JPEG data.
jpeg_data = isyntax.read_macro_image_jpeg()
# This JPEG data can be written directly to a file.
with open("macro_image.jpg", "wb") as f:
f.write(jpeg_data)
# Alternatively, you could decompress the data using Pillow:
# pil_image = PIL.Image.open(io.BytesIO(jpeg_data), formats=["JPEG"])
Development
Dependency management
To set up a development environment from the lock file:
- Ensure that you have micromamba installed.
- Create the environment:
$ micromamba create -n pyisyntax -f conda-lock.yml --category main --category dev
- Activate the environment:
$ micromamba activate pyisyntax
To modify pyisyntax project dependencies:
- Edit pyproject.toml.
- Update the lock file using conda-lock:
$ conda-lock lock -f pyproject.toml -p linux-64 --micromamba
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
pyisyntax-0.1.1.tar.gz
(246.4 kB
view hashes)
Built Distributions
Close
Hashes for pyisyntax-0.1.1-cp310-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad7dbfbfe69dd22e068779932de46311b64f0c78c4457cb16397d06501a732c |
|
MD5 | a3712197305e6dd1767be0c164a03fd2 |
|
BLAKE2b-256 | 54f5303830c7f158e2b28c196d0b41ef0413e4f3ea83920624abcf1b3ffa935a |
Close
Hashes for pyisyntax-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca64d97fc85ed16699fbd8efd661456a998a8067ec3dec3e84dc320945cecb2 |
|
MD5 | 9c815bc9a207eb5c9478ce7374129702 |
|
BLAKE2b-256 | 26aac8161a2f5f97cbde560369e1c514698748fefc7fed06b563a2d07d4f51f9 |
Close
Hashes for pyisyntax-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0632cffbce5c5df7a84edb11524d001beee99cd1846bfe489ed63624a490d935 |
|
MD5 | 927bddb0c0a9cd3df033293f22408b73 |
|
BLAKE2b-256 | ed7180a7bbe33fab3375d6d6f8684e8799c645d12dcdc072e1e7e6080f20b3dc |
Close
Hashes for pyisyntax-0.1.1-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46a3e3348431a44b1d95d7c93486a072f3c194874096263b810c6120569c7a1b |
|
MD5 | 569a4e56fc6ea7039f736eb890a4e3aa |
|
BLAKE2b-256 | 10054ba5a5dd13b14519182e541ad1e0ca23bb1fe336428faca9233d455acd4d |