@cornerstonejs/core 5.10.6 → 5.10.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.
@@ -37,6 +37,7 @@ export type PlanarLegacyCompatibilityHost = {
37
37
  declare class PlanarLegacyCompatibilityController {
38
38
  private readonly host;
39
39
  private readonly managedDataIds;
40
+ private readonly mountingDataIds;
40
41
  private readonly volumeDataIds;
41
42
  private stackSetRequestId;
42
43
  private readonly properties;
@@ -12,6 +12,7 @@ class PlanarLegacyCompatibilityController {
12
12
  constructor(host) {
13
13
  this.host = host;
14
14
  this.managedDataIds = new Set();
15
+ this.mountingDataIds = new Set();
15
16
  this.volumeDataIds = new Map();
16
17
  this.stackSetRequestId = 0;
17
18
  this.properties = new Map();
@@ -221,6 +222,9 @@ class PlanarLegacyCompatibilityController {
221
222
  return Math.max(this.host.getImageCount(), this.host.getMaxImageIdIndex() + 1);
222
223
  }
223
224
  removeData(dataId) {
225
+ if (this.mountingDataIds.has(dataId)) {
226
+ return;
227
+ }
224
228
  if (!this.managedDataIds.delete(dataId)) {
225
229
  return;
226
230
  }
@@ -290,18 +294,24 @@ class PlanarLegacyCompatibilityController {
290
294
  orientation: this.host.getRequestedOrientation(),
291
295
  };
292
296
  const existingSourceDataId = this.host.getActiveDataId();
293
- await this.host.setDisplaySets(...dataIds.map((dataId, index) => {
294
- const shouldMountAsSource = index === 0 && (replaceExisting || !existingSourceDataId);
295
- return {
296
- displaySetId: dataId,
297
- options: {
298
- ...sharedOptions,
299
- role: shouldMountAsSource
300
- ? 'source'
301
- : 'overlay',
302
- },
303
- };
304
- }));
297
+ dataIds.forEach((dataId) => this.mountingDataIds.add(dataId));
298
+ try {
299
+ await this.host.setDisplaySets(...dataIds.map((dataId, index) => {
300
+ const shouldMountAsSource = index === 0 && (replaceExisting || !existingSourceDataId);
301
+ return {
302
+ displaySetId: dataId,
303
+ options: {
304
+ ...sharedOptions,
305
+ role: shouldMountAsSource
306
+ ? 'source'
307
+ : 'overlay',
308
+ },
309
+ };
310
+ }));
311
+ }
312
+ finally {
313
+ dataIds.forEach((dataId) => this.mountingDataIds.delete(dataId));
314
+ }
305
315
  volumeInputArray.forEach((volumeInput, index) => {
306
316
  const dataId = dataIds[index];
307
317
  if (volumeInput.visibility !== undefined) {
@@ -1 +1 @@
1
- export declare const version = "5.10.6";
1
+ export declare const version = "5.10.8";
@@ -1 +1 @@
1
- export const version = '5.10.6';
1
+ export const version = '5.10.8';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "5.10.6",
3
+ "version": "5.10.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.10.6",
88
+ "@cornerstonejs/utils": "5.10.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.10.6"
95
+ "@cornerstonejs/metadata": "5.10.8"
96
96
  },
97
97
  "peerDependencies": {
98
- "@cornerstonejs/metadata": "5.10.6",
99
- "@cornerstonejs/utils": "5.10.6"
98
+ "@cornerstonejs/metadata": "5.10.8",
99
+ "@cornerstonejs/utils": "5.10.8"
100
100
  },
101
101
  "contributors": [
102
102
  {