@cornerstonejs/tools 1.32.2 → 1.32.3

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.32.2",
3
+ "version": "1.32.3",
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.32.2",
32
+ "@cornerstonejs/core": "^1.32.3",
33
33
  "comlink": "^4.4.1",
34
34
  "lodash.clonedeep": "4.5.0",
35
35
  "lodash.get": "^4.4.2"
@@ -53,5 +53,5 @@
53
53
  "type": "individual",
54
54
  "url": "https://ohif.org/donate"
55
55
  },
56
- "gitHead": "c6c2dfdee7f3b1137fae77d9154809267076dc87"
56
+ "gitHead": "0a00cbe4159dc323fcce9b374938f3eedf343ed1"
57
57
  }
@@ -20,6 +20,7 @@ class StackScrollMouseWheelTool extends BaseTool {
20
20
  invert: false,
21
21
  debounceIfNotLoaded: true,
22
22
  loop: false,
23
+ scrollSlabs: false,
23
24
  },
24
25
  }
25
26
  ) {
@@ -41,6 +42,7 @@ class StackScrollMouseWheelTool extends BaseTool {
41
42
  debounceLoading: this.configuration.debounceIfNotLoaded,
42
43
  loop: this.configuration.loop,
43
44
  volumeId,
45
+ scrollSlabs: this.configuration.scrollSlabs,
44
46
  });
45
47
  }
46
48
  }
@@ -4,6 +4,7 @@ type ScrollOptions = {
4
4
  volumeId?: string;
5
5
  debounceLoading?: boolean;
6
6
  loop?: boolean;
7
+ scrollSlabs?: boolean;
7
8
  };
8
9
 
9
10
  export default ScrollOptions;
@@ -38,12 +38,12 @@ export default function scroll(
38
38
  }
39
39
 
40
40
  const { type: viewportType } = viewport;
41
- const { volumeId, delta } = options;
41
+ const { volumeId, delta, scrollSlabs } = options;
42
42
 
43
43
  if (viewport instanceof StackViewport) {
44
44
  viewport.scroll(delta, options.debounceLoading, options.loop);
45
45
  } else if (viewport instanceof VolumeViewport) {
46
- scrollVolume(viewport, volumeId, delta);
46
+ scrollVolume(viewport, volumeId, delta, scrollSlabs);
47
47
  } else if (viewport instanceof VideoViewport) {
48
48
  viewport.scroll(delta);
49
49
  } else {
@@ -54,10 +54,13 @@ export default function scroll(
54
54
  export function scrollVolume(
55
55
  viewport: VolumeViewport,
56
56
  volumeId: string,
57
- delta: number
57
+ delta: number,
58
+ scrollSlabs = false
58
59
  ) {
60
+ const useSlabThickness = scrollSlabs;
61
+
59
62
  const { numScrollSteps, currentStepIndex, sliceRangeInfo } =
60
- csUtils.getVolumeViewportScrollInfo(viewport, volumeId);
63
+ csUtils.getVolumeViewportScrollInfo(viewport, volumeId, useSlabThickness);
61
64
 
62
65
  if (!sliceRangeInfo) {
63
66
  return;