Skip to main content

Python bindings for the imgal image processing and algorithm library.

Project description

pyimgal

Python bindings for the imgal image algorithm and processing library. Visit imgal.org for more information.

Installation

pyimgal from PyPI

You can install the pyimgal package from PyPI with:

$ pip install pyimgal

The pyimgal package is compatible with Python >=3.7 and the following architectures.

Operating System Architecture
Linux amd64, aarch64
macOS intel, arm64
Windows amd64

Alternatively, you can install pyimagal from source by building the imgal_python repository. See the next section for instructions.

Build pyimgal from source

To build the pyimgal Python package from source, use the maturin build tool (this requires the Rust toolchain to build the imgal core library). If you're using uv to manage your Python virtual environments (venv) add maturin to your environment and run the maturin develop --release command in the imgal_python directory of the imgal repository with your selected venv activated:

$ source ~/path/to/myenv/.venv/bin/activate
$ (myenv) cd imgal_python
$ maturin develop --release

Alternatively, if you're using conda or mamba you can do the following:

$ cd imgal_python
$ mamba activate myenv
(myenv) $ mamba install maturin
...
(myenv) $ maturin develop --release

This will install pyimgal in the currently active Python environment.

Usage

Using pyimgal

Once imgal_python has been installed in a compatible Python environment, imgal will be available to import. The example below demonstrates how to obtain a colocalization z-score (i.e. colocalization and anti-colocalization strength) using the Spatially Adaptive Colocalization Analysis (SACA) framework. The two number values after the channels are threshold values for channels a and b respectively.

Note: This example assumes you have 3D data (row, col, ch) to perform colocalization analysis and the tifffile package in your environment.

import imgal.colocalization as coloc
from tifffile import imread

# load some data
image = imread("path/to/data.tif")

# slice channels to perform colocalization analysis
ch_a = image[:, :, 0]
ch_b = image[:, :, 1]

# compute colocalization z-score with SACA 2D with 4 parallel threads
zscore = coloc.saca_2d(ch_a, ch_b, 525, 400, threads=4)

# apply Bonferroni correction and compute significant pixel mask
mask = coloc.saca_significance_mask(z_score)

Documentation

Each function in imgal is documented and published on docs.rs.

License

Imgal is a dual-licensed project with your choice of:

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

pyimgal-0.3.0.tar.gz (102.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyimgal-0.3.0-cp37-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.7+Windows x86-64

pyimgal-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

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

pyimgal-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

pyimgal-0.3.0-cp37-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

pyimgal-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file pyimgal-0.3.0.tar.gz.

File metadata

  • Download URL: pyimgal-0.3.0.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyimgal-0.3.0.tar.gz
Algorithm Hash digest
SHA256 45e6dc4d107a5c7841a8702ccbab8ea2a570f5dafef822dd3ad91a96a3e1e63b
MD5 be039b5e08e17996da785feac72b8414
BLAKE2b-256 b074977a504200b94601957b33dbbfb608cd8c3ca494ba10485facff6676461a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0.tar.gz:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimgal-0.3.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: pyimgal-0.3.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyimgal-0.3.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b7d2dc787c7867e0441396618d68c3064d3def707cf24e9315347d99b7e5fda4
MD5 cb7e429b4bea864bd2fd87c8d0ba11dc
BLAKE2b-256 d2d2fe40852a4ec5c8c6f61c36ae539586b139fb1f3a0fa345cc4eb132cda9c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0-cp37-abi3-win_amd64.whl:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimgal-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2accb6639618a3e52d924b917a10a1584512cce05bb0f5805a32734e88fa47c4
MD5 8b6e76336f2a63d72e89347c9d3dded4
BLAKE2b-256 1ac8c8937ffffae8f30abe456bf944f1e3137fabd25d1cbf67a01687b7f7c10b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimgal-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b3c512a821419aadcd91b1381527f959f18401905f672b15c92c365932c42773
MD5 103abfe6738c7f7e42f9b0a5b4c044b6
BLAKE2b-256 25d757c6f47bdce123179ec96297781b7bf4b101edff5772648ebad009a846cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimgal-0.3.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28bfd8b75c0669f3f7baa00ea11db0c24f69e5207dcf25dd094c1e2c1124bfb7
MD5 5fec6422cec4175fcad4553a1d38b571
BLAKE2b-256 8a3fda3346679010ea18a87ff63ef73ed828d7c9a30c3df254a78dc6ffd8a7c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0-cp37-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyimgal-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0f6b1a4066cc628f1ccc315da4725f92a467dd6aad5ec339083fcb3b9afd3e7b
MD5 a7212d30a7296785b2da860b1af90f89
BLAKE2b-256 c9ecdaf7018c86ef554af64fd6ef2c0f63531e883a5e9cf331ce814de149ff58

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.0-cp37-abi3-macosx_10_12_x86_64.whl:

Publisher: release-pypi.yml on imgal-sc/imgal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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