Skip to main content

Pyramid Generator For OMETiff

Project description

Argolid

Argolid is a Python package for working with volumetric data and generating multi-resolution pyramids. It provides classes for reading and writing pixel data, generating Zarr arrays, and creating multi-resolution pyramids.

Installation

You can install Argolid using pip (pip install argolid) or using conda (conda install -c conda-forge argolid).

Building from Source

Argolid uses Tensorstore for reading and writing pixel data. So Tensorstore build requirements are needed to be satisfied. For Linux, these are the requirements:

  • GCC 10 or later
  • Clang 8 or later
  • Python 3.8 or later
  • CMake 3.24 or later
  • Perl, for building libaom from source (default). Must be in PATH. Not required if -DTENSORSTORE_USE_SYSTEM_LIBAOM=ON is specified.
  • NASM, for building libjpeg-turbo, libaom, and dav1d from source (default). Must be in PATH.Not required if -DTENSORSTORE_USE_SYSTEM_{JPEG,LIBAOM,DAV1D}=ON is specified.
  • GNU Patch or equivalent. Must be in PATH.

Here is an example of building and installing Argolid in a Python virtual environment.

python -m virtualenv venv
source venv/bin/activate
pip install cmake
git clone https://github.com/sameeul/argolid.git 
cd argolid
mkdir build_deps
cd build_deps
sh ../ci_utils/install_prereq_linux.sh
cd ../
export ARGOLID_DER_DIR=./build_deps/local_install
python setup.py install

Usage

PyramidGenerator

Argolid can generate 2D Pyramids from a single image or an image collection with a stitching vector provided. It can generate three different kind of pyramids:

  • Neuroglancer compatible Zarr (NG_Zarr)
  • Precomputed Neuroglancer (PCNG)
  • Viv compatible Zarr (Viv)

Currently, three downsampling methods (mean, mode_max and mode_min) are supported. A dictionary with channel id (integer) as key and downsampling method as value can be passed to specify downsampling method for specific channel. If a channel does not exist as a key in the dictionary, mean will be used as the default downsampling method

Here is an example of generating a pyramid from a single image.

from argolid import PyramidGenerartor
input_file = "/home/samee/axle/data/test_image.ome.tif"
output_dir = "/home/samee/axle/data/test_image_ome_zarr"
min_dim = 1024
pyr_gen = PyramidGenerartor()
pyr_gen.generate_from_single_image(input_file, output_dir, min_dim, "NG_Zarr", {0:"mode_max"})

Here is an example of generating a pyramid from a collection of images and a stitching vector.

from argolid import PyramidGenerartor
input_dir = "/home/samee/axle/data/intensity1"
file_pattern = "x{x:d}_y{y:d}_c{c:d}.ome.tiff"
output_dir = "/home/samee/axle/data/test_assembly_out"
image_name = "test_image"
min_dim = 1024
pyr_gen = PyramidGenerartor()
pyr_gen.generate_from_image_collection(input_dir, file_pattern, image_name, 
                                        output_dir, min_dim, "Viv", {1:"mean"})

Argolid provides two main classes for working with volumetric data and generating multi-resolution pyramids:

VolumeGenerator

The VolumeGenerator class is used to create Zarr arrays from image stacks. It handles reading image files, grouping them based on specified criteria, and writing the data into a Zarr array.

Here's an example of how to use VolumeGenerator:

from argolid import VolumeGenerator

source_dir = "/path/to/image/files"
group_by = "z"  # Group images by z-axis
file_pattern = "image_{z:d}.tif"
out_dir = "/path/to/output"
image_name = "my_volume"

volume_gen = VolumeGenerator(source_dir, group_by, file_pattern, out_dir, image_name)
volume_gen.generate_volume()

PyramidGenerator3D

Here is an example of generating a 3D pyramid from a Zarr array:

from argolid import PyramidGenerator3D

zarr_loc_dir = "/path/to/zarr/array"
base_scale_key = 0
num_levels = 5

pyramid_gen = PyramidGenerator3D(zarr_loc_dir, base_scale_key)
pyramid_gen.generate_pyramid(num_levels)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

argolid-0.0.6rc1-cp311-cp311-win_amd64.whl (11.4 MB view details)

Uploaded CPython 3.11Windows x86-64

argolid-0.0.6rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

argolid-0.0.6rc1-cp311-cp311-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

