Skip to main content

tomviz-kernels

The operators / node kernels shared by the tomviz desktop application and its web version, tomviz-web. Both applications depend on this package, so a fix or a new kernel lands in one place.

Layout

Every kernel is a pair of files in src/tomviz_kernels/:

  • Name.py, the script;
  • Name.json, its description: name, label, description, parameters, ports, and the catalog fields path and tags.

Two flavors coexist:

  • v1 operators (most of them): a module-level transform(dataset, ...) function or a tomviz.operators.Operator subclass; the description has no schemaVersion and may set inputType / outputType.
  • Schema-v2 kernels: "schemaVersion": 2, inputs / outputs port lists, and a single tomviz.nodes.TransformNode or SourceNode subclass (a source when there are no inputs).

Converting the v1 operators to schema v2 is planned, but not done yet.

The scripts are not imported from this package. A host application reads them and runs them through its pipeline, which provides the tomviz.* modules they import: the desktop's own tomviz package, or tomviz-pipeline's aliases for tomviz.operators, tomviz.nodes, tomviz.utils and tomviz.dataset.

Catalog fields

Each description has path and tags:

"path": ["Data Transforms", "Filters & Smoothing"],
"tags": ["gaussian", "blur", "smoothing", "filter", "denoise"],

path places the kernel in the web catalog's tree and tags feed its search. The desktop builds its menus in C++ and ignores both.

Dependencies

The package declares no runtime dependencies. The host provides NumPy, SciPy and tomviz-pipeline. Some kernels need more, imported when they run: tomopy, pyfftw, pystackreg, scikit-image, bm3d, and for the SAM kernels torch, sam2 / sam3 (external environments only).

Use

import tomviz_kernels

tomviz_kernels.directory()  # Path of the directory holding the files
tomviz_kernels.names()      # ['AddConstant', 'AddPoissonNoise', ...]
  • tomviz-web: list the tomviz_kernels module in the catalog. It scans the module's directory for Name.json / Name.py pairs and skips __init__.py.
  • tomviz desktop: install the contents of directory() into share/tomviz/scripts, where readInPythonScript / readInJSONDescription read them today.

Neither application has switched over yet.

Provenance

The kernels were imported from the tomviz desktop repository, branch 3.1 at d0c9879f (2026-09-24). Where the two applications had diverged, the desktop version was kept. path and tags were ported from tomviz-web's builtin_kernels at 59a8145d. They were drafted for the kernels tomviz-web did not have, following where the desktop menus place them.

Until the desktop reads its kernels from here, a fix made to its copy has to be ported. To list those changes: git -C tomviz diff d0c9879f -- tomviz/python.

These stayed in the desktop, because they only make sense there:

  • the custom-transform templates DefaultCustomTransform, NewCustomTransform and DefaultITKTransform;
  • Recon_real_time_tomography, which needs tomviz._realtime;
  • PtychoSource and PyXRFSource, driven by the desktop's beamline workflows;
  • the kernels built on tomviz.itkutils and the ITK the desktop bundles: BinaryMinMaxCurvatureFlow, ElastixRegistration, LabelObjectAttributes, LabelObjectDistanceFromPrincipalAxis, LabelObjectPrincipalAxes, OtsuMultipleThreshold, PeronaMalikAnisotropicDiffusion, SegmentParticles and SegmentPores;
  • ManualManipulation, whose rotations need ITK and whose parameters are set by the desktop's interactive widget;
  • the SAM conda environment files (tomviz/python/environments).

Development

pip install -e ".[dev]"
pytest
flake8 --config setup.cfg src/tomviz_kernels/__init__.py tests

The tests check every kernel's contract (a script and a description with path and tags, unique names), build a tomviz-pipeline node from every description, and run a few cheap kernels end to end. Kernels whose optional dependencies are missing are skipped.

The kernel scripts are kept identical to the desktop copies they came from and are not linted yet.

To add a kernel, put Name.py and Name.json in src/tomviz_kernels/. The description needs a unique name, plus path and tags.

To release, bump __version__ in src/tomviz_kernels/__init__.py, tag v<version>, and publish a GitHub release. publish.yml then uploads to PyPI through trusted publishing.

Metadata

Release files for tomviz-kernels 3.2.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 tomviz-kernels 3.2.1
File Size Uploaded Provenance Actions
tomviz_kernels-3.2.1.tar.gz 99.0 kB With provenance Details for tomviz_kernels-3.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tomviz-kernels 3.2.1
File Interpreter ABI Platform Actions
tomviz_kernels-3.2.1-py3-none-any.whl Python 3 none any Details for tomviz_kernels-3.2.1-py3-none-any.whl

Total release size: 252.6 kB

Release files / tomviz_kernels-3.2.1.tar.gz

Download URL tomviz_kernels-3.2.1.tar.gz
Size 99.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b34cac2bb4274c31ec0d70299c7841816d5ba861286c7288fd99f0bcb8abc365
BLAKE2b-256 checksum
How to use checksums
4ce4ea4b26a5a5d28214c82be0a942d3d14ab535c0c880391f1c3b0f72f03141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / tomviz_kernels-3.2.1-py3-none-any.whl

Download URL tomviz_kernels-3.2.1-py3-none-any.whl
Size 153.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab0e30e75ce906e54f9cd0f591b74d84f46f3e23c08facc12becf8e6ed1af0cc
BLAKE2b-256 checksum
How to use checksums
45e25bd75128cdfa9fbefe2820df3952a3ee19641f40839460aa25beac85e755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for tomviz-kernels 3.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tomviz_kernels-3.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

3.2.1 This release

2 release files Full provenance

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