Skip to main content

elegant-toolkit

Automated image-analysis pipelines for C. elegans microscopy data, developed in the Mango Lab at the Biozentrum, University of Basel.

The toolkit takes raw multi-channel microscopy stacks (.vsi, .nd2, .ics, .tif) and:

  • splits channels and runs optional preprocessing (cropping, padding, blurring, deconvolution);
  • segments embryos and nuclei with Cellpose;
  • segments sub-nuclear "dot" structures by intensity thresholding or Difference of Gaussians blob detection;
  • post-processes the masks (closing, merging, resizing);
  • measures every object (morphology, intensity, position, texture, distances) and writes dataframes and summary tables.

The pipeline can be run both via a Graphical User Interface (see installation instructions below) or directly via the command line.

Installation

Create a conda environment with Python 3.10 or newer, then install the package from the repository root.

conda create -n elegant_toolkit python=3.12

pip install

pip install elegant-toolkit

local install

Clone the repo with:

git clone https://github.com/angelo-angonezi/elegant-toolkit.git

And install with:

(CPU only)

pip install .[cpu]

(GPU - CUDA 13x)

pip install .[gpu] --extra-index-url https://download.pytorch.org/whl/cu130

Then run the setup steps below, and check the installation with cet-version, cet-check_gpu and cet-check_java.

Note: While the pipelines can theoretically be run on a CPU-only machine, running the scripts with a GPU is highly recommended, especially with large confocal microscopy data.

Setup steps

Some dependencies can't be installed with pip, so the package ships cet-download_* commands for them. Each one takes -h for its options.

Command What it does When to run it
cet-download_jdk Installs a JDK (conda-forge openjdk) into the active conda env, used by the Bio-Formats readers for .ics, .tif and .vsi files. Once, unless your env already has a JDK.
cet-download_loci_jar Downloads the Bio-Formats loci_tools.jar ahead of time. Otherwise it is downloaded silently in the middle of the first .ics/.tif/.vsi conversion. Optional.
cet-download_cp_models Downloads the Cellpose cpsam weights to ~/.cet/cellpose/models, the location the pipeline uses. Once, before the first segmentation.
cet-download_pycudadecon Installs pycudadecon from conda-forge, since its PyPI wheel has no working CUDA backend. GPU installs, if you use deconvolution.

Verifying installation and GPU availability

To verify if all pacakges were correctly installed, run:

cet-check_imports

And to assess GPU availability, run:

cet-check_gpu

(this verifies GPU-related imports)

And:

cet-check_imports

(this loads a small matrix in VRAM to verify that PyTorch and CuPy are actually being used)

Updating without internet access

On a machine without internet access (for example a cluster), the package can be updated in place from a local folder of versioned snapshots (YYYY-MM-DD-v1, YYYY-MM-DD-v2, ...):

  • cet-build_update_folder -o <folder> builds a new snapshot of the repository on a machine that has the git history.
  • cet-update -i <folder> copies new and changed files from the most recent snapshot over the installed checkout, backs up replaced files, and runs pip install -e . at the end. Use --dry-run to preview the changes.

The GUI has an update button that runs the same command.

Quick start

Create a desktop shortcut:

cet-create_shortcut

Or launch the GUI directly from the terminal with:

cet-gui

Or run the pipeline from the command line. Copy src/cet/pipelines/settings/default_settings.yaml, set base_folder and the other fields for your experiment, and run:

python -m cet.pipelines.pipeline path/to/settings.yaml

Every processing step is also a standalone module. Run python -m <module> -h to see its options.

Commands

cet-options lists all commands.

Group Commands
GUI cet-gui, cet-napari, cet-create_shortcut
Diagnostics cet-options, cet-version, cet-check_imports, cet-check_gpu, cet-check_java, cet-test_gpu
Setup cet-update, cet-build_update_folder, cet-download_cp_models, cet-download_jdk, cet-download_loci_jar, cet-download_pycudadecon

License

BSD-3. See LICENSE.md.

Metadata

Release files for elegant-toolkit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elegant-toolkit 0.1.0
File Size Uploaded Provenance Actions
elegant_toolkit-0.1.0.tar.gz 783.1 kB Without provenance Details for elegant_toolkit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elegant-toolkit 0.1.0
File Interpreter ABI Platform Actions
elegant_toolkit-0.1.0-py3-none-any.whl Python 3 none any Details for elegant_toolkit-0.1.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / elegant_toolkit-0.1.0.tar.gz

Download URL elegant_toolkit-0.1.0.tar.gz
Size 783.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b13bcf1b8fce19ae8ca2a8afd4f291304fa3ba5bfb87c4373b53161d96226be0
BLAKE2b-256 checksum
How to use checksums
760b4dd2de33c927e11fd07de811a8a31a8137c03ee9f89be5c629d82d14fc59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / elegant_toolkit-0.1.0-py3-none-any.whl

Download URL elegant_toolkit-0.1.0-py3-none-any.whl
Size 855.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93a4cfa877718ca230c026531db0c6d23771bf3a8319596b06353a75b6e6402a
BLAKE2b-256 checksum
How to use checksums
26b493d2b8867a05314263ec074cafa2db5bf67c6e1e0352b9eb8f271db42206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Security for elegant-toolkit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page