@kitware/vtk.js 23.4.2 → 23.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/Math/Constants.js +12 -0
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/ScalarsToColors/Constants.d.ts +18 -0
- package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
- package/Common/DataModel/AbstractPointLocator.js +40 -0
- package/Common/DataModel/BoundingBox.d.ts +659 -0
- package/Common/DataModel/Collection.d.ts +118 -0
- package/Common/DataModel/Collection.js +113 -0
- package/Common/DataModel/DataSet/Constants.d.ts +27 -0
- package/Common/DataModel/EdgeLocator.d.ts +79 -0
- package/Common/DataModel/EdgeLocator.js +85 -0
- package/Common/DataModel/ITKHelper.d.ts +54 -0
- package/Common/DataModel/IncrementalOctreeNode.d.ts +297 -0
- package/Common/DataModel/IncrementalOctreeNode.js +640 -0
- package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
- package/Common/DataModel/IncrementalOctreePointLocator.js +398 -0
- package/Common/DataModel/Locator.d.ts +43 -0
- package/Common/DataModel/Locator.js +37 -0
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/PolyData/Constants.d.ts +6 -0
- package/Common/DataModel/PolyLine.d.ts +63 -0
- package/Common/DataModel/PolyLine.js +77 -0
- package/Common/DataModel/Polygon/Constants.js +12 -0
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Quad/Constants.js +9 -0
- package/Common/DataModel/Quad.d.ts +91 -0
- package/Common/DataModel/Quad.js +235 -0
- package/Common/DataModel/SelectionNode/Constants.d.ts +27 -0
- package/Common/DataModel/Spline1D/Constants.js +17 -0
- package/Common/DataModel/Spline3D/Constants.d.ts +9 -0
- package/Common/Transform/Transform.js +51 -0
- package/Filters/Core/PolyDataNormals.js +124 -0
- package/Filters/General/ClipClosedSurface/Constants.js +10 -0
- package/Filters/General/ClipClosedSurface.d.ts +95 -0
- package/Filters/General/ClipClosedSurface.js +972 -0
- package/Filters/General/ContourTriangulator/Constants.js +6 -0
- package/Filters/General/ContourTriangulator/helper.js +1951 -0
- package/Filters/General/ContourTriangulator.d.ts +136 -0
- package/Filters/General/ContourTriangulator.js +202 -0
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +1 -1
- package/Filters/General/OBBTree/OBBNode.js +82 -0
- package/Filters/General/OBBTree/helper.js +92 -0
- package/Filters/General/OBBTree.js +1243 -0
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/Sources/LineSource.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +68 -0
- package/Interaction/Manipulators/CompositeGestureManipulator.d.ts +168 -0
- package/Interaction/Manipulators/CompositeKeyboardManipulator.d.ts +48 -0
- package/Interaction/Manipulators/CompositeMouseManipulator.d.ts +149 -0
- package/Interaction/Manipulators/CompositeVRManipulator.d.ts +44 -0
- package/Interaction/Manipulators/GestureCameraManipulator.d.ts +34 -0
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts +88 -0
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
- package/Interaction/Style/InteractorStyleImage.d.ts +107 -0
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Interaction/Style/InteractorStyleManipulator.d.ts +348 -0
- package/Interaction/Style/InteractorStyleTrackballCamera.d.ts +170 -0
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
- package/Interaction/Widgets/LabelRepresentation.js +1 -1
- package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +11 -0
- package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
- package/Proxy/Core/AbstractRepresentationProxy.d.ts +24 -0
- package/Proxy/Core/LookupTableProxy.d.ts +45 -0
- package/Proxy/Core/PiecewiseFunctionProxy.d.ts +62 -0
- package/Proxy/Core/ProxyManager.d.ts +115 -0
- package/Proxy/Core/SourceProxy.d.ts +22 -0
- package/Proxy/Core/View2DProxy.d.ts +7 -0
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Proxy/Core/ViewProxy.d.ts +86 -0
- package/Proxy/Representations/SliceRepresentationProxy.d.ts +27 -0
- package/Proxy/Representations/VolumeRepresentationProxy.d.ts +44 -0
- package/README.md +2 -2
- package/Rendering/Core/AbstractImageMapper/helper.js +127 -0
- package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
- package/Rendering/Core/AbstractImageMapper.js +44 -0
- package/Rendering/Core/Camera.js +1 -1
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
- package/Rendering/Core/ColorTransferFunction/Constants.d.ts +17 -0
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate/Constants.d.ts +14 -0
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/Glyph3DMapper/Constants.d.ts +17 -0
- package/Rendering/Core/Glyph3DMapper.js +1 -1
- package/Rendering/Core/HardwareSelector.d.ts +84 -0
- package/Rendering/Core/ImageArrayMapper.d.ts +253 -0
- package/Rendering/Core/ImageArrayMapper.js +242 -0
- package/Rendering/Core/ImageMapper/Constants.d.ts +14 -0
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/ImageProperty/Constants.d.ts +9 -0
- package/Rendering/Core/ImageResliceMapper/Constants.d.ts +11 -0
- package/Rendering/Core/ImageResliceMapper/Constants.js +11 -0
- package/Rendering/Core/ImageResliceMapper.d.ts +245 -0
- package/Rendering/Core/ImageResliceMapper.js +70 -0
- package/Rendering/Core/InteractorObserver.d.ts +132 -0
- package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
- package/Rendering/Core/InteractorStyle.d.ts +229 -0
- package/Rendering/Core/Light.js +1 -1
- package/Rendering/Core/Mapper/Constants.d.ts +26 -0
- package/Rendering/Core/Mapper.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Prop/Constants.d.ts +9 -0
- package/Rendering/Core/Prop/Constants.js +9 -0
- package/Rendering/Core/Property/Constants.d.ts +24 -0
- package/Rendering/Core/Property2D/Constants.d.ts +9 -0
- package/Rendering/Core/RenderWindow.js +1 -1
- package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +31 -0
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/VolumeMapper/Constants.d.ts +20 -0
- package/Rendering/Core/VolumeMapper.js +1 -1
- package/Rendering/Core/VolumeProperty/Constants.d.ts +16 -0
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +129 -0
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +131 -0
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +80 -0
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +763 -0
- package/Rendering/OpenGL/HardwareSelector/Constants.d.ts +8 -0
- package/Rendering/OpenGL/HardwareSelector.d.ts +339 -0
- package/Rendering/OpenGL/ImageResliceMapper.js +996 -0
- package/Rendering/OpenGL/PolyDataMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/RenderWindow/Constants.d.ts +10 -0
- package/Rendering/OpenGL/RenderWindow/Constants.js +13 -0
- package/Rendering/OpenGL/RenderWindow/ContextProxy.js +70 -0
- package/Rendering/OpenGL/RenderWindow.d.ts +9 -2
- package/Rendering/OpenGL/RenderWindow.js +2 -1
- package/Rendering/OpenGL/glsl/vtkImageResliceMapperFS.glsl.js +3 -0
- package/Rendering/OpenGL/glsl/vtkImageResliceMapperVS.glsl.js +3 -0
- package/Rendering/WebGPU/Actor2D.js +151 -0
- package/Rendering/WebGPU/BufferManager.js +1 -1
- package/Rendering/WebGPU/CellArrayMapper.js +853 -0
- package/Rendering/WebGPU/IndexBuffer.js +397 -0
- package/Rendering/WebGPU/PolyDataMapper2D.js +99 -0
- package/Rendering/WebGPU/RenderWindow.js +3 -1
- package/Rendering/WebGPU/SimpleMapper.js +290 -0
- package/Widgets/Core/AbstractWidget.d.ts +187 -0
- package/Widgets/Core/AbstractWidgetFactory.d.ts +131 -0
- package/Widgets/Core/StateBuilder/color3Mixin.js +24 -0
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
- package/Widgets/Core/StateBuilder.d.ts +29 -0
- package/Widgets/Core/WidgetManager/Constants.d.ts +27 -0
- package/Widgets/Core/WidgetManager.d.ts +231 -0
- package/Widgets/Core/WidgetState.d.ts +81 -0
- package/Widgets/Manipulators/AbstractManipulator.d.ts +221 -0
- package/Widgets/Manipulators/AbstractManipulator.js +57 -0
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/TrackballManipulator.js +1 -1
- package/Widgets/Representations/GlyphRepresentation.js +325 -0
- package/Widgets/Representations/LineHandleRepresentation.js +116 -0
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Representations/WidgetRepresentation.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/InteractiveOrientationWidget.d.ts +40 -0
- package/Widgets/Widgets3D/LabelWidget/behavior.js +157 -0
- package/Widgets/Widgets3D/LabelWidget/state.js +22 -0
- package/Widgets/Widgets3D/LabelWidget.js +78 -0
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/index.d.ts +133 -74
- package/package.json +1 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import vtkAbstractImageMapper, { IAbstractImageMapperInitialValues } from './AbstractImageMapper';
|
|
2
|
+
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
3
|
+
import vtkPlane from './../../Common/DataModel/Plane';
|
|
4
|
+
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
5
|
+
import { Bounds, Nullable, Vector3 } from './../../types';
|
|
6
|
+
import { SlabTypes } from './ImageResliceMapper/Constants';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface ICoincidentTopology {
|
|
10
|
+
factor: number;
|
|
11
|
+
offset: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IImageResliceMapperInitialValues extends IAbstractImageMapperInitialValues {
|
|
15
|
+
slabThickness?: number;
|
|
16
|
+
slabTrapezoidIntegration?: number;
|
|
17
|
+
slabType?: SlabTypes;
|
|
18
|
+
slicePlane?: vtkPlane;
|
|
19
|
+
slicePolyData?: vtkPolyData;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface vtkImageResliceMapper extends vtkAbstractImageMapper {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax].
|
|
26
|
+
* @return {Bounds} The bounds for the mapper.
|
|
27
|
+
*/
|
|
28
|
+
getBounds(): Bounds;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
getIsOpaque(): boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
getResolveCoincidentTopology(): ICoincidentTopology
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
getResolveCoincidentTopologyAsString(): ICoincidentTopology
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* Get the slab thickness in world space (mm).
|
|
68
|
+
*/
|
|
69
|
+
getSlabThickness(): number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* Get whether slab trapezoid integration is enabled.
|
|
74
|
+
*/
|
|
75
|
+
getSlabTrapezoidIntegration(): number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* Get the slab composite function.
|
|
80
|
+
*/
|
|
81
|
+
getSlabType(): boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* Get the implicit plane used to slice the volume with.
|
|
86
|
+
*/
|
|
87
|
+
getSlicePlane(): vtkPlane;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* Get the custom polydata used to slice the volume with.
|
|
92
|
+
*/
|
|
93
|
+
getSlicePolyData(): vtkPolyData;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @param {Number} factor
|
|
98
|
+
* @param {Number} offset
|
|
99
|
+
*/
|
|
100
|
+
setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @param {Number} factor
|
|
105
|
+
* @param {Number} offset
|
|
106
|
+
*/
|
|
107
|
+
setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @param {Number} factor
|
|
112
|
+
* @param {Number} offset
|
|
113
|
+
*/
|
|
114
|
+
setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param resolveCoincidentTopology
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @param {Number} factor
|
|
126
|
+
* @param {Number} offset
|
|
127
|
+
*/
|
|
128
|
+
setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param {Number} factor
|
|
133
|
+
* @param {Number} offset
|
|
134
|
+
*/
|
|
135
|
+
setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param value
|
|
140
|
+
*/
|
|
141
|
+
setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {Number} factor
|
|
146
|
+
* @param {Number} offset
|
|
147
|
+
*/
|
|
148
|
+
setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
setResolveCoincidentTopologyToDefault(): boolean;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
setResolveCoincidentTopologyToOff(): boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
setResolveCoincidentTopologyToPolygonOffset(): boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* Enable slab slicing mode and set the slab thickness in world space (mm).
|
|
168
|
+
* @param {Boolean} slabThickness The slab thickness in world space (mm). Default: 0.
|
|
169
|
+
*/
|
|
170
|
+
setSlabThickness(slabThickness: number): number;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* When a slab thickness larger than 0 is provided, the mapper will composite multile slices
|
|
175
|
+
* together using different composite functions based on the slabType. When
|
|
176
|
+
* slabTrapezoidIntegration is enabled, the first and the last slices in the slab are weighted at
|
|
177
|
+
* half their original intensity for sum and mean slab types.
|
|
178
|
+
* @param {Number} slabTrapezoidIntegration Enable/disable trapezoid integration for slab slicing.
|
|
179
|
+
* Default: 0
|
|
180
|
+
*/
|
|
181
|
+
setSlabTrapezoidIntegration(slabTrapezoidIntegration: number): number;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
*
|
|
185
|
+
* When a slab thickness larger than 0 is provided, the mapper will composite multile slices
|
|
186
|
+
* together using different composite functions based on the slabType. Available options are max,
|
|
187
|
+
* min, mean and sum.
|
|
188
|
+
* @param {SlabTypes} slabType The blend function used to composite slab slices.
|
|
189
|
+
* Default: SlabTypes.MEAN
|
|
190
|
+
*/
|
|
191
|
+
setSlabType(slabType: SlabTypes): boolean;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
* The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user
|
|
196
|
+
* can either provide an implicit vtkPlane (defined with its origin and normal), or a custom
|
|
197
|
+
* vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the
|
|
198
|
+
* implicit plane. When providing custom polydata as the source, it is required that the polydata
|
|
199
|
+
* has point normals for slab slicing. When neither sources are provided, the mapper creates a
|
|
200
|
+
* default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z
|
|
201
|
+
* bounds.
|
|
202
|
+
* @param {vtkPlane} slicePlane The implicit plane to slice the volume with. Default: null
|
|
203
|
+
*/
|
|
204
|
+
setSlicePlane(slicePlane: vtkPlane): vtkPlane;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
*
|
|
208
|
+
* The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user
|
|
209
|
+
* can either provide an implicit vtkPlane (defined with its origin and normal), or a custom
|
|
210
|
+
* vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the
|
|
211
|
+
* implicit plane. When providing custom polydata as the source, it is required that the polydata
|
|
212
|
+
* has point normals for slab slicing. When neither sources are provided, the mapper creates a
|
|
213
|
+
* default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z
|
|
214
|
+
* bounds.
|
|
215
|
+
* @param {vtkPolyData} slicePolyData The polydata to slice the volume with. Default: null
|
|
216
|
+
*/
|
|
217
|
+
setSlicePolyData(slicePolyData: vtkPolyData): vtkPolyData;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Method use to decorate a given object (publicAPI+model) with vtkImageResliceMapper characteristics.
|
|
222
|
+
*
|
|
223
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
224
|
+
* @param model object on which data structure will be bounds (protected)
|
|
225
|
+
* @param {IImageResliceMapperInitialValues} [initialValues] (default: {})
|
|
226
|
+
*/
|
|
227
|
+
export function extend(publicAPI: object, model: object, initialValues?: IImageResliceMapperInitialValues): void;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Method use to create a new instance of vtkImageResliceMapper
|
|
231
|
+
* @param {IImageResliceMapperInitialValues} [initialValues] for pre-setting some of its content
|
|
232
|
+
*/
|
|
233
|
+
export function newInstance(initialValues?: IImageResliceMapperInitialValues): vtkImageResliceMapper;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* vtkImageResliceMapper provides hardware accelerated slicing of 3D image data / volumes.
|
|
237
|
+
* It can be associated with a vtkImageSlice prop and placed within a Renderer.
|
|
238
|
+
*
|
|
239
|
+
* This class resolves coincident topology with the same methods as vtkMapper.
|
|
240
|
+
*/
|
|
241
|
+
export declare const vtkImageResliceMapper: {
|
|
242
|
+
newInstance: typeof newInstance;
|
|
243
|
+
extend: typeof extend;
|
|
244
|
+
}
|
|
245
|
+
export default vtkImageResliceMapper;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
|
+
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
4
|
+
import Constants from './ImageResliceMapper/Constants.js';
|
|
5
|
+
import macro from '../../macros.js';
|
|
6
|
+
import vtkAbstractImageMapper from './AbstractImageMapper.js';
|
|
7
|
+
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
8
|
+
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
var SlabTypes = Constants.SlabTypes;
|
|
13
|
+
var staticOffsetAPI = CoincidentTopologyHelper.staticOffsetAPI,
|
|
14
|
+
otherStaticMethods = CoincidentTopologyHelper.otherStaticMethods; // ----------------------------------------------------------------------------
|
|
15
|
+
// vtkImageResliceMapper methods
|
|
16
|
+
// ----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
function vtkImageResliceMapper(publicAPI, model) {
|
|
19
|
+
// Set our className
|
|
20
|
+
model.classHierarchy.push('vtkImageResliceMapper');
|
|
21
|
+
|
|
22
|
+
publicAPI.getBounds = function () {
|
|
23
|
+
var bds = _toConsumableArray(vtkBoundingBox.INIT_BOUNDS);
|
|
24
|
+
|
|
25
|
+
var image = publicAPI.getInputData();
|
|
26
|
+
|
|
27
|
+
if (publicAPI.getSlicePolyData()) {
|
|
28
|
+
bds = publicAPI.getSlicePolyData().getBounds();
|
|
29
|
+
} else if (image) {
|
|
30
|
+
bds = image.getBounds();
|
|
31
|
+
|
|
32
|
+
if (publicAPI.getSlicePlane()) {
|
|
33
|
+
vtkBoundingBox.cutWithPlane(bds, publicAPI.getSlicePlane().getOrigin(), publicAPI.getSlicePlane().getNormal());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return bds;
|
|
38
|
+
};
|
|
39
|
+
} // ----------------------------------------------------------------------------
|
|
40
|
+
// Object factory
|
|
41
|
+
// ----------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var DEFAULT_VALUES = {
|
|
45
|
+
slabThickness: 0.0,
|
|
46
|
+
slabTrapezoidIntegration: 0,
|
|
47
|
+
slabType: SlabTypes.MEAN,
|
|
48
|
+
slicePlane: null,
|
|
49
|
+
slicePolyData: null
|
|
50
|
+
}; // ----------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
function extend(publicAPI, model) {
|
|
53
|
+
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
54
|
+
Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API
|
|
55
|
+
|
|
56
|
+
vtkAbstractImageMapper.extend(publicAPI, model, initialValues);
|
|
57
|
+
macro.setGet(publicAPI, model, ['slabThickness', 'slabTrapezoidIntegration', 'slabType', 'slicePlane', 'slicePolyData']);
|
|
58
|
+
CoincidentTopologyHelper.implementCoincidentTopologyMethods(publicAPI, model); // Object methods
|
|
59
|
+
|
|
60
|
+
vtkImageResliceMapper(publicAPI, model);
|
|
61
|
+
} // ----------------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
var newInstance = macro.newInstance(extend, 'vtkImageResliceMapper'); // ----------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
var vtkImageResliceMapper$1 = _objectSpread(_objectSpread({
|
|
66
|
+
newInstance: newInstance,
|
|
67
|
+
extend: extend
|
|
68
|
+
}, staticOffsetAPI), otherStaticMethods);
|
|
69
|
+
|
|
70
|
+
export { vtkImageResliceMapper$1 as default, extend, newInstance };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import vtkRenderer from './Renderer';
|
|
2
|
+
import vtkRenderWindowInteractor from './RenderWindowInteractor';
|
|
3
|
+
import { vtkObject, EventHandler, vtkSubscription } from './../../interfaces';
|
|
4
|
+
import { Vector3 } from './../../types';
|
|
5
|
+
|
|
6
|
+
export interface vtkInteractorObserver extends vtkObject {
|
|
7
|
+
/**
|
|
8
|
+
* Invoke an interaction event.
|
|
9
|
+
*
|
|
10
|
+
* @param args Event payload.
|
|
11
|
+
*/
|
|
12
|
+
invokeInteractionEvent(...args: unknown[]): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Registers a callback to be invoked when an interaction event occurs.
|
|
16
|
+
*
|
|
17
|
+
* @param {EventHandler} cb The callback to be called.
|
|
18
|
+
* @param {Number} [priority] The priority of the event.
|
|
19
|
+
*/
|
|
20
|
+
onInteractionEvent(cb: EventHandler, priority?: number): Readonly<vtkSubscription>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Invoke a start interaction event.
|
|
24
|
+
*
|
|
25
|
+
* @param args Event payload.
|
|
26
|
+
*/
|
|
27
|
+
invokeStartInteractionEvent(...args: unknown[]): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Registers a callback to be invoked when a start interaction event occurs.
|
|
31
|
+
*
|
|
32
|
+
* @param {EventHandler} cb The callback to be called.
|
|
33
|
+
* @param {Number} [priority] The callback to be called
|
|
34
|
+
*/
|
|
35
|
+
onStartInteractionEvent(cb: EventHandler, priority?: number): Readonly<vtkSubscription>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Invoke an end interaction event.
|
|
39
|
+
*
|
|
40
|
+
* @param args Event payload.
|
|
41
|
+
*/
|
|
42
|
+
invokeEndInteractionEvent(...args: unknown[]): void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Registers a callback to be invoked when an end interaction event occurs.
|
|
46
|
+
*
|
|
47
|
+
* @param {EventHandler} cb The callback to be called.
|
|
48
|
+
* @param {Number?} [priority] The callback to be called
|
|
49
|
+
*/
|
|
50
|
+
onEndInteractionEvent(cb: EventHandler, priority?: number): Readonly<vtkSubscription>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve the render window interactor instance.
|
|
54
|
+
*/
|
|
55
|
+
getInteractor(): vtkRenderWindowInteractor;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get wether or not this InteractorObserver instance is enabled.
|
|
59
|
+
*/
|
|
60
|
+
getEnabled(): boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Enable/disable the interactor observer. Note that if you are enabling the interactor observer, an interactor instance must exists on the model.
|
|
64
|
+
* Typically you can call `setInteractor`
|
|
65
|
+
*
|
|
66
|
+
* @param {Boolean} enable
|
|
67
|
+
*/
|
|
68
|
+
setEnabled(enable: boolean): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Set the priority.
|
|
72
|
+
*
|
|
73
|
+
* @param {Number} priority The priority level.
|
|
74
|
+
*/
|
|
75
|
+
setPriority(priority: number): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Get the priority.
|
|
79
|
+
*/
|
|
80
|
+
getPriority(): number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Set whether or not the interactor observer instance should process events.
|
|
84
|
+
*
|
|
85
|
+
* @param {Boolean} processEvents
|
|
86
|
+
*/
|
|
87
|
+
setProcessEvents(processEvents: boolean): boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get whether or not the interactor observer instance should process events.
|
|
91
|
+
*/
|
|
92
|
+
getProcessEvents(): boolean;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Set the interactor instance.
|
|
96
|
+
*
|
|
97
|
+
* @param {vtkRenderWindowInteractor} interactor
|
|
98
|
+
*/
|
|
99
|
+
setInteractor(interactor: vtkRenderWindowInteractor): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Transform from world to display coordinates.
|
|
103
|
+
*
|
|
104
|
+
* @param {vtkRenderer} renderer The vtkRenderer instance.
|
|
105
|
+
* @param {Number} x
|
|
106
|
+
* @param {Number} y
|
|
107
|
+
* @param {Number} z
|
|
108
|
+
*/
|
|
109
|
+
computeWorldToDisplay(
|
|
110
|
+
renderer: vtkRenderer,
|
|
111
|
+
x: number,
|
|
112
|
+
y: number,
|
|
113
|
+
z: number
|
|
114
|
+
): Vector3;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Transform from display to world coordinates.
|
|
118
|
+
*
|
|
119
|
+
* @param {vtkRenderer} renderer The vtkRenderer instance.
|
|
120
|
+
* @param {Number} x
|
|
121
|
+
* @param {Number} y
|
|
122
|
+
* @param {Number} z
|
|
123
|
+
*/
|
|
124
|
+
computeDisplayToWorld(
|
|
125
|
+
renderer: vtkRenderer,
|
|
126
|
+
x: number,
|
|
127
|
+
y: number,
|
|
128
|
+
z: number
|
|
129
|
+
): Vector3;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export default vtkInteractorObserver;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum States {
|
|
2
|
+
IS_START = 0,
|
|
3
|
+
IS_NONE = 0,
|
|
4
|
+
IS_ROTATE = 1,
|
|
5
|
+
IS_PAN = 2,
|
|
6
|
+
IS_SPIN = 3,
|
|
7
|
+
IS_DOLLY = 4,
|
|
8
|
+
IS_CAMERA_POSE = 11,
|
|
9
|
+
IS_WINDOW_LEVEL = 1024,
|
|
10
|
+
IS_SLICE = 1025,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const _default: {
|
|
14
|
+
States: States;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|