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.6-cp311-cp311-win_amd64.whl (11.4 MB view details)

Uploaded CPython 3.11Windows x86-64

argolid-0.0.6-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.6-cp311-cp311-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

argolid-0.0.6-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.6-cp310-cp310-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.15+ x86-64

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

Uploaded CPython 3.9Windows x86-64

argolid-0.0.6-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.6-cp39-cp39-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.15+ x86-64

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

Uploaded CPython 3.8Windows x86-64

argolid-0.0.6-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.6-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.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: argolid-0.0.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e67e461d9522e2b277d7bc91466e830d2a8aa8252cd37e9b36d6c21bb645482a
MD5 6b17d0162d56fc2282ebc28fd74db995
BLAKE2b-256 7b1f7854bf7839cb4daf4cfee2f8f158c6f4352be95dc1234b8705145c9e129f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 500dd96abafa7f9c5b9bf6fac40235e957aecb370608589b7a6e48585248e962
MD5 7331e71589effd267ce287e9480a40d5
BLAKE2b-256 3aaab9ce22f2a7b7f7bc0c303e2546005ebfd9754b50f3870b6ea2a009a79249

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4e3d9a19dab109422c5a0e12211646d45194c8afd76e5ccd9b155f066e7d441e
MD5 9f33e5157e19f693cf2a1f37d4910ed5
BLAKE2b-256 a7e8b6cfd295910de287814a49bdf87943bfa3ec5c1ddbe7f089ab7d8f4f8367

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5695942781b68104982bc7d3b8fc9f49e10f05e35bf3a07f73bbd66f2f53e0e7
MD5 0ecfeb6f8d87aa4d773318b87a8e8b6f
BLAKE2b-256 657e1b624f585c34b236ee6923bc048f06d3706eaf82ea4d4d3bbd3578e4974f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argolid-0.0.6-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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3ea89e77c888767c36b7ab26d9b79fabd1d2c4b5b935d6229a8d3c5daae2a555
MD5 c8268a7d05ef8ea611d31ad4fcde5291
BLAKE2b-256 fa5afba97616ae05854fe91e9f2c432425b3bee6d6864bf294fad310ca091c1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 611e4c890889cb94e70c3f4b3d1ae1d28d597d882cc2c3d893d5c9919708f422
MD5 9f23a6a3f1741588b0afde5e469c5fcd
BLAKE2b-256 b9b2c67e29385a33f35538337ae6af2f17b6436de52184eb01df352480b45c76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb23566cdfb99c99b4b30394134fd4a8714c80a7cd0b5c3a4959a22f08cd080c
MD5 2423b36ee6c19a5eef85c32174b086fa
BLAKE2b-256 20c9df0d216bfb8562c79050823008382022c73ca292f9116808aa97a41a83f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7ebba89a2e809dd445e85a5af9ad44b66d87b97a613010a931e91c436ceddcb0
MD5 4bc3eac21ccdc9fa15fe22807af1bc67
BLAKE2b-256 aca4ea2f08ae2f1eeecbc4729b3bcd29840ec6f6a8b5b44114c174769fbcdf22

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argolid-0.0.6-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.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cc1884aff7e176d83b53d9d77c6543a3f1f285d0579b0ebf3e1195c756445b76
MD5 8e75afae015e9ab48d8b89ecf16036f6
BLAKE2b-256 3b3a5637fab0656c44f3f3382b6d7d8313ab805bed873fb15d7237b6f784ad21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3cc5b5b079baaccf124f20dd95db079bd391fae119984a222588e76b50fa361
MD5 710cf165b2e83dba90b2c0c3fef86b4d
BLAKE2b-256 e044f263c32a5984a81d275f4c7680ecac435769dfa9d655dab1a995ca7ae515

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e334327821d7d091403b3055c427b50083d7d8d6f1451727dd71cf13058641c
MD5 2f6f9cef2b83fe5f9ead4de018b36fea
BLAKE2b-256 4137016c7bdf841deb67682cf01e4401f58a4a69f3cf09a218ff0f6e89fb5e33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 05169fa983ae9ad7b8daa2b0b1de97ee3aa7199f00bcdf7827e8709711b205bc
MD5 ed759e42779902087b0ef4bb5e65c924
BLAKE2b-256 4265feefe08f88d19eed4dbc33d735f82542a14e86c079934e8e22708ffe05b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argolid-0.0.6-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.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e99c014d28c88f165463362377e32d82092c6427264881addc7dbd760be51990
MD5 c19602b49ba108c7bee7303e57887b42
BLAKE2b-256 dcb0bb7f77fcc5813425ac585879ba432ccbb5cf9006bbb49cc19f693e68cfe1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 308288fffc7a3287dc64dd5151c442b42da1e7ba3267e902c1b0a681cc43b642
MD5 3c6da23fbdf251242a6da99fa41cfef2
BLAKE2b-256 3657b06a9147f81bc6de2aae659bf2ee06b96ec2b2e087415b781f68634a44a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argolid-0.0.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c0f5cab5aefe8611d95a16b3670bb246cab981a6625285157fd284a116c4c2b7
MD5 9a535137f46a18834e2ea2824e0188a9
BLAKE2b-256 50b54d832f89fa8200ef430aa6cc27d2e6a4579080d61a1ece4991c70e8684b0

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