-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sortImageIdsAndGetSpacing): sliceThickness and spacingBetweenSlices in case of nonstrict spacing #1752
Conversation
… using Math.abs for sliceThickness and spacingBetweenSlices
|
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
FYI @salimkanoun |
It could be negative, see https://dicom.innolitics.com/ciods/ct-image/image-plane/00180088 If you use absolute value you will reintroduce flipped NM images issue |
@@ -157,14 +157,14 @@ export default function sortImageIdsAndGetSpacing( | |||
// If possible, we use the sliceThickness, but we warn about this dicom file | |||
// weirdness. If sliceThickness is not available, we set to 1 just to render | |||
if (zSpacing === 0 && !strictZSpacingForVolumeViewport) { | |||
if (sliceThickness && spacingBetweenSlices) { | |||
if (!sliceThickness && spacingBetweenSlices) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you care about slice thickness at all - just order it starting at the preferred item, then moving to the least preferred. So maybe
if( spacingBetweenSclies ) {
...
else if ( sliceThickness)
That is, ignore the sliceThickness in the first test, OR put the slice thickness version first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment inline.
More discussion (much more) about issues with negative SpacingBetweenSlices that popped up in ITK and Slicer not so long ago: InsightSoftwareConsortium/ITK#4794 There are some nonstandard CT instances in the world (at least some in IDC that appear to have come from real modalities) where the spacing value is negative even though the standard says it should only happen for NM. |
It can be negative for spacing between slices, but our construct (zSpacing, vtk spacing) cannot be negative as far as i know |
…ion to ensure correct usage of sliceThickness and spacingBetweenSlices
@salimkanoun Actually i reverted the Math.abs and still works so most likely vtk.js Math.abs internally |
Sounds good! |
Not sure why the logic was like this, it didn't makes sense
zSpacing also should not be negative