Skip to content

feat: filaments, instance segmentations and compact instance browsing (v2.0) - #74

Merged
uermel merged 4 commits into
v2.0from
uermel/filaments-instances-v2
Oct 6, 2026
Merged

uermel merged 4 commits into
v2.0from
uermel/filaments-instances-v2

Conversation

@uermel

@uermel uermel commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

v2.0 counterpart of #73. Shared, viewer-independent support for copick's filaments and instance / panoptic segmentations, used by napari-copick (copick/napari-copick#50) and chimerax-copick (copick/chimerax-copick#112).

  • Types (core/types.py): object and segmentation type detection (binary, multilabel, instance, panoptic) and filament specs, tolerant of older copick.
  • Filament editing (util/filament_session.py, util/filaments.py): FilamentEditSession with add / move / remove control points, new, reverse, delete, convert, cut and join. Curves are regenerated through copick core's curve API. Undo / redo history that hosts can mirror. Pick sampling along filaments and direction markers.
  • Instances (util/instances.py): shared instance colours (same IDs, same colours in every viewer), ID sets, label counts, merge / delete, browser rows with compact titles and captions.
  • Widgets:
    • InstanceBrowserWidget: step, focus, show / hide, filter, sort menu, new / delete / merge / reverse, selection signal.
    • compact_delegate: two-line / inline compact rows, outline selection, header sort menu, wrap-around arrow keys.
    • FlowLayout: wrapping rows that keep native button heights.
  • Fixes: the Edit Object Types dialog keeps object metadata, which it used to drop, and edits filament specs. The info widget, data worker, URI widget and CLI forms know filaments and segmentation types.

Depends on

Testing

  • pytest tests: 103 passed, 3 skipped.
  • Exercised end to end through the napari-copick and chimerax-copick self-tests on a CryoET Data Portal test project.

🤖 Generated with Claude Code

Shared, viewer-independent support for the copick filament and instance/panoptic
segmentation features, used by napari-copick and chimerax-copick:

- core/types.py: copick object / segmentation type detection (binary, multilabel,
  instance, panoptic) and filament specs, tolerant of older copick versions.
- util/filaments.py and util/filament_session.py: FilamentEditSession, the editing
  state for traced filaments (insert/move/remove control points, new, reverse, delete,
  convert, cut and join), all regenerated through copick core's curve API, with an
  undo/redo history that hosts can mirror; pick sampling along filaments and
  direction markers.
- util/instances.py: instance colours shared by all viewers, ID sets, label counts,
  merge/delete, and the rows and compact titles/captions of the instance browser.
- widgets/instances/instance_browser.py: InstanceBrowserWidget (step, focus,
  visibility, filter, sort menu, new/delete/merge/reverse, shared selection).
- widgets/compact_delegate.py: two-line / inline compact rows (swatch, name, type chip,
  caption) with outline selection, a header sort menu and wrap-around arrow keys.
- widgets/flow_layout.py: wrapping rows that keep native button heights.
- Edit object types dialog keeps object metadata and edits filament specs; info
  widget, data worker, URI widget and CLI forms know filaments and segmentation types.

