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 micromamba installed.
  2. Create the environment:
    $ micromamba create -n pyisyntax -f conda-lock.yml --category main --category dev
    
  3. Activate the environment:
    $ micromamba activate pyisyntax
    

To modify pyisyntax project dependencies:

  1. Edit pyproject.toml.
  2. 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.4.tar.gz (249.1 kB view details)

Uploaded Source

Built Distributions

pyisyntax-0.1.4-cp310-abi3-win_amd64.whl (88.7 kB view details)

Uploaded CPython 3.10+ Windows x86-64

pyisyntax-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (576.6 kB view details)

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

pyisyntax-0.1.4-cp310-abi3-macosx_11_0_arm64.whl (136.4 kB view details)

Uploaded CPython 3.10+ macOS 11.0+ ARM64

pyisyntax-0.1.4-cp310-abi3-macosx_10_9_x86_64.whl (150.5 kB view details)

Uploaded CPython 3.10+ macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyisyntax-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c9dade00fef8751dbbf5590001d33a8d1afcfdd31647ea7a24144e93698f46ff
MD5 ce08da66793f9b88e98993f0f5bbaf88
BLAKE2b-256 a49a8f0502f8cfa2b46e85c839f467fc9f4fabcfc9e6ac0b56985ab4a9406738

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyisyntax-0.1.4-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 88.7 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for pyisyntax-0.1.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f8c899c96a5aebf35057a0c79269d135576e75c0376484741fb0845a93e1e4d5
MD5 a57063436baca23ca82a707150f94b4a
BLAKE2b-256 d2dd44e02287d0a30ea80998e315e12d356fc53c009a1fe5de2de47f1bd712b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyisyntax-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef26e383660af5b91c83f16018bff6a85d3bae3f21737e393f393fa2146e4700
MD5 b9daab0b96a514a8fa9b42c66d11b6fe
BLAKE2b-256 84a80662084b8a7f7b94fccb1052d396e7fef212108642930805f03aa4c14c69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyisyntax-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33e94aa39f4147d49c9a54e55138d6aa09633a8bf9be6ffb4464a26a2eb2cbc4
MD5 1bca3f3dbc12a8b2dc814cb506fa3558
BLAKE2b-256 572f2e5ab0298df898e1625209180e6dafef329a6ac5c7b597eb189c7c8074df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyisyntax-0.1.4-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fa658a31b705e6f927d2b8c6ecf0eaedb859db8df8e2a78e2ffd9de9cedd70c8
MD5 62359cd65c600a5ae0e0485a0a9a4ba4
BLAKE2b-256 02e6a4587df6060aac7fa926c6ec6c889d039e002f9668006b72b486b28f489a

See more details on using hashes here.

Supported by

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