Skip to content

Make PyramidContents immutable, except for pixel data - #154

Merged
stefanhahmann merged 9 commits into
mainfrom
issue-114-immutable-pyramid-contents
Oct 27, 2026
Merged

stefanhahmann merged 9 commits into
mainfrom
issue-114-immutable-pyramid-contents

Conversation

@stefanhahmann

@stefanhahmann stefanhahmann commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #114. OmeZarr caches one PyramidContents for all openers, so a caller that changed a transform or the OMERO metadata changed every later display.

Images stay shared, not copied. Copying a lazy CachedCellImg would read the whole dataset, and ImageJ edits showing up in BDV may even be considered a feature, cf. (#148).

Breaking API changes

ome-zarr-imglib2

  • PyramidContents: public fields replaced by accessors
    • name, type, omero, hasPlaceholderCalibration → name(), type() (a new instance per call), omero(), hasPlaceholderCalibration()
    • transforms[ level ] → transform( level ) (a copy)
    • axesPerLevel[ level ] → axes( level ) (an unmodifiable List)
    • cachedCellImgs[ level ] → asImg( level )
  • Omero and its nested Rdefs, Channel and Window are final: public fields replaced by constructors and accessors, e.g. omero.channels() (unmodifiable), channel.window().start()

ome-zarr-n5, ome-zarr-zarrjava, ome-zarr-fiji, ome-zarr-fiji-ui

No API changes.

🤖 Generated with Claude Code

@stefanhahmann stefanhahmann self-assigned this Oct 22, 2026
@stefanhahmann
stefanhahmann requested a review from xulman October 23, 2026 08:50
@stefanhahmann
stefanhahmann force-pushed the issue-114-immutable-pyramid-contents branch from 605c812 to ca49d30 Compare October 26, 2026 13:41
@stefanhahmann
stefanhahmann force-pushed the issue-114-immutable-pyramid-contents branch from ca49d30 to 603feaa Compare October 26, 2026 14:25
stefanhahmann and others added 9 commits October 27, 2026 12:40
Both were public fields. They are now private behind name() and
hasPlaceholderCalibration(). Neither was mutable, but the remaining
fields will get accessors for issue #114, and the API should be uniform.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Its public fields let any opener change the cached contents (#114).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@stefanhahmann
stefanhahmann force-pushed the issue-114-immutable-pyramid-contents branch from 603feaa to 0caf669 Compare October 27, 2026 13:07
@sonarqubecloud

Copy link
Copy Markdown

@stefanhahmann
stefanhahmann merged commit 30d4a89 into main Oct 27, 2026
6 checks passed
@stefanhahmann
stefanhahmann deleted the issue-114-immutable-pyramid-contents branch October 27, 2026 14:10
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.

PyramidContents isn't (entirely) immutable

1 participant