@kitware/vtk.js 26.3.1 → 26.4.0
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/DataModel/Collection.d.ts +118 -0
- package/Common/DataModel/Collection.js +113 -0
- 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/MouseBoxSelectorManipulator.d.ts +88 -0
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
- package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
- package/Interaction/Style/InteractorStyleManipulator.d.ts +333 -0
- 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 +81 -0
- package/Proxy/Core/SourceProxy.d.ts +22 -0
- package/Proxy/Core/View2DProxy.d.ts +7 -0
- 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/Rendering/Core/AbstractImageMapper/helper.js +127 -0
- package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
- package/Rendering/Core/AbstractImageMapper.js +42 -0
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/ImageArrayMapper.d.ts +252 -0
- package/Rendering/Core/ImageArrayMapper.js +242 -0
- package/Rendering/Core/ImageMapper.d.ts +5 -35
- package/Rendering/Core/ImageMapper.js +16 -108
- package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
- package/Rendering/Core/InteractorStyle.d.ts +229 -0
- package/Rendering/Core/PointPicker.js +1 -1
- package/Rendering/OpenGL/CellArrayBufferObject.js +1 -1
- package/Rendering/OpenGL/ImageMapper.js +13 -7
- package/Rendering/OpenGL/PolyDataMapper.js +8 -7
- package/Rendering/OpenGL/RenderWindow.d.ts +8 -1
- package/Rendering/OpenGL/RenderWindow.js +3 -2
- package/Rendering/OpenGL/Texture.js +13 -12
- package/Widgets/Core/StateBuilder.d.ts +29 -0
- package/index.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import vtkAbstractRepresentationProxy from './../Core/AbstractRepresentationProxy';
|
|
2
|
+
import vtkImageCropFilter from './../../Filters/General/ImageCropFilter';
|
|
3
|
+
|
|
4
|
+
export interface vtkVolumeRepresentationProxy
|
|
5
|
+
extends vtkAbstractRepresentationProxy {
|
|
6
|
+
setIs2DVolume(is2D: boolean): void;
|
|
7
|
+
getIs2DVolume(): boolean;
|
|
8
|
+
isVisible(): boolean;
|
|
9
|
+
setVisibility(visible: boolean): void;
|
|
10
|
+
getVisibility(): boolean;
|
|
11
|
+
setSliceVisibility(isVisible: boolean): void;
|
|
12
|
+
getSliceVisibility(): boolean;
|
|
13
|
+
setSampleDistance(samp: number): void;
|
|
14
|
+
getSampleDistance(): number;
|
|
15
|
+
setEdgeGradient(grad: number): void;
|
|
16
|
+
getEdgeGradient(): number;
|
|
17
|
+
getCropFilter(): vtkImageCropFilter;
|
|
18
|
+
|
|
19
|
+
// proxy property mappings
|
|
20
|
+
getXSlice(): number;
|
|
21
|
+
setXSlice(slice: number): boolean;
|
|
22
|
+
getYSlice(): number;
|
|
23
|
+
setYSlice(slice: number): boolean;
|
|
24
|
+
getZSlice(): number;
|
|
25
|
+
setZSlice(slice: number): boolean;
|
|
26
|
+
getVolumeVisibility(): boolean;
|
|
27
|
+
setVolumeVisibility(visible: boolean): boolean;
|
|
28
|
+
getXSliceVisibility(): boolean;
|
|
29
|
+
setXSliceVisibility(visible: boolean): boolean;
|
|
30
|
+
getYSliceVisibility(): boolean;
|
|
31
|
+
setYSliceVisibility(visible: boolean): boolean;
|
|
32
|
+
getZSliceVisibility(): boolean;
|
|
33
|
+
setZSliceVisibility(visible: boolean): boolean;
|
|
34
|
+
getWindowWidth(): number;
|
|
35
|
+
setWindowWidth(width: number): boolean;
|
|
36
|
+
getWindowLevel(): number;
|
|
37
|
+
setWindowLevel(level: number): boolean;
|
|
38
|
+
getUseShadow(): boolean;
|
|
39
|
+
setUseShadow(useShadow: boolean): boolean;
|
|
40
|
+
getCroppingPlanes(): number[];
|
|
41
|
+
setCroppingPlanes(planes: number[]): boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default vtkVolumeRepresentationProxy;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Perform plane-line intersection, where the line is defined by two points (p1, p2),
|
|
6
|
+
* and the plane is defined by the imageData and slice number.
|
|
7
|
+
*
|
|
8
|
+
* @param {Vector3} p1
|
|
9
|
+
* @param {Vector3} p2
|
|
10
|
+
* @param {vtkImageMapper|vtkImageArrayMapper} mapper
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function doPicking(p1, p2, mapper) {
|
|
14
|
+
var imageData = mapper.getCurrentImage();
|
|
15
|
+
var extent = imageData.getExtent(); // Slice origin
|
|
16
|
+
|
|
17
|
+
var ijk = [extent[0], extent[2], extent[4]];
|
|
18
|
+
|
|
19
|
+
var _mapper$getClosestIJK = mapper.getClosestIJKAxis(),
|
|
20
|
+
ijkMode = _mapper$getClosestIJK.ijkMode;
|
|
21
|
+
|
|
22
|
+
var nSlice = mapper.isA('vtkImageArrayMapper') ? mapper.getSubSlice() : mapper.getSlice();
|
|
23
|
+
|
|
24
|
+
if (ijkMode !== mapper.getSlicingMode()) {
|
|
25
|
+
// If not IJK slicing, get the IJK slice from the XYZ position/slice
|
|
26
|
+
nSlice = mapper.getSliceAtPosition(nSlice);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ijk[ijkMode] += nSlice;
|
|
30
|
+
var worldOrigin = [0, 0, 0];
|
|
31
|
+
imageData.indexToWorld(ijk, worldOrigin); // Normal computation
|
|
32
|
+
|
|
33
|
+
ijk[ijkMode] += 1;
|
|
34
|
+
var worldNormal = [0, 0, 0];
|
|
35
|
+
imageData.indexToWorld(ijk, worldNormal);
|
|
36
|
+
worldNormal[0] -= worldOrigin[0];
|
|
37
|
+
worldNormal[1] -= worldOrigin[1];
|
|
38
|
+
worldNormal[2] -= worldOrigin[2];
|
|
39
|
+
vec3.normalize(worldNormal, worldNormal);
|
|
40
|
+
var intersect = vtkPlane.intersectWithLine(p1, p2, worldOrigin, worldNormal);
|
|
41
|
+
|
|
42
|
+
if (intersect.intersection) {
|
|
43
|
+
var point = intersect.x;
|
|
44
|
+
var absoluteIJK = [0, 0, 0];
|
|
45
|
+
imageData.worldToIndex(point, absoluteIJK); // `t` is the parametric position along the line
|
|
46
|
+
// defined in Plane.intersectWithLine
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
t: intersect.t,
|
|
50
|
+
absoluteIJK: absoluteIJK
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Implement point picking for image plane.
|
|
58
|
+
* The plane is defined by the imageData and current slice number,
|
|
59
|
+
* set in the input mapper.
|
|
60
|
+
*
|
|
61
|
+
* @param {Vector3} p1
|
|
62
|
+
* @param {Vector3} p2
|
|
63
|
+
* @param {vtkImageMapper|vtkImageArrayMapper} mapper
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
function intersectWithLineForPointPicking(p1, p2, mapper) {
|
|
68
|
+
var pickingData = doPicking(p1, p2, mapper);
|
|
69
|
+
|
|
70
|
+
if (pickingData) {
|
|
71
|
+
var imageData = mapper.getCurrentImage();
|
|
72
|
+
var extent = imageData.getExtent(); // Get closer integer ijk
|
|
73
|
+
// NB: point picking means closest slice, means rounding
|
|
74
|
+
|
|
75
|
+
var ijk = [Math.round(pickingData.absoluteIJK[0]), Math.round(pickingData.absoluteIJK[1]), Math.round(pickingData.absoluteIJK[2])]; // Are we outside our actual extent
|
|
76
|
+
|
|
77
|
+
if (ijk[0] < extent[0] || ijk[0] > extent[1] || ijk[1] < extent[2] || ijk[1] > extent[3] || ijk[2] < extent[4] || ijk[2] > extent[5]) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
t: pickingData.t,
|
|
83
|
+
ijk: ijk
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Implement cell picking for image plane.
|
|
91
|
+
* The plane is defined by the imageData and current slice number,
|
|
92
|
+
* set in the input mapper.
|
|
93
|
+
*
|
|
94
|
+
* @param {Vector3} p1
|
|
95
|
+
* @param {Vector3} p2
|
|
96
|
+
* @param {vtkImageMapper|vtkImageArrayMapper} mapper
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
function intersectWithLineForCellPicking(p1, p2, mapper) {
|
|
100
|
+
var pickingData = doPicking(p1, p2, mapper);
|
|
101
|
+
|
|
102
|
+
if (pickingData) {
|
|
103
|
+
var imageData = mapper.getCurrentImage();
|
|
104
|
+
var extent = imageData.getExtent();
|
|
105
|
+
var absIJK = pickingData.absoluteIJK; // Get closer integer ijk
|
|
106
|
+
// NB: cell picking means closest voxel, means flooring
|
|
107
|
+
|
|
108
|
+
var ijk = [Math.floor(absIJK[0]), Math.floor(absIJK[1]), Math.floor(absIJK[2])]; // Are we outside our actual extent
|
|
109
|
+
|
|
110
|
+
if (ijk[0] < extent[0] || ijk[0] > extent[1] - 1 || ijk[1] < extent[2] || ijk[1] > extent[3] - 1 || ijk[2] < extent[4] || // handle single-slice images
|
|
111
|
+
ijk[2] > (extent[5] ? extent[5] - 1 : extent[5])) {
|
|
112
|
+
return null;
|
|
113
|
+
} // Parametric coordinates within cell
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
var pCoords = [absIJK[0] - ijk[0], absIJK[1] - ijk[1], absIJK[2] - ijk[2]];
|
|
117
|
+
return {
|
|
118
|
+
t: pickingData.t,
|
|
119
|
+
ijk: ijk,
|
|
120
|
+
pCoords: pCoords
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { intersectWithLineForCellPicking, intersectWithLineForPointPicking };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import vtkAbstractMapper, { IAbstractMapperInitialValues } from './AbstractMapper';
|
|
2
|
+
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
3
|
+
import { Nullable } from './../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface IAbstractImageMapperInitialValues extends IAbstractMapperInitialValues {
|
|
7
|
+
customDisplayExtent?: number[];
|
|
8
|
+
useCustomExtents?: boolean;
|
|
9
|
+
slice?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface vtkAbstractImageMapper extends vtkAbstractMapper {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
getIsOpaque(): boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Return currently active image for the mapper. Overridden by deriving classes.
|
|
21
|
+
*/
|
|
22
|
+
getCurrentImage(): Nullable<vtkImageData>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get the slice index.
|
|
26
|
+
*/
|
|
27
|
+
getSlice(): number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {Number} slice The slice index.
|
|
32
|
+
*/
|
|
33
|
+
setSlice(slice: number): boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
getUseCustomExtents(): boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {Boolean} useCustomExtents
|
|
43
|
+
*/
|
|
44
|
+
setUseCustomExtents(useCustomExtents: boolean): boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {Number} x1 The x coordinate of the first point.
|
|
49
|
+
* @param {Number} x2 The x coordinate of the second point.
|
|
50
|
+
* @param {Number} y1 The y coordinate of the first point.
|
|
51
|
+
* @param {Number} y2 The y coordinate of the second point.
|
|
52
|
+
* @param {Number} z1 The z coordinate of the first point.
|
|
53
|
+
* @param {Number} z2 The z coordinate of the second point.
|
|
54
|
+
*/
|
|
55
|
+
setCustomDisplayExtent(x1: number, x2: number, y1: number, y2: number, z1: number, z2: number): boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param customDisplayExtent
|
|
60
|
+
*/
|
|
61
|
+
setCustomDisplayExtentFrom(customDisplayExtent: number[]): boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Method use to decorate a given object (publicAPI+model) with vtkAbstractImageMapper characteristics.
|
|
66
|
+
*
|
|
67
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
68
|
+
* @param model object on which data structure will be bounds (protected)
|
|
69
|
+
* @param {IAbstractImageMapperInitialValues} [initialValues] (default: {})
|
|
70
|
+
*/
|
|
71
|
+
export function extend(publicAPI: object, model: object, initialValues?: IAbstractImageMapperInitialValues): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* vtkImageMapper provides 2D image display support for vtk.
|
|
75
|
+
* It can be associated with a vtkImageSlice prop and placed within a Renderer.
|
|
76
|
+
*
|
|
77
|
+
* This class resolves coincident topology with the same methods as vtkMapper.
|
|
78
|
+
*/
|
|
79
|
+
export declare const vtkAbstractImageMapper: {
|
|
80
|
+
extend: typeof extend;
|
|
81
|
+
}
|
|
82
|
+
export default vtkAbstractImageMapper;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import macro from '../../macros.js';
|
|
2
|
+
import vtkAbstractMapper from './AbstractMapper.js';
|
|
3
|
+
|
|
4
|
+
// vtkAbstractImageMapper methods
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
function vtkAbstractImageMapper(publicAPI, model) {
|
|
8
|
+
model.classHierarchy.push('vtkAbstractImageMapper');
|
|
9
|
+
|
|
10
|
+
publicAPI.getIsOpaque = function () {
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
publicAPI.getCurrentImage = function () {
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
} // ----------------------------------------------------------------------------
|
|
18
|
+
// Object factory
|
|
19
|
+
// ----------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var DEFAULT_VALUES = {
|
|
23
|
+
slice: 0,
|
|
24
|
+
customDisplayExtent: [0, 0, 0, 0, 0, 0],
|
|
25
|
+
useCustomExtents: false
|
|
26
|
+
}; // ----------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
function extend(publicAPI, model) {
|
|
29
|
+
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
30
|
+
Object.assign(model, DEFAULT_VALUES, initialValues); // Build VTK API
|
|
31
|
+
|
|
32
|
+
vtkAbstractMapper.extend(publicAPI, model, initialValues);
|
|
33
|
+
macro.setGet(publicAPI, model, ['slice', 'useCustomExtents']);
|
|
34
|
+
macro.setGetArray(publicAPI, model, ['customDisplayExtent'], 6);
|
|
35
|
+
vtkAbstractImageMapper(publicAPI, model);
|
|
36
|
+
} // ----------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
var vtkAbstractImageMapper$1 = {
|
|
39
|
+
extend: extend
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { vtkAbstractImageMapper$1 as default, extend };
|
|
@@ -180,7 +180,7 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
180
180
|
return Number.MAX_VALUE;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
if (mapper.isA('vtkImageMapper')) {
|
|
183
|
+
if (mapper.isA('vtkImageMapper') || mapper.isA('vtkImageArrayMapper')) {
|
|
184
184
|
var pickData = mapper.intersectWithLineForCellPicking(p1, p2);
|
|
185
185
|
|
|
186
186
|
if (pickData) {
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import vtkAbstractImageMapper, { IAbstractImageMapperInitialValues } from './AbstractImageMapper';
|
|
2
|
+
import IClosestIJKAxis from './ImageMapper';
|
|
3
|
+
import { Bounds, Nullable } from './../../types';
|
|
4
|
+
import { SlicingMode } from './ImageMapper/Constants';
|
|
5
|
+
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
6
|
+
import vtkCollection from './../../Common/DataModel/Collection';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface ICoincidentTopology {
|
|
10
|
+
factor: number;
|
|
11
|
+
offset: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ISliceToSubSlice {
|
|
15
|
+
imageIndex: number;
|
|
16
|
+
subSlice: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IImageArrayMapperInitialValues extends IAbstractImageMapperInitialValues {
|
|
20
|
+
slicingMode: SlicingMode.K,
|
|
21
|
+
sliceToSubSliceMap: ISliceToSubSlice[],
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface vtkImageArrayMapper extends vtkAbstractImageMapper {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param inputData set input as a vtkCollection of vtkImageData objects.
|
|
29
|
+
*/
|
|
30
|
+
setInputData(inputData: vtkCollection): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get vtkImageData corresponding to the provided (global) slice number.
|
|
34
|
+
* @param slice (global) slice number. If a slice number is not provided,
|
|
35
|
+
* the function uses the current slice number (i.e. the output of getSlice()).
|
|
36
|
+
*/
|
|
37
|
+
getImage(slice?: number): Nullable<vtkImageData>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Return currently active image. This depends on the currently active slice number.
|
|
41
|
+
*/
|
|
42
|
+
getCurrentImage(): Nullable<vtkImageData>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax].
|
|
46
|
+
* @return {Bounds} The bounds for the mapper.
|
|
47
|
+
*/
|
|
48
|
+
getBounds(): Bounds;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax].
|
|
52
|
+
* @param {Number} [slice] The slice index.
|
|
53
|
+
* @param {Number} [halfThickness] Half the slice thickness in index space (unit voxel spacing).
|
|
54
|
+
* @return {Number[]} The bounds for a given slice.
|
|
55
|
+
*/
|
|
56
|
+
getBoundsForSlice(slice?: number, halfThickness?: number): number[];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get the closest IJK axis
|
|
60
|
+
* @return {IClosestIJKAxis} The axis object.
|
|
61
|
+
*/
|
|
62
|
+
getClosestIJKAxis(): IClosestIJKAxis;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Calculate the total number of slices in the input collection.
|
|
66
|
+
*/
|
|
67
|
+
computeTotalSlices(): number;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Fetch the pre-calculated total number of slices in the input collection.
|
|
71
|
+
*/
|
|
72
|
+
getTotalSlices(): number;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {Number} slice The slice index.
|
|
77
|
+
*/
|
|
78
|
+
setSlice(slice: number): boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Calculate the global slice number that corresponds to the provided image and subSlice number.
|
|
82
|
+
* The global slice number corresponds to the total number of 2D image frames that a collection has.
|
|
83
|
+
* @param imageIndex The image number is the index of the vtkImageData object in the input collection.
|
|
84
|
+
* @param subSlice The subSlice number is the k-index of a slice within a vtkImageData object in the input collection.
|
|
85
|
+
*/
|
|
86
|
+
computeSlice(imageIndex: number, subSlice: number): number;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get the vtkImageData index corresponding to the provided global slice number.
|
|
90
|
+
* @param slice global slice number. If a slice number is not provided,
|
|
91
|
+
* the function uses the current slice number (i.e. the output of getSlice()).
|
|
92
|
+
*/
|
|
93
|
+
getImageIndex(slice?: number): number;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Given a global slice number, identify the subSlice number (slice k-index within a vtkImageData).
|
|
97
|
+
* @param slice global slice number. If a slice number is not provided,
|
|
98
|
+
* the function uses the current slice number (i.e. the output of getSlice()).
|
|
99
|
+
*/
|
|
100
|
+
getSubSlice(slice?: number): number;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
getResolveCoincidentTopology(): ICoincidentTopology
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
*/
|
|
111
|
+
getResolveCoincidentTopologyAsString(): ICoincidentTopology
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
*/
|
|
121
|
+
getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
*/
|
|
126
|
+
getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
* @param {Number} factor
|
|
136
|
+
* @param {Number} offset
|
|
137
|
+
*/
|
|
138
|
+
setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @param {Number} factor
|
|
143
|
+
* @param {Number} offset
|
|
144
|
+
*/
|
|
145
|
+
setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @param {Number} factor
|
|
150
|
+
* @param {Number} offset
|
|
151
|
+
*/
|
|
152
|
+
setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @param resolveCoincidentTopology
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @param {Number} factor
|
|
164
|
+
* @param {Number} offset
|
|
165
|
+
*/
|
|
166
|
+
setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
*
|
|
170
|
+
* @param {Number} factor
|
|
171
|
+
* @param {Number} offset
|
|
172
|
+
*/
|
|
173
|
+
setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @param value
|
|
178
|
+
*/
|
|
179
|
+
setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @param {Number} factor
|
|
184
|
+
* @param {Number} offset
|
|
185
|
+
*/
|
|
186
|
+
setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
setResolveCoincidentTopologyToDefault(): boolean;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
196
|
+
setResolveCoincidentTopologyToOff(): boolean;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
*
|
|
200
|
+
*/
|
|
201
|
+
setResolveCoincidentTopologyToPolygonOffset(): boolean;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Set the slicing mode.
|
|
205
|
+
* @param {Number} mode The slicing mode.
|
|
206
|
+
*/
|
|
207
|
+
setSlicingMode(mode: number): boolean;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* @param {Number[]} p1 The coordinates of the first point.
|
|
212
|
+
* @param {Number[]} p2 The coordinates of the second point.
|
|
213
|
+
*/
|
|
214
|
+
intersectWithLineForPointPicking(p1: number[], p2: number[]): any;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
*
|
|
218
|
+
* @param {Number[]} p1 The coordinates of the first point.
|
|
219
|
+
* @param {Number[]} p2 The coordinates of the second point.
|
|
220
|
+
*/
|
|
221
|
+
intersectWithLineForCellPicking(p1: number[], p2: number[]): any;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Method use to decorate a given object (publicAPI+model) with vtkImageArrayMapper characteristics.
|
|
226
|
+
*
|
|
227
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
228
|
+
* @param model object on which data structure will be bounds (protected)
|
|
229
|
+
* @param {IImageArrayMapperInitialValues} [initialValues] (default: {})
|
|
230
|
+
*/
|
|
231
|
+
export function extend(publicAPI: object, model: object, initialValues?: IImageArrayMapperInitialValues): void;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Method use to create a new instance of vtkImageArrayMapper
|
|
235
|
+
* @param {IImageArrayMapperInitialValues} [initialValues] for pre-setting some of its content
|
|
236
|
+
*/
|
|
237
|
+
export function newInstance(initialValues?: IImageArrayMapperInitialValues): vtkImageArrayMapper;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* vtkImageArrayMapper provides display support for a collection of single/multi-frame images.
|
|
241
|
+
* Images can have variable dimensions (width, height, depth in pixels), can be mixture of
|
|
242
|
+
* color (RGB) and grayscale images, origin point and direction cosines.
|
|
243
|
+
* It can be associated with a vtkImageSlice prop and placed within a Renderer.
|
|
244
|
+
*
|
|
245
|
+
* This class resolves coincident topology with the same methods as vtkMapper.
|
|
246
|
+
*/
|
|
247
|
+
export declare const vtkImageArrayMapper: {
|
|
248
|
+
newInstance: typeof newInstance;
|
|
249
|
+
extend: typeof extend;
|
|
250
|
+
SlicingMode: typeof SlicingMode;
|
|
251
|
+
}
|
|
252
|
+
export default vtkImageArrayMapper;
|