Repository navigation
Report a malformed OME-Zarr labels group as unreadable_mask - #41
Merged
Merged
Conversation
find_masks caught the NgffError from reading an OME-Zarr image's labels group, logged it at info level and went on. When every image of a mask type was affected, the type vanished from the inventory and mask_missing never fired, so those objects were silently not measured. The group is now the error unreadable_mask with the path <image>/labels, which stops check, run and the masks command. Without the zarr extra label images are still skipped, as documented. Fixes #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
This was referenced Oct 29, 2026
…-labels # Conflicts: # docs/contract.md # docs/user_guide.md # src/morphobricks_preprocessing/masks.py # tests/test_masks.py
Contributor
Author
|
Merged main (#40, #42, #43, #44) in:
1121 passed, 1 skipped (test_discovery.py:472, root), ruff clean, CI 7/7 green on 0ddd360. Merging. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #38.
labelsgroup cannot be read,_label_masksnow returns its path,<image>/labels. Examples are a group that does not list its label images, or a store that fails to open.find_masksreports these paths under the existing errorunreadable_mask, together with masks whose headers cannot be opened.zarrextra, label images are still skipped quietly, asfind_masksdocuments. In that case the OME-Zarr image itself is unreadable and already reported.unreadable_maskrow in user guide §8 now cover this case.Why
The
NgffErrorwas logged at info level and then ignored. If every image of a mask type was affected, that type disappeared from the inventory andmask_missingnever fired. Those objects were then not measured, and nothing said so.Notes for review
unreadable_maskis reused, with an extended action text.Tests
tests/test_masks.py::test_a_malformed_labels_group_is_an_error_not_a_vanished_mask_type. It uses two OME-Zarr images whoselabelsattribute is not a list. It checks bothpreflightand thatrun_experimentis blocked.MaskInventory(types=(), files=(), issues=())and.okis True.test_discovery.py:472: running as root ignores file modes.ruff check .andruff format --check .are clean.Generated by Claude Code