fix(imageResliceMapper): adjust texel size calculation for anisotropi…#3465
fix(imageResliceMapper): adjust texel size calculation for anisotropi…#3465finetjul merged 3 commits intoKitware:masterfrom
Conversation
|
Update: updated the screenshot for test |
|
Good fix. This changes outline thickness from voxel space to physical space. The implication: small spacing produces thicker outlines, large spacing produces thinner ones for the same "outline thickness" paramter. Current change is already better methinks, but i'm also consitering: Normalize by the finest axis (minSpacing / (dims * spacing)) — keeps the anisotropy fix but thickness stays ~1 voxel on the finest axis. or Compute texelSize from the view-projection matrix so outlines are a fixed pixel width regardless of spacing or zoom |
…nt label outlines
|
@PaulHax please check it out |
|
Looks good, outline thickness operating in "voxel" space makes sense to me. |
|
any chance we can merge this? @sankhesh |
|
🎉 This PR is included in version 35.5.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
The label-outline thickness rendered by
vtkImageResliceMapperappears inconsistent (stretched or compressed) when the input image has anisotropic spacing. Thishappens because the texel-size uniform used for neighbor sampling in the outline shader is computed from voxel dimensions alone, ignoring the physical spacing of
each axis.
Results
Before: outline thickness varies per axis on anisotropic data — thicker along the axis with smaller spacing, thinner along the axis with larger spacing.
After: outline thickness is visually uniform across all axes regardless of spacing differences.
Changes
Sources/Rendering/OpenGL/ImageResliceMapper/index.js: ThetexelSizeuniform computation now divides byinputDims[i] * inputSpacing[i]instead of justinputDims[i], normalizing the texture-coordinate step by physical spacing so the outline kernel samples at consistent physical distances in all directions.No API changes.
Documentation and TypeScript definitions were updated to match those changes
PR and Code Checklist
npm run reformatto have correctly formatted codeTesting
CC @PaulHax