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.8 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.1.tar.gz (37.6 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.1-cp38-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

pyimgal-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

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

pyimgal-0.3.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

pyimgal-0.3.1-cp38-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pyimgal-0.3.1-cp38-abi3-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pyimgal-0.3.1.tar.gz
  • Upload date:
  • Size: 37.6 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.1.tar.gz
Algorithm Hash digest
SHA256 494062d21434a5ffcaa5fad7be0278291419709662acef9fd1e35a8e61f3ccb1
MD5 c9f546bad4d96c0556779cc8bdde0eb8
BLAKE2b-256 366d69c4394d1d4489195cdb66e34125c765d77d74766144cb5451a99ca92873

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1.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.1-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: pyimgal-0.3.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.8+, 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.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6ea25a1b0bb8b0dcda92002444635c7e3a612db9e326490b2a614265e6393d77
MD5 8b6b771fd4055eb85e81d62bee584e4d
BLAKE2b-256 906db88997b88555d623677d3c4553e5b57ec52c58fc2ff6d60b657a8e263606

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1-cp38-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.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a113f5853b85a5dc2a90232a48f54e59d2e3fc5008c3558019defec67c02ed9
MD5 5fddbcc3e2ac3fd42ffa9fffa29a9da2
BLAKE2b-256 06aa212b8e1ab2e03da176402b26d43e33245df1f14128ce6b00338248346258

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1-cp38-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.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2243b9b869d8b53b5ba8fc136e8311d694b475af21ef5c9ae56d4d76350c2480
MD5 1f6b4294ae027b6213d7718a6c13a331
BLAKE2b-256 385984ad7ab281dda4d6ed6ab6a70c0af3cdcc9d966125f3ae349a580c86a3d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1-cp38-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.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bff923c1ebaec3545a176637a2c49a3aa0e1604815ec86363c65ffafa05cbc08
MD5 29a12962fd0fad2550e6d423c9f1ac57
BLAKE2b-256 1ddeb0cfdb27b86450f36b8262ec84c277e61af848969096b5ff7d9b8b2b5a64

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1-cp38-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.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyimgal-0.3.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f8749c6829195081cee1fd16aaf452458529e591babe49603dc15718b69da299
MD5 b4fa8f7c22e128186c9dcc3a58e4ab22
BLAKE2b-256 6f973148700354c1377d42d0134d4408696066c5a7e46958f34de6355387a5e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyimgal-0.3.1-cp38-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