Python bindings for libisyntax
Project description
pyisyntax
A Python library for working with pathology images in the iSyntax file format, powered by libisyntax.
Installation
$ pip install pyisyntax
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 uv installed.
- Create the virtual environment:
$ uv sync --frozen
To modify pyisyntax project dependencies:
- Edit dependencies in
pyproject.toml. - Update the lock file using uv:
$ uv lock
Cutting a new release
- Ensure that tests are passing and everything is ready for release.
- Create and push a Git tag:
$ git tag v0.1.6 $ git push --tags
- Download the artifacts from GitHub Actions, which will include the source distribution tarball and binary wheels.
- Create a new release on GitHub from the tagged commit and upload the packages as attachments to the release.
- Also upload the packages to PyPI using Twine:
$ uv run twine upload pyisyntax-*.tar.gz pyisyntax-*.whl
- Bump the version number in
pyproject.tomland create a commit, signalling the start of development on the next version.
These files should also be added to a GitHub release.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyisyntax-0.1.6.tar.gz.
File metadata
- Download URL: pyisyntax-0.1.6.tar.gz
- Upload date:
- Size: 252.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914ee78aa5f12a52ddf00c2c1240994061e532c4aa5b99fbcfd1b18856d8e13e
|
|
| MD5 |
e88569fb7429f327f40785889bb940b1
|
|
| BLAKE2b-256 |
5374893fd2facfab8efcd681bc7ad927e931b7a5b39b6f74d11335b2c9aa077c
|
File details
Details for the file pyisyntax-0.1.6-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: pyisyntax-0.1.6-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 89.2 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deacb37048ccc71ce630e421201e28e557374dd380345cf20082a4e0866ce363
|
|
| MD5 |
1342658fda378d69a85df6e5a5f32e8b
|
|
| BLAKE2b-256 |
c437c21942df82f80a365ee902b86f0fb360285b92460a3d426211f772451a74
|
File details
Details for the file pyisyntax-0.1.6-cp310-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyisyntax-0.1.6-cp310-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 597.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85e60032bcb3dc47e5534f8dee91eaf37b2ba4959392c26009dd9e8b21c9c6e7
|
|
| MD5 |
4dad2f3293dce2b21c7ad6a9765c96b5
|
|
| BLAKE2b-256 |
18b382c739c3201f79fa444648712689e46e4cffc6d47dcc92110aab87f2fd8f
|
File details
Details for the file pyisyntax-0.1.6-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyisyntax-0.1.6-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 574.0 kB
- Tags: CPython 3.10+, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
065efe0936e35cfb7977cc89d01eed3ebad1ce1d757a58503a32aae5e01de029
|
|
| MD5 |
bab77a381a2c64ea77af5bd8e68546d2
|
|
| BLAKE2b-256 |
60722c0e04c038fb1f43de8203529e5652e9a48572e37d6dd15c9016eea9b9f3
|
File details
Details for the file pyisyntax-0.1.6-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyisyntax-0.1.6-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 137.9 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d70605fc46ed9fe2ab3b19726a15e50c672c989eb87cbd4356e90bee58ebb9de
|
|
| MD5 |
38441e7d1ec83e09798deb103a747dc9
|
|
| BLAKE2b-256 |
80fc673d556c9c0d438b0993a1fabe3fa64d76e967008e4e574586f8ef1a90fa
|
File details
Details for the file pyisyntax-0.1.6-cp310-abi3-macosx_10_9_x86_64.whl.
File metadata
- Download URL: pyisyntax-0.1.6-cp310-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 149.1 kB
- Tags: CPython 3.10+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a297991a0c3fa083be48948fe78fdaf254d63fb948aa4feecfa13a438c2c572
|
|
| MD5 |
d8f1ef53bfa4d04a4371583352a4df0f
|
|
| BLAKE2b-256 |
849cbeaf3c83a05c9df4e1353e4015349021c136cb77430cab476a67ba30661f
|