@kitware/vtk.js 20.1.2 → 20.2.1
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/Base64.d.ts +14 -2
- package/Common/Core/Base64.js +31 -2
- package/Common/Core/Math/index.js +3 -3
- package/Common/Core/Math.d.ts +128 -128
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.js +39 -41
- package/Common/DataModel/ImageData.js +12 -14
- package/Common/Transform/LandmarkTransform.js +6 -7
- package/Filters/General/PaintFilter/PaintFilter.worker.js +8 -8
- package/Filters/General/PaintFilter.js +11 -11
- package/Filters/Sources/PlaneSource.js +12 -13
- package/IO/Core/BinaryHelper.js +2 -4
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +1 -1
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +1 -1
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +2 -2
- package/IO/Core/ZipMultiDataSetReader.js +1 -1
- package/IO/Core/ZipMultiDataSetWriter.js +1 -1
- package/IO/Geometry/STLWriter.js +4 -4
- package/IO/Misc/SkyboxReader.js +1 -1
- package/IO/XML/XMLReader.js +3 -4
- package/IO/XML/XMLWriter.js +5 -6
- package/Imaging/Core/ImageReslice.js +18 -19
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +27 -28
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +8 -9
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +14 -15
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +12 -13
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +5 -6
- package/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +8 -9
- package/Rendering/Core/Actor.js +3 -4
- package/Rendering/Core/Camera.js +81 -84
- package/Rendering/Core/CellPicker.js +2 -2
- package/Rendering/Core/CubeAxesActor.js +32 -33
- package/Rendering/Core/Follower.js +20 -21
- package/Rendering/Core/Glyph3DMapper.js +30 -32
- package/Rendering/Core/ImageMapper.js +2 -2
- package/Rendering/Core/ImageSlice.js +5 -6
- package/Rendering/Core/Picker.js +5 -6
- package/Rendering/Core/PixelSpaceCallbackMapper.js +3 -4
- package/Rendering/Core/Prop3D.js +24 -25
- package/Rendering/Core/Renderer.js +11 -12
- package/Rendering/Core/ScalarBarActor.js +32 -33
- package/Rendering/Core/Volume.js +3 -4
- package/Rendering/OpenGL/Actor.js +9 -10
- package/Rendering/OpenGL/Camera.js +8 -9
- package/Rendering/OpenGL/CellArrayBufferObject.js +6 -8
- package/Rendering/OpenGL/Glyph3DMapper.js +8 -9
- package/Rendering/OpenGL/ImageMapper.js +7 -7
- package/Rendering/OpenGL/ImageSlice.js +4 -4
- package/Rendering/OpenGL/PolyDataMapper.js +11 -13
- package/Rendering/OpenGL/RenderWindow.d.ts +37 -1
- package/Rendering/OpenGL/ShaderCache.js +1 -1
- package/Rendering/OpenGL/Skybox.js +4 -5
- package/Rendering/OpenGL/SphereMapper.js +2 -2
- package/Rendering/OpenGL/StickMapper.js +3 -4
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +1 -1
- package/Rendering/OpenGL/Volume.js +6 -7
- package/Rendering/OpenGL/VolumeMapper.js +47 -49
- package/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl.js +1 -1
- package/Rendering/WebGPU/Actor.js +8 -8
- package/Rendering/WebGPU/Camera.js +8 -8
- package/Rendering/WebGPU/ImageMapper.js +18 -19
- package/Rendering/WebGPU/ImageSlice.js +9 -9
- package/Rendering/WebGPU/PolyDataMapper.js +3 -4
- package/Rendering/WebGPU/Renderer.js +6 -7
- package/Rendering/WebGPU/Texture.js +10 -9
- package/Rendering/WebGPU/Volume.js +3 -3
- package/Rendering/WebGPU/VolumePassFSQ.js +10 -10
- package/ThirdParty/index.js +2 -2
- package/Widgets/Manipulators/TrackballManipulator.js +5 -6
- package/Widgets/Representations/ArrowHandleRepresentation.js +10 -12
- package/Widgets/Representations/CircleContextRepresentation.js +4 -5
- package/Widgets/Representations/RectangleContextRepresentation.js +3 -3
- package/Widgets/Widgets3D/EllipseWidget/behavior.js +5 -5
- package/Widgets/Widgets3D/ImageCroppingWidget/helpers.js +6 -8
- package/Widgets/Widgets3D/PaintWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/ResliceCursorWidget.js +6 -7
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +10 -10
- package/Widgets/Widgets3D/SplineWidget/behavior.js +5 -5
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +1 -1
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
- package/package.json +2 -2
- package/vtk.js +2 -2
- package/_vendor/base64-js/index.js_commonjs-exports.js +0 -1
- package/_vendor/blueimp-md5/js/md5.js_commonjs-module.js +0 -3
- package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/implementation.browser.js_commonjs-module.js +0 -3
- package/_vendor/globalthis/implementation.browser.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/shim.js_commonjs-proxy.js +0 -2
- package/_vendor/jszip/dist/jszip.min.js_commonjs-module.js +0 -3
- package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/alea.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/alea.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/tychei.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/tychei.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xor128.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xor128.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xor4096.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xor4096.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xorshift7.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xorshift7.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xorwow.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xorwow.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/seedrandom.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/seedrandom.js_commonjs-proxy.js +0 -1
- package/_vendor/webworker-promise/lib/register.js_commonjs-module.js +0 -3
- package/_vendor/webworker-promise/lib/tiny-emitter.js_commonjs-proxy.js +0 -1
- package/_vendor/webworker-promise/src/tiny-emitter.js_commonjs-proxy.js +0 -1
- package/_vendor/xmlbuilder2/lib/xmlbuilder2.min.js_commonjs-module.js +0 -3
- package/_virtual/_rollup_plugin_ignore_empty_module_placeholder_commonjs-proxy.js +0 -6
- package/_virtual/commonjsHelpers.js +0 -22
- package/_virtual/polyfill-node.buffer.js +0 -1971
- package/_virtual/polyfill-node.global.js +0 -5
- package/_virtual/rollup_plugin_ignore_empty_module_placeholder.js +0 -8
- package/vendor/base64-js/index.js +0 -72
- package/vendor/blueimp-md5/js/md5.js +0 -402
- package/vendor/d3-array/src/array.js +0 -1
- package/vendor/d3-array/src/ascending.js +0 -5
- package/vendor/d3-array/src/bin.js +0 -1
- package/vendor/d3-array/src/bisect.js +0 -10
- package/vendor/d3-array/src/bisector.js +0 -46
- package/vendor/d3-array/src/constant.js +0 -1
- package/vendor/d3-array/src/count.js +0 -1
- package/vendor/d3-array/src/cross.js +0 -1
- package/vendor/d3-array/src/cumsum.js +0 -1
- package/vendor/d3-array/src/descending.js +0 -1
- package/vendor/d3-array/src/deviation.js +0 -1
- package/vendor/d3-array/src/difference.js +0 -1
- package/vendor/d3-array/src/disjoint.js +0 -1
- package/vendor/d3-array/src/every.js +0 -1
- package/vendor/d3-array/src/extent.js +0 -1
- package/vendor/d3-array/src/filter.js +0 -1
- package/vendor/d3-array/src/fsum.js +0 -1
- package/vendor/d3-array/src/greatest.js +0 -1
- package/vendor/d3-array/src/greatestIndex.js +0 -1
- package/vendor/d3-array/src/group.js +0 -1
- package/vendor/d3-array/src/groupSort.js +0 -1
- package/vendor/d3-array/src/identity.js +0 -1
- package/vendor/d3-array/src/index.js +0 -1
- package/vendor/d3-array/src/intersection.js +0 -1
- package/vendor/d3-array/src/least.js +0 -1
- package/vendor/d3-array/src/leastIndex.js +0 -1
- package/vendor/d3-array/src/map.js +0 -1
- package/vendor/d3-array/src/max.js +0 -1
- package/vendor/d3-array/src/maxIndex.js +0 -1
- package/vendor/d3-array/src/mean.js +0 -1
- package/vendor/d3-array/src/median.js +0 -1
- package/vendor/d3-array/src/merge.js +0 -1
- package/vendor/d3-array/src/min.js +0 -1
- package/vendor/d3-array/src/minIndex.js +0 -1
- package/vendor/d3-array/src/mode.js +0 -1
- package/vendor/d3-array/src/nice.js +0 -1
- package/vendor/d3-array/src/number.js +0 -5
- package/vendor/d3-array/src/pairs.js +0 -1
- package/vendor/d3-array/src/permute.js +0 -1
- package/vendor/d3-array/src/quantile.js +0 -1
- package/vendor/d3-array/src/quickselect.js +0 -1
- package/vendor/d3-array/src/range.js +0 -1
- package/vendor/d3-array/src/reduce.js +0 -1
- package/vendor/d3-array/src/reverse.js +0 -1
- package/vendor/d3-array/src/scan.js +0 -1
- package/vendor/d3-array/src/set.js +0 -1
- package/vendor/d3-array/src/shuffle.js +0 -1
- package/vendor/d3-array/src/some.js +0 -1
- package/vendor/d3-array/src/sort.js +0 -1
- package/vendor/d3-array/src/subset.js +0 -1
- package/vendor/d3-array/src/sum.js +0 -1
- package/vendor/d3-array/src/superset.js +0 -1
- package/vendor/d3-array/src/threshold/freedmanDiaconis.js +0 -1
- package/vendor/d3-array/src/threshold/scott.js +0 -1
- package/vendor/d3-array/src/threshold/sturges.js +0 -1
- package/vendor/d3-array/src/ticks.js +0 -56
- package/vendor/d3-array/src/transpose.js +0 -1
- package/vendor/d3-array/src/union.js +0 -1
- package/vendor/d3-array/src/variance.js +0 -1
- package/vendor/d3-array/src/zip.js +0 -1
- package/vendor/d3-color/src/color.js +0 -373
- package/vendor/d3-color/src/cubehelix.js +0 -1
- package/vendor/d3-color/src/define.js +0 -12
- package/vendor/d3-color/src/index.js +0 -1
- package/vendor/d3-color/src/lab.js +0 -1
- package/vendor/d3-color/src/math.js +0 -1
- package/vendor/d3-format/src/defaultLocale.js +0 -20
- package/vendor/d3-format/src/exponent.js +0 -7
- package/vendor/d3-format/src/formatDecimal.js +0 -22
- package/vendor/d3-format/src/formatGroup.js +0 -20
- package/vendor/d3-format/src/formatNumerals.js +0 -9
- package/vendor/d3-format/src/formatPrefixAuto.js +0 -18
- package/vendor/d3-format/src/formatRounded.js +0 -13
- package/vendor/d3-format/src/formatSpecifier.js +0 -49
- package/vendor/d3-format/src/formatTrim.js +0 -13
- package/vendor/d3-format/src/formatTypes.js +0 -21
- package/vendor/d3-format/src/identity.js +0 -5
- package/vendor/d3-format/src/index.js +0 -1
- package/vendor/d3-format/src/locale.js +0 -150
- package/vendor/d3-format/src/precisionFixed.js +0 -7
- package/vendor/d3-format/src/precisionPrefix.js +0 -7
- package/vendor/d3-format/src/precisionRound.js +0 -8
- package/vendor/d3-interpolate/src/array.js +0 -19
- package/vendor/d3-interpolate/src/basis.js +0 -1
- package/vendor/d3-interpolate/src/basisClosed.js +0 -1
- package/vendor/d3-interpolate/src/color.js +0 -26
- package/vendor/d3-interpolate/src/constant.js +0 -3
- package/vendor/d3-interpolate/src/cubehelix.js +0 -1
- package/vendor/d3-interpolate/src/date.js +0 -8
- package/vendor/d3-interpolate/src/discrete.js +0 -1
- package/vendor/d3-interpolate/src/hcl.js +0 -1
- package/vendor/d3-interpolate/src/hsl.js +0 -1
- package/vendor/d3-interpolate/src/hue.js +0 -1
- package/vendor/d3-interpolate/src/index.js +0 -1
- package/vendor/d3-interpolate/src/lab.js +0 -1
- package/vendor/d3-interpolate/src/number.js +0 -7
- package/vendor/d3-interpolate/src/numberArray.js +0 -16
- package/vendor/d3-interpolate/src/object.js +0 -25
- package/vendor/d3-interpolate/src/piecewise.js +0 -1
- package/vendor/d3-interpolate/src/quantize.js +0 -1
- package/vendor/d3-interpolate/src/rgb.js +0 -26
- package/vendor/d3-interpolate/src/round.js +0 -7
- package/vendor/d3-interpolate/src/string.js +0 -66
- package/vendor/d3-interpolate/src/transform/decompose.js +0 -1
- package/vendor/d3-interpolate/src/transform/index.js +0 -1
- package/vendor/d3-interpolate/src/transform/parse.js +0 -1
- package/vendor/d3-interpolate/src/value.js +0 -24
- package/vendor/d3-interpolate/src/zoom.js +0 -1
- package/vendor/d3-scale/src/band.js +0 -1
- package/vendor/d3-scale/src/constant.js +0 -7
- package/vendor/d3-scale/src/continuous.js +0 -129
- package/vendor/d3-scale/src/diverging.js +0 -1
- package/vendor/d3-scale/src/identity.js +0 -1
- package/vendor/d3-scale/src/index.js +0 -1
- package/vendor/d3-scale/src/init.js +0 -10
- package/vendor/d3-scale/src/linear.js +0 -72
- package/vendor/d3-scale/src/log.js +0 -1
- package/vendor/d3-scale/src/nice.js +0 -1
- package/vendor/d3-scale/src/number.js +0 -5
- package/vendor/d3-scale/src/ordinal.js +0 -1
- package/vendor/d3-scale/src/pow.js +0 -1
- package/vendor/d3-scale/src/quantile.js +0 -1
- package/vendor/d3-scale/src/quantize.js +0 -1
- package/vendor/d3-scale/src/radial.js +0 -1
- package/vendor/d3-scale/src/sequential.js +0 -1
- package/vendor/d3-scale/src/sequentialQuantile.js +0 -1
- package/vendor/d3-scale/src/symlog.js +0 -1
- package/vendor/d3-scale/src/threshold.js +0 -1
- package/vendor/d3-scale/src/tickFormat.js +0 -35
- package/vendor/d3-scale/src/time.js +0 -1
- package/vendor/d3-scale/src/utcTime.js +0 -1
- package/vendor/d3-time/src/day.js +0 -1
- package/vendor/d3-time/src/duration.js +0 -1
- package/vendor/d3-time/src/hour.js +0 -1
- package/vendor/d3-time/src/index.js +0 -1
- package/vendor/d3-time/src/interval.js +0 -1
- package/vendor/d3-time/src/millisecond.js +0 -1
- package/vendor/d3-time/src/minute.js +0 -1
- package/vendor/d3-time/src/month.js +0 -1
- package/vendor/d3-time/src/second.js +0 -1
- package/vendor/d3-time/src/ticks.js +0 -1
- package/vendor/d3-time/src/utcDay.js +0 -1
- package/vendor/d3-time/src/utcHour.js +0 -1
- package/vendor/d3-time/src/utcMinute.js +0 -1
- package/vendor/d3-time/src/utcMonth.js +0 -1
- package/vendor/d3-time/src/utcWeek.js +0 -1
- package/vendor/d3-time/src/utcYear.js +0 -1
- package/vendor/d3-time/src/week.js +0 -1
- package/vendor/d3-time/src/year.js +0 -1
- package/vendor/d3-time-format/src/defaultLocale.js +0 -1
- package/vendor/d3-time-format/src/index.js +0 -1
- package/vendor/d3-time-format/src/isoFormat.js +0 -1
- package/vendor/d3-time-format/src/isoParse.js +0 -1
- package/vendor/d3-time-format/src/locale.js +0 -1
- package/vendor/define-properties/index.js +0 -60
- package/vendor/gl-matrix/esm/common.js +0 -30
- package/vendor/gl-matrix/esm/index.js +0 -1
- package/vendor/gl-matrix/esm/mat2.js +0 -1
- package/vendor/gl-matrix/esm/mat2d.js +0 -1
- package/vendor/gl-matrix/esm/mat3.js +0 -817
- package/vendor/gl-matrix/esm/mat4.js +0 -1868
- package/vendor/gl-matrix/esm/quat.js +0 -330
- package/vendor/gl-matrix/esm/quat2.js +0 -1
- package/vendor/gl-matrix/esm/vec2.js +0 -1
- package/vendor/gl-matrix/esm/vec3.js +0 -842
- package/vendor/gl-matrix/esm/vec4.js +0 -153
- package/vendor/globalthis/implementation.browser.js +0 -11
- package/vendor/globalthis/index.js +0 -25
- package/vendor/globalthis/polyfill.js +0 -14
- package/vendor/globalthis/shim.js +0 -25
- package/vendor/internmap/src/index.js +0 -1
- package/vendor/jszip/dist/jszip.min.js +0 -11
- package/vendor/object-keys/implementation.js +0 -124
- package/vendor/object-keys/index.js +0 -35
- package/vendor/object-keys/isArguments.js +0 -17
- package/vendor/pako/dist/pako.esm.mjs.js +0 -6707
- package/vendor/seedrandom/index.js +0 -77
- package/vendor/seedrandom/lib/alea.js +0 -117
- package/vendor/seedrandom/lib/tychei.js +0 -105
- package/vendor/seedrandom/lib/xor128.js +0 -84
- package/vendor/seedrandom/lib/xor4096.js +0 -150
- package/vendor/seedrandom/lib/xorshift7.js +0 -101
- package/vendor/seedrandom/lib/xorwow.js +0 -89
- package/vendor/seedrandom/seedrandom.js +0 -256
- package/vendor/webworker-promise/lib/register.js +0 -158
- package/vendor/webworker-promise/lib/tiny-emitter.js +0 -89
- package/vendor/webworker-promise/src/index.js +0 -110
- package/vendor/webworker-promise/src/tiny-emitter.js +0 -51
- package/vendor/xmlbuilder2/lib/xmlbuilder2.min.js +0 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { mat4, vec4 } from 'gl-matrix';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
5
|
import { VtkDataTypes } from '../../Common/Core/DataArray/Constants.js';
|
|
@@ -9,8 +10,6 @@ import vtkImagePointDataIterator from './ImagePointDataIterator.js';
|
|
|
9
10
|
import { InterpolationMode, ImageBorderMode } from './AbstractImageInterpolator/Constants.js';
|
|
10
11
|
import { vtkInterpolationMathRound, vtkInterpolationMathClamp, vtkInterpolationMathFloor } from './AbstractImageInterpolator/InterpolationInfo.js';
|
|
11
12
|
import Constants from './ImageReslice/Constants.js';
|
|
12
|
-
import { i as identity, h as exactEquals, d as copy, g as invert, m as multiply } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
13
|
-
import { t as transformMat4 } from '../../vendor/gl-matrix/esm/vec4.js';
|
|
14
13
|
|
|
15
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
16
15
|
|
|
@@ -100,11 +99,11 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
100
99
|
|
|
101
100
|
publicAPI.setResliceAxes = function (resliceAxes) {
|
|
102
101
|
if (!model.resliceAxes) {
|
|
103
|
-
model.resliceAxes = identity(new Float64Array(16));
|
|
102
|
+
model.resliceAxes = mat4.identity(new Float64Array(16));
|
|
104
103
|
}
|
|
105
104
|
|
|
106
|
-
if (!exactEquals(model.resliceAxes, resliceAxes)) {
|
|
107
|
-
copy(model.resliceAxes, resliceAxes);
|
|
105
|
+
if (!mat4.exactEquals(model.resliceAxes, resliceAxes)) {
|
|
106
|
+
mat4.copy(model.resliceAxes, resliceAxes);
|
|
108
107
|
publicAPI.modified();
|
|
109
108
|
return true;
|
|
110
109
|
}
|
|
@@ -137,11 +136,11 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
137
136
|
if (model.resliceAxes) {
|
|
138
137
|
matrix = model.resliceAxes;
|
|
139
138
|
} else {
|
|
140
|
-
matrix = identity(new Float64Array(16));
|
|
139
|
+
matrix = mat4.identity(new Float64Array(16));
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
var imatrix = new Float64Array(16);
|
|
144
|
-
invert(imatrix, matrix);
|
|
143
|
+
mat4.invert(imatrix, matrix);
|
|
145
144
|
var inCenter = [origin[0] + 0.5 * (inWholeExt[0] + inWholeExt[1]) * inSpacing[0], origin[1] + 0.5 * (inWholeExt[2] + inWholeExt[3]) * inSpacing[1], origin[2] + 0.5 * (inWholeExt[4] + inWholeExt[5]) * inSpacing[2]];
|
|
146
145
|
var maxBounds = null;
|
|
147
146
|
|
|
@@ -582,19 +581,19 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
582
581
|
publicAPI.getIndexMatrix = function (input, output) {
|
|
583
582
|
// first verify that we have to update the matrix
|
|
584
583
|
if (indexMatrix === null) {
|
|
585
|
-
indexMatrix = identity(new Float64Array(16));
|
|
584
|
+
indexMatrix = mat4.identity(new Float64Array(16));
|
|
586
585
|
}
|
|
587
586
|
|
|
588
587
|
var inOrigin = input.getOrigin();
|
|
589
588
|
var inSpacing = input.getSpacing();
|
|
590
589
|
var outOrigin = output.getOrigin();
|
|
591
590
|
var outSpacing = output.getSpacing();
|
|
592
|
-
var transform = identity(new Float64Array(16));
|
|
593
|
-
var inMatrix = identity(new Float64Array(16));
|
|
594
|
-
var outMatrix = identity(new Float64Array(16));
|
|
591
|
+
var transform = mat4.identity(new Float64Array(16));
|
|
592
|
+
var inMatrix = mat4.identity(new Float64Array(16));
|
|
593
|
+
var outMatrix = mat4.identity(new Float64Array(16));
|
|
595
594
|
|
|
596
595
|
if (model.resliceAxes) {
|
|
597
|
-
copy(transform, model.resliceAxes);
|
|
596
|
+
mat4.copy(transform, model.resliceAxes);
|
|
598
597
|
}
|
|
599
598
|
|
|
600
599
|
if (model.resliceTransform) ; // check to see if we have an identity matrix
|
|
@@ -617,17 +616,17 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
617
616
|
if (!isIdentity) {
|
|
618
617
|
// transform.PreMultiply();
|
|
619
618
|
// transform.Concatenate(outMatrix);
|
|
620
|
-
multiply(transform, transform, outMatrix); // the optimizedTransform requires data coords, not
|
|
619
|
+
mat4.multiply(transform, transform, outMatrix); // the optimizedTransform requires data coords, not
|
|
621
620
|
// index coords, as its input
|
|
622
621
|
|
|
623
622
|
{
|
|
624
623
|
// transform->PostMultiply();
|
|
625
624
|
// transform->Concatenate(inMatrix);
|
|
626
|
-
multiply(transform, inMatrix, transform);
|
|
625
|
+
mat4.multiply(transform, inMatrix, transform);
|
|
627
626
|
}
|
|
628
627
|
}
|
|
629
628
|
|
|
630
|
-
copy(indexMatrix, transform);
|
|
629
|
+
mat4.copy(indexMatrix, transform);
|
|
631
630
|
return indexMatrix;
|
|
632
631
|
};
|
|
633
632
|
|
|
@@ -639,9 +638,9 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
639
638
|
var matrix = new Float64Array(16);
|
|
640
639
|
|
|
641
640
|
if (model.resliceAxes) {
|
|
642
|
-
invert(matrix, model.resliceAxes);
|
|
641
|
+
mat4.invert(matrix, model.resliceAxes);
|
|
643
642
|
} else {
|
|
644
|
-
identity(matrix);
|
|
643
|
+
mat4.identity(matrix);
|
|
645
644
|
}
|
|
646
645
|
|
|
647
646
|
var bounds = [Number.MAX_VALUE, -Number.MAX_VALUE, Number.MAX_VALUE, -Number.MAX_VALUE, Number.MAX_VALUE, -Number.MAX_VALUE];
|
|
@@ -655,7 +654,7 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
655
654
|
|
|
656
655
|
if (model.resliceTransform) ;
|
|
657
656
|
|
|
658
|
-
transformMat4(point, point, matrix);
|
|
657
|
+
vec4.transformMat4(point, point, matrix);
|
|
659
658
|
var f = 1.0 / point[3];
|
|
660
659
|
point[0] *= f;
|
|
661
660
|
point[1] *= f;
|
|
@@ -837,7 +836,7 @@ function vtkImageReslice(publicAPI, model) {
|
|
|
837
836
|
|
|
838
837
|
publicAPI.applyTransform = function (newTrans, inPoint, inOrigin, inInvSpacing) {
|
|
839
838
|
inPoint[3] = 1;
|
|
840
|
-
transformMat4(inPoint, inPoint, newTrans);
|
|
839
|
+
vec4.transformMat4(inPoint, inPoint, newTrans);
|
|
841
840
|
inPoint[0] -= inOrigin[0];
|
|
842
841
|
inPoint[1] -= inOrigin[1];
|
|
843
842
|
inPoint[2] -= inOrigin[2];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
4
5
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
5
6
|
import { r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
|
|
6
7
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
7
|
-
import { i as identity, t as translate, r as rotate } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
8
|
-
import { t as transformMat4, a as subtract, n as normalize, d as dot, h as distance, e as scaleAndAdd, c as cross$1, l as length } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
9
8
|
|
|
10
9
|
// vtkMouseCameraAxisRotateManipulator methods
|
|
11
10
|
// ----------------------------------------------------------------------------
|
|
@@ -36,34 +35,34 @@ function vtkMouseCameraAxisRotateManipulator(publicAPI, model) {
|
|
|
36
35
|
var cameraFp = camera.getFocalPoint();
|
|
37
36
|
var cameraViewUp = camera.getViewUp();
|
|
38
37
|
var cameraDirection = camera.getDirectionOfProjection();
|
|
39
|
-
identity(trans);
|
|
38
|
+
mat4.identity(trans);
|
|
40
39
|
var center = model.center,
|
|
41
40
|
rotationFactor = model.rotationFactor,
|
|
42
41
|
rotationAxis = model.rotationAxis; // Translate to center
|
|
43
42
|
|
|
44
|
-
translate(trans, trans, center);
|
|
43
|
+
mat4.translate(trans, trans, center);
|
|
45
44
|
var dx = model.previousPosition.x - position.x;
|
|
46
45
|
var dy = model.previousPosition.y - position.y;
|
|
47
46
|
var size = interactor.getView().getSize(); // Azimuth
|
|
48
47
|
|
|
49
|
-
rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), rotationAxis); // Elevation
|
|
48
|
+
mat4.rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), rotationAxis); // Elevation
|
|
50
49
|
|
|
51
50
|
cross(cameraDirection, cameraViewUp, v2);
|
|
52
|
-
rotate(trans, trans, radiansFromDegrees(-360.0 * dy / size[1] * rotationFactor), v2); // Translate back
|
|
51
|
+
mat4.rotate(trans, trans, radiansFromDegrees(-360.0 * dy / size[1] * rotationFactor), v2); // Translate back
|
|
53
52
|
|
|
54
53
|
centerNeg[0] = -center[0];
|
|
55
54
|
centerNeg[1] = -center[1];
|
|
56
55
|
centerNeg[2] = -center[2];
|
|
57
|
-
translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
56
|
+
mat4.translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
58
57
|
|
|
59
|
-
transformMat4(newCamPos, cameraPos, trans);
|
|
60
|
-
transformMat4(newFp, cameraFp, trans); // what is the current direction from the fp
|
|
58
|
+
vec3.transformMat4(newCamPos, cameraPos, trans);
|
|
59
|
+
vec3.transformMat4(newFp, cameraFp, trans); // what is the current direction from the fp
|
|
61
60
|
// to the camera
|
|
62
61
|
|
|
63
|
-
subtract(fpDirection, newCamPos, newFp);
|
|
64
|
-
normalize(fpDirection, fpDirection); // make the top sticky to avoid accidental flips
|
|
62
|
+
vec3.subtract(fpDirection, newCamPos, newFp);
|
|
63
|
+
vec3.normalize(fpDirection, fpDirection); // make the top sticky to avoid accidental flips
|
|
65
64
|
|
|
66
|
-
if (Math.abs(dot(fpDirection, rotationAxis)) > 0.95) {
|
|
65
|
+
if (Math.abs(vec3.dot(fpDirection, rotationAxis)) > 0.95) {
|
|
67
66
|
// this can be smarter where it still allows Azimuth here
|
|
68
67
|
// but prevents the elevation part
|
|
69
68
|
model.previousPosition = position;
|
|
@@ -72,41 +71,41 @@ function vtkMouseCameraAxisRotateManipulator(publicAPI, model) {
|
|
|
72
71
|
|
|
73
72
|
if (model.useHalfAxis) {
|
|
74
73
|
// what is the current distance from pos to center of rotation
|
|
75
|
-
var distance
|
|
74
|
+
var distance = vec3.distance(newCamPos, center); // what is the current direction from the center of rotation
|
|
76
75
|
// to the camera
|
|
77
76
|
|
|
78
|
-
subtract(direction, newCamPos, center);
|
|
79
|
-
normalize(direction, direction); // project the rotation axis onto the direction
|
|
77
|
+
vec3.subtract(direction, newCamPos, center);
|
|
78
|
+
vec3.normalize(direction, direction); // project the rotation axis onto the direction
|
|
80
79
|
// so we know how much below the half plane we are
|
|
81
80
|
|
|
82
|
-
var dotP = dot(rotationAxis, direction);
|
|
81
|
+
var dotP = vec3.dot(rotationAxis, direction);
|
|
83
82
|
|
|
84
83
|
if (dotP < 0) {
|
|
85
84
|
// adjust the new camera position to bring it up to the half plane
|
|
86
|
-
scaleAndAdd(newCamPos, newCamPos, rotationAxis, -dotP * distance
|
|
85
|
+
vec3.scaleAndAdd(newCamPos, newCamPos, rotationAxis, -dotP * distance); // the above step will change the distance which might feel odd
|
|
87
86
|
// so the next couple lines restore the distance to the center
|
|
88
87
|
// what is the new direction from the center of rotation
|
|
89
88
|
// to the camera
|
|
90
89
|
|
|
91
|
-
subtract(direction, newCamPos, center);
|
|
92
|
-
normalize(direction, direction);
|
|
93
|
-
scaleAndAdd(newCamPos, center, direction, distance
|
|
90
|
+
vec3.subtract(direction, newCamPos, center);
|
|
91
|
+
vec3.normalize(direction, direction);
|
|
92
|
+
vec3.scaleAndAdd(newCamPos, center, direction, distance); // compute original cam direction to center
|
|
94
93
|
|
|
95
|
-
subtract(v2, cameraPos, center);
|
|
96
|
-
normalize(v2, v2); // const rAngle = 0.0;
|
|
94
|
+
vec3.subtract(v2, cameraPos, center);
|
|
95
|
+
vec3.normalize(v2, v2); // const rAngle = 0.0;
|
|
97
96
|
|
|
98
|
-
var acosR = Math.min(1.0, Math.max(-1.0, dot(direction, v2)));
|
|
97
|
+
var acosR = Math.min(1.0, Math.max(-1.0, vec3.dot(direction, v2)));
|
|
99
98
|
var rAngle = Math.acos(acosR); // 0 to pi
|
|
100
99
|
|
|
101
|
-
cross
|
|
102
|
-
normalize(v2, v2);
|
|
103
|
-
subtract(newFp, cameraFp, center);
|
|
104
|
-
var fpDist = length(newFp); // Note it normalizes the vector to be rotated
|
|
100
|
+
vec3.cross(v2, v2, direction);
|
|
101
|
+
vec3.normalize(v2, v2);
|
|
102
|
+
vec3.subtract(newFp, cameraFp, center);
|
|
103
|
+
var fpDist = vec3.length(newFp); // Note it normalizes the vector to be rotated
|
|
105
104
|
|
|
106
105
|
var result = _toConsumableArray(newFp);
|
|
107
106
|
|
|
108
107
|
vtkMatrixBuilder.buildFromRadian().rotate(rAngle, v2).apply(result);
|
|
109
|
-
scaleAndAdd(newFp, center, result, fpDist);
|
|
108
|
+
vec3.scaleAndAdd(newFp, center, result, fpDist);
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
1
2
|
import macro from '../../macros.js';
|
|
2
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
3
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
4
5
|
import { r as radiansFromDegrees, y as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
5
|
-
import { i as identity, t as translate, r as rotate } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
6
|
-
import { t as transformMat4 } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
7
6
|
|
|
8
7
|
// vtkMouseCameraTrackballRollManipulator methods
|
|
9
8
|
// ----------------------------------------------------------------------------
|
|
@@ -52,23 +51,23 @@ function vtkMouseCameraTrackballRollManipulator(publicAPI, model) {
|
|
|
52
51
|
|
|
53
52
|
var angle = degreesFromRadians((x1 * y2 - y1 * x2) / (Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2)));
|
|
54
53
|
var center = model.center;
|
|
55
|
-
identity(transform);
|
|
54
|
+
mat4.identity(transform);
|
|
56
55
|
centerNeg[0] = -center[0];
|
|
57
56
|
centerNeg[1] = -center[1];
|
|
58
57
|
centerNeg[2] = -center[2]; // Translate to center
|
|
59
58
|
|
|
60
|
-
translate(transform, transform, center); // roll
|
|
59
|
+
mat4.translate(transform, transform, center); // roll
|
|
61
60
|
|
|
62
|
-
rotate(transform, transform, radiansFromDegrees(angle), axis); // Translate back
|
|
61
|
+
mat4.rotate(transform, transform, radiansFromDegrees(angle), axis); // Translate back
|
|
63
62
|
|
|
64
|
-
translate(transform, transform, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
63
|
+
mat4.translate(transform, transform, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
65
64
|
|
|
66
|
-
transformMat4(newCamPos, cameraPos, transform);
|
|
67
|
-
transformMat4(newFp, cameraFp, transform);
|
|
65
|
+
vec3.transformMat4(newCamPos, cameraPos, transform);
|
|
66
|
+
vec3.transformMat4(newFp, cameraFp, transform);
|
|
68
67
|
direction[0] = viewUp[0] + cameraPos[0];
|
|
69
68
|
direction[1] = viewUp[1] + cameraPos[1];
|
|
70
69
|
direction[2] = viewUp[2] + cameraPos[2];
|
|
71
|
-
transformMat4(newViewUp, direction, transform);
|
|
70
|
+
vec3.transformMat4(newViewUp, direction, transform);
|
|
72
71
|
camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);
|
|
73
72
|
camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);
|
|
74
73
|
camera.setViewUp(newViewUp[0] - newCamPos[0], newViewUp[1] - newCamPos[1], newViewUp[2] - newCamPos[2]);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
1
2
|
import macro from '../../macros.js';
|
|
2
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
3
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
4
5
|
import { t as multiplyScalar, d as dot, k as add, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
|
|
5
|
-
import { i as identity, t as translate, r as rotate } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
6
|
-
import { i as copy, t as transformMat4 } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
7
6
|
|
|
8
7
|
// vtkMouseCameraTrackballRotateManipulator methods
|
|
9
8
|
// ----------------------------------------------------------------------------
|
|
@@ -31,7 +30,7 @@ function vtkMouseCameraTrackballRotateManipulator(publicAPI, model) {
|
|
|
31
30
|
var camera = renderer.getActiveCamera();
|
|
32
31
|
var cameraPos = camera.getPosition();
|
|
33
32
|
var cameraFp = camera.getFocalPoint();
|
|
34
|
-
identity(trans);
|
|
33
|
+
mat4.identity(trans);
|
|
35
34
|
var center = model.center,
|
|
36
35
|
rotationFactor = model.rotationFactor;
|
|
37
36
|
|
|
@@ -49,38 +48,38 @@ function vtkMouseCameraTrackballRotateManipulator(publicAPI, model) {
|
|
|
49
48
|
|
|
50
49
|
if (model.useWorldUpVec) {
|
|
51
50
|
var centerOfRotation = new Float64Array(3);
|
|
52
|
-
copy(centerOfRotation, model.worldUpVec); // Compute projection of cameraPos onto worldUpVec
|
|
51
|
+
vec3.copy(centerOfRotation, model.worldUpVec); // Compute projection of cameraPos onto worldUpVec
|
|
53
52
|
|
|
54
53
|
multiplyScalar(centerOfRotation, dot(cameraPos, model.worldUpVec) / dot(model.worldUpVec, model.worldUpVec));
|
|
55
54
|
add(center, centerOfRotation, centerOfRotation);
|
|
56
|
-
translate(trans, trans, centerOfRotation);
|
|
57
|
-
rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), model.worldUpVec); // Translate back
|
|
55
|
+
mat4.translate(trans, trans, centerOfRotation);
|
|
56
|
+
mat4.rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), model.worldUpVec); // Translate back
|
|
58
57
|
|
|
59
58
|
centerOfRotation[0] = -centerOfRotation[0];
|
|
60
59
|
centerOfRotation[1] = -centerOfRotation[1];
|
|
61
60
|
centerOfRotation[2] = -centerOfRotation[2];
|
|
62
|
-
translate(trans, trans, centerOfRotation);
|
|
63
|
-
translate(trans, trans, center);
|
|
61
|
+
mat4.translate(trans, trans, centerOfRotation);
|
|
62
|
+
mat4.translate(trans, trans, center);
|
|
64
63
|
} else {
|
|
65
|
-
translate(trans, trans, center);
|
|
66
|
-
rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), viewUp);
|
|
64
|
+
mat4.translate(trans, trans, center);
|
|
65
|
+
mat4.rotate(trans, trans, radiansFromDegrees(360.0 * dx / size[0] * rotationFactor), viewUp);
|
|
67
66
|
} // Elevation
|
|
68
67
|
|
|
69
68
|
|
|
70
69
|
cross(camera.getDirectionOfProjection(), viewUp, v2);
|
|
71
|
-
rotate(trans, trans, radiansFromDegrees(-360.0 * dy / size[1] * rotationFactor), v2); // Translate back
|
|
70
|
+
mat4.rotate(trans, trans, radiansFromDegrees(-360.0 * dy / size[1] * rotationFactor), v2); // Translate back
|
|
72
71
|
|
|
73
72
|
centerNeg[0] = -center[0];
|
|
74
73
|
centerNeg[1] = -center[1];
|
|
75
74
|
centerNeg[2] = -center[2];
|
|
76
|
-
translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
75
|
+
mat4.translate(trans, trans, centerNeg); // Apply transformation to camera position, focal point, and view up
|
|
77
76
|
|
|
78
|
-
transformMat4(newCamPos, cameraPos, trans);
|
|
79
|
-
transformMat4(newFp, cameraFp, trans);
|
|
77
|
+
vec3.transformMat4(newCamPos, cameraPos, trans);
|
|
78
|
+
vec3.transformMat4(newFp, cameraFp, trans);
|
|
80
79
|
direction[0] = viewUp[0] + cameraPos[0];
|
|
81
80
|
direction[1] = viewUp[1] + cameraPos[1];
|
|
82
81
|
direction[2] = viewUp[2] + cameraPos[2];
|
|
83
|
-
transformMat4(newViewUp, direction, trans);
|
|
82
|
+
vec3.transformMat4(newViewUp, direction, trans);
|
|
84
83
|
camera.setPosition(newCamPos[0], newCamPos[1], newCamPos[2]);
|
|
85
84
|
camera.setFocalPoint(newFp[0], newFp[1], newFp[2]);
|
|
86
85
|
camera.setViewUp(newViewUp[0] - newCamPos[0], newViewUp[1] - newCamPos[1], newViewUp[2] - newCamPos[2]);
|
|
@@ -8,10 +8,9 @@ import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
|
8
8
|
import vtkPointPicker from '../../Rendering/Core/PointPicker.js';
|
|
9
9
|
import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
10
10
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
11
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
11
12
|
import macro from '../../macros.js';
|
|
12
13
|
import { z as areEquals, l as normalize, d as dot, A as clampValue, g as subtract, j as cross, t as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
13
|
-
import { i as identity, t as translate, r as rotate } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
14
|
-
import { t as transformMat4 } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
15
14
|
|
|
16
15
|
var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
|
|
17
16
|
// vtkMouseCameraUnicamRotateManipulator methods
|
|
@@ -79,25 +78,25 @@ function vtkMouseCameraUnicamRotateManipulator(publicAPI, model) {
|
|
|
79
78
|
cameraPosition[3] = 1.0;
|
|
80
79
|
cameraFocalPoint[3] = 1.0;
|
|
81
80
|
cameraViewUp[3] = 0.0;
|
|
82
|
-
var transform = identity(new Float64Array(16));
|
|
83
|
-
translate(transform, transform, [cx, cy, cz]);
|
|
84
|
-
rotate(transform, transform, angle, [ax, ay, az]);
|
|
85
|
-
translate(transform, transform, [-cx, -cy, -cz]);
|
|
81
|
+
var transform = mat4.identity(new Float64Array(16));
|
|
82
|
+
mat4.translate(transform, transform, [cx, cy, cz]);
|
|
83
|
+
mat4.rotate(transform, transform, angle, [ax, ay, az]);
|
|
84
|
+
mat4.translate(transform, transform, [-cx, -cy, -cz]);
|
|
86
85
|
var newCameraPosition = [];
|
|
87
86
|
var newCameraFocalPoint = [];
|
|
88
|
-
transformMat4(newCameraPosition, cameraPosition, transform);
|
|
89
|
-
transformMat4(newCameraFocalPoint, cameraFocalPoint, transform);
|
|
90
|
-
identity(transform);
|
|
91
|
-
rotate(transform, transform, angle, [ax, ay, az]);
|
|
87
|
+
vec3.transformMat4(newCameraPosition, cameraPosition, transform);
|
|
88
|
+
vec3.transformMat4(newCameraFocalPoint, cameraFocalPoint, transform);
|
|
89
|
+
mat4.identity(transform);
|
|
90
|
+
mat4.rotate(transform, transform, angle, [ax, ay, az]);
|
|
92
91
|
var newCameraViewUp = [];
|
|
93
|
-
transformMat4(newCameraViewUp, cameraViewUp, transform);
|
|
92
|
+
vec3.transformMat4(newCameraViewUp, cameraViewUp, transform);
|
|
94
93
|
camera.setPosition.apply(camera, newCameraPosition);
|
|
95
94
|
camera.setFocalPoint.apply(camera, newCameraFocalPoint);
|
|
96
95
|
camera.setViewUp.apply(camera, newCameraViewUp);
|
|
97
96
|
}; //----------------------------------------------------------------------------
|
|
98
97
|
|
|
99
98
|
|
|
100
|
-
var rotate
|
|
99
|
+
var rotate = function rotate(interactor, position) {
|
|
101
100
|
var _interactor$getView;
|
|
102
101
|
|
|
103
102
|
var renderer = interactor.findPokedRenderer();
|
|
@@ -300,7 +299,7 @@ function vtkMouseCameraUnicamRotateManipulator(publicAPI, model) {
|
|
|
300
299
|
}
|
|
301
300
|
|
|
302
301
|
model.state = States.IS_ROTATE;
|
|
303
|
-
rotate
|
|
302
|
+
rotate(interactor, position);
|
|
304
303
|
model.previousPosition = position;
|
|
305
304
|
}; //--------------------------------------------------------------------------
|
|
306
305
|
|
|
@@ -6,8 +6,7 @@ import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
|
6
6
|
import vtkAbstractWidget from './AbstractWidget.js';
|
|
7
7
|
import vtkImageCroppingRegionsRepresentation from './ImageCroppingRegionsRepresentation.js';
|
|
8
8
|
import Constants from './ImageCroppingRegionsWidget/Constants.js';
|
|
9
|
-
import {
|
|
10
|
-
import { t as transformMat4 } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
9
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
11
10
|
|
|
12
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
13
12
|
|
|
@@ -42,8 +41,8 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
|
|
|
42
41
|
model.classHierarchy.push('vtkImageCroppingRegionsWidget'); // camera subscription
|
|
43
42
|
|
|
44
43
|
var cameraSub = null;
|
|
45
|
-
model.indexToWorld = identity(new Float64Array(16));
|
|
46
|
-
model.worldToIndex = identity(new Float64Array(16));
|
|
44
|
+
model.indexToWorld = mat4.identity(new Float64Array(16));
|
|
45
|
+
model.worldToIndex = mat4.identity(new Float64Array(16));
|
|
47
46
|
var handlesCache = null;
|
|
48
47
|
model.widgetState = {
|
|
49
48
|
activeHandleIndex: -1,
|
|
@@ -54,13 +53,13 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
|
|
|
54
53
|
|
|
55
54
|
function worldToIndex(ain) {
|
|
56
55
|
var vout = [];
|
|
57
|
-
transformMat4(vout, ain, model.worldToIndex);
|
|
56
|
+
vec3.transformMat4(vout, ain, model.worldToIndex);
|
|
58
57
|
return vout;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
function indexToWorld(ain) {
|
|
62
61
|
var vout = [];
|
|
63
|
-
transformMat4(vout, ain, model.indexToWorld);
|
|
62
|
+
vec3.transformMat4(vout, ain, model.indexToWorld);
|
|
64
63
|
return vout;
|
|
65
64
|
} // Overridden method
|
|
66
65
|
|
|
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
3
3
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
4
|
import macro from '../../macros.js';
|
|
5
5
|
import { C as arrayRange } from '../../Common/Core/Math/index.js';
|
|
6
|
-
import
|
|
6
|
+
import WebworkerPromise from 'webworker-promise';
|
|
7
7
|
import { W as WorkerFactory } from '../../_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js';
|
|
8
8
|
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -522,7 +522,7 @@ function vtkPiecewiseGaussianWidget(publicAPI, model) {
|
|
|
522
522
|
while (arrayIndex < array.length) {
|
|
523
523
|
var worker = new WorkerFactory();
|
|
524
524
|
workers.push(worker);
|
|
525
|
-
var workerPromise = new
|
|
525
|
+
var workerPromise = new WebworkerPromise(worker);
|
|
526
526
|
var arrayStart = arrayIndex;
|
|
527
527
|
var arrayEnd = Math.min(arrayIndex + arrayStride, array.length - 1);
|
|
528
528
|
var subArray = new array.constructor(array.slice(arrayStart, arrayEnd + 1));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../../macros.js';
|
|
3
|
+
import { mat4, vec4 } from 'gl-matrix';
|
|
3
4
|
import vtkImageMapper from '../../../Rendering/Core/ImageMapper.js';
|
|
4
5
|
import vtkImageReslice from '../../../Imaging/Core/ImageReslice.js';
|
|
5
6
|
import vtkImageSlice from '../../../Rendering/Core/ImageSlice.js';
|
|
@@ -7,8 +8,6 @@ import { k as add, g as subtract, l as normalize } from '../../../Common/Core/Ma
|
|
|
7
8
|
import vtkPlaneSource from '../../../Filters/Sources/PlaneSource.js';
|
|
8
9
|
import vtkWidgetRepresentation from '../WidgetRepresentation.js';
|
|
9
10
|
import { transformPlane, boundPlane } from '../../../Widgets/Widgets3D/ResliceCursorWidget/helpers.js';
|
|
10
|
-
import { i as identity, j as transpose } from '../../../vendor/gl-matrix/esm/mat4.js';
|
|
11
|
-
import { t as transformMat4 } from '../../../vendor/gl-matrix/esm/vec4.js';
|
|
12
11
|
|
|
13
12
|
var vtkErrorMacro = macro.vtkErrorMacro;
|
|
14
13
|
var VTK_INT_MAX = 2147483647; // ----------------------------------------------------------------------------
|
|
@@ -156,7 +155,7 @@ function vtkResliceCursorRepresentation(publicAPI, model) {
|
|
|
156
155
|
var planeSizeX = normalize(planeAxis1);
|
|
157
156
|
var planeSizeY = normalize(planeAxis2);
|
|
158
157
|
var normal = model.planeSource.getNormal();
|
|
159
|
-
identity(model.newResliceAxes);
|
|
158
|
+
mat4.identity(model.newResliceAxes);
|
|
160
159
|
|
|
161
160
|
for (var i = 0; i < 3; i++) {
|
|
162
161
|
model.newResliceAxes[4 * i + 0] = planeAxis1[i];
|
|
@@ -169,9 +168,9 @@ function vtkResliceCursorRepresentation(publicAPI, model) {
|
|
|
169
168
|
var planeOrigin = [].concat(_toConsumableArray(model.planeSource.getOrigin()), [1.0]);
|
|
170
169
|
var originXYZW = [];
|
|
171
170
|
var newOriginXYZW = [];
|
|
172
|
-
transformMat4(originXYZW, planeOrigin, model.newResliceAxes);
|
|
173
|
-
transpose(model.newResliceAxes, model.newResliceAxes);
|
|
174
|
-
transformMat4(newOriginXYZW, originXYZW, model.newResliceAxes);
|
|
171
|
+
vec4.transformMat4(originXYZW, planeOrigin, model.newResliceAxes);
|
|
172
|
+
mat4.transpose(model.newResliceAxes, model.newResliceAxes);
|
|
173
|
+
vec4.transformMat4(newOriginXYZW, originXYZW, model.newResliceAxes);
|
|
175
174
|
model.newResliceAxes[4 * 3 + 0] = newOriginXYZW[0];
|
|
176
175
|
model.newResliceAxes[4 * 3 + 1] = newOriginXYZW[1];
|
|
177
176
|
model.newResliceAxes[4 * 3 + 2] = newOriginXYZW[2]; // Compute a new set of resliced extents
|
|
@@ -250,7 +249,7 @@ function vtkResliceCursorRepresentation(publicAPI, model) {
|
|
|
250
249
|
publicAPI.computeOrigin = function (matrix) {
|
|
251
250
|
var center = publicAPI.getResliceCursor().getCenter();
|
|
252
251
|
var centerTransformed = [];
|
|
253
|
-
transformMat4(centerTransformed, center, matrix);
|
|
252
|
+
vec4.transformMat4(centerTransformed, center, matrix);
|
|
254
253
|
|
|
255
254
|
for (var i = 0; i < 3; i++) {
|
|
256
255
|
matrix[4 * 3 + i] = matrix[4 * 3 + i] + center[i] - centerTransformed[i];
|
|
@@ -346,8 +345,8 @@ function extend(publicAPI, model) {
|
|
|
346
345
|
vtkWidgetRepresentation.extend(publicAPI, model, initialValues);
|
|
347
346
|
model.reslice = null;
|
|
348
347
|
model.planeSource = vtkPlaneSource.newInstance();
|
|
349
|
-
model.resliceAxes = identity(new Float64Array(16));
|
|
350
|
-
model.newResliceAxes = identity(new Float64Array(16));
|
|
348
|
+
model.resliceAxes = mat4.identity(new Float64Array(16));
|
|
349
|
+
model.newResliceAxes = mat4.identity(new Float64Array(16));
|
|
351
350
|
model.imageActor = vtkImageSlice.newInstance();
|
|
352
351
|
model.imageMapper = vtkImageMapper.newInstance();
|
|
353
352
|
model.imageMapper.setResolveCoincidentTopologyToPolygonOffset();
|
package/Rendering/Core/Actor.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
5
|
import vtkProp3D from './Prop3D.js';
|
|
5
6
|
import vtkProperty from './Property.js';
|
|
6
|
-
import { j as transpose } from '../../vendor/gl-matrix/esm/mat4.js';
|
|
7
|
-
import { t as transformMat4 } from '../../vendor/gl-matrix/esm/vec3.js';
|
|
8
7
|
|
|
9
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
10
9
|
|
|
@@ -105,9 +104,9 @@ function vtkActor(publicAPI, model) {
|
|
|
105
104
|
vtkBoundingBox.getCorners(bds, bbox);
|
|
106
105
|
publicAPI.computeMatrix();
|
|
107
106
|
var tmp4 = new Float64Array(16);
|
|
108
|
-
transpose(tmp4, model.matrix);
|
|
107
|
+
mat4.transpose(tmp4, model.matrix);
|
|
109
108
|
bbox.forEach(function (pt) {
|
|
110
|
-
return transformMat4(pt, pt, tmp4);
|
|
109
|
+
return vec3.transformMat4(pt, pt, tmp4);
|
|
111
110
|
});
|
|
112
111
|
/* eslint-disable no-multi-assign */
|
|
113
112
|
|