Skip to content

Fast4DRegPy as a LabConstrictor app: installers, PyPI, napari and Fiji tools, docs - #7

Merged
guijacquemet merged 8 commits into
mainfrom
claude/keen-mendel-ekvei7
Nov 16, 2026
Merged

guijacquemet merged 8 commits into
mainfrom
claude/keen-mendel-ekvei7

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Turns Fast4DRegPy into a LabConstrictor app in the same repository, without changing the registration code.

What it adds

  • Template 0.1.31 (installers for Windows, macOS, Linux; PyPI at each release; weekly template sync), copied without the template's own tests and lint settings, and filled in as the setup form does with the package name fast4dreg. No template git history is merged; the sync works through .template_sync/manifest.yaml.
  • PyPI (fast4dregpy): pyproject.toml stays the package description. Its version must equal the release tag; the PyPI step stops, without uploading, otherwise (the release tags the commit before the version bump, so a dynamic version would publish the previous one). setup.py (what the installer ships) has no python_requires or install_requires, which would override pyproject.toml on PyPI (it had turned Requires-Python into >=3.12). __version__ now comes from the installed metadata.
  • Notebook notebooks/Fast4DRegApp/ with its pinned environment (requirements.yaml: Python 3.12, NanoPyx 2.1.4, pandas for the tool tables). It now offers every Fast4DReg setting, and its install cell works in Colab only.
  • napari / Fiji tools (src/fast4dreg_lc_tools/): Correct drift (time-lapse) and Align channels, calling only the public API. Hosts send arrays without axis names, and Fast4DRegPy never guesses them, so each tool asks for the axes and refuses ones that don't fit, with the image's shape. Hosts: notebook, napari, fiji (QuPath off).
  • Installer images and icon from the Fast4DReg logo (MIT).
  • Docs in the style of NucleiSky and Fast4DReg: README, plus docs/ (index, installation, workflow with every setting, napari and Fiji, Python guide, troubleshooting, development and releases). The speed comparison is in docs/validation.md.

Checks

  • pytest: 90 passed on Python 3.12 and 3.10; ruff clean. tests/test_lc_tools.py checks that the tools recover known drift (asymmetric fixtures, whole-pixel offsets) within 0.4 px. labconstrictor-tools test: 9/9 cases. CI installs Tools at the installer's pin for both.
  • Template checks: manifest valid, no placeholders left; pypi_package.py builds fast4dregpy 0.5.0 (Requires-Python <3.14,>=3.10) and refuses a mismatched tag.
  • Simulated installed app (setup.py + src only, pinned requirements, registration with --app-manifest): imports, and registers with hosts notebook/napari/fiji. napari UI audit 21/21; Fiji UI audit 19/19, after LabConstrictor-Tools#163, which fixes Fiji not opening 3-plane results.
  • Published movie (Zenodo 7514913): the repo's full validation passes the strict gate on this branch. Through the tool (real worker), the corrected movie is voxel-identical to the library's, and the drift is 0.0047 px from Fiji and 0.11 px from the known drift.
  • Speed on the same 4-CPU machine, Fiji settings: Fiji macro 32 s; Python 40.4 s with 1 worker, 16.0 s with 4; through the tool 41.8 s and 18.3 s.

Known limits (documented)

  • The 3-plane Fiji result fix reaches apps only when the installer's Tools pin moves past LabConstrictor-Tools#163.
  • In Fiji, a corrected 4D movie opens as one stack; use Stack to Hyperstack.
  • Z drift isn't measured on stacks of about 10 slices or fewer (it is on 20). This is a library behaviour, now documented.
  • The repository is private: releases, Colab, the App Centre and installer downloads need it to be public.

After merge

The notebook workflow generates the lock files on main. For a release: set the version in pyproject.toml, then publish the tag. For PyPI: add the pending publisher on pypi.org and set PYPI_PUBLISH=true (see docs/development.md).


Generated by Claude Code

The files that build installers for Windows, macOS and Linux and publish
the package on PyPI at each release, copied from the template at 0.1.31
(without its own tests and lint settings) and filled in as the template's
setup form does, with fast4dreg as the package name. The template-sync
workflow keeps them up to date with migrations; no template history is
merged.

- labconstrictor-app.yaml: the App Centre description; hosts notebook,
  napari and fiji (not QuPath); distribution.pip fast4dregpy.
- setup.py is what the installer uses (only it and src/ are shipped). It
  has no python_requires or install_requires, which would override
  pyproject.toml in the package on PyPI.
- pyproject.toml stays the description of fast4dregpy; its version must
  equal the release tag (the PyPI step stops otherwise).
- __version__ comes from the installed metadata (fast4dregpy from PyPI,
  fast4dreg from the installer).
- LICENSE and README are Fast4DRegPy's; .gitignore and MANIFEST.in merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
notebooks/Fast4DRegApp/ holds the notebook and requirements.yaml, the
pinned environment of the installed app (Python 3.12, NanoPyx 2.1.4, and
pandas for the tables of the napari and Fiji tools). requirements.txt and
requirements_gpu.txt are generated from it by the template's script, as
the notebook workflow does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
src/fast4dreg_lc_tools declares two LabConstrictor tools that call
register_time and register_channels and return the corrected image and
the (dz, dy, dx) table. Hosts send arrays without axis names and
Fast4DRegPy never guesses them, so each tool asks for the axes and
refuses, with the image's shape, axes that do not fit, Z correction
without a Z axis, or a missing T / C axis. A ValueError of Fast4DRegPy
becomes a tool error the person can read.

lc_tests/: fixtures cut out of one scene at known whole-pixel offsets
(make_fixtures.py) and the cases napari and Fiji are checked with.
tests/test_lc_tools.py: the tools find the known drift within 0.4 px.
The tests workflow installs labconstrictor-tools at the installer's pin
and runs both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
The symbol of the Fast4DReg logo (MIT, Fast4DReg repository) is the app
icon (PNG, ICO, ICNS, made as the LabConstrictor setup form makes them)
and the App Centre icon; the installer has a banner and a header with
it. Wired in as the setup form does: construct.yaml (images and
extra_files) and the launcher's icons per platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
In Colab it installs Fast4DRegPy from GitHub and mounts Google Drive; in
the app and in a local Python it does nothing (the package is there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
Adds time averaging, maximum expected drift, crop output, extend Z, the
reslice mode and the output type, so the notebook offers what the Fiji
dialog offers. Only calls the public API. Checked by running the notebook
on a 3D time-lapse and a 3-channel image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
README: the Fast4DReg logo and pipeline figure, what it is, four ways to
use it (desktop app, napari / Fiji, Colab, Python), key capabilities,
three things to get right, a documentation index and the citations
(Fast4DReg, NanoJ, NanoPyx).

docs/: index (choose your path), installation, step-by-step workflow with
every setting (Fast4DReg's walkthrough, with the names of the Fiji dialog
and of Python), napari and Fiji with screenshots, the Python guide (the
API text of the old README), troubleshooting with the real error
messages, development and releases (tests, tools, the template files,
PyPI, App Centre). validation.md gains the timings against the Fiji
macro and through the napari / Fiji tool on the published movie.

Links to the LabConstrictor website are checked (HTTP 200).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6VXx7mT1FYsKmB1184
@guijacquemet
guijacquemet merged commit 4c77185 into main Nov 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants