Skip to content

Preserve declared grayscale volume and RGB TIFF semantics - #24

Merged
trissim merged 1 commit into
mainfrom
fix/declared-tiff-pixel-axes
Oct 3, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/declared-tiff-pixel-axes

Conversation

@trissim

@trissim trissim commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

A declared three-plane grayscale (3, 4, 5) volume currently receives RGB TIFF tags because tifffile infers samples from its shape. Reload can then reinterpret Z as a channel axis. Four-plane grayscale volumes have the same ambiguity with RGBA.

TiffConfig now owns explicit photometric interpretation, dimension identities, and planar sample layout. The disk writer validates declared rank before writing pixels and forwards these options through the existing tifffile boundary. Semantic-only declarations remain active without compression and only reach TIFF paths. Default unconfigured writes and existing lossless compression retain their behavior.

OpenHCS intrinsic-volume materialization is the production consumer: its existing image-format owner derives configuration from declared image metadata before array normalization. This change adds no shape-based color detection, payload wrapper, or backend cache. Planar samples are supported immediately before the final two spatial dimensions; unsupported or conflicting declarations fail explicitly.

Validation: PYTHONPATH=/var/tmp/polystore-declared-tiff-20261003/src taskset -c 3 /home/ts/code/projects/openhcs/.venv/bin/python -m pytest tests/test_disk_backend.py -q — 15 passed. Controls cover exact pixels and native headers for grayscale ZYX depths 3/4, RGB YXS/SYX/ZSYX, invalid rank/layout, mixed-format uncompressed batching, and existing compression/payload normalization. git diff --check and production config Ruff pass. The test-file Ruff check still reports the pre-existing C408 at line 58 (unchanged verified-source fixture); no unrelated cleanup was included.

No installed dependencies or shared runtime environment were changed. No performance improvement is claimed by this scientific correctness fix.

Closes #23

Copilot AI balanced review requested due to automatic review settings October 3, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit 1d72165 into main Oct 3, 2026
5 of 11 checks passed
@trissim

trissim commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Concrete ordinary-install dependency closure from OpenHCS main after Root394: main9f75 imports TiffPhotometric and TiffPlanarConfig from polystore.config during the real MCP CLI entrypoint. Published polystore0.3.1 (wheel d1c81414f9b5ec1373a68a41bf704ec76c4b1f60a1ea0f00bb031bc8ae264e50) lacks these declarations, so the copied future target fails PREMCP ImportError; no science/native operation launched. This PR24 and mergedPR26 source89deeef3662eabb11bc520fad9acd976698636bd contain the required original owners, but still declare version0.3.1 already published from older source. Please coordinate the original reviewed release of this API as0.3.2 (or provide the actual newer release pointer); standing user authorization covers dependency publication. Planck owns OpenHCS dependency-floor/future-package receiving only and will raise its stale>=0.3.0 floor to the actual containing release. No shared prefix edit, enum alias/class shadow, republishing0.3.1 or weak fallback. Original negative is engineering-wholemain-after394-20261004/mcp01.stdout; package/source proof and ObjectState119 publication preserved. Need named original PolyStore release owner/source release checkpoint, not a competing runtime implementation.

@trissim

trissim commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Current owner check complete: no active publication claim/run, latest official0.3.1; existing main544919 contains merged reviewed APIs. Planck now owns original0.3.2 patch release via reused released polystore-release-030 checkout. Version-only source checkpoint0fdf621 published on release/0.3.2-tiff-contract-20261004 and visible draftPR; existing trusted publisher/tag will be used after qualified local/real affected consumer checks. This continues the same601/602 dependency closure, no source workaround, shared installation or duplicate runtime patch.

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.

Preserve declared TIFF spatial and sample axes when writing grayscale volumes

2 participants