@cornerstonejs/adapters 1.49.1 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters.es.js +50 -10
- package/dist/adapters.es.js.map +1 -1
- package/package.json +5 -5
package/dist/adapters.es.js
CHANGED
|
@@ -14272,7 +14272,7 @@ function isNumberType(value) {
|
|
|
14272
14272
|
function isNumberArrayLike(value) {
|
|
14273
14273
|
return 'length' in value && typeof value[0] === 'number';
|
|
14274
14274
|
}
|
|
14275
|
-
function isEqual$
|
|
14275
|
+
function isEqual$2(v1, v2, tolerance = 1e-5) {
|
|
14276
14276
|
if (typeof v1 !== typeof v2 || v1 === null || v2 === null) {
|
|
14277
14277
|
return false;
|
|
14278
14278
|
}
|
|
@@ -38491,7 +38491,7 @@ function isValidVolume(imageIds) {
|
|
|
38491
38491
|
columns,
|
|
38492
38492
|
rows
|
|
38493
38493
|
} = getMetaData('imagePlaneModule', imageId);
|
|
38494
|
-
return seriesInstanceUID === baseMetadata.seriesInstanceUID && modality === baseMetadata.modality && columns === baseMetadata.columns && rows === baseMetadata.rows && isEqual$
|
|
38494
|
+
return seriesInstanceUID === baseMetadata.seriesInstanceUID && modality === baseMetadata.modality && columns === baseMetadata.columns && rows === baseMetadata.rows && isEqual$2(imageOrientationPatient, baseMetadata.imageOrientationPatient) && isEqual$2(pixelSpacing, baseMetadata.pixelSpacing);
|
|
38495
38495
|
});
|
|
38496
38496
|
return validVolume;
|
|
38497
38497
|
}
|
|
@@ -40896,7 +40896,7 @@ class Viewport {
|
|
|
40896
40896
|
cameraModifiedOutOfPlane = Math.abs(vtkMath.dot(deltaCamera, currentViewPlaneNormal)) > 0;
|
|
40897
40897
|
}
|
|
40898
40898
|
if (viewUp) {
|
|
40899
|
-
viewUpHasChanged = !isEqual$
|
|
40899
|
+
viewUpHasChanged = !isEqual$2(currentViewUp, prevViewUp);
|
|
40900
40900
|
}
|
|
40901
40901
|
if (cameraModifiedOutOfPlane || viewUpHasChanged || this.newActorAdded) {
|
|
40902
40902
|
const actorEntry = this.getDefaultActor();
|
|
@@ -42266,7 +42266,7 @@ var utilities = /*#__PURE__*/Object.freeze({
|
|
|
42266
42266
|
imageToWorldCoords: imageToWorldCoords,
|
|
42267
42267
|
indexWithinDimensions: indexWithinDimensions,
|
|
42268
42268
|
invertRgbTransferFunction: invertRgbTransferFunction,
|
|
42269
|
-
isEqual: isEqual$
|
|
42269
|
+
isEqual: isEqual$2,
|
|
42270
42270
|
isImageActor: isImageActor,
|
|
42271
42271
|
isOpposite: isOpposite,
|
|
42272
42272
|
isPTPrescaledWithSUV: isPTPrescaledWithSUV$1,
|
|
@@ -45041,9 +45041,9 @@ class StackViewport extends Viewport$1 {
|
|
|
45041
45041
|
const rowCosines = direction.slice(0, 3);
|
|
45042
45042
|
const columnCosines = direction.slice(3, 6);
|
|
45043
45043
|
const dataType = imageData.getPointData().getScalars().getDataType();
|
|
45044
|
-
const isSameXSpacing = isEqual$
|
|
45045
|
-
const isSameYSpacing = isEqual$
|
|
45046
|
-
return (isSameXSpacing || image.columnPixelSpacing === null && xSpacing === 1.0) && (isSameYSpacing || image.rowPixelSpacing === null && ySpacing === 1.0) && xVoxels === image.columns && yVoxels === image.rows && isEqual$
|
|
45044
|
+
const isSameXSpacing = isEqual$2(xSpacing, image.columnPixelSpacing);
|
|
45045
|
+
const isSameYSpacing = isEqual$2(ySpacing, image.rowPixelSpacing);
|
|
45046
|
+
return (isSameXSpacing || image.columnPixelSpacing === null && xSpacing === 1.0) && (isSameYSpacing || image.rowPixelSpacing === null && ySpacing === 1.0) && xVoxels === image.columns && yVoxels === image.rows && isEqual$2(imagePlaneModule.rowCosines, rowCosines) && isEqual$2(imagePlaneModule.columnCosines, columnCosines) && (!this.useNativeDataType || dataType === image.getPixelData().constructor.name);
|
|
45047
45047
|
}
|
|
45048
45048
|
_updateVTKImageDataFromCornerstoneImage(image) {
|
|
45049
45049
|
const imagePlaneModule = this._getImagePlaneModule(image.imageId);
|
|
@@ -47407,7 +47407,7 @@ let state = {
|
|
|
47407
47407
|
};
|
|
47408
47408
|
|
|
47409
47409
|
const {
|
|
47410
|
-
isEqual
|
|
47410
|
+
isEqual: isEqual$1
|
|
47411
47411
|
} = utilities;
|
|
47412
47412
|
function getViewportForAnnotation(annotation) {
|
|
47413
47413
|
const {
|
|
@@ -47420,7 +47420,7 @@ function getViewportForAnnotation(annotation) {
|
|
|
47420
47420
|
viewPlaneNormal,
|
|
47421
47421
|
viewUp
|
|
47422
47422
|
} = viewport.getCamera();
|
|
47423
|
-
return isEqual(viewPlaneNormal, metadata.viewPlaneNormal) && (!metadata.viewUp || isEqual(viewUp, metadata.viewUp));
|
|
47423
|
+
return isEqual$1(viewPlaneNormal, metadata.viewPlaneNormal) && (!metadata.viewUp || isEqual$1(viewUp, metadata.viewUp));
|
|
47424
47424
|
}
|
|
47425
47425
|
return;
|
|
47426
47426
|
});
|
|
@@ -48502,7 +48502,7 @@ function _linearlyInterpolateContour(c1Interp, c2Interp, sliceIndex, annotationP
|
|
|
48502
48502
|
const zInterp = (sliceIndex - startIndex) / (endIndex - startIndex);
|
|
48503
48503
|
const interpolated3DPoints = _generateInterpolatedOpenContour(c1Interp, c2Interp, zInterp, c1HasMoreNodes);
|
|
48504
48504
|
const nearestAnnotation = interpolationData.get(annotationPair[zInterp > 0.5 ? 1 : 0])[0];
|
|
48505
|
-
const handleCount = Math.round(Math.max(8, interpolationData.get(startIndex)[0].data.handles.points.length
|
|
48505
|
+
const handleCount = Math.round(Math.max(8, interpolationData.get(startIndex)[0].data.handles.points.length, interpolationData.get(endIndex)[0].data.handles.points.length, interpolated3DPoints.x.length / 50));
|
|
48506
48506
|
const handlePoints = _subselect(interpolated3DPoints, handleCount);
|
|
48507
48507
|
if (interpolationData.has(sliceIndex)) {
|
|
48508
48508
|
_editInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex, nearestAnnotation, eventData);
|
|
@@ -48933,6 +48933,7 @@ class InterpolationManager {
|
|
|
48933
48933
|
console.warn('Unable to find matching viewport for annotation interpolation', annotation);
|
|
48934
48934
|
return;
|
|
48935
48935
|
}
|
|
48936
|
+
annotation.autoGenerated = false;
|
|
48936
48937
|
const sliceData = getSliceData(viewport);
|
|
48937
48938
|
const viewportData = {
|
|
48938
48939
|
viewport,
|
|
@@ -48989,12 +48990,51 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
48989
48990
|
InterpolationManager: InterpolationManager
|
|
48990
48991
|
});
|
|
48991
48992
|
|
|
48993
|
+
const {
|
|
48994
|
+
isEqual
|
|
48995
|
+
} = utilities;
|
|
48996
|
+
function findHandlePolylineIndex(annotation, handleIndex) {
|
|
48997
|
+
const {
|
|
48998
|
+
polyline
|
|
48999
|
+
} = annotation.data.contour;
|
|
49000
|
+
const {
|
|
49001
|
+
points
|
|
49002
|
+
} = annotation.data.handles;
|
|
49003
|
+
const {
|
|
49004
|
+
length
|
|
49005
|
+
} = points;
|
|
49006
|
+
if (handleIndex === length) {
|
|
49007
|
+
return polyline.length;
|
|
49008
|
+
}
|
|
49009
|
+
if (handleIndex < 0) {
|
|
49010
|
+
handleIndex = (handleIndex + length) % length;
|
|
49011
|
+
}
|
|
49012
|
+
if (handleIndex === 0) {
|
|
49013
|
+
return 0;
|
|
49014
|
+
}
|
|
49015
|
+
const handle = points[handleIndex];
|
|
49016
|
+
const index = polyline.findIndex(point => isEqual(handle, point));
|
|
49017
|
+
if (index !== -1) {
|
|
49018
|
+
return index;
|
|
49019
|
+
}
|
|
49020
|
+
let closestDistance = Infinity;
|
|
49021
|
+
return polyline.reduce((closestIndex, point, testIndex) => {
|
|
49022
|
+
const distance = vec3.squaredDistance(point, handle);
|
|
49023
|
+
if (distance < closestDistance) {
|
|
49024
|
+
closestDistance = distance;
|
|
49025
|
+
return testIndex;
|
|
49026
|
+
}
|
|
49027
|
+
return closestIndex;
|
|
49028
|
+
}, -1);
|
|
49029
|
+
}
|
|
49030
|
+
|
|
48992
49031
|
var index = /*#__PURE__*/Object.freeze({
|
|
48993
49032
|
__proto__: null,
|
|
48994
49033
|
AnnotationToPointData: AnnotationToPointData$2,
|
|
48995
49034
|
acceptAutogeneratedInterpolations: acceptAutogeneratedInterpolations,
|
|
48996
49035
|
contourFinder: contourFinder,
|
|
48997
49036
|
detectContourHoles: detectContourHoles,
|
|
49037
|
+
findHandlePolylineIndex: findHandlePolylineIndex,
|
|
48998
49038
|
generateContourSetsFromLabelmap: generateContourSetsFromLabelmap$2,
|
|
48999
49039
|
interpolation: index$1,
|
|
49000
49040
|
mergePoints: mergePoints
|