Skip to content

Conversation

@thewtex
Copy link
Collaborator

@thewtex thewtex commented Jun 17, 2025

Re: #157

@thewtex thewtex force-pushed the bin-shrink-crash branch 2 times, most recently from df2b459 to eeefe4a Compare June 20, 2025 18:59
@thewtex thewtex changed the title WIP: BUG: tzyxc bin shrink crassh BUG: tzyxc bin shrink crassh Jun 20, 2025
@thewtex thewtex marked this pull request as ready for review June 20, 2025 19:00
Punt on ITK_BIN_SHRINK, but throw a more informative error.

Add multi-component support for ITKWASM_BIN_SHINK.

Re: #157
@thewtex thewtex force-pushed the bin-shrink-crash branch from eeefe4a to e912627 Compare June 20, 2025 19:03
@thewtex thewtex requested a review from Copilot June 20, 2025 19:03
@thewtex thewtex changed the title BUG: tzyxc bin shrink crassh BUG: tzyxc bin shrink crash Jun 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a bug related to bin shrink operations on images with "tzyxc" dimensions. It introduces new tests to catch the error, updates dependency versions, and adjusts helper methods to properly support scaling and error handling.

  • Added tests for ITK and ITKWASM bin shrink operations with "tzyxc" dimensions
  • Updated dependency version for itkwasm-downsample in pyproject.toml
  • Modified utility functions in _support.py, _itkwasm.py, and _itk.py to correct scaling, chunk alignment, and error handling

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/test_to_ngff_zarr_itkwasm.py Added test for ITKWASM bin shrink operation on tzyxc dimension
test/test_to_ngff_zarr_itk.py Added test to ensure ITK bin shrink raises ValueError with channel dimension
pyproject.toml Bumped itkwasm-downsample dependency version
ngff_zarr/methods/_support.py Enhanced scale factor handling by accounting for all dimensions
ngff_zarr/methods/_itkwasm.py Updated iteration over output chunk sizes and fixed list removal
ngff_zarr/methods/_itk.py Added explicit error-raising for channel dimension in ITK bin shrink
Comments suppressed due to low confidence (2)

ngff_zarr/methods/_itk.py:152

  • Consider adding an inline comment explaining why the channel dimension ('c') is not supported for ITK BinShrinkImageFilter, to help users understand the rationale behind this decision.
        if "c" in previous_image.dims:

test/test_to_ngff_zarr_itkwasm.py:110

  • [nitpick] The test function name 'test_bin_shrink_tzyxc' is very similar to 'test_bin_shrink_tczyx'; consider renaming one or adding a clarifying docstring to differentiate their intended purposes more clearly.
def test_bin_shrink_tzyxc():

@thewtex thewtex merged commit 2688b9c into main Jun 20, 2025
35 of 36 checks passed
@thewtex thewtex deleted the bin-shrink-crash branch June 20, 2025 20:28
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