Fix custom-center rotation and channel offsets #1184
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 172 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1184"
general
weight: 0.35
gigony
closes #1180
Summary
This PR fixes two issues in
cucim.skimage.transform.rotatewhen constructingan affine transform for images with trailing channel or batch dimensions.
With a custom center and
resize=False, the output shape remainedNone.Appending the trailing dimensions raised
TypeError: unsupported operand type(s) for +: 'NoneType' and 'tuple':With
resize=True, the call completed but placed the spatial translation inthe channel-coordinate column of the larger affine matrix. Each channel
therefore received a different spatial offset, causing color separation:
Initialize the spatial output shape to the input's first two dimensions, then
replace it with the computed bounds when resizing. Embed the 2D rotation in
the larger identity matrix with translation in its final column, preserving
independent channel and batch dimensions. The corrected shape and channel
behavior matches scikit-image.
Regression tests compare grayscale, RGB, and RGBA rotations with scikit-image
for orders 0 and 1. Additional tests check independent trailing dimensions
for orders 0, 1, and 3, with and without resizing.