Skip to main content

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:

  1. Ensure that you have uv installed.
  2. Create the virtual environment:
    $ uv sync --frozen
    

To modify pyisyntax project dependencies:

  1. Edit dependencies in pyproject.toml.
  2. Update the lock file using uv:
    $ uv lock
    

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.5.tar.gz (251.3 kB view details)

Uploaded Source

Built Distributions

pyisyntax-0.1.5-cp310-abi3-win_amd64.whl (89.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

pyisyntax-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (581.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

pyisyntax-0.1.5-cp310-abi3-macosx_11_0_arm64.whl (137.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

pyisyntax-0.1.5-cp310-abi3-macosx_10_9_x86_64.whl (150.8 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file pyisyntax-0.1.5.tar.gz.

File metadata

  • Download URL: pyisyntax-0.1.5.tar.gz
  • Upload date:
  • Size: 251.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for pyisyntax-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a2954cb2f729968b2b03387dc40c90b13c1144b346488537a3b311bf3e0c5fdf
MD5 e114dc0bac4e2cc2f22d79b741dda390
BLAKE2b-256 65a791d7c3fcbcfca442acc472a682dfbaa5de37f2fb53d9ff6bd5c80598bdbf

See more details on using hashes here.

File details

Details for the file pyisyntax-0.1.5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pyisyntax-0.1.5-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 89.5 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

Hashes for pyisyntax-0.1.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7dc8198e13ec4449f085930511aa575ebf78f79bfbce42ae38305403fb6a0f60
MD5 946b96ffdb357791820dc2f96eb40a1f
BLAKE2b-256 a4af142117c80358de2ede26c8442e4eb8d250d276b85498b2393f64edeaac5e

See more details on using hashes here.

File details

Details for the file pyisyntax-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyisyntax-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1ca728e1bcab43685471ed8091491b958d408ecfd3bde379b03e4af682a0b60b
MD5 6912fec2afa94627fd30b7d342ce9b67
BLAKE2b-256 8e686c14334b8c7d511b7cc5d3ead7e4432bc2eb3babea80c7f8f3f5c279d079

See more details on using hashes here.

File details

Details for the file pyisyntax-0.1.5-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyisyntax-0.1.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ac9ed080fc015ed0e1c7c79dd8d7021ec1def35dc266c2764a30014b7c87482
MD5 68864d399434b54d3f846dcf6e9c8fa8
BLAKE2b-256 e5f62da858f6b383983a44865c4dd896f9fdc93e8f7d9b0955d5433eecc6ae1d

See more details on using hashes here.

File details

Details for the file pyisyntax-0.1.5-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyisyntax-0.1.5-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f94a9e69b928dbdec4c28b77bb0253db9526bc542b4e2cea62d39e8458ab6f26
MD5 a0cc4af57b7110474d515429fc53a259
BLAKE2b-256 3cf4d27196e337f77cab85d07fd148a24df1ad76a467f362a7d94f700fef1cfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page