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.1

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.1
File Size Uploaded Provenance Actions
elegant_toolkit-0.1.1.tar.gz 785.0 kB Without provenance Details for elegant_toolkit-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / elegant_toolkit-0.1.1.tar.gz

Download URL elegant_toolkit-0.1.1.tar.gz
Size 785.0 kB
Tags Source
SHA-256 checksum
How to use checksums
22b0a2f83c52b612fcfd310d7806600b70cc008b5d415c202d2e1b22f0c75932
BLAKE2b-256 checksum
How to use checksums
702590b750969d1aaab61134dcdf6b8961f90957c429e0ea2ca988df4f5bce84
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.1-py3-none-any.whl

Download URL elegant_toolkit-0.1.1-py3-none-any.whl
Size 855.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6b2ef68f141180cfac0a2abbbccdee6a671122cd49a19d4ab7d3a91c70f03c4
BLAKE2b-256 checksum
How to use checksums
fb02c33d61fc82be9a89b920486d36567ddcc39eee9fbffbc2f15546621c32a1
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.1

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