argolid-0.0.6rc1-cp311-cp311-macosx_10_15_x86_64.whl (11.2 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

argolid-0.0.6rc1-cp310-cp310-win_amd64.whl (11.4 MB view details)

Uploaded CPython 3.10Windows x86-64

argolid-0.0.6rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

argolid-0.0.6rc1-cp310-cp310-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

argolid-0.0.6rc1-cp310-cp310-macosx_10_15_x86_64.whl (11.2 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

argolid-0.0.6rc1-cp39-cp39-win_amd64.whl (11.4 MB view details)

Uploaded CPython 3.9Windows x86-64

argolid-0.0.6rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

argolid-0.0.6rc1-cp39-cp39-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

argolid-0.0.6rc1-cp39-cp39-macosx_10_15_x86_64.whl (11.2 MB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

argolid-0.0.6rc1-cp38-cp38-win_amd64.whl (11.4 MB view details)

Uploaded CPython 3.8Windows x86-64

argolid-0.0.6rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

argolid-0.0.6rc1-cp38-cp38-macosx_10_15_x86_64.whl (11.2 MB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

File details

Details for the file argolid-0.0.6rc1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: argolid-0.0.6rc1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for argolid-0.0.6rc1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bf43e3c934c046afb69c3a6bcf517b4a7d44b0a2ed19cf9d3c89faa09151e61f
MD5 6bcc5536a9f3cd5d45013e9a89455b56
BLAKE2b-256 45993515aec9e5f0c4ff915f50b5be0baec0ed1232a5e66083af1f206c3c248e

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a7645086d5ce7a55ca52b0c199fae45a25b31d4a7a612f33e2b9a2ab9bb4244
MD5 bfda023eeaad3145c53b4fc668fb2c0a
BLAKE2b-256 51209cc656612815b855b452e1ff180aafa9c65b57aad8cef25c9d8d81ce41d9

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b9ad7800717e32ed8e5a3bfe3131ca6ec41d2d9ba4cacdfa19465756e5fe2867
MD5 e60a8e6654a70e74ad716912157613be
BLAKE2b-256 6b090196ca663e32c32b693f8990aff204b49ec51fff3aacfcd1edd37dd76360

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8f056f86dd89c66460915da2bb14dd4e19d42796acc4445655221ca29f8c30ff
MD5 95c659e4bd7a18fad1b9616fbb81712c
BLAKE2b-256 db1cd60f028bbb3aba214aa14ffad7739b617929faa0231e9a809481076cbf61

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: argolid-0.0.6rc1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for argolid-0.0.6rc1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 85460058b5ac29830dc7e571845cca0a7013434bf387598ce5f6866d5d22f3cf
MD5 e9d620b24cd19a7d7893383fa64175c6
BLAKE2b-256 ed2f733a3bb4a70e8adfc9c74b103070aba494447b514772fab8e8f8a56ba4c3

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7e55c59b25364c9a5a54c5b9b99fa68aa2a6d354ac23d11492fac536a6eb092
MD5 08a750569d3114302814ea7bda08c6e1
BLAKE2b-256 79816e147aae39e8f4a89c0ff79dcbc72c158be523309bc8441ca063bb8d8f1e

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec65986062f103350674e6574417417a0e362194e10cd2fda0a6f68cff987ff5
MD5 ef28ffd1b18c845533a04b5f3f96aa20
BLAKE2b-256 29a0b1b6c085b5161a929bc5520c0a0e310e5aa692ccdd79d710df9c43b5f96c

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f58ed1799b1ea86c7c43ac6d6a9a99f88a24a2077b2b0177c4e0b4b48dad72cf
MD5 84109811dcf647077819985d63ef9cb4
BLAKE2b-256 89b05b4ed19a83d4d76c8eb39cafef21d90d06e686794337e75f2194ff7d2eab

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: argolid-0.0.6rc1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for argolid-0.0.6rc1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bbc1569d2fa5e1bc47935b78f61b6839de9ab57c81dc7624534b14886abfc3f4
MD5 a66d9b3f7e8953dce93adc96249f1ce0
BLAKE2b-256 2735ee867f26b85ac0f7cead979f68655b1f7a94536fd135088325e57a2fbd11

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 460392e4f88b94630828772b94eee936eeeaca52a78b9ad9809b7e4e51813c5a
MD5 df0dddd6cf6eab15f43e5f7b83ee6e9a
BLAKE2b-256 3b5e0145e0ef9f385c5125c0db645175df79e0082aaf0e8d7fadeb6e13e63be0

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e2e94d7c7369613888ba1d62cdfa71478a43583fa652db25bce6bf262a82bd8
MD5 7002ca8a65fc7294f6bd9659f29430c7
BLAKE2b-256 760d13b5a6b2086f68f51fad670fb62c06ea4aed82d914bf5620b5d4ef36e269

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 468d3d23e5eb433eb466dabe9e7502ceb640d6dc0068d74824f5339eeb193c6d
MD5 023afc35d048344f32f36d5e82f9531f
BLAKE2b-256 cd77b5c0c854e765b009983132e0758a437501e5970c3c32ef8982ee84862d53

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: argolid-0.0.6rc1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for argolid-0.0.6rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 470741849d35204c92da8e4ecc953b3f53a4273c238ad0aec75409f2af466a46
MD5 feaf0ef99763851902c9334ffe50203c
BLAKE2b-256 5afec7dab9151c05bb995034c3aebe1f08bf19cd9e503bf1c1aac09b37d74427

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ec30a5bcbf9923b81c451a2b2a0d9452b0481231f0e5b2f443937499c88bca9
MD5 f097476f7ad94c391c471f8f1843528d
BLAKE2b-256 eb28aa0d949cf7591ea30260363b450f5795377c319110e1825288c6deffbd9d

See more details on using hashes here.

File details

Details for the file argolid-0.0.6rc1-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for argolid-0.0.6rc1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a46f1677856217f4822aa58287ed235567cb5b7e0c4424f2deca91e2b10b2666
MD5 5c2c8eac9a3167f33000bce82ad85b03
BLAKE2b-256 179752666d215d6c6c38162a89ef488fb8ae765e15eb2ee560eff2c398f5f1b5

See more details on using hashes here.

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