vue-visual-kit 1.0.202507241746 → 1.0.202507242114
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/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/package.json +3 -2
- package/patches/@cornerstonejs+core+3.19.3.patch +191 -191
- package/patches/@cornerstonejs+tools+3.19.3.patch +114 -114
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-visual-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.202507242114",
|
|
4
4
|
"private": false,
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"@cornerstonejs/core": "^3.15.3",
|
|
27
27
|
"@cornerstonejs/dicom-image-loader": "^3.15.3",
|
|
28
28
|
"@cornerstonejs/polymorphic-segmentation": "^3.15.3",
|
|
29
|
-
"@cornerstonejs/tools": "^3.15.3"
|
|
29
|
+
"@cornerstonejs/tools": "^3.15.3",
|
|
30
|
+
"@kitware/vtk.js": "^32.12.1"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@cornerstonejs/core": "^3.15.3",
|
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
2
|
-
index 75d8c08..8f58cc2 100644
|
|
3
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
4
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
5
|
-
@@ -1,6 +1,7 @@
|
|
6
|
-
import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
|
|
7
|
-
import vtkColorMaps from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
8
|
-
import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
|
|
9
|
-
+import vtkCellPicker from '@kitware/vtk.js/Rendering/Core/CellPicker';
|
|
10
|
-
import { vec2, vec3 } from 'gl-matrix';
|
|
11
|
-
import cache from '../cache/cache';
|
|
12
|
-
import { MPR_CAMERA_VALUES, RENDERING_DEFAULTS, VIEWPORT_PRESETS, } from '../constants';
|
|
13
|
-
@@ -163,6 +164,50 @@ class BaseVolumeViewport extends Viewport {
|
|
14
|
-
vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
15
|
-
return [worldCoord[0], worldCoord[1], worldCoord[2]];
|
|
16
|
-
};
|
|
17
|
-
+ this.canvasToWorldV2 = (canvasPos) => {
|
|
18
|
-
+ const vtkCamera = this.getVtkActiveCamera();
|
|
19
|
-
+ vtkCamera.setIsPerformingCoordinateTransformation?.(true);
|
|
20
|
-
+ const renderer = this.getRenderer();
|
|
21
|
-
+ const displayCoords = this.getVtkDisplayCoords(canvasPos);
|
|
22
|
-
+ const picker = vtkCellPicker.newInstance({ opacityThreshold: 0.0001 });
|
|
23
|
-
+ picker.setTolerance(0);
|
|
24
|
-
+ picker.pick(displayCoords, renderer);
|
|
25
|
-
+ if (picker.getActors().length>0) {
|
|
26
|
-
+ const worldCoord = picker.getPickPosition();
|
|
27
|
-
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
28
|
-
+ return worldCoord
|
|
29
|
-
+ } else {
|
|
30
|
-
+ const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow;
|
|
31
|
-
+ const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow();
|
|
32
|
-
+ const worldCoord = openGLRenderWindow.displayToWorld(displayCoords[0], displayCoords[1], displayCoords[2], renderer);
|
|
33
|
-
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
34
|
-
+ return [worldCoord[0], worldCoord[1], worldCoord[2]];
|
|
35
|
-
+ }
|
|
36
|
-
+ };
|
|
37
|
-
+ this.canvasToPickerActors = (canvasPos) => {
|
|
38
|
-
+ const vtkCamera = this.getVtkActiveCamera();
|
|
39
|
-
+ vtkCamera.setIsPerformingCoordinateTransformation?.(true);
|
|
40
|
-
+ const renderer = this.getRenderer();
|
|
41
|
-
+ const displayCoords = this.getVtkDisplayCoords(canvasPos);
|
|
42
|
-
+ const picker = vtkCellPicker.newInstance({ opacityThreshold: 0.0001 });
|
|
43
|
-
+ picker.setTolerance(0);
|
|
44
|
-
+ picker.pick(displayCoords, renderer);
|
|
45
|
-
+ const pickedActors = picker.getActors();
|
|
46
|
-
+ const result = [];
|
|
47
|
-
+ if (pickedActors.length>0) {
|
|
48
|
-
+ pickedActors.forEach(it => {
|
|
49
|
-
+ const tmp = it.get('custome');
|
|
50
|
-
+ if(tmp.custome && tmp.custome.id) {
|
|
51
|
-
+ result.push({
|
|
52
|
-
+ id: tmp.custome.id,
|
|
53
|
-
+ name: tmp.custome.name
|
|
54
|
-
+ })
|
|
55
|
-
+ }
|
|
56
|
-
+ })
|
|
57
|
-
+ }
|
|
58
|
-
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
59
|
-
+ return result;
|
|
60
|
-
+ };
|
|
61
|
-
this.getVtkDisplayCoords = (canvasPos) => {
|
|
62
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
63
|
-
const canvasPosWithDPR = [
|
|
64
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
65
|
-
index 130df4a..b8f9ddd 100644
|
|
66
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
67
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
68
|
-
@@ -542,7 +542,7 @@ class RenderingEngine {
|
|
69
|
-
let eventDetail;
|
|
70
|
-
if (viewport.sWidth < VIEWPORT_MIN_SIZE ||
|
|
71
|
-
viewport.sHeight < VIEWPORT_MIN_SIZE) {
|
|
72
|
-
- console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
|
|
73
|
-
+ // console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (viewportTypeUsesCustomRenderingPipeline(viewport.type) === true) {
|
|
77
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js b/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
78
|
-
index 46aba9e..c3c6e52 100644
|
|
79
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
80
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
81
|
-
@@ -6,6 +6,7 @@ import vtkXMLPolyDataReader from '@kitware/vtk.js/IO/XML/XMLPolyDataReader';
|
|
82
|
-
import vtkOBJReader from '@kitware/vtk.js/IO/Misc/OBJReader';
|
|
83
|
-
import vtkProperty from '@kitware/vtk.js/Rendering/Core/Property';
|
|
84
|
-
import vtkPolyDataNormals from '@kitware/vtk.js/Filters/Core/PolyDataNormals';
|
|
85
|
-
+import vtkWindowedSincPolyDataFilter from '@kitware/vtk.js/Filters/General/WindowedSincPolyDataFilter';
|
|
86
|
-
import { MeshType } from '../../enums';
|
|
87
|
-
export class Mesh {
|
|
88
|
-
constructor(props) {
|
|
89
|
-
@@ -14,13 +15,22 @@ export class Mesh {
|
|
90
|
-
this.id = props.id;
|
|
91
|
-
this._color = props.color ?? this._color;
|
|
92
|
-
this._format = props.format;
|
|
93
|
-
+ this._sincOption = props.sincOption;
|
|
94
|
-
+ this._normalOption = props.normalOption;
|
|
95
|
-
+ this._smoothFlag = props.smoothFlag;
|
|
96
|
-
const textDecoder = new TextDecoder();
|
|
97
|
-
- const normals = vtkPolyDataNormals.newInstance();
|
|
98
|
-
+ let normals = null
|
|
99
|
-
+ if(this._smoothFlag) {
|
|
100
|
-
+ normals = vtkPolyDataNormals.newInstance(this._normalOption)
|
|
101
|
-
+ } else {
|
|
102
|
-
+ normals = vtkPolyDataNormals.newInstance()
|
|
103
|
-
+ }
|
|
104
|
-
const createActorWithMapper = (mapper) => {
|
|
105
|
-
const actor = vtkActor.newInstance();
|
|
106
|
-
actor.setMapper(mapper);
|
|
107
|
-
const property = vtkProperty.newInstance();
|
|
108
|
-
property.setColor(this._color[0] / 255, this._color[1] / 255, this._color[2] / 255);
|
|
109
|
-
+ property.setInterpolationToPhong();
|
|
110
|
-
actor.setProperty(property);
|
|
111
|
-
return actor;
|
|
112
|
-
};
|
|
113
|
-
@@ -35,8 +45,15 @@ export class Mesh {
|
|
114
|
-
const mapper = vtkMapper.newInstance();
|
|
115
|
-
const reader = vtkSTLReader.newInstance();
|
|
116
|
-
reader.parseAsArrayBuffer(props.arrayBuffer);
|
|
117
|
-
- normals.setInputConnection(reader.getOutputPort());
|
|
118
|
-
+ if(this._smoothFlag) {
|
|
119
|
-
+ const smoothFilter = vtkWindowedSincPolyDataFilter.newInstance(this._sincOption)
|
|
120
|
-
+ smoothFilter.setInputConnection(reader.getOutputPort());
|
|
121
|
-
+ normals.setInputConnection(smoothFilter.getOutputPort());
|
|
122
|
-
+ } else {
|
|
123
|
-
+ normals.setInputConnection(reader.getOutputPort());
|
|
124
|
-
+ }
|
|
125
|
-
mapper.setInputConnection(normals.getOutputPort());
|
|
126
|
-
+ mapper.setScalarVisibility(false);
|
|
127
|
-
this._actors.push(createActorWithMapper(mapper));
|
|
128
|
-
}
|
|
129
|
-
else if (this._format === MeshType.OBJ) {
|
|
130
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js b/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
131
|
-
index f866524..2935ac9 100644
|
|
132
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
133
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
134
|
-
@@ -23,6 +23,18 @@ const presets = [
|
|
135
|
-
diffuse: '0.9',
|
|
136
|
-
interpolation: '1',
|
|
137
|
-
},
|
|
138
|
-
+ {
|
|
139
|
-
+ name: 'CT-NONE',
|
|
140
|
-
+ gradientOpacity: '4 0 1 0 1',
|
|
141
|
-
+ specularPower: '10',
|
|
142
|
-
+ scalarOpacity: '16 0 0 0 0 0 0 0 0',
|
|
143
|
-
+ specular: '0.2',
|
|
144
|
-
+ shade: '1',
|
|
145
|
-
+ ambient: '0.1',
|
|
146
|
-
+ colorTransfer: '16 -3024 0 0 0 -16.4458 0.729412 0.254902 0.301961 641.385 0.905882 0.815686 0.552941 3071 1 1 1',
|
|
147
|
-
+ diffuse: '0.9',
|
|
148
|
-
+ interpolation: '1',
|
|
149
|
-
+ },
|
|
150
|
-
{
|
|
151
|
-
name: 'CT-Bone',
|
|
152
|
-
gradientOpacity: '4 0 1 255 1',
|
|
153
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js b/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
154
|
-
index fb16294..aef45b1 100644
|
|
155
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
156
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
157
|
-
@@ -24,7 +24,7 @@ function cornerstoneStreamingImageVolumeLoader(volumeId, options) {
|
|
158
|
-
imageLoadPoolManager.addRequest(async () => {
|
|
159
|
-
loadImage(imageId)
|
|
160
|
-
.then(() => {
|
|
161
|
-
- console.log(`Prefetched imageId: ${imageId}`);
|
|
162
|
-
+ // console.log(`Prefetched imageId: ${imageId}`);
|
|
163
|
-
resolve(true);
|
|
164
|
-
})
|
|
165
|
-
.catch((err) => {
|
|
166
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js b/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
167
|
-
index 7701b73..4319713 100644
|
|
168
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
169
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
170
|
-
@@ -413,7 +413,7 @@ export default class VoxelManager {
|
|
171
|
-
}
|
|
172
|
-
const image = cache.getImage(imageId);
|
|
173
|
-
if (!image) {
|
|
174
|
-
- console.warn(`Image not found for imageId: ${imageId}`);
|
|
175
|
-
+ // console.warn(`Image not found for imageId: ${imageId}`);
|
|
176
|
-
return { pixelData: null, pixelIndex: null };
|
|
177
|
-
}
|
|
178
|
-
const voxelManager = image.voxelManager;
|
|
179
|
-
diff --git a/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js b/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
180
|
-
index 02c8518..b5a9b0e 100644
|
|
181
|
-
--- a/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
182
|
-
+++ b/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
183
|
-
@@ -26,7 +26,7 @@ export default function getClosestImageId(imageVolume, worldPos, viewPlaneNormal
|
|
184
|
-
const imageId = imageIds[i];
|
|
185
|
-
const imagePlaneModule = metaData.get('imagePlaneModule', imageId);
|
|
186
|
-
if (!imagePlaneModule?.imagePositionPatient) {
|
|
187
|
-
- log.warn(`Missing imagePositionPatient for imageId: ${imageId}`);
|
|
188
|
-
+ // log.warn(`Missing imagePositionPatient for imageId: ${imageId}`);
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
const { imagePositionPatient } = imagePlaneModule;
|
|
1
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
2
|
+
index 75d8c08..8f58cc2 100644
|
|
3
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
4
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js
|
|
5
|
+
@@ -1,6 +1,7 @@
|
|
6
|
+
import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
|
|
7
|
+
import vtkColorMaps from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
8
|
+
import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
|
|
9
|
+
+import vtkCellPicker from '@kitware/vtk.js/Rendering/Core/CellPicker';
|
|
10
|
+
import { vec2, vec3 } from 'gl-matrix';
|
|
11
|
+
import cache from '../cache/cache';
|
|
12
|
+
import { MPR_CAMERA_VALUES, RENDERING_DEFAULTS, VIEWPORT_PRESETS, } from '../constants';
|
|
13
|
+
@@ -163,6 +164,50 @@ class BaseVolumeViewport extends Viewport {
|
|
14
|
+
vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
15
|
+
return [worldCoord[0], worldCoord[1], worldCoord[2]];
|
|
16
|
+
};
|
|
17
|
+
+ this.canvasToWorldV2 = (canvasPos) => {
|
|
18
|
+
+ const vtkCamera = this.getVtkActiveCamera();
|
|
19
|
+
+ vtkCamera.setIsPerformingCoordinateTransformation?.(true);
|
|
20
|
+
+ const renderer = this.getRenderer();
|
|
21
|
+
+ const displayCoords = this.getVtkDisplayCoords(canvasPos);
|
|
22
|
+
+ const picker = vtkCellPicker.newInstance({ opacityThreshold: 0.0001 });
|
|
23
|
+
+ picker.setTolerance(0);
|
|
24
|
+
+ picker.pick(displayCoords, renderer);
|
|
25
|
+
+ if (picker.getActors().length>0) {
|
|
26
|
+
+ const worldCoord = picker.getPickPosition();
|
|
27
|
+
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
28
|
+
+ return worldCoord
|
|
29
|
+
+ } else {
|
|
30
|
+
+ const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow;
|
|
31
|
+
+ const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow();
|
|
32
|
+
+ const worldCoord = openGLRenderWindow.displayToWorld(displayCoords[0], displayCoords[1], displayCoords[2], renderer);
|
|
33
|
+
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
34
|
+
+ return [worldCoord[0], worldCoord[1], worldCoord[2]];
|
|
35
|
+
+ }
|
|
36
|
+
+ };
|
|
37
|
+
+ this.canvasToPickerActors = (canvasPos) => {
|
|
38
|
+
+ const vtkCamera = this.getVtkActiveCamera();
|
|
39
|
+
+ vtkCamera.setIsPerformingCoordinateTransformation?.(true);
|
|
40
|
+
+ const renderer = this.getRenderer();
|
|
41
|
+
+ const displayCoords = this.getVtkDisplayCoords(canvasPos);
|
|
42
|
+
+ const picker = vtkCellPicker.newInstance({ opacityThreshold: 0.0001 });
|
|
43
|
+
+ picker.setTolerance(0);
|
|
44
|
+
+ picker.pick(displayCoords, renderer);
|
|
45
|
+
+ const pickedActors = picker.getActors();
|
|
46
|
+
+ const result = [];
|
|
47
|
+
+ if (pickedActors.length>0) {
|
|
48
|
+
+ pickedActors.forEach(it => {
|
|
49
|
+
+ const tmp = it.get('custome');
|
|
50
|
+
+ if(tmp.custome && tmp.custome.id) {
|
|
51
|
+
+ result.push({
|
|
52
|
+
+ id: tmp.custome.id,
|
|
53
|
+
+ name: tmp.custome.name
|
|
54
|
+
+ })
|
|
55
|
+
+ }
|
|
56
|
+
+ })
|
|
57
|
+
+ }
|
|
58
|
+
+ vtkCamera.setIsPerformingCoordinateTransformation?.(false);
|
|
59
|
+
+ return result;
|
|
60
|
+
+ };
|
|
61
|
+
this.getVtkDisplayCoords = (canvasPos) => {
|
|
62
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
63
|
+
const canvasPosWithDPR = [
|
|
64
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
65
|
+
index 130df4a..b8f9ddd 100644
|
|
66
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
67
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js
|
|
68
|
+
@@ -542,7 +542,7 @@ class RenderingEngine {
|
|
69
|
+
let eventDetail;
|
|
70
|
+
if (viewport.sWidth < VIEWPORT_MIN_SIZE ||
|
|
71
|
+
viewport.sHeight < VIEWPORT_MIN_SIZE) {
|
|
72
|
+
- console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
|
|
73
|
+
+ // console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (viewportTypeUsesCustomRenderingPipeline(viewport.type) === true) {
|
|
77
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js b/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
78
|
+
index 46aba9e..c3c6e52 100644
|
|
79
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
80
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/cache/classes/Mesh.js
|
|
81
|
+
@@ -6,6 +6,7 @@ import vtkXMLPolyDataReader from '@kitware/vtk.js/IO/XML/XMLPolyDataReader';
|
|
82
|
+
import vtkOBJReader from '@kitware/vtk.js/IO/Misc/OBJReader';
|
|
83
|
+
import vtkProperty from '@kitware/vtk.js/Rendering/Core/Property';
|
|
84
|
+
import vtkPolyDataNormals from '@kitware/vtk.js/Filters/Core/PolyDataNormals';
|
|
85
|
+
+import vtkWindowedSincPolyDataFilter from '@kitware/vtk.js/Filters/General/WindowedSincPolyDataFilter';
|
|
86
|
+
import { MeshType } from '../../enums';
|
|
87
|
+
export class Mesh {
|
|
88
|
+
constructor(props) {
|
|
89
|
+
@@ -14,13 +15,22 @@ export class Mesh {
|
|
90
|
+
this.id = props.id;
|
|
91
|
+
this._color = props.color ?? this._color;
|
|
92
|
+
this._format = props.format;
|
|
93
|
+
+ this._sincOption = props.sincOption;
|
|
94
|
+
+ this._normalOption = props.normalOption;
|
|
95
|
+
+ this._smoothFlag = props.smoothFlag;
|
|
96
|
+
const textDecoder = new TextDecoder();
|
|
97
|
+
- const normals = vtkPolyDataNormals.newInstance();
|
|
98
|
+
+ let normals = null
|
|
99
|
+
+ if(this._smoothFlag) {
|
|
100
|
+
+ normals = vtkPolyDataNormals.newInstance(this._normalOption)
|
|
101
|
+
+ } else {
|
|
102
|
+
+ normals = vtkPolyDataNormals.newInstance()
|
|
103
|
+
+ }
|
|
104
|
+
const createActorWithMapper = (mapper) => {
|
|
105
|
+
const actor = vtkActor.newInstance();
|
|
106
|
+
actor.setMapper(mapper);
|
|
107
|
+
const property = vtkProperty.newInstance();
|
|
108
|
+
property.setColor(this._color[0] / 255, this._color[1] / 255, this._color[2] / 255);
|
|
109
|
+
+ property.setInterpolationToPhong();
|
|
110
|
+
actor.setProperty(property);
|
|
111
|
+
return actor;
|
|
112
|
+
};
|
|
113
|
+
@@ -35,8 +45,15 @@ export class Mesh {
|
|
114
|
+
const mapper = vtkMapper.newInstance();
|
|
115
|
+
const reader = vtkSTLReader.newInstance();
|
|
116
|
+
reader.parseAsArrayBuffer(props.arrayBuffer);
|
|
117
|
+
- normals.setInputConnection(reader.getOutputPort());
|
|
118
|
+
+ if(this._smoothFlag) {
|
|
119
|
+
+ const smoothFilter = vtkWindowedSincPolyDataFilter.newInstance(this._sincOption)
|
|
120
|
+
+ smoothFilter.setInputConnection(reader.getOutputPort());
|
|
121
|
+
+ normals.setInputConnection(smoothFilter.getOutputPort());
|
|
122
|
+
+ } else {
|
|
123
|
+
+ normals.setInputConnection(reader.getOutputPort());
|
|
124
|
+
+ }
|
|
125
|
+
mapper.setInputConnection(normals.getOutputPort());
|
|
126
|
+
+ mapper.setScalarVisibility(false);
|
|
127
|
+
this._actors.push(createActorWithMapper(mapper));
|
|
128
|
+
}
|
|
129
|
+
else if (this._format === MeshType.OBJ) {
|
|
130
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js b/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
131
|
+
index f866524..2935ac9 100644
|
|
132
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
133
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js
|
|
134
|
+
@@ -23,6 +23,18 @@ const presets = [
|
|
135
|
+
diffuse: '0.9',
|
|
136
|
+
interpolation: '1',
|
|
137
|
+
},
|
|
138
|
+
+ {
|
|
139
|
+
+ name: 'CT-NONE',
|
|
140
|
+
+ gradientOpacity: '4 0 1 0 1',
|
|
141
|
+
+ specularPower: '10',
|
|
142
|
+
+ scalarOpacity: '16 0 0 0 0 0 0 0 0',
|
|
143
|
+
+ specular: '0.2',
|
|
144
|
+
+ shade: '1',
|
|
145
|
+
+ ambient: '0.1',
|
|
146
|
+
+ colorTransfer: '16 -3024 0 0 0 -16.4458 0.729412 0.254902 0.301961 641.385 0.905882 0.815686 0.552941 3071 1 1 1',
|
|
147
|
+
+ diffuse: '0.9',
|
|
148
|
+
+ interpolation: '1',
|
|
149
|
+
+ },
|
|
150
|
+
{
|
|
151
|
+
name: 'CT-Bone',
|
|
152
|
+
gradientOpacity: '4 0 1 255 1',
|
|
153
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js b/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
154
|
+
index fb16294..aef45b1 100644
|
|
155
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
156
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js
|
|
157
|
+
@@ -24,7 +24,7 @@ function cornerstoneStreamingImageVolumeLoader(volumeId, options) {
|
|
158
|
+
imageLoadPoolManager.addRequest(async () => {
|
|
159
|
+
loadImage(imageId)
|
|
160
|
+
.then(() => {
|
|
161
|
+
- console.log(`Prefetched imageId: ${imageId}`);
|
|
162
|
+
+ // console.log(`Prefetched imageId: ${imageId}`);
|
|
163
|
+
resolve(true);
|
|
164
|
+
})
|
|
165
|
+
.catch((err) => {
|
|
166
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js b/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
167
|
+
index 7701b73..4319713 100644
|
|
168
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
169
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js
|
|
170
|
+
@@ -413,7 +413,7 @@ export default class VoxelManager {
|
|
171
|
+
}
|
|
172
|
+
const image = cache.getImage(imageId);
|
|
173
|
+
if (!image) {
|
|
174
|
+
- console.warn(`Image not found for imageId: ${imageId}`);
|
|
175
|
+
+ // console.warn(`Image not found for imageId: ${imageId}`);
|
|
176
|
+
return { pixelData: null, pixelIndex: null };
|
|
177
|
+
}
|
|
178
|
+
const voxelManager = image.voxelManager;
|
|
179
|
+
diff --git a/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js b/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
180
|
+
index 02c8518..b5a9b0e 100644
|
|
181
|
+
--- a/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
182
|
+
+++ b/node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js
|
|
183
|
+
@@ -26,7 +26,7 @@ export default function getClosestImageId(imageVolume, worldPos, viewPlaneNormal
|
|
184
|
+
const imageId = imageIds[i];
|
|
185
|
+
const imagePlaneModule = metaData.get('imagePlaneModule', imageId);
|
|
186
|
+
if (!imagePlaneModule?.imagePositionPatient) {
|
|
187
|
+
- log.warn(`Missing imagePositionPatient for imageId: ${imageId}`);
|
|
188
|
+
+ // log.warn(`Missing imagePositionPatient for imageId: ${imageId}`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const { imagePositionPatient } = imagePlaneModule;
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js b/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
2
|
-
index e4bfd9b..46105be 100644
|
|
3
|
-
--- a/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
4
|
-
+++ b/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
5
|
-
@@ -2,6 +2,7 @@ import _getHash from './_getHash';
|
|
6
|
-
import setNewAttributesIfValid from './setNewAttributesIfValid';
|
|
7
|
-
import setAttributesIfNecessary from './setAttributesIfNecessary';
|
|
8
|
-
function drawHandle(svgDrawingHelper, annotationUID, handleGroupUID, handle, options = {}, uniqueIndex) {
|
|
9
|
-
+ if(!handle) return
|
|
10
|
-
const { color, handleRadius, width, lineWidth, fill, type, opacity } = Object.assign({
|
|
11
|
-
color: 'rgb(0, 255, 0)',
|
|
12
|
-
handleRadius: '6',
|
|
13
|
-
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js b/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
14
|
-
index e0e5d55..9de6b6c 100644
|
|
15
|
-
--- a/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
16
|
-
+++ b/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
17
|
-
@@ -37,6 +37,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
18
|
-
constructor(toolProps = {}, defaultToolProps = {
|
|
19
|
-
supportedInteractionTypes: ['Mouse'],
|
|
20
|
-
configuration: {
|
|
21
|
-
+ rotatable: false,
|
|
22
|
-
shadow: true,
|
|
23
|
-
viewportIndicators: false,
|
|
24
|
-
viewportIndicatorsConfig: {
|
|
25
|
-
@@ -575,6 +576,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
26
|
-
viewportDraggableRotatable &&
|
|
27
|
-
viewportSlabThicknessControlsOn) {
|
|
28
|
-
let handleUID = `${lineIndex}One`;
|
|
29
|
-
+ opacity = this.configuration.rotatable?opacity:0
|
|
30
|
-
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
31
|
-
color,
|
|
32
|
-
handleRadius,
|
|
33
|
-
@@ -594,6 +596,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
34
|
-
!slabThicknessHandlesActive &&
|
|
35
|
-
viewportDraggableRotatable) {
|
|
36
|
-
const handleUID = `${lineIndex}`;
|
|
37
|
-
+ opacity = this.configuration.rotatable?opacity:0
|
|
38
|
-
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
39
|
-
color,
|
|
40
|
-
handleRadius,
|
|
41
|
-
@@ -619,10 +622,12 @@ class CrosshairsTool extends AnnotationTool {
|
|
42
|
-
(this.configuration.enableHDPIHandles
|
|
43
|
-
? window.devicePixelRatio
|
|
44
|
-
: 1);
|
|
45
|
-
+ opacity = this.configuration.rotatable?opacity:0
|
|
46
|
-
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
47
|
-
color,
|
|
48
|
-
handleRadius,
|
|
49
|
-
fill: color,
|
|
50
|
-
+ opacity,
|
|
51
|
-
type: 'circle',
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
@@ -972,7 +977,11 @@ class CrosshairsTool extends AnnotationTool {
|
|
55
|
-
if (this._isClockWise(centerCanvas, originalPointCanvas, finalPointCanvas)) {
|
|
56
|
-
angle *= -1;
|
|
57
|
-
}
|
|
58
|
-
- angle = Math.round(angle * 100) / 100;
|
|
59
|
-
+ if(this.configuration.rotatable) {
|
|
60
|
-
+ angle = Math.round(angle * 100) / 100;
|
|
61
|
-
+ } else {
|
|
62
|
-
+ angle = 0
|
|
63
|
-
+ }
|
|
64
|
-
const rotationAxis = viewport.getCamera().viewPlaneNormal;
|
|
65
|
-
const { matrix } = vtkMatrixBuilder
|
|
66
|
-
.buildFromRadian()
|
|
67
|
-
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js b/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
68
|
-
index 63bdec9..c596c44 100644
|
|
69
|
-
--- a/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
70
|
-
+++ b/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
71
|
-
@@ -24,6 +24,7 @@ class RectangleROITool extends AnnotationTool {
|
|
72
|
-
constructor(toolProps = {}, defaultToolProps = {
|
|
73
|
-
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
74
|
-
configuration: {
|
|
75
|
-
+ textBoxVisibility: true,
|
|
76
|
-
storePointData: false,
|
|
77
|
-
shadow: true,
|
|
78
|
-
preventHandleOutsideImage: false,
|
|
79
|
-
@@ -394,18 +395,24 @@ class RectangleROITool extends AnnotationTool {
|
|
80
|
-
}, dataId);
|
|
81
|
-
renderStatus = true;
|
|
82
|
-
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
83
|
-
- if (!options.visibility) {
|
|
84
|
-
- data.handles.textBox = {
|
|
85
|
-
- hasMoved: false,
|
|
86
|
-
- worldPosition: [0, 0, 0],
|
|
87
|
-
- worldBoundingBox: {
|
|
88
|
-
- topLeft: [0, 0, 0],
|
|
89
|
-
- topRight: [0, 0, 0],
|
|
90
|
-
- bottomLeft: [0, 0, 0],
|
|
91
|
-
- bottomRight: [0, 0, 0],
|
|
92
|
-
- },
|
|
93
|
-
- };
|
|
94
|
-
+ const textBoxGoneTmp = {
|
|
95
|
-
+ hasMoved: false,
|
|
96
|
-
+ worldPosition: [0, 0, 0],
|
|
97
|
-
+ worldBoundingBox: {
|
|
98
|
-
+ topLeft: [0, 0, 0],
|
|
99
|
-
+ topRight: [0, 0, 0],
|
|
100
|
-
+ bottomLeft: [0, 0, 0],
|
|
101
|
-
+ bottomRight: [0, 0, 0],
|
|
102
|
-
+ }
|
|
103
|
-
+ };
|
|
104
|
-
+ if(!this.configuration.textBoxVisibility) {
|
|
105
|
-
+ data.handles.textBox = textBoxGoneTmp;
|
|
106
|
-
continue;
|
|
107
|
-
+ } else {
|
|
108
|
-
+ if (!options.visibility) {
|
|
109
|
-
+ data.handles.textBox = textBoxGoneTmp;
|
|
110
|
-
+ continue;
|
|
111
|
-
+ }
|
|
112
|
-
}
|
|
113
|
-
const textLines = this.configuration.getTextLines(data, targetId);
|
|
114
|
-
if (!textLines || textLines.length === 0) {
|
|
1
|
+
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js b/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
2
|
+
index e4bfd9b..46105be 100644
|
|
3
|
+
--- a/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
4
|
+
+++ b/node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js
|
|
5
|
+
@@ -2,6 +2,7 @@ import _getHash from './_getHash';
|
|
6
|
+
import setNewAttributesIfValid from './setNewAttributesIfValid';
|
|
7
|
+
import setAttributesIfNecessary from './setAttributesIfNecessary';
|
|
8
|
+
function drawHandle(svgDrawingHelper, annotationUID, handleGroupUID, handle, options = {}, uniqueIndex) {
|
|
9
|
+
+ if(!handle) return
|
|
10
|
+
const { color, handleRadius, width, lineWidth, fill, type, opacity } = Object.assign({
|
|
11
|
+
color: 'rgb(0, 255, 0)',
|
|
12
|
+
handleRadius: '6',
|
|
13
|
+
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js b/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
14
|
+
index e0e5d55..9de6b6c 100644
|
|
15
|
+
--- a/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
16
|
+
+++ b/node_modules/@cornerstonejs/tools/dist/esm/tools/CrosshairsTool.js
|
|
17
|
+
@@ -37,6 +37,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
18
|
+
constructor(toolProps = {}, defaultToolProps = {
|
|
19
|
+
supportedInteractionTypes: ['Mouse'],
|
|
20
|
+
configuration: {
|
|
21
|
+
+ rotatable: false,
|
|
22
|
+
shadow: true,
|
|
23
|
+
viewportIndicators: false,
|
|
24
|
+
viewportIndicatorsConfig: {
|
|
25
|
+
@@ -575,6 +576,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
26
|
+
viewportDraggableRotatable &&
|
|
27
|
+
viewportSlabThicknessControlsOn) {
|
|
28
|
+
let handleUID = `${lineIndex}One`;
|
|
29
|
+
+ opacity = this.configuration.rotatable?opacity:0
|
|
30
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
31
|
+
color,
|
|
32
|
+
handleRadius,
|
|
33
|
+
@@ -594,6 +596,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
34
|
+
!slabThicknessHandlesActive &&
|
|
35
|
+
viewportDraggableRotatable) {
|
|
36
|
+
const handleUID = `${lineIndex}`;
|
|
37
|
+
+ opacity = this.configuration.rotatable?opacity:0
|
|
38
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
39
|
+
color,
|
|
40
|
+
handleRadius,
|
|
41
|
+
@@ -619,10 +622,12 @@ class CrosshairsTool extends AnnotationTool {
|
|
42
|
+
(this.configuration.enableHDPIHandles
|
|
43
|
+
? window.devicePixelRatio
|
|
44
|
+
: 1);
|
|
45
|
+
+ opacity = this.configuration.rotatable?opacity:0
|
|
46
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
47
|
+
color,
|
|
48
|
+
handleRadius,
|
|
49
|
+
fill: color,
|
|
50
|
+
+ opacity,
|
|
51
|
+
type: 'circle',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
@@ -972,7 +977,11 @@ class CrosshairsTool extends AnnotationTool {
|
|
55
|
+
if (this._isClockWise(centerCanvas, originalPointCanvas, finalPointCanvas)) {
|
|
56
|
+
angle *= -1;
|
|
57
|
+
}
|
|
58
|
+
- angle = Math.round(angle * 100) / 100;
|
|
59
|
+
+ if(this.configuration.rotatable) {
|
|
60
|
+
+ angle = Math.round(angle * 100) / 100;
|
|
61
|
+
+ } else {
|
|
62
|
+
+ angle = 0
|
|
63
|
+
+ }
|
|
64
|
+
const rotationAxis = viewport.getCamera().viewPlaneNormal;
|
|
65
|
+
const { matrix } = vtkMatrixBuilder
|
|
66
|
+
.buildFromRadian()
|
|
67
|
+
diff --git a/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js b/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
68
|
+
index 63bdec9..c596c44 100644
|
|
69
|
+
--- a/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
70
|
+
+++ b/node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/RectangleROITool.js
|
|
71
|
+
@@ -24,6 +24,7 @@ class RectangleROITool extends AnnotationTool {
|
|
72
|
+
constructor(toolProps = {}, defaultToolProps = {
|
|
73
|
+
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
74
|
+
configuration: {
|
|
75
|
+
+ textBoxVisibility: true,
|
|
76
|
+
storePointData: false,
|
|
77
|
+
shadow: true,
|
|
78
|
+
preventHandleOutsideImage: false,
|
|
79
|
+
@@ -394,18 +395,24 @@ class RectangleROITool extends AnnotationTool {
|
|
80
|
+
}, dataId);
|
|
81
|
+
renderStatus = true;
|
|
82
|
+
const options = this.getLinkedTextBoxStyle(styleSpecifier, annotation);
|
|
83
|
+
- if (!options.visibility) {
|
|
84
|
+
- data.handles.textBox = {
|
|
85
|
+
- hasMoved: false,
|
|
86
|
+
- worldPosition: [0, 0, 0],
|
|
87
|
+
- worldBoundingBox: {
|
|
88
|
+
- topLeft: [0, 0, 0],
|
|
89
|
+
- topRight: [0, 0, 0],
|
|
90
|
+
- bottomLeft: [0, 0, 0],
|
|
91
|
+
- bottomRight: [0, 0, 0],
|
|
92
|
+
- },
|
|
93
|
+
- };
|
|
94
|
+
+ const textBoxGoneTmp = {
|
|
95
|
+
+ hasMoved: false,
|
|
96
|
+
+ worldPosition: [0, 0, 0],
|
|
97
|
+
+ worldBoundingBox: {
|
|
98
|
+
+ topLeft: [0, 0, 0],
|
|
99
|
+
+ topRight: [0, 0, 0],
|
|
100
|
+
+ bottomLeft: [0, 0, 0],
|
|
101
|
+
+ bottomRight: [0, 0, 0],
|
|
102
|
+
+ }
|
|
103
|
+
+ };
|
|
104
|
+
+ if(!this.configuration.textBoxVisibility) {
|
|
105
|
+
+ data.handles.textBox = textBoxGoneTmp;
|
|
106
|
+
continue;
|
|
107
|
+
+ } else {
|
|
108
|
+
+ if (!options.visibility) {
|
|
109
|
+
+ data.handles.textBox = textBoxGoneTmp;
|
|
110
|
+
+ continue;
|
|
111
|
+
+ }
|
|
112
|
+
}
|
|
113
|
+
const textLines = this.configuration.getTextLines(data, targetId);
|
|
114
|
+
if (!textLines || textLines.length === 0) {
|