Skip to content

Add OME-Zarrs to an already open BigDataViewer - #150

Merged
stefanhahmann merged 25 commits into
mainfrom
127-add-to-open-bdv
Oct 27, 2026
Merged

stefanhahmann merged 25 commits into
mainfrom
127-add-to-open-bdv

Conversation

@stefanhahmann

@stefanhahmann stefanhahmann commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Lets a second OME-Zarr, e.g. a segmentation, be added to a BigDataViewer window this plugin opened (part of #127):

  • Opener "BigDataViewer (add to active window)": adds to the BDV holding the active pyramidal, or opens a new one. The existing BDV opener is relabelled "BigDataViewer (new window)". A BDV window's active pyramidal now follows BDV's current source.
  • Drop onto a BDV window: files, folders and URLs dropped onto the image area are added to that window, regardless of the configured opener.
  • Several images at once (aka the "low-hanging fruit" of Open several currently open OME-Zarr images in BDV #108, no BigDataViewer change needed): "Open Current OME-Zarr Image in BigDataViewer" asks which of the open OME-Zarrs to show, like BDV's "Open Current Image", and shows the selected ones in one BDV window afterwards.
  • API: new OmeZarr.showInBdv(BdvHandle) and OmeZarrOpenActions.showInBdv(BdvHandle) (null = new window). BdvUtils' show/register methods are merged into show; showBdvAndRegisterWindow and the helpers are no longer public.
  • New Test data: bdv_testing/ with logo_spots (spots laid out like our logo, plus the Zarr wordmark) and their segmentation logo_labels (including OMERO colors and contrast limits).

BDV windows opened outside of this plugin are not covered by this PR; see the sketch in #127 and bigdataviewer/bigdataviewer-core#227.

🤖 Generated with Claude Code

@stefanhahmann stefanhahmann self-assigned this Oct 9, 2026
@stefanhahmann
stefanhahmann force-pushed the 127-add-to-open-bdv branch 8 times, most recently from 9211a8f to abe44ad Compare October 12, 2026 09:56
@stefanhahmann
stefanhahmann requested a review from xulman October 12, 2026 15:13
@stefanhahmann
stefanhahmann force-pushed the 127-add-to-open-bdv branch 6 times, most recently from 4ed8a1f to be870d1 Compare October 13, 2026 18:59
Comment thread ome-zarr-fiji-ui/src/main/java/ome/zarr/fijiui/open/OmeZarrDropListener.java Outdated
Comment thread ome-zarr-fiji-ui/src/main/java/ome/zarr/fijiui/open/OmeZarrDropListener.java Outdated
Comment thread ome-zarr-fiji-ui/src/main/java/ome/zarr/fijiui/open/OmeZarrDropListener.java Outdated
Comment thread ome-zarr-fiji-ui/src/main/java/ome/zarr/fijiui/open/OmeZarrOpenActions.java Outdated
Comment thread ome-zarr-fiji/src/main/java/ome/zarr/fiji/PyramidalBdv.java Outdated
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
It becomes the only focus listener, so PyramidalService and the BDV
opener share one precedence rule (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
PyramidalBdv.getBdvHandle() knew only the last of several BDVs, so a
window could check the wrong viewer (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
It is now the only AWT focus listener. PyramidalService follows it
instead of listening itself, so it and the BDV opener share one rule
for which viewer is active (review of #150). OmeZarr reports viewers
it opens itself, since their focus events arrive late.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
PyramidalBdv.getBdvHandle() knew only the last of several BDVs, so a
window could check the wrong viewer (review of #150). The opener now
asks ActiveViewerService for the active viewer and BdvUtils.bdvHandleOf
for its handle, a client property mirroring bigdataviewer-core#227.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
It is now the only AWT focus listener. PyramidalService follows it
instead of listening itself (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann added a commit that referenced this pull request Oct 23, 2026
PyramidalBdv.getBdvHandle() knew only the last of several BDVs, so a
window could check the wrong viewer (review of #150). The opener now
asks ActiveViewerService for the active viewer and BdvUtils.bdvHandleOf for its handle.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stefanhahmann and others added 23 commits October 26, 2026 15:22
BdvUtils had four similarly named show/register methods which become one show method with an optional BDVHandle param (null handle = new window, else add to that BDV). Some helpers are no longer public. The omeroChannels
test moves to BdvUtilsTest.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds the image to an already open BDV instead of opening a new one.
null opens a new window, and showInBdv() now delegates to it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The label "BigDataViewer" becomes "BigDataViewer (new window)", so it stays
distinguishable from an opener that adds to an open BDV. Its name
bdv-multi-resolution stays, as it is persisted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds the image to the BDV holding the active pyramidal via
OmeZarr.showInBdv(BdvHandle), or opens a new one if there is none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OmeZarrOpenActions gets showInBdv(BdvHandle), mirroring OmeZarr (null opens a
new window), and showInBdv() delegates to it. Both BDV openers now go through
the class OmeZarrOpenActions (like all other openers). This allows to add UI behaviour for BDV windows in one place (#127).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dropping files, folders or URLs onto the image area of a BDV windows that were opened through this plugin before adds them to that window, regardless of the configured opener
(#127).
OmeZarrDropListener parses them like pasted text, checks them with
isZarr and reads them with the user's settings. The reading happens in a separate thread.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OmeZarrDropListener had no test. This one opens logo_spots with the "add to
active window" opener, drops logo_labels onto the window's real DropTarget
(only the transferable is faked) and checks that BDV then shows both.
droppedLocations is unit tested for file lists, text and unreadable drops.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Opening logo_spots and then logo_labels: "add to active window" opens a new
window only for the first and adds the second to it, while "new window" opens
one window per image.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lists the OME-Zarrs that are open, once per PyramidContents

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A dialog to choose from a subset from a list of given OME-Zarrs based on PyramidContents

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Shows several OME-Zarrs in one new BDV window, one pyramidal each, so
callers no longer thread the BdvHandle through a loop themselves.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…OME-Zarr images at once.

The command previously opened only the active OME-Zarr. With more than one open, in ImageJ or BDV, it now asks which to show, via OmeZarrImagesChooser, and
shows them in one new BDV window, like BigDataViewer's own "Open Current Image" does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It is now the only AWT focus listener. PyramidalService follows it
instead of listening itself (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PyramidalBdv.getBdvHandle() knew only the last of several BDVs, so a
window could check the wrong viewer (review of #150). The opener now
asks ActiveViewerService for the active viewer and BdvUtils.bdvHandleOf for its handle.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Named like withDefaultBackend

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Not once per dropped location (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It reports the data transfer, not the opening (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It only works on BDV windows (review of #150).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@xulman xulman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified in a Zoom call. Now I'm happy :)

Comment thread ome-zarr-fiji/src/main/java/ome/zarr/fiji/PyramidalBdv.java Outdated
Comment thread ome-zarr-fiji/src/main/java/ome/zarr/fiji/PyramidalBdv.java Outdated
@stefanhahmann
stefanhahmann merged commit f3340b5 into main Oct 27, 2026
6 checks passed
@stefanhahmann
stefanhahmann deleted the 127-add-to-open-bdv branch October 27, 2026 10:34
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