Skip to content

fix(OutputImage): support information-only image outputs#1545

Open
vboussot wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
vboussot:fix/downsample-information-only
Open

fix(OutputImage): support information-only image outputs#1545
vboussot wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
vboussot:fix/downsample-information-only

Conversation

@vboussot

Copy link
Copy Markdown

Summary

  • allow memory-I/O image outputs with an empty buffered region
  • reshape Python image data from bufferedRegion.size while preserving the
    largest possible image size
  • apply the same buffered-region reconstruction in Pyodide
  • add native, Python runtime, and Pyodide regression coverage

Context

downsample_bin_shrink(..., information_only=True) calls
UpdateOutputInformation() and intentionally produces output metadata without
allocating a pixel buffer. OutputImage currently aborts when that legitimate
buffer has zero bytes. After removing the abort, the Python runtime also needs
to reshape data from the buffered region rather than the largest possible
region; otherwise it attempts to reshape an empty array to the logical image
size.

This breaks the metadata pre-pass used by itkwasm-downsample-cucim==0.2.0
for Gaussian and bin-shrink downsampling.

Downstream report: fideus-labs/ngff-zarr#577

Validation

  • core Python tests excluding browser-only tests: 28 passed, 2 skipped
  • focused native itkPipelineMemoryIOTest: passed
  • C++ files pass clang-format --dry-run --Werror
  • full native build reached and compiled the modified test, but the aggregate
    target was blocked by an unavailable pre-existing external test object:
    TransformSequence.h5
  • WASI package rebuild was not available locally because Docker/Podman is not
    installed
  • the Pyodide wheel built successfully, but all browser tests were blocked at
    setup because the local Chrome instance exited before creating a session

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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