@cornerstonejs/core 3.8.3 → 3.8.5

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.
@@ -2,6 +2,7 @@ import type RGB from './RGB';
2
2
  interface ColormapRegistration {
3
3
  ColorSpace: string;
4
4
  Name: string;
5
+ name?: string;
5
6
  RGBPoints: RGB[] | number[];
6
7
  }
7
8
  interface OpacityMapping {
@@ -3,7 +3,8 @@ import isEqual from './isEqual';
3
3
  import { actorIsA } from './actorCheck';
4
4
  const _colormaps = new Map();
5
5
  function registerColormap(colormap) {
6
- _colormaps.set(colormap.Name, colormap);
6
+ colormap.name = colormap.name || colormap.Name;
7
+ _colormaps.set(colormap.name, colormap);
7
8
  }
8
9
  function getColormap(name) {
9
10
  return _colormaps.get(name);
@@ -15,6 +15,7 @@ type ReturnImageDataMetadata = {
15
15
  modality: string;
16
16
  scalingFactor: number;
17
17
  calibration: IImageCalibration;
18
+ scanAxisNormal: Point3;
18
19
  };
19
20
  export declare function getImageDataMetadata(image: IImage): ReturnImageDataMetadata;
20
21
  export {};
@@ -38,6 +38,7 @@ export function getImageDataMetadata(image) {
38
38
  modality,
39
39
  scalingFactor,
40
40
  calibration,
41
+ scanAxisNormal: scanAxisNormal,
41
42
  };
42
43
  }
43
44
  function _getNumCompsFromPhotometricInterpretation(photometricInterpretation) {
@@ -4,4 +4,5 @@ declare function linePlaneIntersection(p0: Point3, p1: Point3, plane: Plane): Po
4
4
  declare function planeEquation(normal: Point3, point: Point3 | vec3, normalized?: boolean): Plane;
5
5
  declare function threePlaneIntersection(firstPlane: Plane, secondPlane: Plane, thirdPlane: Plane): Point3;
6
6
  declare function planeDistanceToPoint(plane: Plane, point: Point3, signed?: boolean): number;
7
- export { linePlaneIntersection, planeEquation, threePlaneIntersection, planeDistanceToPoint, };
7
+ declare function isPointOnPlane(point: Point3, plane: Plane, tolerance?: number): boolean;
8
+ export { linePlaneIntersection, planeEquation, threePlaneIntersection, planeDistanceToPoint, isPointOnPlane, };
@@ -1,4 +1,5 @@
1
1
  import { mat3 } from 'gl-matrix';
2
+ import { EPSILON } from '../constants';
2
3
  function linePlaneIntersection(p0, p1, plane) {
3
4
  const [x0, y0, z0] = p0;
4
5
  const [x1, y1, z1] = p1;
@@ -42,4 +43,7 @@ function planeDistanceToPoint(plane, point, signed = false) {
42
43
  const sign = signed ? Math.sign(numerator) : 1;
43
44
  return sign * distance;
44
45
  }
45
- export { linePlaneIntersection, planeEquation, threePlaneIntersection, planeDistanceToPoint, };
46
+ function isPointOnPlane(point, plane, tolerance = EPSILON) {
47
+ return planeDistanceToPoint(plane, point) < tolerance;
48
+ }
49
+ export { linePlaneIntersection, planeEquation, threePlaneIntersection, planeDistanceToPoint, isPointOnPlane, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "3.8.3",
3
+ "version": "3.8.5",
4
4
  "description": "Cornerstone3D Core",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -91,5 +91,5 @@
91
91
  "type": "individual",
92
92
  "url": "https://ohif.org/donate"
93
93
  },
94
- "gitHead": "f4dd844bc47c06493547a4754c955e6854475d3f"
94
+ "gitHead": "782551a1523d3619fa002b9b5bb2991519fb5f40"
95
95
  }