Skip to content

BUG: Fix pixelType typo breaking WASM tensor round-trip - #6954

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
SID-6921:fix-wasm-symmetric-tensor-pixeltype-typo
Oct 23, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
SID-6921:fix-wasm-symmetric-tensor-pixeltype-typo

Conversation

@SID-6921

Copy link
Copy Markdown
Contributor

Fix a pixelType string typo that broke the WASM round trip for
SymmetricSecondRankTensor images, and add a regression test.

Root cause

wasm_type_from_image_type labeled these images as
"SymmetrySecondRankTensor" while pixelType_to_prefix and
image_type_from_wasm_type both expect "SymmetricSecondRankTensor",
matching the itk.SymmetricSecondRankTensor type name used in the
same branch. The mismatch made image_type_from_wasm_type raise
KeyError when converting the WASM type back to an ITK image type.

AI assistance

An AI coding agent (operating under a human developer's direction)
searched for sibling-function inconsistencies in ITK's Python
wrapping support modules, located this typo, applied the one-line
fix, and added the regression test. Verified locally against an
installed itk 5.4.7 package: reproduced the KeyError with the
original code, confirmed the fix resolves the round trip.

wasm_type_from_image_type tagged SymmetricSecondRankTensor images
as "SymmetrySecondRankTensor", a string pixelType_to_prefix does
not recognize. image_type_from_wasm_type then raised KeyError
converting the type back, breaking the image/WASM round trip for
this pixel type.
@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct labels Oct 19, 2026

@dzenanz dzenanz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good on a glance.

@dzenanz
dzenanz requested a review from thewtex October 20, 2026 12:38
@hjmjohnson

Copy link
Copy Markdown
Member

@SID-6921 Is this PR ready for review? Do you still have concerns or modifications you would like to make?

@SID-6921
SID-6921 marked this pull request as ready for review October 22, 2026 14:14
Copilot AI balanced review requested due to automatic review settings October 22, 2026 14:14
@SID-6921

Copy link
Copy Markdown
Contributor Author

Yes, ready for review. CI is clean, no outstanding concerns on my end. Marked it out of draft.

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.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Fixes the tensor type label emitted by wasm_type_from_image_type.

  • Tensor images now round-trip with a matching pixel type name.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "BUG: Fix pixelType typo breaking WASM te..." · Reviewed by Greptile

@hjmjohnson
hjmjohnson merged commit 6e432d0 into InsightSoftwareConsortium:main Oct 23, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Python wrapping Python bindings for a class type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants