Skip to content

fix: keep pick shifts, and default score and id for new picks (v2.0) - #110

Merged
uermel merged 4 commits into
v2.0from
uermel/keep-pick-shifts-v2
Oct 6, 2026
Merged

uermel merged 4 commits into
v2.0from
uermel/keep-pick-shifts-v2

Conversation

@uermel

@uermel uermel commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

v2.0 port of #108: keep pick shifts, and default score and ID for new picks.

  • The two commits of fix: keep pick shifts, and default score and id for new picks #108 are cherry-picked unchanged; they apply cleanly to v2.0.
  • One extra commit extends the v2.0 test harness: tests/conftest.py replaces the bundle's modules with stubs, and the tool now imports the new pick helpers from misc.pickops, so the stub provides them.

The filament / instance PR for v2.0 (#112) is stacked on this branch, as the main-branch one is stacked on #108.

Testing

  • pytest tests -m "not chimerax" on this branch alone: 33 passed, including the new test_pickops.py.

🤖 Generated with Claude Code

uermel and others added 4 commits October 6, 2026 01:36
Shifts. copick's particle centre is location + t, with t the transform's
translation. Loading set ArtiaX's shift to zero and kept only the rotation,
so a shifted pick was drawn at its location; saving wrote the rotation
alone, so storing a user's pick set erased every t in it. Load now sets the
ArtiaX shift from t (ArtiaX places a particle at origin + shift, the same
model) and save writes it back. A particle dragged in the GUI has its shift
reset by ArtiaX and is saved at its new location with t = 0.

New picks. ArtiaX zero-fills every key, so a point placed in the GUI was
saved with score 0. The particle data now starts new particles at score 1.0
and instance 0, by wrapping that one object's new_particle rather than
subclassing the format (ArtiaX restores sessions through the bundle's
get_class, which this bundle lacks). A missing score loads as 1.0, not 0.

Taking particles into the user's own set stores the open list first (it is
redrawn from storage, which discarded unsaved edits), and for filament
objects moves the incoming instance ids past the set's own, so two sets'
"filament 1" stay apart. Filament objects are coloured by instance id.
Filament detection reads copick's is_filament, or the metadata spec on
copick < 1.28.

The conversion lives in src/misc/pickops.py and is tested without ChimeraX
(pytest tests); checked against ArtiaX in ChimeraX 1.10 headless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v2.0 tests replace the bundle's modules with stubs; the tool now imports the pick identity, pose and colour
helpers from misc.pickops, so the stub provides them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pick tests (tests/test_pickops.py) exercise misc/pickops.py, which works on copick's pick models, so the portable
test environment needs copick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uermel
uermel force-pushed the uermel/keep-pick-shifts-v2 branch from a9c6f59 to 0dd26b4 Compare October 6, 2026 08:38
@uermel
uermel merged commit b53ba98 into v2.0 Oct 6, 2026
3 checks passed
uermel added a commit 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>
uermel pushed a commit that referenced this pull request Oct 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.0.0-alpha.5](chimerax-copick-v2.0.0-alpha.4...chimerax-copick-v2.0.0-alpha.5)
(2026-10-06)


### ✨ Features

* filaments, instance and panoptic segmentations, Copick Edit toolbar
and Annotate window (v2.0)
([#112](#112))
([f463801](f463801))


### 🐞 Bug Fixes

* keep pick shifts, and default score and id for new picks (v2.0)
([#110](#110))
([b53ba98](b53ba98))

---
Merging this PR will publish a chimerax-copick alpha GitHub prerelease.
It will not publish to the ChimeraX Toolshed.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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