@kitware/vtk.js 30.5.2 → 30.5.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/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Rendering/Core/CellPicker.js +12 -22
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +1 -1
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/CubeAxesActor.js +1 -1
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/ScalarBarActor.js +1 -1
- package/Rendering/Core/VolumeMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/Texture.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/package.json +1 -1
|
@@ -2245,4 +2245,4 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
2245
2245
|
'default': vtkMath
|
|
2246
2246
|
});
|
|
2247
2247
|
|
|
2248
|
-
export {
|
|
2248
|
+
export { arrayMin as $, degreesFromRadians as A, areEquals as B, clampValue as C, arrayRange as D, getMajorAxisIndex as E, createUninitializedBounds as F, identity as G, multiplyMatrix as H, floor as I, isInf as J, rgb2hsv as K, rgb2lab as L, lab2rgb as M, round as N, normalize2D as O, nearestPowerOfTwo as P, multiply3x3_vect3 as Q, getSparseOrthogonalMatrix as R, areBoundsInitialized as S, isPowerOfTwo as T, angleBetweenVectors as U, signedAngleBetweenVectors as V, createArray as W, Pi as X, ceil as Y, min as Z, max as _, areMatricesEqual as a, float2CssRGBA as a$, arrayMax as a0, ceilLog2 as a1, factorial as a2, binomial as a3, beginCombination as a4, nextCombination as a5, randomSeed as a6, getSeed as a7, gaussian as a8, multiplyScalar2D as a9, diagonalize3x3 as aA, singularValueDecomposition3x3 as aB, luFactorLinearSystem as aC, luSolveLinearSystem as aD, invertMatrix as aE, estimateMatrixCondition as aF, solveHomogeneousLeastSquares as aG, solveLeastSquares as aH, hex2float as aI, lab2xyz as aJ, xyz2lab as aK, xyz2rgb as aL, rgb2xyz as aM, computeBoundsFromPoints as aN, clampAndNormalizeValue as aO, getScalarTypeFittingRange as aP, getAdjustedScalarRange as aQ, extentIsWithinOtherExtent as aR, boundsIsWithinOtherBounds as aS, pointIsWithinBounds as aT, solve3PointCircle as aU, inf as aV, negInf as aW, isFinite as aX, isNaN as aY, floatToHex2 as aZ, floatRGB2HexCode as a_, multiplyAccumulate2D as aa, outer as ab, projectVector as ac, dot2D as ad, projectVector2D as ae, gaussianAmplitude as af, gaussianWeight as ag, outer2D as ah, norm2D as ai, rowsToMat4 as aj, columnsToMat4 as ak, columnsToMat3 as al, LUFactor3x3 as am, LUSolve3x3 as an, linearSolve3x3 as ao, multiply3x3_mat3 as ap, transpose3x3 as aq, invert3x3 as ar, identity3x3 as as, isIdentity as at, isIdentity3x3 as au, quaternionToMatrix3x3 as av, roundNumber as aw, matrix3x3ToQuaternion as ax, multiplyQuaternion as ay, orthogonalize3x3 as az, roundVector as b, clampVector as c, dot as d, distance2BetweenPoints as e, vtkMath as f, solveLinearSystem as g, hsv2rgb as h, isNan as i, cross as j, add as k, normalize as l, multiplyAccumulate as m, norm as n, determinant2x2 as o, jacobiN as p, perpendiculars as q, radiansFromDegrees as r, subtract as s, jacobi as t, uninitializeBounds as u, vtkMath$1 as v, multiplyScalar as w, random as x, determinant3x3 as y, rowsToMat3 as z };
|
package/Common/Core/Math.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'seedrandom';
|
|
2
2
|
import '../../macros2.js';
|
|
3
3
|
import './Math/Constants.js';
|
|
4
|
-
export {
|
|
4
|
+
export { am as LUFactor3x3, an as LUSolve3x3, X as Pi, k as add, U as angleBetweenVectors, S as areBoundsInitialized, B as areEquals, a as areMatricesEqual, a0 as arrayMax, $ as arrayMin, D as arrayRange, a4 as beginCombination, a3 as binomial, aS as boundsIsWithinOtherBounds, Y as ceil, a1 as ceilLog2, aO as clampAndNormalizeValue, C as clampValue, c as clampVector, al as columnsToMat3, ak as columnsToMat4, aN as computeBoundsFromPoints, W as createArray, F as createUninitializedBounds, j as cross, f as default, A as degreesFromRadians, o as determinant2x2, y as determinant3x3, aA as diagonalize3x3, e as distance2BetweenPoints, d as dot, ad as dot2D, aF as estimateMatrixCondition, aR as extentIsWithinOtherExtent, a2 as factorial, a$ as float2CssRGBA, a_ as floatRGB2HexCode, aZ as floatToHex2, I as floor, a8 as gaussian, af as gaussianAmplitude, ag as gaussianWeight, aQ as getAdjustedScalarRange, E as getMajorAxisIndex, aP as getScalarTypeFittingRange, a7 as getSeed, R as getSparseOrthogonalMatrix, aI as hex2float, h as hsv2rgb, G as identity, as as identity3x3, aV as inf, ar as invert3x3, aE as invertMatrix, aX as isFinite, at as isIdentity, au as isIdentity3x3, J as isInf, aY as isNaN, i as isNan, T as isPowerOfTwo, t as jacobi, p as jacobiN, M as lab2rgb, aJ as lab2xyz, ao as linearSolve3x3, aC as luFactorLinearSystem, aD as luSolveLinearSystem, ax as matrix3x3ToQuaternion, _ as max, Z as min, ap as multiply3x3_mat3, Q as multiply3x3_vect3, m as multiplyAccumulate, aa as multiplyAccumulate2D, H as multiplyMatrix, ay as multiplyQuaternion, w as multiplyScalar, a9 as multiplyScalar2D, P as nearestPowerOfTwo, aW as negInf, a5 as nextCombination, n as norm, ai as norm2D, l as normalize, O as normalize2D, az as orthogonalize3x3, ab as outer, ah as outer2D, q as perpendiculars, aT as pointIsWithinBounds, ac as projectVector, ae as projectVector2D, av as quaternionToMatrix3x3, r as radiansFromDegrees, x as random, a6 as randomSeed, K as rgb2hsv, L as rgb2lab, aM as rgb2xyz, N as round, aw as roundNumber, b as roundVector, z as rowsToMat3, aj as rowsToMat4, V as signedAngleBetweenVectors, aB as singularValueDecomposition3x3, aU as solve3PointCircle, aG as solveHomogeneousLeastSquares, aH as solveLeastSquares, g as solveLinearSystem, s as subtract, aq as transpose3x3, u as uninitializeBounds, aK as xyz2lab, aL as xyz2rgb } from './Math/index.js';
|
|
@@ -5,10 +5,9 @@ import vtkPicker from './Picker.js';
|
|
|
5
5
|
import vtkPolyLine from '../../Common/DataModel/PolyLine.js';
|
|
6
6
|
import vtkTriangle from '../../Common/DataModel/Triangle.js';
|
|
7
7
|
import vtkQuad from '../../Common/DataModel/Quad.js';
|
|
8
|
-
import { l as normalize,
|
|
8
|
+
import { l as normalize, e as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
9
9
|
import { CellType } from '../../Common/DataModel/CellTypes/Constants.js';
|
|
10
10
|
import { vec3, vec4 } from 'gl-matrix';
|
|
11
|
-
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
12
11
|
import vtkBox from '../../Common/DataModel/Box.js';
|
|
13
12
|
|
|
14
13
|
// ----------------------------------------------------------------------------
|
|
@@ -212,16 +211,11 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
212
211
|
let tMin = Number.MAX_VALUE;
|
|
213
212
|
const mapper = volume.getMapper();
|
|
214
213
|
const imageData = mapper.getInputData();
|
|
215
|
-
const origin = imageData.getOrigin();
|
|
216
|
-
const spacing = imageData.getSpacing();
|
|
217
214
|
const dims = imageData.getDimensions();
|
|
218
215
|
const scalars = imageData.getPointData().getScalars().getData();
|
|
219
216
|
const extent = imageData.getExtent();
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (!isIdentity3x3(direction)) {
|
|
223
|
-
imageTransform = vtkMatrixBuilder.buildFromRadian().translate(origin[0], origin[1], origin[2]).multiply3x3(direction).translate(-origin[0], -origin[1], -origin[2]).invert().getMatrix();
|
|
224
|
-
}
|
|
217
|
+
// get the world to index transform to correctly transform from world to volume index
|
|
218
|
+
const imageTransform = imageData.getWorldToIndex();
|
|
225
219
|
|
|
226
220
|
// calculate opacity table
|
|
227
221
|
const numIComps = 1;
|
|
@@ -245,8 +239,8 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
245
239
|
const scale = oWidth / (oRange[1] - oRange[0] + 1);
|
|
246
240
|
|
|
247
241
|
// Make a new p1 and p2 using the clipped t1 and t2
|
|
248
|
-
const q1 = [0, 0, 0];
|
|
249
|
-
const q2 = [0, 0, 0];
|
|
242
|
+
const q1 = [0, 0, 0, 1];
|
|
243
|
+
const q2 = [0, 0, 0, 1];
|
|
250
244
|
q1[0] = p1[0];
|
|
251
245
|
q1[1] = p1[1];
|
|
252
246
|
q1[2] = p1[2];
|
|
@@ -259,13 +253,13 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
259
253
|
q2[j] = p1[j] * (1.0 - t2) + p2[j] * t2;
|
|
260
254
|
}
|
|
261
255
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const x = [0, 0, 0
|
|
256
|
+
|
|
257
|
+
// convert q1, q2 world coordinates to x1, x2 volume index coordinates
|
|
258
|
+
const x1 = [0, 0, 0, 0];
|
|
259
|
+
const x2 = [0, 0, 0, 0];
|
|
260
|
+
vec4.transformMat4(x1, q1, imageTransform);
|
|
261
|
+
vec4.transformMat4(x2, q2, imageTransform);
|
|
262
|
+
const x = [0, 0, 0];
|
|
269
263
|
const xi = [0, 0, 0];
|
|
270
264
|
const sliceSize = dims[1] * dims[0];
|
|
271
265
|
const rowSize = dims[0];
|
|
@@ -281,10 +275,6 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
281
275
|
// "t" is the fractional distance between endpoints x1 and x2
|
|
282
276
|
x[j] = x1[j] * (1.0 - t) + x2[j] * t;
|
|
283
277
|
}
|
|
284
|
-
x[3] = 1.0;
|
|
285
|
-
if (imageTransform) {
|
|
286
|
-
vec4.transformMat4(x, x, imageTransform);
|
|
287
|
-
}
|
|
288
278
|
for (let j = 0; j < 3; j++) {
|
|
289
279
|
// Bounds check
|
|
290
280
|
if (x[j] < extent[2 * j]) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import { h as hsv2rgb, i as isNan,
|
|
2
|
+
import { h as hsv2rgb, i as isNan, I as floor, J as isInf, K as rgb2hsv, L as rgb2lab, M as lab2rgb } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import vtkScalarsToColors from '../../Common/Core/ScalarsToColors.js';
|
|
4
4
|
import Constants from './ColorTransferFunction/Constants.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import Constants from './Coordinate/Constants.js';
|
|
3
|
-
import {
|
|
3
|
+
import { N as round, I as floor } from '../../Common/Core/Math/index.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
6
|
Coordinate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vec3, mat4 } from 'gl-matrix';
|
|
2
2
|
import * as d3 from 'd3-scale';
|
|
3
|
-
import {
|
|
3
|
+
import { O as normalize2D, P as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import { m as macro } from '../../macros2.js';
|
|
5
5
|
import vtkActor from './Actor.js';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
@@ -2,7 +2,7 @@ import Constants from './ImageMapper/Constants.js';
|
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkAbstractImageMapper from './AbstractImageMapper.js';
|
|
4
4
|
import { intersectWithLineForPointPicking, intersectWithLineForCellPicking } from './AbstractImageMapper/helper.js';
|
|
5
|
-
import { C as clampValue,
|
|
5
|
+
import { C as clampValue, Q as multiply3x3_vect3, F as createUninitializedBounds, R as getSparseOrthogonalMatrix } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import { n as newInstance$1, g as get, e as setGet, k as getArray, l as setGetArray, i as moveToProtected, c as macro } from '../../macros2.js';
|
|
3
3
|
import vtkCamera from './Camera.js';
|
|
4
4
|
import vtkLight from './Light.js';
|
|
5
|
-
import {
|
|
5
|
+
import { S as areBoundsInitialized, u as uninitializeBounds, r as radiansFromDegrees, d as dot, F as createUninitializedBounds } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkViewport from './Viewport.js';
|
|
7
7
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as d3 from 'd3-scale';
|
|
2
|
-
import {
|
|
2
|
+
import { P as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import { m as macro } from '../../macros2.js';
|
|
4
4
|
import vtkActor from './Actor.js';
|
|
5
5
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import { F as createUninitializedBounds, C as clampValue,
|
|
2
|
+
import { F as createUninitializedBounds, C as clampValue, I as floor } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import Constants from './VolumeMapper/Constants.js';
|
|
4
4
|
import vtkAbstractMapper3D from './AbstractMapper3D.js';
|
|
5
5
|
import vtkPiecewiseFunction from '../../Common/DataModel/PiecewiseFunction.js';
|
|
@@ -8,7 +8,7 @@ import { v as vtkPolyData2DVS } from './glsl/vtkPolyData2DVS.glsl.js';
|
|
|
8
8
|
import vtkReplacementShaderMapper from './ReplacementShaderMapper.js';
|
|
9
9
|
import vtkShaderProgram from './ShaderProgram.js';
|
|
10
10
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
11
|
-
import {
|
|
11
|
+
import { N as round } from '../../Common/Core/Math/index.js';
|
|
12
12
|
import { DisplayLocation } from '../Core/Property2D/Constants.js';
|
|
13
13
|
import { registerOverride } from './ViewNodeFactory.js';
|
|
14
14
|
|
|
@@ -2,7 +2,7 @@ import Constants from './Texture/Constants.js';
|
|
|
2
2
|
import HalfFloat from '../../Common/Core/HalfFloat.js';
|
|
3
3
|
import { n as newInstance$1, o as obj, s as set, e as setGet, g as get, i as moveToProtected, a as newTypedArray, c as macro } from '../../macros2.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import {
|
|
5
|
+
import { T as isPowerOfTwo, P as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
7
7
|
import { registerOverride } from './ViewNodeFactory.js';
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
3
3
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
|
-
import { s as subtract,
|
|
6
|
+
import { s as subtract, U as angleBetweenVectors } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import widgetBehavior from './AngleWidget/behavior.js';
|
|
8
8
|
import generateState from './AngleWidget/state.js';
|
|
9
9
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../../macros2.js';
|
|
2
2
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
3
3
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
4
|
-
import { k as add, l as normalize, s as subtract, d as dot, j as cross, m as multiplyAccumulate, w as multiplyScalar,
|
|
4
|
+
import { k as add, l as normalize, s as subtract, d as dot, j as cross, m as multiplyAccumulate, w as multiplyScalar, V as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
5
5
|
import { getLineNames, getOtherLineName, updateState, boundPointOnPlane, getLinePlaneName, getLineInPlaneName, rotateVector } from './helpers.js';
|
|
6
6
|
import { InteractionMethodsName, ScrollingMethods, planeNameToViewType } from './Constants.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
|
|
|
2
2
|
import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
|
|
3
3
|
import vtkCutter from '../../../Filters/Core/Cutter.js';
|
|
4
4
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
5
|
-
import { s as subtract, l as normalize, j as cross, w as multiplyScalar, m as multiplyAccumulate,
|
|
5
|
+
import { s as subtract, l as normalize, j as cross, w as multiplyScalar, m as multiplyAccumulate, V as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import { viewTypeToPlaneName, planeNameToViewType, planeNames } from './Constants.js';
|
|
8
8
|
|