@cornerstonejs/core 5.19.7 → 5.19.8

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.
@@ -66,6 +66,7 @@ declare class PlanarLegacyCompatibilityController {
66
66
  private getInitialVolumeImageIdIndex;
67
67
  private getBlendModeTargetDataIds;
68
68
  private resolveTargetDataId;
69
+ private emitVOIModified;
69
70
  private emitColormapModified;
70
71
  private applyVolumePresentation;
71
72
  private buildVolumeActorEntries;
@@ -97,7 +97,8 @@ class PlanarLegacyCompatibilityController {
97
97
  if (!targetDataId) {
98
98
  return;
99
99
  }
100
- const nextProperties = mergePlanarLegacyProperties(this.properties.get(targetDataId) || {}, properties);
100
+ const previousProperties = this.properties.get(targetDataId) || {};
101
+ const nextProperties = mergePlanarLegacyProperties(previousProperties, properties);
101
102
  const currentDefaults = this.globalDefaultProperties.get(targetDataId) || {};
102
103
  this.globalDefaultProperties.set(targetDataId, mergePlanarLegacyProperties(properties, currentDefaults));
103
104
  this.properties.set(targetDataId, nextProperties);
@@ -105,7 +106,14 @@ class PlanarLegacyCompatibilityController {
105
106
  this.host.setCameraOrientation(clonePlanarOrientation(properties.orientation));
106
107
  }
107
108
  this.host.setDataPresentationState(targetDataId, toPlanarDataPresentation(nextProperties));
108
- if (!suppressEvents && properties.colormap !== undefined) {
109
+ if (suppressEvents || volumeIdOrSuppressEvents === true) {
110
+ return;
111
+ }
112
+ if (properties.voiRange !== undefined || properties.invert !== undefined) {
113
+ this.emitVOIModified(targetDataId, volumeId, properties.invert !== undefined &&
114
+ !!properties.invert !== !!previousProperties.invert);
115
+ }
116
+ if (properties.colormap !== undefined) {
109
117
  this.emitColormapModified(targetDataId, volumeId);
110
118
  }
111
119
  }
@@ -390,6 +398,22 @@ class PlanarLegacyCompatibilityController {
390
398
  }
391
399
  return this.host.getActiveDataId() || this.host.getFirstBoundDataId();
392
400
  }
401
+ emitVOIModified(dataId, requestedVolumeId, invertStateChanged = false) {
402
+ const properties = this.properties.get(dataId);
403
+ const range = properties?.voiRange ?? this.host.getDefaultVOIRange(dataId);
404
+ if (!range) {
405
+ return;
406
+ }
407
+ triggerEvent(this.host.getElement(), Events.VOI_MODIFIED, {
408
+ viewportId: this.host.getViewportId(),
409
+ volumeId: requestedVolumeId || this.resolveVolumeIdForDataId(dataId),
410
+ range,
411
+ VOILUTFunction: properties?.VOILUTFunction,
412
+ invert: properties?.invert,
413
+ invertStateChanged,
414
+ colormap: properties?.colormap,
415
+ });
416
+ }
393
417
  emitColormapModified(dataId, requestedVolumeId) {
394
418
  const volumeId = requestedVolumeId || this.resolveVolumeIdForDataId(dataId);
395
419
  const colormap = (volumeId ? this.buildVolumeColormap(dataId) : undefined) ||
@@ -1 +1 @@
1
- export declare const version = "5.19.7";
1
+ export declare const version = "5.19.8";
@@ -1 +1 @@
1
- export const version = '5.19.7';
1
+ export const version = '5.19.8';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "5.19.7",
3
+ "version": "5.19.8",
4
4
  "description": "Cornerstone3D Core",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -85,18 +85,18 @@
85
85
  "prepublishOnly": "pnpm run build"
86
86
  },
87
87
  "dependencies": {
88
- "@cornerstonejs/utils": "5.19.7",
88
+ "@cornerstonejs/utils": "5.19.8",
89
89
  "@kitware/vtk.js": "36.4.1",
90
90
  "comlink": "4.4.2",
91
91
  "gl-matrix": "3.4.3",
92
92
  "loglevel": "1.9.2"
93
93
  },
94
94
  "devDependencies": {
95
- "@cornerstonejs/metadata": "5.19.7"
95
+ "@cornerstonejs/metadata": "5.19.8"
96
96
  },
97
97
  "peerDependencies": {
98
- "@cornerstonejs/metadata": "5.19.7",
99
- "@cornerstonejs/utils": "5.19.7"
98
+ "@cornerstonejs/metadata": "5.19.8",
99
+ "@cornerstonejs/utils": "5.19.8"
100
100
  },
101
101
  "contributors": [
102
102
  {