@cornerstonejs/tools 1.59.1 → 1.60.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.59.1",
3
+ "version": "1.60.0",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
30
30
  },
31
31
  "dependencies": {
32
- "@cornerstonejs/core": "^1.59.1",
32
+ "@cornerstonejs/core": "^1.60.0",
33
33
  "@icr/polyseg-wasm": "0.4.0",
34
34
  "@types/offscreencanvas": "2019.7.3",
35
35
  "comlink": "^4.4.1",
@@ -59,5 +59,5 @@
59
59
  "type": "individual",
60
60
  "url": "https://ohif.org/donate"
61
61
  },
62
- "gitHead": "f8957765edd911ce0e78ed21f8de92ca4b01f516"
62
+ "gitHead": "d3576b0ceede627af81fe21d424846fe7da3cc25"
63
63
  }
@@ -139,7 +139,9 @@ class FrameOfReferenceSpecificAnnotationManager implements IAnnotationManager {
139
139
  }
140
140
 
141
141
  if (toolName) {
142
- return annotations[groupKey][toolName];
142
+ return annotations[groupKey][toolName]
143
+ ? annotations[groupKey][toolName]
144
+ : [];
143
145
  }
144
146
 
145
147
  return annotations[groupKey];
@@ -86,14 +86,8 @@ export function scrollVolume(
86
86
 
87
87
  const desiredStepIndex = currentStepIndex + delta;
88
88
 
89
- if (
90
- (desiredStepIndex > numScrollSteps || desiredStepIndex < 0) &&
91
- viewport.getCurrentImageId() // Check that we are in the plane of acquistion
92
- ) {
93
- // One common use case of this trigger might be to load the next
94
- // volume in a time series or the next segment of a partially loaded volume.
95
-
96
- const VolumeScrollEventDetail = {
89
+ const VolumeScrollEventDetail: EventTypes.VolumeScrollOutOfBoundsEventDetail =
90
+ {
97
91
  volumeId,
98
92
  viewport,
99
93
  delta,
@@ -103,10 +97,23 @@ export function scrollVolume(
103
97
  currentImageId: viewport.getCurrentImageId(),
104
98
  };
105
99
 
100
+ if (
101
+ (desiredStepIndex > numScrollSteps || desiredStepIndex < 0) &&
102
+ viewport.getCurrentImageId() // Check that we are in the plane of acquistion
103
+ ) {
104
+ // One common use case of this trigger might be to load the next
105
+ // volume in a time series or the next segment of a partially loaded volume.
106
+
106
107
  csUtils.triggerEvent(
107
108
  eventTarget,
108
109
  EVENTS.VOLUME_SCROLL_OUT_OF_BOUNDS,
109
- VolumeScrollEventDetail as EventTypes.VolumeScrollOutOfBoundsEventDetail
110
+ VolumeScrollEventDetail
111
+ );
112
+ } else {
113
+ csUtils.triggerEvent(
114
+ eventTarget,
115
+ EVENTS.VOLUME_VIEWPORT_SCROLL,
116
+ VolumeScrollEventDetail
110
117
  );
111
118
  }
112
119
  }