Requires copick >= 2.0.0a2 (the v2.0 twins copick/copick#481, #482, #493, #495). The v2.0 counterpart of
the main-branch change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. Pin and lock it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/napari-copick that referenced this pull request Oct 6, 2026
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. The copick-shared-ui alpha with the filament / instance helpers (copick/copick-shared-ui#74)
follows 2.0.0a2 as well, so require 2.0.0a3 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/chimerax-copick that referenced this pull request Oct 6, 2026
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. The copick-shared-ui alpha with the filament / instance helpers (copick/copick-shared-ui#74)
follows 2.0.0a2 as well, so require 2.0.0a3 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel and others added 2 commits October 6, 2026 01:17
The wheel / bundle metadata checks still expected the 2.0.0a1 floor; the requirements now start at 2.0.0a3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only restated the dependency floors from pyproject.toml and had to be edited on every version bump. The test
workflow still builds the wheel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uermel
uermel marked this pull request as ready for review October 6, 2026 08:19
@uermel
uermel merged commit 763861b into v2.0 Oct 6, 2026
6 checks passed
uermel pushed a commit that referenced this pull request Oct 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.0.0-alpha.3](copick-shared-ui-v2.0.0-alpha.2...copick-shared-ui-v2.0.0-alpha.3)
(2026-10-06)


### ✨ Features

* filaments, instance segmentations and compact instance browsing (v2.0)
([#74](#74))
([763861b](763861b))

---
Merging this PR will publish a copick-shared-ui alpha prerelease to
PyPI.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
uermel added a commit to copick/napari-copick that referenced this pull request Oct 6, 2026
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. The copick-shared-ui alpha with the filament / instance helpers (copick/copick-shared-ui#74)
follows 2.0.0a2 as well, so require 2.0.0a3 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/napari-copick that referenced this pull request Oct 6, 2026
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. The copick-shared-ui alpha with the filament / instance helpers (copick/copick-shared-ui#74)
follows 2.0.0a2 as well, so require 2.0.0a3 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/napari-copick that referenced this pull request Oct 6, 2026
…s (v2.0) (#50)

## Summary
v2.0 (Zarr v3) counterpart of
#49. napari support for
copick's filaments and instance / panoptic segmentations, with
annotation tools.

- **Tree**:
- a Filaments node, and separate Segmentations / Instance / Panoptic
nodes;
- one item per segmentation, so same-key segmentations of different
types no longer collide;
  - delete and edit actions.
- **Display**:
  - filaments as centreline samples with direction arrows;
  - picks of filament objects coloured by instance;
  - instance segmentations in the shared instance colours;
  - panoptic segmentations as label and segment layers (read-only).
- **Saving**:
  - a segmentation type selector (binary / multilabel / instance);
  - labels are no longer narrowed to uint8;
  - values are validated per type;
- filament sets can be saved, optionally with sampled picks, which
replace that picks set after a confirmation.
- **Annotate tab**:
- the shared instance browser (step, focus, show / hide, sort, filter,
compact rows) for picks, filaments and instance segmentations;
- filament tracing: control points, insert position, reverse, delete,
**join**, convert;
- instance editing: paint / erase / fill / pick, merge, delete, recount.

## Depends on
- **Stacked on #48 (v2.0
port of #47); this PR's diff is only the new work.
- copick-shared-ui >= 2.0.0a3, the alpha that will contain
copick/copick-shared-ui#74 (2.0.0a2 does not)
- copick >= 2.0.0a3 (released; the first published v2.0 alpha with
copick/copick#481, #482, #493, #495). CI installs copick-shared-ui from
PyPI, so it passes once 2.0.0a3 (with #74) is published.

## Testing
- `pytest src/napari_copick/_tests`: 46 passed.
- Scripted end-to-end self-test in napari (26 checks) on a CryoET Data
Portal test project with filaments, picks, instance and panoptic
segmentations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/chimerax-copick that referenced this pull request Oct 6, 2026
copick 2.0.0a2 never reached PyPI (the release setup skipped it); 2.0.0a3 is the first published v2.0 alpha with
filaments, curves, instance and panoptic segmentations. The copick-shared-ui alpha with the filament / instance helpers (copick/copick-shared-ui#74)
follows 2.0.0a2 as well, so require 2.0.0a3 there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uermel added a commit to copick/chimerax-copick that referenced this pull request Oct 6, 2026
…lbar and Annotate window (v2.0) (#112)

## Summary
v2.0 (Zarr v3) counterpart of
#111. ChimeraX support for
copick's filaments and instance / panoptic segmentations, with editing
tools, a Copick Annotate window and a Copick Edit toolbar tab.

**Display and data**
- **Filaments**:
  - a Filaments tab with a stepper (`<< k of N >>`, `fp` / `fn`);
- filament sets drawn as tubes in instance colours, with direction
arrowheads;
  - control-point handles while editing.
- **Segmentations**:
- the Segmentations tab shows types (binary, multilabel, instance,
panoptic);
- instance and panoptic segmentations are drawn as per-instance
surfaces;
- deleting a segmentation now passes its type, so a same-key
segmentation of another type is kept (data-loss fix).
- **Tables**: compact two-line object tables (swatch, name, type chip /
"user · session"), a header sort menu, outline selection, search across
user / session / type, and wrap-around arrow keys.

**Editing**
- **Filaments**:
  - trace mouse mode (add / drag / remove control points) and cut mode;
- join (also on tubes selected in the 3D view; the 3D selection and the
filament list share one selection), reverse, delete, convert;
  - save, optionally with sampled picks.
- Every filament edit is a step on ChimeraX's undo stack: Cmd/Ctrl+Z,
including in copick's keyboard-shortcut mode.
- **Instances**: paint / erase / pick-ID mouse modes, brush sizes, new
ID, merge, delete, undo, save.
- **Copick Annotate window**:
- Filaments, Instances and Pick instances pages, using the shared
instance browser;
- tabbed with the right-hand panel group and kept in front when ArtiaX
raises its options panel.
- **Copick Edit toolbar tab** (31 buttons, at most as many as the Copick
tab):
  - annotate, new picks / filaments / instances, save all;
  - common particle tools;
  - filaments, instances, brush sizes and pick colours.
  - Particle tools stay in the Copick tab as before.
- **Commands, shortcuts, docs**: `copick filament …`, `copick instance
…`, `copick annotate`, `copick save`, `copick colorpicks`; filament /
instance shortcuts; documentation pages.

## Depends on
- **Stacked on #110
(v2.0 port of #108); this PR's diff is only the new work.
- copick-shared-ui >= 2.0.0a3, the alpha that will contain
copick/copick-shared-ui#74 (2.0.0a2 does not)
- copick >= 2.0.0a3 (released; the first published v2.0 alpha with
copick/copick#481, #482, #493, #495). CI installs copick-shared-ui from
PyPI, so it passes once 2.0.0a3 (with #74) is published.

## Testing
- `pytest tests -m "not chimerax"`: 35 passed.
- Scripted self-tests driving ChimeraX Daily over REST, on a CryoET Data
Portal test project with filaments, picks, instance and panoptic
segmentations:
  - display, tables, stepper, saving: 39 checks;
  - undo / cut / join / 3D-selection: 53 checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant