fix(io): replace zero voxel spacing when reading images - #949
Open
PaulHax wants to merge 2 commits into
Open
Conversation
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PaulHax
force-pushed
the
paint-brush-spacing
branch
from
September 11, 2026 18:42
e5d1697 to
085defc
Compare
A MetaImage or VTI header can declare zero or non-finite voxel spacing, and an ultrasound region can declare a zero physical delta. Slice views then render blank and the paint brush throws on every pointer move because its stencil scale divides by spacing. Zero or non-finite spacing now becomes 1 on import, with a warning that measurements along that axis are not physical. Labelmaps restored from a session get the same repair so they keep the parent grid. Ultrasound region spacing is applied only when both deltas are nonzero and finite. Negative spacing is kept because its sign places the voxels.
A zero or non-finite PhysicalDeltaX or PhysicalDeltaY is broken calibration, and measurements silently fell back to the image pixel spacing. Report it to the user instead of only the console.
PaulHax
force-pushed
the
paint-brush-spacing
branch
from
September 11, 2026 20:09
085defc to
3b5cfba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Images with zero or non-finite voxel spacing left slice views blank and made the paint brush throw. Such spacing now becomes 1, and ultrasound regions with a zero delta are ignored, both with a warning.