@cornerstonejs/tools 2.7.1 → 2.7.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.
@@ -229,8 +229,6 @@ class SplineROITool extends ContourSegmentationBaseTool {
229
229
  const { element } = eventDetail;
230
230
  const { currentPoints } = eventDetail;
231
231
  const { canvas: canvasPoint, world: worldPoint } = currentPoints;
232
- const enabledElement = getEnabledElement(element);
233
- const { renderingEngine } = enabledElement;
234
232
  let closeContour = data.handles.points.length >= 2 && doubleClick;
235
233
  let addNewPoint = true;
236
234
  if (data.handles.points.length >= 3) {
@@ -18,17 +18,17 @@ class WholeBodySegmentTool extends GrowCutBaseTool {
18
18
  const { element, currentPoints } = eventData;
19
19
  const { world: currentWorldPoint } = currentPoints;
20
20
  const enabledElement = getEnabledElement(element);
21
- const { renderingEngine, viewport } = enabledElement;
21
+ const { viewport } = enabledElement;
22
22
  const linePoints = this._getHorizontalLineWorldPoints(enabledElement, currentWorldPoint);
23
23
  this.growCutData.horizontalLines[1] = linePoints;
24
24
  triggerAnnotationRenderForViewportUIDs([viewport.id]);
25
25
  };
26
- this._endCallback = (evt) => {
26
+ this._endCallback = async (evt) => {
27
27
  const eventData = evt.detail;
28
28
  const { element } = eventData;
29
29
  const enabledElement = getEnabledElement(element);
30
- const { renderingEngine, viewport } = enabledElement;
31
- this.runGrowCut();
30
+ const { viewport } = enabledElement;
31
+ await this.runGrowCut();
32
32
  this._deactivateDraw(element);
33
33
  this.growCutData = null;
34
34
  resetElementCursor(element);
@@ -4,7 +4,9 @@ export declare enum SegmentationEnum {
4
4
  SEGMENT = 1,
5
5
  ISLAND = 2,
6
6
  INTERIOR = 3,
7
- EXTERIOR = 4
7
+ EXTERIOR = 4,
8
+ INTERIOR_SMALL = -5,
9
+ INTERIOR_TEST = -6
8
10
  }
9
11
  declare const _default: {
10
12
  onInteractionEnd: (operationData: InitializedOperationData) => void;
@@ -10,6 +10,8 @@ export var SegmentationEnum;
10
10
  SegmentationEnum[SegmentationEnum["ISLAND"] = 2] = "ISLAND";
11
11
  SegmentationEnum[SegmentationEnum["INTERIOR"] = 3] = "INTERIOR";
12
12
  SegmentationEnum[SegmentationEnum["EXTERIOR"] = 4] = "EXTERIOR";
13
+ SegmentationEnum[SegmentationEnum["INTERIOR_SMALL"] = -5] = "INTERIOR_SMALL";
14
+ SegmentationEnum[SegmentationEnum["INTERIOR_TEST"] = -6] = "INTERIOR_TEST";
13
15
  })(SegmentationEnum || (SegmentationEnum = {}));
14
16
  export default {
15
17
  [StrategyCallbacks.OnInteractionEnd]: (operationData) => {
@@ -19,6 +19,10 @@ export default {
19
19
  viewport,
20
20
  });
21
21
  const spacing = segmentationImageData.getSpacing();
22
+ const { boundsIJK: boundsOrig } = segmentationVoxelManager;
23
+ if (!boundsOrig) {
24
+ return VolumetricCalculator.getStatistics({ spacing });
25
+ }
22
26
  segmentationVoxelManager.forEach((voxel) => {
23
27
  const { value, pointIJK } = voxel;
24
28
  if (indicesArr.indexOf(value) === -1) {
@@ -9,8 +9,8 @@ type BoundingBoxInfo = {
9
9
  type GrowCutBoundingBoxOptions = GrowCutOptions & {
10
10
  positiveSeedValue?: number;
11
11
  negativeSeedValue?: number;
12
- negativePixelRange: [number, number];
13
- positivePixelRange: [number, number];
12
+ negativePixelRange?: [number, number];
13
+ positivePixelRange?: [number, number];
14
14
  };
15
15
  declare function runGrowCutForBoundingBox(referencedVolumeId: string, boundingBoxInfo: BoundingBoxInfo, options?: GrowCutBoundingBoxOptions): Promise<Types.IImageVolume>;
16
16
  export { runGrowCutForBoundingBox as default, runGrowCutForBoundingBox };
@@ -7,7 +7,6 @@ const POSITIVE_PIXEL_RANGE = [0, 1900];
7
7
  function _setNegativeSeedValues(subVolume, labelmap, options) {
8
8
  const { negativeSeedValue = NEGATIVE_SEED_VALUE, negativePixelRange = NEGATIVE_PIXEL_RANGE, } = options;
9
9
  const subVolPixelData = subVolume.voxelManager.getCompleteScalarDataArray();
10
- const labelmapData = labelmap.voxelManager.getCompleteScalarDataArray();
11
10
  const [width, height, numSlices] = labelmap.dimensions;
12
11
  const middleSliceIndex = Math.floor(numSlices / 2);
13
12
  const visited = new Array(width * height).fill(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^2.7.1",
107
+ "@cornerstonejs/core": "^2.7.3",
108
108
  "@kitware/vtk.js": "32.1.1",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "bad9df9ca06d63d00d0ea9463364c355c1a57850"
126
+ "gitHead": "b93d749cd3d670af26430c9ef00413dcb1103559"
127
127
  }