feat(Thumbnail): Display set messages support & displaying of series inconsistencies in the thumbnail (#3499)
Co-authored-by: Igor Octaviano <igoroctaviano@gmail.com>
This commit is contained in:
1 parent
aedb9d1576
commit
5302e5b62b
31 files changed
+1126
-12
No files matched your search
@@ -54,8 +54,8 @@ function hasPixelMeasurements(multiFrameInstance) {
|
||||
Boolean(sharedSequence?.PixelMeasuresSequence) ||
|
||||
Boolean(
|
||||
multiFrameInstance.PixelSpacing &&
|
||||
(multiFrameInstance.SliceThickness ||
|
||||
multiFrameInstance.SpacingBetweenFrames)
|
||||
(multiFrameInstance.SliceThickness ||
|
||||
multiFrameInstance.SpacingBetweenFrames)
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -70,8 +70,8 @@ function hasOrientation(multiFrameInstance) {
|
||||
Boolean(perFrameSequence?.PlaneOrientationSequence) ||
|
||||
Boolean(
|
||||
multiFrameInstance.ImageOrientationPatient ||
|
||||
multiFrameInstance.DetectorInformationSequence?.[0]
|
||||
?.ImageOrientationPatient
|
||||
multiFrameInstance.DetectorInformationSequence?.[0]
|
||||
?.ImageOrientationPatient
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -85,8 +85,8 @@ function hasPosition(multiFrameInstance) {
|
||||
Boolean(perFrameSequence?.CTPositionSequence) ||
|
||||
Boolean(
|
||||
multiFrameInstance.ImagePositionPatient ||
|
||||
multiFrameInstance.DetectorInformationSequence?.[0]
|
||||
?.ImagePositionPatient
|
||||
multiFrameInstance.DetectorInformationSequence?.[0]
|
||||
?.ImagePositionPatient
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -161,6 +161,7 @@ function processSingleframe(instances) {
|
||||
}
|
||||
|
||||
let missingFrames = 0;
|
||||
let averageSpacingBetweenFrames;
|
||||
|
||||
// Check if frame spacing is approximately equal within a spacingTolerance.
|
||||
// If spacing is on a uniform grid but we are missing frames,
|
||||
@@ -175,7 +176,7 @@ function processSingleframe(instances) {
|
||||
return { value: false };
|
||||
}
|
||||
|
||||
const averageSpacingBetweenFrames =
|
||||
averageSpacingBetweenFrames =
|
||||
_getPerpendicularDistance(firstImagePositionPatient, lastIpp) /
|
||||
(instances.length - 1);
|
||||
|
||||
@@ -209,7 +210,7 @@ function processSingleframe(instances) {
|
||||
}
|
||||
}
|
||||
|
||||
return { value: true, missingFrames };
|
||||
return { value: true, averageSpacingBetweenFrames };
|
||||
}
|
||||
|
||||
function _isSameOrientation(iop1, iop2) {
|
||||
@@ -220,7 +221,10 @@ function _isSameOrientation(iop1, iop2) {
|
||||
return (
|
||||
Math.abs(iop1[0] - iop2[0]) < iopTolerance &&
|
||||
Math.abs(iop1[1] - iop2[1]) < iopTolerance &&
|
||||
Math.abs(iop1[2] - iop2[2]) < iopTolerance
|
||||
Math.abs(iop1[2] - iop2[2]) < iopTolerance &&
|
||||
Math.abs(iop1[3] - iop2[3]) < iopTolerance &&
|
||||
Math.abs(iop1[4] - iop2[4]) < iopTolerance &&
|
||||
Math.abs(iop1[5] - iop2[5]) < iopTolerance
|
||||
);
|
||||
}
|
||||
|
||||
@@ -260,8 +264,8 @@ function _getSpacingIssue(spacing, averageSpacing) {
|
||||
function _getPerpendicularDistance(a, b) {
|
||||
return Math.sqrt(
|
||||
Math.pow(a[0] - b[0], 2) +
|
||||
Math.pow(a[1] - b[1], 2) +
|
||||
Math.pow(a[2] - b[2], 2)
|
||||
Math.pow(a[1] - b[1], 2) +
|
||||
Math.pow(a[2] - b[2], 2)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -270,3 +274,15 @@ const reconstructionIssues = {
|
||||
MISSING_FRAMES: 'missingframes',
|
||||
IRREGULAR_SPACING: 'irregularspacing',
|
||||
};
|
||||
|
||||
export {
|
||||
hasPixelMeasurements,
|
||||
hasOrientation,
|
||||
hasPosition,
|
||||
isNMReconstructable,
|
||||
_isSameOrientation,
|
||||
_getSpacingIssue,
|
||||
_getPerpendicularDistance,
|
||||
reconstructionIssues,
|
||||
constructableModalities,
|
||||
};
|
||||
Reference in new issue
Block a user