@ohif/app 3.9.0-beta.45 → 3.9.0-beta.47
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/dist/031089e563a18ada8441.wasm +0 -0
- package/dist/{445.bundle.38c6d2af64e41cd7c614.js → 10.bundle.c626810bd199ab63f3a2.js} +3 -3
- package/dist/{501.bundle.2f703ca4598a3be0d748.js → 129.bundle.3102eccbd5c78524c3dd.js} +6036 -11592
- package/dist/{140.bundle.fcf29be726bb9dcea834.js → 153.bundle.d3732d0fdebb39e139b4.js} +7 -4
- package/dist/{139.bundle.09e5af0a9ae8a285af77.js → 169.bundle.eeb9614e7b06f896c70f.js} +65 -535
- package/dist/{139.css → 169.css} +0 -1
- package/dist/{164.bundle.2b23bfbcb23497d7c87a.js → 196.bundle.cf8c2311aafb5312bbf7.js} +15562 -8539
- package/dist/{342.bundle.fcb2038060a062129d34.js → 202.bundle.bb0e8196739bb896dc9e.js} +238 -276
- package/dist/{129.bundle.894f29369d609094208b.js → 210.bundle.d6d6cbd1b65e4f506ed1.js} +46 -46
- package/dist/{363.bundle.c7e38cf0c1fc7d19a701.js → 217.bundle.042317b439df47cd38b1.js} +2099 -195
- package/dist/{363.css → 217.css} +1 -0
- package/dist/{14.bundle.60eed1138c62b91572a7.js → 246.bundle.288317813cd5781e64f7.js} +11 -11
- package/dist/250.bundle.4743b359797751102600.js +663 -0
- package/dist/{944.bundle.baa0880e0bbde13fccc5.js → 281.bundle.5946cbee5150dec1532f.js} +241 -254
- package/dist/{727.bundle.7b7f3962207601643615.js → 286.bundle.985c5ebbb2158c7e59ab.js} +4 -4
- package/dist/29.bundle.976319462f33868497c2.js +12347 -0
- package/dist/{675.bundle.c9720f40fd7c7e9b7e54.js → 315.bundle.92d7aefc4dc9cfd951bd.js} +18 -18
- package/dist/{218.bundle.a1709956bc65c4f54874.js → 353.bundle.58b3ea80771ebaca956b.js} +8 -8
- package/dist/{799.bundle.33fc63add3b915d0c2b2.js → 360.bundle.81592d66456d25930928.js} +62 -62
- package/dist/{555.bundle.768f1594e1d40b707342.js → 372.bundle.5e3dc2539055ca5861e6.js} +50 -50
- package/dist/{211.bundle.194272cd32bedb302303.js → 376.bundle.45b94427174400b86d5d.js} +8 -8
- package/dist/{612.bundle.297a033523539e0b47f9.js → 412.bundle.836f106f6e2896dc42a5.js} +4 -4
- package/dist/{931.bundle.058f8de4606f27b31f4f.js → 417.bundle.abf8bcee0f246002acb9.js} +25 -25
- package/dist/{370.bundle.bd9884c274c26a54dfae.js → 428.bundle.744fc5865b2d747de88a.js} +829 -1511
- package/dist/{483.bundle.0f1848f6a2cf34829fef.js → 497.bundle.ee102d6243f984113f08.js} +141 -141
- package/dist/{323.bundle.955cc8f5eb5c01295118.js → 498.bundle.bb47c493dd02451f77ef.js} +17 -17
- package/dist/{552.bundle.0d11c419f675cb5a63b1.js → 502.bundle.857675fc2cbb2fbe3e47.js} +8 -9
- package/dist/{835.bundle.5d1951da8bbc6afdf3e0.js → 530.bundle.87f8b13ff55bf7b2a6d1.js} +28 -28
- package/dist/{121.bundle.57fe5a392b0910f33c2d.js → 552.bundle.95c0f28b051797242104.js} +733 -62
- package/dist/{265.bundle.61b0e1ce9d444704a976.js → 571.bundle.a80609c9815339516d77.js} +24 -24
- package/dist/{853.bundle.26b774ab3259f3e6087c.js → 591.bundle.1dca7dfd3e0490ea6dc1.js} +15 -14
- package/dist/604.bundle.83f50929b208c60e48da.js +1950 -0
- package/dist/610.min.worker.js +1 -1
- package/dist/610.min.worker.js.map +1 -1
- package/dist/{792.bundle.485ad2f98823a4b3feb1.js → 658.bundle.219ed199728759098008.js} +17 -17
- package/dist/{989.bundle.4be1e8f36734961852a8.js → 791.bundle.be08fa50f9a84244253b.js} +11 -11
- package/dist/{722.bundle.1242e0348afc63ca4f5e.js → 793.bundle.c92f52ddff0e3bf506e6.js} +13 -13
- package/dist/{914.bundle.e15be8089bf422ed7b51.js → 818.bundle.cda4e369fdee5459a544.js} +1239 -627
- package/dist/{726.bundle.90d63d40a19b058034ee.js → 831.bundle.9e1a3495947e5bb49756.js} +512 -512
- package/dist/{382.bundle.7cdad0f12b64f248dd28.js → 842.bundle.0664bcdeb7f153ab52bb.js} +11 -11
- package/dist/{806.bundle.1ec5fda0b16e053350d7.js → 888.bundle.2d02f805cedcf5d2ee7d.js} +14 -14
- package/dist/{702.bundle.963481fbf871984b646f.js → 909.bundle.1fbb8bb4c41d0bb2994d.js} +119 -381
- package/dist/{109.bundle.b4fee2a22b622839baf5.js → 931.bundle.f6fa2a436ace89ebf60f.js} +5036 -4642
- package/dist/{141.bundle.556b4c1e4cab770417ac.js → 937.bundle.cc709c922731f9496810.js} +86 -478
- package/dist/{444.bundle.75f58f53dab4d04db97d.js → 944.bundle.194f4f4e4e55ec466b78.js} +9 -10
- package/dist/945.min.worker.js +1 -1
- package/dist/945.min.worker.js.map +1 -1
- package/dist/{194.bundle.e6fb48f13f312eded76b.js → 962.bundle.225fcd92e6a5af66b6a2.js} +33 -37
- package/dist/{920.bundle.f75637a18563de8c8235.js → 978.bundle.4edc8c4615d7e3b4717a.js} +6 -6
- package/dist/{236.bundle.34db90a140e37d34fd71.js → 993.bundle.aa31ebda5a5f62c44de5.js} +2363 -2351
- package/dist/{717.bundle.3b84fbd289af82208a19.js → 994.bundle.269ce05b16fd6aa28006.js} +90 -164
- package/dist/app-config.js +58 -4
- package/dist/app.bundle.css +3 -3
- package/dist/{app.bundle.e2d3b6781252f9c7b2a3.js → app.bundle.ecc3736aff52e6abfd49.js} +52547 -36094
- package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
- package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
- package/dist/dicom-microscopy-viewer/5004fdc02f329ce53b69.wasm +0 -0
- package/dist/dicom-microscopy-viewer/c22b37c3488e1d6c3aa4.wasm +0 -0
- package/dist/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js +3 -0
- package/dist/{dicomMicroscopyViewer.min.js.LICENSE.txt → dicom-microscopy-viewer/dicomMicroscopyViewer.min.js.LICENSE.txt} +11 -0
- package/dist/dicom-microscopy-viewer/index.worker.min.worker.js +2 -0
- package/dist/dicom-microscopy-viewer/index.worker.min.worker.js.map +1 -0
- package/dist/{histogram-worker.bundle.6b31e5ed4c4a7a6998f2.js → histogram-worker.bundle.e7e9fea2c3236b0e747a.js} +12 -16
- package/dist/index.html +1 -1
- package/dist/index.worker.5a5a581362c14598c3d9.worker.js +2 -0
- package/dist/index.worker.5a5a581362c14598c3d9.worker.js.map +1 -0
- package/dist/{polySeg.bundle.df492df5042827938ba4.js → polySeg.bundle.b25c61224998018d0f79.js} +24 -5
- package/dist/{suv-peak-worker.bundle.8f4b505fad3d371489fe.js → suv-peak-worker.bundle.eb11e71db02e52601ecf.js} +40 -21
- package/dist/sw.js +1 -1
- package/package.json +25 -33
- package/dist/117.bundle.1f7b56504d506e7259e3.js +0 -6552
- package/dist/172.bundle.e0ee762bee7496d6491e.js +0 -662
- package/dist/36785fbd89b0e17f6099.wasm +0 -0
- package/dist/62ab5d58a2bea7b5a1dc.wasm +0 -0
- package/dist/644.bundle.1e77691d2eeb96a423b0.js +0 -19159
- package/dist/75a0c2dfe07b824c7d21.wasm +0 -0
- package/dist/dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js +0 -13
- package/dist/dicomMicroscopyViewer.min.js +0 -3
- package/dist/index.worker.f4bda803c15bc6359d5f.worker.js +0 -2
- package/dist/index.worker.f4bda803c15bc6359d5f.worker.js.map +0 -1
- package/dist/index.worker.min.worker.js +0 -2
- package/dist/index.worker.min.worker.js.map +0 -1
- /package/dist/{129.css → 210.css} +0 -0
- /package/dist/{727.css → 286.css} +0 -0
- /package/dist/{172.css → 552.css} +0 -0
- /package/dist/{404.css → 757.css} +0 -0
- /package/dist/{717.css → 994.css} +0 -0
- /package/dist/{65916ef3def695744bda.wasm → dicom-microscopy-viewer/65916ef3def695744bda.wasm} +0 -0
- /package/dist/{b6b803111e2d06a825bd.wasm → dicom-microscopy-viewer/b6b803111e2d06a825bd.wasm} +0 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[250],{
|
|
3
|
+
|
|
4
|
+
/***/ 8455:
|
|
5
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
|
+
|
|
7
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8
|
+
/* harmony export */ ZP: () => (/* binding */ vtkImageData$1)
|
|
9
|
+
/* harmony export */ });
|
|
10
|
+
/* unused harmony exports extend, newInstance */
|
|
11
|
+
/* harmony import */ var _macros2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68470);
|
|
12
|
+
/* harmony import */ var _Core_Math_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59474);
|
|
13
|
+
/* harmony import */ var _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91382);
|
|
14
|
+
/* harmony import */ var _DataSet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14418);
|
|
15
|
+
/* harmony import */ var _StructuredData_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57036);
|
|
16
|
+
/* harmony import */ var _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(35368);
|
|
17
|
+
/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72076);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
vtkErrorMacro
|
|
28
|
+
} = _macros2_js__WEBPACK_IMPORTED_MODULE_0__.m;
|
|
29
|
+
|
|
30
|
+
// ----------------------------------------------------------------------------
|
|
31
|
+
// vtkImageData methods
|
|
32
|
+
// ----------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
function vtkImageData(publicAPI, model) {
|
|
35
|
+
// Set our className
|
|
36
|
+
model.classHierarchy.push('vtkImageData');
|
|
37
|
+
publicAPI.setExtent = function () {
|
|
38
|
+
if (model.deleted) {
|
|
39
|
+
vtkErrorMacro('instance deleted - cannot call any method');
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
for (var _len = arguments.length, inExtent = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
inExtent[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
const extentArray = inExtent.length === 1 ? inExtent[0] : inExtent;
|
|
46
|
+
if (extentArray.length !== 6) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const changeDetected = model.extent.some((item, index) => item !== extentArray[index]);
|
|
50
|
+
if (changeDetected) {
|
|
51
|
+
model.extent = extentArray.slice();
|
|
52
|
+
model.dataDescription = _StructuredData_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"].getDataDescriptionFromExtent */ .Z.getDataDescriptionFromExtent(model.extent);
|
|
53
|
+
publicAPI.modified();
|
|
54
|
+
}
|
|
55
|
+
return changeDetected;
|
|
56
|
+
};
|
|
57
|
+
publicAPI.setDimensions = function () {
|
|
58
|
+
let i;
|
|
59
|
+
let j;
|
|
60
|
+
let k;
|
|
61
|
+
if (model.deleted) {
|
|
62
|
+
vtkErrorMacro('instance deleted - cannot call any method');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (arguments.length === 1) {
|
|
66
|
+
const array = arguments.length <= 0 ? undefined : arguments[0];
|
|
67
|
+
i = array[0];
|
|
68
|
+
j = array[1];
|
|
69
|
+
k = array[2];
|
|
70
|
+
} else if (arguments.length === 3) {
|
|
71
|
+
i = arguments.length <= 0 ? undefined : arguments[0];
|
|
72
|
+
j = arguments.length <= 1 ? undefined : arguments[1];
|
|
73
|
+
k = arguments.length <= 2 ? undefined : arguments[2];
|
|
74
|
+
} else {
|
|
75
|
+
vtkErrorMacro('Bad dimension specification');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
publicAPI.setExtent(0, i - 1, 0, j - 1, 0, k - 1);
|
|
79
|
+
};
|
|
80
|
+
publicAPI.getDimensions = () => [model.extent[1] - model.extent[0] + 1, model.extent[3] - model.extent[2] + 1, model.extent[5] - model.extent[4] + 1];
|
|
81
|
+
publicAPI.getNumberOfCells = () => {
|
|
82
|
+
const dims = publicAPI.getDimensions();
|
|
83
|
+
let nCells = 1;
|
|
84
|
+
for (let i = 0; i < 3; i++) {
|
|
85
|
+
if (dims[i] === 0) {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
if (dims[i] > 1) {
|
|
89
|
+
nCells *= dims[i] - 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return nCells;
|
|
93
|
+
};
|
|
94
|
+
publicAPI.getNumberOfPoints = () => {
|
|
95
|
+
const dims = publicAPI.getDimensions();
|
|
96
|
+
return dims[0] * dims[1] * dims[2];
|
|
97
|
+
};
|
|
98
|
+
publicAPI.getPoint = index => {
|
|
99
|
+
const dims = publicAPI.getDimensions();
|
|
100
|
+
if (dims[0] === 0 || dims[1] === 0 || dims[2] === 0) {
|
|
101
|
+
vtkErrorMacro('Requesting a point from an empty image.');
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const ijk = new Float64Array(3);
|
|
105
|
+
switch (model.dataDescription) {
|
|
106
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.EMPTY:
|
|
107
|
+
return null;
|
|
108
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.SINGLE_POINT:
|
|
109
|
+
break;
|
|
110
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.X_LINE:
|
|
111
|
+
ijk[0] = index;
|
|
112
|
+
break;
|
|
113
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.Y_LINE:
|
|
114
|
+
ijk[1] = index;
|
|
115
|
+
break;
|
|
116
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.Z_LINE:
|
|
117
|
+
ijk[2] = index;
|
|
118
|
+
break;
|
|
119
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.XY_PLANE:
|
|
120
|
+
ijk[0] = index % dims[0];
|
|
121
|
+
ijk[1] = index / dims[0];
|
|
122
|
+
break;
|
|
123
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.YZ_PLANE:
|
|
124
|
+
ijk[1] = index % dims[1];
|
|
125
|
+
ijk[2] = index / dims[1];
|
|
126
|
+
break;
|
|
127
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.XZ_PLANE:
|
|
128
|
+
ijk[0] = index % dims[0];
|
|
129
|
+
ijk[2] = index / dims[0];
|
|
130
|
+
break;
|
|
131
|
+
case _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.XYZ_GRID:
|
|
132
|
+
ijk[0] = index % dims[0];
|
|
133
|
+
ijk[1] = index / dims[0] % dims[1];
|
|
134
|
+
ijk[2] = index / (dims[0] * dims[1]);
|
|
135
|
+
break;
|
|
136
|
+
default:
|
|
137
|
+
vtkErrorMacro('Invalid dataDescription');
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
const coords = [0, 0, 0];
|
|
141
|
+
publicAPI.indexToWorld(ijk, coords);
|
|
142
|
+
return coords;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// vtkCell *GetCell(vtkIdType cellId) VTK_OVERRIDE;
|
|
146
|
+
// void GetCell(vtkIdType cellId, vtkGenericCell *cell) VTK_OVERRIDE;
|
|
147
|
+
// void GetCellBounds(vtkIdType cellId, double bounds[6]) VTK_OVERRIDE;
|
|
148
|
+
// virtual vtkIdType FindPoint(double x, double y, double z)
|
|
149
|
+
// {
|
|
150
|
+
// return this->vtkDataSet::FindPoint(x, y, z);
|
|
151
|
+
// }
|
|
152
|
+
// vtkIdType FindPoint(double x[3]) VTK_OVERRIDE;
|
|
153
|
+
// vtkIdType FindCell(
|
|
154
|
+
// double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
|
|
155
|
+
// int& subId, double pcoords[3], double *weights) VTK_OVERRIDE;
|
|
156
|
+
// vtkIdType FindCell(
|
|
157
|
+
// double x[3], vtkCell *cell, vtkGenericCell *gencell,
|
|
158
|
+
// vtkIdType cellId, double tol2, int& subId,
|
|
159
|
+
// double pcoords[3], double *weights) VTK_OVERRIDE;
|
|
160
|
+
// vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
|
|
161
|
+
// double tol2, int& subId, double pcoords[3],
|
|
162
|
+
// double *weights) VTK_OVERRIDE;
|
|
163
|
+
// int GetCellType(vtkIdType cellId) VTK_OVERRIDE;
|
|
164
|
+
// void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) VTK_OVERRIDE
|
|
165
|
+
// {vtkStructuredData::GetCellPoints(cellId,ptIds,this->DataDescription,
|
|
166
|
+
// this->GetDimensions());}
|
|
167
|
+
// void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) VTK_OVERRIDE
|
|
168
|
+
// {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
|
|
169
|
+
// void ComputeBounds() VTK_OVERRIDE;
|
|
170
|
+
// int GetMaxCellSize() VTK_OVERRIDE {return 8;}; //voxel is the largest
|
|
171
|
+
|
|
172
|
+
publicAPI.getBounds = () => publicAPI.extentToBounds(publicAPI.getSpatialExtent());
|
|
173
|
+
publicAPI.extentToBounds = ex => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .ZP.transformBounds(ex, model.indexToWorld);
|
|
174
|
+
publicAPI.getSpatialExtent = () => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].inflate */ .ZP.inflate([...model.extent], 0.5);
|
|
175
|
+
|
|
176
|
+
// Internal, shouldn't need to call this manually.
|
|
177
|
+
publicAPI.computeTransforms = () => {
|
|
178
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat4.fromTranslation */ ._E.fromTranslation(model.indexToWorld, model.origin);
|
|
179
|
+
model.indexToWorld[0] = model.direction[0];
|
|
180
|
+
model.indexToWorld[1] = model.direction[1];
|
|
181
|
+
model.indexToWorld[2] = model.direction[2];
|
|
182
|
+
model.indexToWorld[4] = model.direction[3];
|
|
183
|
+
model.indexToWorld[5] = model.direction[4];
|
|
184
|
+
model.indexToWorld[6] = model.direction[5];
|
|
185
|
+
model.indexToWorld[8] = model.direction[6];
|
|
186
|
+
model.indexToWorld[9] = model.direction[7];
|
|
187
|
+
model.indexToWorld[10] = model.direction[8];
|
|
188
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat4.scale */ ._E.scale(model.indexToWorld, model.indexToWorld, model.spacing);
|
|
189
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat4.invert */ ._E.invert(model.worldToIndex, model.indexToWorld);
|
|
190
|
+
};
|
|
191
|
+
publicAPI.indexToWorld = function (ain) {
|
|
192
|
+
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
193
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .vec3.transformMat4 */ .R3.transformMat4(aout, ain, model.indexToWorld);
|
|
194
|
+
return aout;
|
|
195
|
+
};
|
|
196
|
+
publicAPI.indexToWorldVec3 = publicAPI.indexToWorld;
|
|
197
|
+
publicAPI.worldToIndex = function (ain) {
|
|
198
|
+
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
199
|
+
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .vec3.transformMat4 */ .R3.transformMat4(aout, ain, model.worldToIndex);
|
|
200
|
+
return aout;
|
|
201
|
+
};
|
|
202
|
+
publicAPI.worldToIndexVec3 = publicAPI.worldToIndex;
|
|
203
|
+
publicAPI.indexToWorldBounds = function (bin) {
|
|
204
|
+
let bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
205
|
+
return _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .ZP.transformBounds(bin, model.indexToWorld, bout);
|
|
206
|
+
};
|
|
207
|
+
publicAPI.worldToIndexBounds = function (bin) {
|
|
208
|
+
let bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
209
|
+
return _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .ZP.transformBounds(bin, model.worldToIndex, bout);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// Make sure the transform is correct
|
|
213
|
+
publicAPI.onModified(publicAPI.computeTransforms);
|
|
214
|
+
publicAPI.computeTransforms();
|
|
215
|
+
publicAPI.getCenter = () => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].getCenter */ .ZP.getCenter(publicAPI.getBounds());
|
|
216
|
+
publicAPI.computeHistogram = function (worldBounds) {
|
|
217
|
+
let voxelFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
218
|
+
const bounds = [0, 0, 0, 0, 0, 0];
|
|
219
|
+
publicAPI.worldToIndexBounds(worldBounds, bounds);
|
|
220
|
+
const point1 = [0, 0, 0];
|
|
221
|
+
const point2 = [0, 0, 0];
|
|
222
|
+
_BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].computeCornerPoints */ .ZP.computeCornerPoints(bounds, point1, point2);
|
|
223
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_1__.b)(point1, point1);
|
|
224
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_1__.b)(point2, point2);
|
|
225
|
+
const dimensions = publicAPI.getDimensions();
|
|
226
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_1__.c)(point1, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point1);
|
|
227
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_1__.c)(point2, [0, 0, 0], [dimensions[0] - 1, dimensions[1] - 1, dimensions[2] - 1], point2);
|
|
228
|
+
const yStride = dimensions[0];
|
|
229
|
+
const zStride = dimensions[0] * dimensions[1];
|
|
230
|
+
const pixels = publicAPI.getPointData().getScalars().getData();
|
|
231
|
+
let maximum = -Infinity;
|
|
232
|
+
let minimum = Infinity;
|
|
233
|
+
let sumOfSquares = 0;
|
|
234
|
+
let isum = 0;
|
|
235
|
+
let inum = 0;
|
|
236
|
+
for (let z = point1[2]; z <= point2[2]; z++) {
|
|
237
|
+
for (let y = point1[1]; y <= point2[1]; y++) {
|
|
238
|
+
let index = point1[0] + y * yStride + z * zStride;
|
|
239
|
+
for (let x = point1[0]; x <= point2[0]; x++) {
|
|
240
|
+
if (!voxelFunc || voxelFunc([x, y, z], bounds)) {
|
|
241
|
+
const pixel = pixels[index];
|
|
242
|
+
if (pixel > maximum) maximum = pixel;
|
|
243
|
+
if (pixel < minimum) minimum = pixel;
|
|
244
|
+
sumOfSquares += pixel * pixel;
|
|
245
|
+
isum += pixel;
|
|
246
|
+
inum += 1;
|
|
247
|
+
}
|
|
248
|
+
++index;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const average = inum > 0 ? isum / inum : 0;
|
|
253
|
+
const variance = inum ? Math.abs(sumOfSquares / inum - average * average) : 0;
|
|
254
|
+
const sigma = Math.sqrt(variance);
|
|
255
|
+
return {
|
|
256
|
+
minimum,
|
|
257
|
+
maximum,
|
|
258
|
+
average,
|
|
259
|
+
variance,
|
|
260
|
+
sigma,
|
|
261
|
+
count: inum
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).
|
|
266
|
+
// Scalar data could be tuples for color information?
|
|
267
|
+
publicAPI.computeIncrements = function (extent) {
|
|
268
|
+
let numberOfComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
269
|
+
const increments = [];
|
|
270
|
+
let incr = numberOfComponents;
|
|
271
|
+
|
|
272
|
+
// Calculate array increment offsets
|
|
273
|
+
// similar to c++ vtkImageData::ComputeIncrements
|
|
274
|
+
for (let idx = 0; idx < 3; ++idx) {
|
|
275
|
+
increments[idx] = incr;
|
|
276
|
+
incr *= extent[idx * 2 + 1] - extent[idx * 2] + 1;
|
|
277
|
+
}
|
|
278
|
+
return increments;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @param {Number[]} index the localized `[i,j,k]` pixel array position. Float values will be rounded.
|
|
283
|
+
* @return {Number} the corresponding flattened index in the scalar array
|
|
284
|
+
*/
|
|
285
|
+
publicAPI.computeOffsetIndex = _ref => {
|
|
286
|
+
let [i, j, k] = _ref;
|
|
287
|
+
const extent = publicAPI.getExtent();
|
|
288
|
+
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
289
|
+
const increments = publicAPI.computeIncrements(extent, numberOfComponents);
|
|
290
|
+
// Use the array increments to find the pixel index
|
|
291
|
+
// similar to c++ vtkImageData::GetArrayPointer
|
|
292
|
+
// Math.floor to catch "practically 0" e^-15 scenarios.
|
|
293
|
+
return Math.floor((Math.round(i) - extent[0]) * increments[0] + (Math.round(j) - extent[2]) * increments[1] + (Math.round(k) - extent[4]) * increments[2]);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @param {Number[]} xyz the [x,y,z] Array in world coordinates
|
|
298
|
+
* @return {Number|NaN} the corresponding pixel's index in the scalar array
|
|
299
|
+
*/
|
|
300
|
+
publicAPI.getOffsetIndexFromWorld = xyz => {
|
|
301
|
+
const extent = publicAPI.getExtent();
|
|
302
|
+
const index = publicAPI.worldToIndex(xyz);
|
|
303
|
+
|
|
304
|
+
// Confirm indexed i,j,k coords are within the bounds of the volume
|
|
305
|
+
for (let idx = 0; idx < 3; ++idx) {
|
|
306
|
+
if (index[idx] < extent[idx * 2] || index[idx] > extent[idx * 2 + 1]) {
|
|
307
|
+
vtkErrorMacro(`GetScalarPointer: Pixel ${index} is not in memory. Current extent = ${extent}`);
|
|
308
|
+
return NaN;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Assumed the index here is within 0 <-> scalarData.length, but doesn't hurt to check upstream
|
|
313
|
+
return publicAPI.computeOffsetIndex(index);
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* @param {Number[]} xyz the [x,y,z] Array in world coordinates
|
|
317
|
+
* @param {Number?} comp the scalar component index for multi-component scalars
|
|
318
|
+
* @return {Number|NaN} the corresponding pixel's scalar value
|
|
319
|
+
*/
|
|
320
|
+
publicAPI.getScalarValueFromWorld = function (xyz) {
|
|
321
|
+
let comp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
322
|
+
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
323
|
+
if (comp < 0 || comp >= numberOfComponents) {
|
|
324
|
+
vtkErrorMacro(`GetScalarPointer: Scalar Component ${comp} is not within bounds. Current Scalar numberOfComponents: ${numberOfComponents}`);
|
|
325
|
+
return NaN;
|
|
326
|
+
}
|
|
327
|
+
const offsetIndex = publicAPI.getOffsetIndexFromWorld(xyz);
|
|
328
|
+
if (Number.isNaN(offsetIndex)) {
|
|
329
|
+
// VTK Error Macro will have been tripped already, no need to do it again,
|
|
330
|
+
return offsetIndex;
|
|
331
|
+
}
|
|
332
|
+
return publicAPI.getPointData().getScalars().getComponent(offsetIndex, comp);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// ----------------------------------------------------------------------------
|
|
337
|
+
// Object factory
|
|
338
|
+
// ----------------------------------------------------------------------------
|
|
339
|
+
|
|
340
|
+
const DEFAULT_VALUES = {
|
|
341
|
+
direction: null,
|
|
342
|
+
// a mat3
|
|
343
|
+
indexToWorld: null,
|
|
344
|
+
// a mat4
|
|
345
|
+
worldToIndex: null,
|
|
346
|
+
// a mat4
|
|
347
|
+
spacing: [1.0, 1.0, 1.0],
|
|
348
|
+
origin: [0.0, 0.0, 0.0],
|
|
349
|
+
extent: [0, -1, 0, -1, 0, -1],
|
|
350
|
+
dataDescription: _StructuredData_Constants_js__WEBPACK_IMPORTED_MODULE_5__/* .StructuredType */ ._.EMPTY
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
// ----------------------------------------------------------------------------
|
|
354
|
+
|
|
355
|
+
function extend(publicAPI, model) {
|
|
356
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
357
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
358
|
+
|
|
359
|
+
// Inheritance
|
|
360
|
+
_DataSet_js__WEBPACK_IMPORTED_MODULE_3__["default"].extend(publicAPI, model, initialValues);
|
|
361
|
+
if (!model.direction) {
|
|
362
|
+
model.direction = gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat3.identity */ .wO.identity(new Float64Array(9));
|
|
363
|
+
} else if (Array.isArray(model.direction)) {
|
|
364
|
+
model.direction = new Float64Array(model.direction.slice(0, 9));
|
|
365
|
+
}
|
|
366
|
+
model.indexToWorld = new Float64Array(16);
|
|
367
|
+
model.worldToIndex = new Float64Array(16);
|
|
368
|
+
|
|
369
|
+
// Set/Get methods
|
|
370
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.get(publicAPI, model, ['indexToWorld', 'worldToIndex']);
|
|
371
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.setGetArray(publicAPI, model, ['origin', 'spacing'], 3);
|
|
372
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.setGetArray(publicAPI, model, ['direction'], 9);
|
|
373
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.getArray(publicAPI, model, ['extent'], 6);
|
|
374
|
+
|
|
375
|
+
// Object specific methods
|
|
376
|
+
vtkImageData(publicAPI, model);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// ----------------------------------------------------------------------------
|
|
380
|
+
|
|
381
|
+
const newInstance = _macros2_js__WEBPACK_IMPORTED_MODULE_0__.m.newInstance(extend, 'vtkImageData');
|
|
382
|
+
|
|
383
|
+
// ----------------------------------------------------------------------------
|
|
384
|
+
|
|
385
|
+
var vtkImageData$1 = {
|
|
386
|
+
newInstance,
|
|
387
|
+
extend
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
/***/ }),
|
|
394
|
+
|
|
395
|
+
/***/ 3969:
|
|
396
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
397
|
+
|
|
398
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
399
|
+
/* harmony export */ ZP: () => (/* binding */ vtkPlane$1)
|
|
400
|
+
/* harmony export */ });
|
|
401
|
+
/* unused harmony exports STATIC, extend, newInstance, vtkPlane */
|
|
402
|
+
/* harmony import */ var _Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59474);
|
|
403
|
+
/* harmony import */ var _macros2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68470);
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
const PLANE_TOLERANCE = 1.0e-6;
|
|
408
|
+
const COINCIDE = 'coincide';
|
|
409
|
+
const DISJOINT = 'disjoint';
|
|
410
|
+
|
|
411
|
+
// ----------------------------------------------------------------------------
|
|
412
|
+
// Global methods
|
|
413
|
+
// ----------------------------------------------------------------------------
|
|
414
|
+
|
|
415
|
+
function evaluate(normal, origin, x) {
|
|
416
|
+
return normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);
|
|
417
|
+
}
|
|
418
|
+
function distanceToPlane(x, origin, normal) {
|
|
419
|
+
const distance = normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);
|
|
420
|
+
return Math.abs(distance);
|
|
421
|
+
}
|
|
422
|
+
function projectPoint(x, origin, normal, xproj) {
|
|
423
|
+
const xo = [];
|
|
424
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(x, origin, xo);
|
|
425
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, xo);
|
|
426
|
+
xproj[0] = x[0] - t * normal[0];
|
|
427
|
+
xproj[1] = x[1] - t * normal[1];
|
|
428
|
+
xproj[2] = x[2] - t * normal[2];
|
|
429
|
+
}
|
|
430
|
+
function projectVector(v, normal, vproj) {
|
|
431
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(v, normal);
|
|
432
|
+
let n2 = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, normal);
|
|
433
|
+
if (n2 === 0) {
|
|
434
|
+
n2 = 1.0;
|
|
435
|
+
}
|
|
436
|
+
vproj[0] = v[0] - t * normal[0] / n2;
|
|
437
|
+
vproj[1] = v[1] - t * normal[1] / n2;
|
|
438
|
+
vproj[2] = v[2] - t * normal[2] / n2;
|
|
439
|
+
return vproj;
|
|
440
|
+
}
|
|
441
|
+
function generalizedProjectPoint(x, origin, normal, xproj) {
|
|
442
|
+
const xo = [];
|
|
443
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(x, origin, xo);
|
|
444
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, xo);
|
|
445
|
+
const n2 = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, normal);
|
|
446
|
+
if (n2 !== 0) {
|
|
447
|
+
xproj[0] = x[0] - t * normal[0] / n2;
|
|
448
|
+
xproj[1] = x[1] - t * normal[1] / n2;
|
|
449
|
+
xproj[2] = x[2] - t * normal[2] / n2;
|
|
450
|
+
} else {
|
|
451
|
+
xproj[0] = x[0];
|
|
452
|
+
xproj[1] = x[1];
|
|
453
|
+
xproj[2] = x[2];
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function intersectWithLine(p1, p2, origin, normal) {
|
|
457
|
+
const outObj = {
|
|
458
|
+
intersection: false,
|
|
459
|
+
betweenPoints: false,
|
|
460
|
+
t: Number.MAX_VALUE,
|
|
461
|
+
x: []
|
|
462
|
+
};
|
|
463
|
+
const p21 = [];
|
|
464
|
+
const p1Origin = [];
|
|
465
|
+
// Compute line vector
|
|
466
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(p2, p1, p21);
|
|
467
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(origin, p1, p1Origin);
|
|
468
|
+
|
|
469
|
+
// Compute denominator. If ~0, line and plane are parallel.
|
|
470
|
+
// const num = vtkMath.dot(normal, origin) - vtkMath.dot(normal, p1);
|
|
471
|
+
const num = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, p1Origin);
|
|
472
|
+
const den = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, p21);
|
|
473
|
+
|
|
474
|
+
// If denominator with respect to numerator is "zero", then the line and
|
|
475
|
+
// plane are considered parallel.
|
|
476
|
+
let fabsden;
|
|
477
|
+
let fabstolerance;
|
|
478
|
+
|
|
479
|
+
// Trying to avoid an expensive call to fabs()
|
|
480
|
+
if (den < 0.0) {
|
|
481
|
+
fabsden = -den;
|
|
482
|
+
} else {
|
|
483
|
+
fabsden = den;
|
|
484
|
+
}
|
|
485
|
+
if (num < 0.0) {
|
|
486
|
+
fabstolerance = -num * PLANE_TOLERANCE;
|
|
487
|
+
} else {
|
|
488
|
+
fabstolerance = num * PLANE_TOLERANCE;
|
|
489
|
+
}
|
|
490
|
+
if (fabsden <= fabstolerance) {
|
|
491
|
+
return outObj;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// Where on the line between p1 and p2 is the intersection
|
|
495
|
+
// If between 0 and 1, it is between the two points. If < 0 it's before p1, if > 1 it's after p2
|
|
496
|
+
outObj.t = num / den;
|
|
497
|
+
outObj.x[0] = p1[0] + outObj.t * p21[0];
|
|
498
|
+
outObj.x[1] = p1[1] + outObj.t * p21[1];
|
|
499
|
+
outObj.x[2] = p1[2] + outObj.t * p21[2];
|
|
500
|
+
outObj.intersection = true;
|
|
501
|
+
outObj.betweenPoints = outObj.t >= 0.0 && outObj.t <= 1.0;
|
|
502
|
+
return outObj;
|
|
503
|
+
}
|
|
504
|
+
function intersectWithPlane(plane1Origin, plane1Normal, plane2Origin, plane2Normal) {
|
|
505
|
+
const outObj = {
|
|
506
|
+
intersection: false,
|
|
507
|
+
l0: [],
|
|
508
|
+
l1: [],
|
|
509
|
+
error: null
|
|
510
|
+
};
|
|
511
|
+
const cross$1 = [];
|
|
512
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.j)(plane1Normal, plane2Normal, cross$1);
|
|
513
|
+
const absCross = cross$1.map(n => Math.abs(n));
|
|
514
|
+
|
|
515
|
+
// test if the two planes are parallel
|
|
516
|
+
if (absCross[0] + absCross[1] + absCross[2] < PLANE_TOLERANCE) {
|
|
517
|
+
// test if disjoint or coincide
|
|
518
|
+
const v = [];
|
|
519
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(plane1Origin, plane2Origin, v);
|
|
520
|
+
if ((0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane1Normal, v) === 0) {
|
|
521
|
+
outObj.error = COINCIDE;
|
|
522
|
+
} else {
|
|
523
|
+
outObj.error = DISJOINT;
|
|
524
|
+
}
|
|
525
|
+
return outObj;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// Plane1 and Plane2 intersect in a line
|
|
529
|
+
// first determine max abs coordinate of the cross product
|
|
530
|
+
let maxc;
|
|
531
|
+
if (absCross[0] > absCross[1] && absCross[0] > absCross[2]) {
|
|
532
|
+
maxc = 'x';
|
|
533
|
+
} else if (absCross[1] > absCross[2]) {
|
|
534
|
+
maxc = 'y';
|
|
535
|
+
} else {
|
|
536
|
+
maxc = 'z';
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// To get a point on the intersect line, zero the max coord, and solve for the other two
|
|
540
|
+
const iP = []; // intersectionPoint
|
|
541
|
+
// the constants in the 2 plane equations
|
|
542
|
+
const d1 = -(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane1Normal, plane1Origin);
|
|
543
|
+
const d2 = -(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane2Normal, plane2Origin);
|
|
544
|
+
|
|
545
|
+
// eslint-disable-next-line default-case
|
|
546
|
+
switch (maxc) {
|
|
547
|
+
case 'x':
|
|
548
|
+
// intersect with x=0
|
|
549
|
+
iP[0] = 0;
|
|
550
|
+
iP[1] = (d2 * plane1Normal[2] - d1 * plane2Normal[2]) / cross$1[0];
|
|
551
|
+
iP[2] = (d1 * plane2Normal[1] - d2 * plane1Normal[1]) / cross$1[0];
|
|
552
|
+
break;
|
|
553
|
+
case 'y':
|
|
554
|
+
// intersect with y=0
|
|
555
|
+
iP[0] = (d1 * plane2Normal[2] - d2 * plane1Normal[2]) / cross$1[1];
|
|
556
|
+
iP[1] = 0;
|
|
557
|
+
iP[2] = (d2 * plane1Normal[0] - d1 * plane2Normal[0]) / cross$1[1];
|
|
558
|
+
break;
|
|
559
|
+
case 'z':
|
|
560
|
+
// intersect with z=0
|
|
561
|
+
iP[0] = (d2 * plane1Normal[1] - d1 * plane2Normal[1]) / cross$1[2];
|
|
562
|
+
iP[1] = (d1 * plane2Normal[0] - d2 * plane1Normal[0]) / cross$1[2];
|
|
563
|
+
iP[2] = 0;
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
outObj.l0 = iP;
|
|
567
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.k)(iP, cross$1, outObj.l1);
|
|
568
|
+
outObj.intersection = true;
|
|
569
|
+
return outObj;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// ----------------------------------------------------------------------------
|
|
573
|
+
// Static API
|
|
574
|
+
// ----------------------------------------------------------------------------
|
|
575
|
+
|
|
576
|
+
const STATIC = {
|
|
577
|
+
evaluate,
|
|
578
|
+
distanceToPlane,
|
|
579
|
+
projectPoint,
|
|
580
|
+
projectVector,
|
|
581
|
+
generalizedProjectPoint,
|
|
582
|
+
intersectWithLine,
|
|
583
|
+
intersectWithPlane,
|
|
584
|
+
DISJOINT,
|
|
585
|
+
COINCIDE
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
// ----------------------------------------------------------------------------
|
|
589
|
+
// vtkPlane methods
|
|
590
|
+
// ----------------------------------------------------------------------------
|
|
591
|
+
|
|
592
|
+
function vtkPlane(publicAPI, model) {
|
|
593
|
+
// Set our className
|
|
594
|
+
model.classHierarchy.push('vtkPlane');
|
|
595
|
+
publicAPI.distanceToPlane = x => distanceToPlane(x, model.origin, model.normal);
|
|
596
|
+
publicAPI.projectPoint = (x, xproj) => {
|
|
597
|
+
projectPoint(x, model.origin, model.normal, xproj);
|
|
598
|
+
};
|
|
599
|
+
publicAPI.projectVector = (v, vproj) => projectVector(v, model.normal, vproj);
|
|
600
|
+
publicAPI.push = distance => {
|
|
601
|
+
if (distance === 0.0) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
for (let i = 0; i < 3; i++) {
|
|
605
|
+
model.origin[i] += distance * model.normal[i];
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
publicAPI.generalizedProjectPoint = (x, xproj) => {
|
|
609
|
+
generalizedProjectPoint(x, model.origin, model.normal, xproj);
|
|
610
|
+
};
|
|
611
|
+
publicAPI.evaluateFunction = (x, y, z) => {
|
|
612
|
+
if (!Array.isArray(x)) {
|
|
613
|
+
return model.normal[0] * (x - model.origin[0]) + model.normal[1] * (y - model.origin[1]) + model.normal[2] * (z - model.origin[2]);
|
|
614
|
+
}
|
|
615
|
+
return model.normal[0] * (x[0] - model.origin[0]) + model.normal[1] * (x[1] - model.origin[1]) + model.normal[2] * (x[2] - model.origin[2]);
|
|
616
|
+
};
|
|
617
|
+
publicAPI.evaluateGradient = xyz => {
|
|
618
|
+
const retVal = [model.normal[0], model.normal[1], model.normal[2]];
|
|
619
|
+
return retVal;
|
|
620
|
+
};
|
|
621
|
+
publicAPI.intersectWithLine = (p1, p2) => intersectWithLine(p1, p2, model.origin, model.normal);
|
|
622
|
+
publicAPI.intersectWithPlane = (planeOrigin, planeNormal) => intersectWithPlane(planeOrigin, planeNormal, model.origin, model.normal);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// ----------------------------------------------------------------------------
|
|
626
|
+
// Object factory
|
|
627
|
+
// ----------------------------------------------------------------------------
|
|
628
|
+
|
|
629
|
+
const DEFAULT_VALUES = {
|
|
630
|
+
normal: [0.0, 0.0, 1.0],
|
|
631
|
+
origin: [0.0, 0.0, 0.0]
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
// ----------------------------------------------------------------------------
|
|
635
|
+
|
|
636
|
+
function extend(publicAPI, model) {
|
|
637
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
638
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
639
|
+
|
|
640
|
+
// Object methods
|
|
641
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_1__.m.obj(publicAPI, model);
|
|
642
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_1__.m.setGetArray(publicAPI, model, ['normal', 'origin'], 3);
|
|
643
|
+
vtkPlane(publicAPI, model);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// ----------------------------------------------------------------------------
|
|
647
|
+
|
|
648
|
+
const newInstance = _macros2_js__WEBPACK_IMPORTED_MODULE_1__.m.newInstance(extend, 'vtkPlane');
|
|
649
|
+
|
|
650
|
+
// ----------------------------------------------------------------------------
|
|
651
|
+
|
|
652
|
+
var vtkPlane$1 = {
|
|
653
|
+
newInstance,
|
|
654
|
+
extend,
|
|
655
|
+
...STATIC
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
/***/ })
|
|
662
|
+
|
|
663
|
+
}]);
|