dwv 0.33.0-beta.4 → 0.33.0-beta.41
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/decoders/pdfjs/readme.md +13 -14
- package/decoders/rii-mango/readme.md +10 -11
- package/dist/dwv.d.ts +1785 -575
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +16 -15
- package/readme.md +12 -13
package/dist/dwv.d.ts
CHANGED
|
@@ -4,10 +4,19 @@ import Konva from 'konva';
|
|
|
4
4
|
* Add tags to the dictionary.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} group The group key.
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {Object<string, string[]>} tags The tags to add as an
|
|
8
|
+
* object indexed by element key with values as:
|
|
9
|
+
* [VR, multiplicity, TagName] (all strings).
|
|
8
10
|
*/
|
|
9
|
-
export declare function addTagsToDictionary(group: string, tags:
|
|
11
|
+
export declare function addTagsToDictionary(group: string, tags: {
|
|
12
|
+
[x: string]: string[];
|
|
13
|
+
}): void;
|
|
10
14
|
|
|
15
|
+
/**
|
|
16
|
+
* List of ViewConfigs indexed by dataIds.
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Object<string, ViewConfig[]>} DataViewConfigs
|
|
19
|
+
*/
|
|
11
20
|
/**
|
|
12
21
|
* Main application class.
|
|
13
22
|
*
|
|
@@ -15,9 +24,10 @@ export declare function addTagsToDictionary(group: string, tags: object): void;
|
|
|
15
24
|
* // create the dwv app
|
|
16
25
|
* const app = new dwv.App();
|
|
17
26
|
* // initialise
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
27
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
28
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
29
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
30
|
+
* app.init(options);
|
|
21
31
|
* // load dicom data
|
|
22
32
|
* app.loadURLs([
|
|
23
33
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
@@ -28,15 +38,15 @@ export declare class App {
|
|
|
28
38
|
* Get the image.
|
|
29
39
|
*
|
|
30
40
|
* @param {string} dataId The data id.
|
|
31
|
-
* @returns {Image} The associated image.
|
|
41
|
+
* @returns {Image|undefined} The associated image.
|
|
32
42
|
*/
|
|
33
|
-
getImage(dataId: string): Image_2;
|
|
43
|
+
getImage(dataId: string): Image_2 | undefined;
|
|
34
44
|
/**
|
|
35
45
|
* Get the last loaded image.
|
|
36
46
|
*
|
|
37
|
-
* @returns {Image} The image.
|
|
47
|
+
* @returns {Image|undefined} The image.
|
|
38
48
|
*/
|
|
39
|
-
getLastImage(): Image_2;
|
|
49
|
+
getLastImage(): Image_2 | undefined;
|
|
40
50
|
/**
|
|
41
51
|
* Set the image at the given id.
|
|
42
52
|
*
|
|
@@ -55,58 +65,72 @@ export declare class App {
|
|
|
55
65
|
*
|
|
56
66
|
* @param {Image} image The new image.
|
|
57
67
|
* @param {object} meta The image meta.
|
|
68
|
+
* @param {string} source The source of the new image,
|
|
69
|
+
* will be passed with load events.
|
|
58
70
|
* @returns {string} The new image data id.
|
|
59
71
|
*/
|
|
60
|
-
addNewImage(image: Image_2, meta: object): string;
|
|
72
|
+
addNewImage(image: Image_2, meta: object, source: string): string;
|
|
61
73
|
/**
|
|
62
74
|
* Get the meta data.
|
|
63
75
|
*
|
|
64
76
|
* @param {string} dataId The data id.
|
|
65
|
-
* @returns {
|
|
77
|
+
* @returns {Object<string, DataElement>|undefined} The list of meta data.
|
|
66
78
|
*/
|
|
67
|
-
getMetaData(dataId: string):
|
|
79
|
+
getMetaData(dataId: string): {
|
|
80
|
+
[x: string]: DataElement;
|
|
81
|
+
} | undefined;
|
|
68
82
|
/**
|
|
69
83
|
* Get the list of ids in the data storage.
|
|
70
84
|
*
|
|
71
|
-
* @returns {
|
|
85
|
+
* @returns {string[]} The list of data ids.
|
|
72
86
|
*/
|
|
73
|
-
getDataIds():
|
|
87
|
+
getDataIds(): string[];
|
|
74
88
|
/**
|
|
75
|
-
*
|
|
89
|
+
* Get the list of dataIds that contain the input UIDs.
|
|
90
|
+
*
|
|
91
|
+
* @param {string[]} uids A list of UIDs.
|
|
92
|
+
* @returns {string[]} The list of dataIds that contain the UIDs.
|
|
93
|
+
*/
|
|
94
|
+
getDataIdsFromSopUids(uids: string[]): string[];
|
|
95
|
+
/**
|
|
96
|
+
* Can the data (of the active view of the active layer) be scrolled?
|
|
76
97
|
*
|
|
77
98
|
* @returns {boolean} True if the data has a third dimension greater than one.
|
|
99
|
+
* @deprecated Please use the ViewController equivalent directly instead.
|
|
78
100
|
*/
|
|
79
101
|
canScroll(): boolean;
|
|
80
102
|
/**
|
|
81
|
-
* Can window and level be applied to the data
|
|
103
|
+
* Can window and level be applied to the data
|
|
104
|
+
* (of the active view of the active layer)?
|
|
82
105
|
*
|
|
83
106
|
* @returns {boolean} True if the data is monochrome.
|
|
107
|
+
* @deprecated Please use the ViewController equivalent directly instead.
|
|
84
108
|
*/
|
|
85
109
|
canWindowLevel(): boolean;
|
|
86
110
|
/**
|
|
87
|
-
* Get the layer scale on top of the base scale.
|
|
111
|
+
* Get the active layer group scale on top of the base scale.
|
|
88
112
|
*
|
|
89
|
-
* @returns {
|
|
113
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
90
114
|
*/
|
|
91
|
-
getAddedScale():
|
|
115
|
+
getAddedScale(): Scalar3D;
|
|
92
116
|
/**
|
|
93
|
-
* Get the base scale.
|
|
117
|
+
* Get the base scale of the active layer group.
|
|
94
118
|
*
|
|
95
|
-
* @returns {
|
|
119
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
96
120
|
*/
|
|
97
|
-
getBaseScale():
|
|
121
|
+
getBaseScale(): Scalar3D;
|
|
98
122
|
/**
|
|
99
|
-
* Get the layer offset.
|
|
123
|
+
* Get the layer offset of the active layer group.
|
|
100
124
|
*
|
|
101
|
-
* @returns {
|
|
125
|
+
* @returns {Scalar3D} The offset as {x,y,z}.
|
|
102
126
|
*/
|
|
103
|
-
getOffset():
|
|
127
|
+
getOffset(): Scalar3D;
|
|
104
128
|
/**
|
|
105
129
|
* Get the toolbox controller.
|
|
106
130
|
*
|
|
107
|
-
* @returns {
|
|
131
|
+
* @returns {ToolboxController} The controller.
|
|
108
132
|
*/
|
|
109
|
-
getToolboxController():
|
|
133
|
+
getToolboxController(): ToolboxController;
|
|
110
134
|
/**
|
|
111
135
|
* Get the active layer group.
|
|
112
136
|
* The layer is available after the first loaded item.
|
|
@@ -114,22 +138,28 @@ export declare class App {
|
|
|
114
138
|
* @returns {LayerGroup} The layer group.
|
|
115
139
|
*/
|
|
116
140
|
getActiveLayerGroup(): LayerGroup;
|
|
141
|
+
/**
|
|
142
|
+
* Set the active layer group.
|
|
143
|
+
*
|
|
144
|
+
* @param {number} index The layer group index.
|
|
145
|
+
*/
|
|
146
|
+
setActiveLayerGroup(index: number): void;
|
|
117
147
|
/**
|
|
118
148
|
* Get the view layers associated to a data id.
|
|
119
149
|
* The layer are available after the first loaded item.
|
|
120
150
|
*
|
|
121
151
|
* @param {string} dataId The data id.
|
|
122
|
-
* @returns {
|
|
152
|
+
* @returns {ViewLayer[]} The layers.
|
|
123
153
|
*/
|
|
124
|
-
getViewLayersByDataId(dataId: string):
|
|
154
|
+
getViewLayersByDataId(dataId: string): ViewLayer[];
|
|
125
155
|
/**
|
|
126
156
|
* Get the draw layers associated to a data id.
|
|
127
157
|
* The layer are available after the first loaded item.
|
|
128
158
|
*
|
|
129
159
|
* @param {string} dataId The data id.
|
|
130
|
-
* @returns {
|
|
160
|
+
* @returns {DrawLayer[]} The layers.
|
|
131
161
|
*/
|
|
132
|
-
getDrawLayersByDataId(dataId: string):
|
|
162
|
+
getDrawLayersByDataId(dataId: string): DrawLayer[];
|
|
133
163
|
/**
|
|
134
164
|
* Get a layer group by div id.
|
|
135
165
|
* The layer is available after the first loaded item.
|
|
@@ -155,34 +185,22 @@ export declare class App {
|
|
|
155
185
|
*
|
|
156
186
|
* @param {object} cmd The command to add.
|
|
157
187
|
* @fires UndoStack#undoadd
|
|
188
|
+
* @function
|
|
158
189
|
*/
|
|
159
190
|
addToUndoStack: (cmd: object) => void;
|
|
160
191
|
/**
|
|
161
192
|
* Initialise the application.
|
|
162
193
|
*
|
|
163
|
-
* @param {
|
|
164
|
-
* - `dataViewConfigs`: dataId indexed object containing the data view
|
|
165
|
-
* configurations in the form of a list of objects containing:
|
|
166
|
-
* - divId: the HTML div id
|
|
167
|
-
* - orientation: optional 'axial', 'coronal' or 'sagittal' orientation
|
|
168
|
-
* string (default undefined keeps the original slice order)
|
|
169
|
-
* - `binders`: array of layerGroup binders
|
|
170
|
-
* - `tools`: tool name indexed object containing individual tool
|
|
171
|
-
* configurations in the form of a list of objects containing:
|
|
172
|
-
* - options: array of tool options
|
|
173
|
-
* - `viewOnFirstLoadItem`: boolean flag to trigger the first data render
|
|
174
|
-
* after the first loaded data or not
|
|
175
|
-
* - `defaultCharacterSet`: the default chraracter set string used for DICOM
|
|
176
|
-
* parsing
|
|
177
|
-
* - `overlayConfig`: list of tags / properties used as overlay information.
|
|
194
|
+
* @param {AppOptions} opt The application options
|
|
178
195
|
* @example
|
|
179
196
|
* // create the dwv app
|
|
180
197
|
* const app = new dwv.App();
|
|
181
198
|
* // initialise
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
199
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
200
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
201
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
202
|
+
* options.viewOnFirstLoadItem = false;
|
|
203
|
+
* app.init(options);
|
|
186
204
|
* // render button
|
|
187
205
|
* const button = document.createElement('button');
|
|
188
206
|
* button.id = 'render';
|
|
@@ -202,7 +220,7 @@ export declare class App {
|
|
|
202
220
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
203
221
|
* ]);
|
|
204
222
|
*/
|
|
205
|
-
init(opt:
|
|
223
|
+
init(opt: AppOptions): void;
|
|
206
224
|
/**
|
|
207
225
|
* Reset the application.
|
|
208
226
|
*/
|
|
@@ -215,34 +233,35 @@ export declare class App {
|
|
|
215
233
|
* Add an event listener to this class.
|
|
216
234
|
*
|
|
217
235
|
* @param {string} type The event type.
|
|
218
|
-
* @param {
|
|
236
|
+
* @param {Function} callback The function associated with the provided
|
|
219
237
|
* event type, will be called with the fired event.
|
|
220
238
|
*/
|
|
221
|
-
addEventListener(type: string, callback:
|
|
239
|
+
addEventListener(type: string, callback: Function): void;
|
|
222
240
|
/**
|
|
223
241
|
* Remove an event listener from this class.
|
|
224
242
|
*
|
|
225
243
|
* @param {string} type The event type.
|
|
226
|
-
* @param {
|
|
244
|
+
* @param {Function} callback The function associated with the provided
|
|
227
245
|
* event type.
|
|
228
246
|
*/
|
|
229
|
-
removeEventListener(type: string, callback:
|
|
247
|
+
removeEventListener(type: string, callback: Function): void;
|
|
230
248
|
/**
|
|
231
249
|
* Load a list of files. Can be image files or a state file.
|
|
232
250
|
*
|
|
233
|
-
* @param {
|
|
251
|
+
* @param {File[]} files The list of files to load.
|
|
234
252
|
* @fires App#loadstart
|
|
235
253
|
* @fires App#loadprogress
|
|
236
254
|
* @fires App#loaditem
|
|
237
255
|
* @fires App#loadend
|
|
238
|
-
* @fires App#
|
|
239
|
-
* @fires App#
|
|
256
|
+
* @fires App#error
|
|
257
|
+
* @fires App#abort
|
|
258
|
+
* @function
|
|
240
259
|
*/
|
|
241
|
-
loadFiles: (files:
|
|
260
|
+
loadFiles: (files: File[]) => void;
|
|
242
261
|
/**
|
|
243
262
|
* Load a list of URLs. Can be image files or a state file.
|
|
244
263
|
*
|
|
245
|
-
* @param {
|
|
264
|
+
* @param {string[]} urls The list of urls to load.
|
|
246
265
|
* @param {object} [options] The options object, can contain:
|
|
247
266
|
* - requestHeaders: an array of {name, value} to use as request headers
|
|
248
267
|
* - withCredentials: boolean xhr.withCredentials flag to pass to the request
|
|
@@ -251,15 +270,17 @@ export declare class App {
|
|
|
251
270
|
* @fires App#loadprogress
|
|
252
271
|
* @fires App#loaditem
|
|
253
272
|
* @fires App#loadend
|
|
254
|
-
* @fires App#
|
|
255
|
-
* @fires App#
|
|
273
|
+
* @fires App#error
|
|
274
|
+
* @fires App#abort
|
|
275
|
+
* @function
|
|
256
276
|
*/
|
|
257
|
-
loadURLs: (urls:
|
|
277
|
+
loadURLs: (urls: string[], options?: object) => void;
|
|
258
278
|
/**
|
|
259
279
|
* Load from an input uri.
|
|
260
280
|
*
|
|
261
281
|
* @param {string} uri The input uri, for example: 'window.location.href'.
|
|
262
282
|
* @param {object} [options] Optional url request options.
|
|
283
|
+
* @function
|
|
263
284
|
*/
|
|
264
285
|
loadFromUri: (uri: string, options?: object) => void;
|
|
265
286
|
/**
|
|
@@ -271,14 +292,21 @@ export declare class App {
|
|
|
271
292
|
* @fires App#loadprogress
|
|
272
293
|
* @fires App#loaditem
|
|
273
294
|
* @fires App#loadend
|
|
274
|
-
* @fires App#
|
|
275
|
-
* @fires App#
|
|
295
|
+
* @fires App#error
|
|
296
|
+
* @fires App#abort
|
|
297
|
+
* @function
|
|
276
298
|
*/
|
|
277
299
|
loadImageObject: (data: any[]) => void;
|
|
278
300
|
/**
|
|
279
|
-
* Abort the current
|
|
301
|
+
* Abort all the current loads.
|
|
302
|
+
*/
|
|
303
|
+
abortAllLoads(): void;
|
|
304
|
+
/**
|
|
305
|
+
* Abort an individual data load.
|
|
306
|
+
*
|
|
307
|
+
* @param {string} dataId The data to stop loading.
|
|
280
308
|
*/
|
|
281
|
-
abortLoad(): void;
|
|
309
|
+
abortLoad(dataId: string): void;
|
|
282
310
|
/**
|
|
283
311
|
* Fit the display to the data of each layer group.
|
|
284
312
|
* To be called once the image is loaded.
|
|
@@ -286,6 +314,9 @@ export declare class App {
|
|
|
286
314
|
fitToContainer(): void;
|
|
287
315
|
/**
|
|
288
316
|
* Init the Window/Level display
|
|
317
|
+
* (of the active layer of the active layer group).
|
|
318
|
+
*
|
|
319
|
+
* @deprecated Please set the opacity of the desired view layer directly.
|
|
289
320
|
*/
|
|
290
321
|
initWLDisplay(): void;
|
|
291
322
|
/**
|
|
@@ -294,56 +325,82 @@ export declare class App {
|
|
|
294
325
|
* @param {boolean} flag True to enable smoothing.
|
|
295
326
|
*/
|
|
296
327
|
setImageSmoothing(flag: boolean): void;
|
|
328
|
+
/**
|
|
329
|
+
* Get the layer group configuration from a data id.
|
|
330
|
+
*
|
|
331
|
+
* @param {string} dataId The data id.
|
|
332
|
+
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
333
|
+
* (default to false).
|
|
334
|
+
* @returns {ViewConfig[]} The list of associated configs.
|
|
335
|
+
*/
|
|
336
|
+
getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
|
|
337
|
+
/**
|
|
338
|
+
* Get the layer group configuration for a data id and group
|
|
339
|
+
* div id.
|
|
340
|
+
*
|
|
341
|
+
* @param {string} dataId The data id.
|
|
342
|
+
* @param {string} groupDivId The layer group div id.
|
|
343
|
+
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
344
|
+
* (default to false).
|
|
345
|
+
* @returns {ViewConfig|undefined} The associated config.
|
|
346
|
+
*/
|
|
347
|
+
getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
|
|
297
348
|
/**
|
|
298
349
|
* Get the data view config.
|
|
299
350
|
* Carefull, returns a reference, do not modify without resetting.
|
|
300
351
|
*
|
|
301
|
-
* @returns {
|
|
352
|
+
* @returns {Object<string, ViewConfig[]>} The configuration list.
|
|
302
353
|
*/
|
|
303
|
-
|
|
354
|
+
getDataViewConfigs(): {
|
|
355
|
+
[x: string]: ViewConfig[];
|
|
356
|
+
};
|
|
304
357
|
/**
|
|
305
|
-
* Set the data view configuration
|
|
358
|
+
* Set the data view configuration.
|
|
359
|
+
* Resets the stage and recreates all the views.
|
|
306
360
|
*
|
|
307
|
-
* @param {
|
|
361
|
+
* @param {Object<string, ViewConfig[]>} configs The configuration list.
|
|
308
362
|
*/
|
|
309
|
-
|
|
363
|
+
setDataViewConfigs(configs: {
|
|
364
|
+
[x: string]: ViewConfig[];
|
|
365
|
+
}): void;
|
|
310
366
|
/**
|
|
311
367
|
* Add a data view config.
|
|
312
368
|
*
|
|
313
369
|
* @param {string} dataId The data id.
|
|
314
|
-
* @param {
|
|
370
|
+
* @param {ViewConfig} config The view configuration.
|
|
315
371
|
*/
|
|
316
|
-
addDataViewConfig(dataId: string, config:
|
|
372
|
+
addDataViewConfig(dataId: string, config: ViewConfig): void;
|
|
317
373
|
/**
|
|
318
374
|
* Remove a data view config.
|
|
319
375
|
*
|
|
320
376
|
* @param {string} dataId The data id.
|
|
321
|
-
* @param {
|
|
377
|
+
* @param {string} divId The div id.
|
|
322
378
|
*/
|
|
323
|
-
removeDataViewConfig(dataId: string,
|
|
379
|
+
removeDataViewConfig(dataId: string, divId: string): void;
|
|
324
380
|
/**
|
|
325
|
-
* Update
|
|
381
|
+
* Update an existing data view config.
|
|
382
|
+
* Removes and re-creates the layer if found.
|
|
326
383
|
*
|
|
327
384
|
* @param {string} dataId The data id.
|
|
328
385
|
* @param {string} divId The div id.
|
|
329
|
-
* @param {
|
|
386
|
+
* @param {ViewConfig} config The view configuration.
|
|
330
387
|
*/
|
|
331
|
-
updateDataViewConfig(dataId: string, divId: string, config:
|
|
388
|
+
updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void;
|
|
332
389
|
/**
|
|
333
390
|
* Set the layer groups binders.
|
|
334
391
|
*
|
|
335
|
-
* @param {
|
|
392
|
+
* @param {string[]} list The list of binder names.
|
|
336
393
|
*/
|
|
337
|
-
setLayerGroupsBinders(list:
|
|
394
|
+
setLayerGroupsBinders(list: string[]): void;
|
|
338
395
|
/**
|
|
339
396
|
* Render the current data.
|
|
340
397
|
*
|
|
341
398
|
* @param {string} dataId The data id to render.
|
|
342
|
-
* @param {
|
|
399
|
+
* @param {ViewConfig[]} [viewConfigs] The list of configs to render.
|
|
343
400
|
*/
|
|
344
|
-
render(dataId: string, viewConfigs?:
|
|
401
|
+
render(dataId: string, viewConfigs?: ViewConfig[]): void;
|
|
345
402
|
/**
|
|
346
|
-
* Zoom
|
|
403
|
+
* Zoom the layers of the active layer group.
|
|
347
404
|
*
|
|
348
405
|
* @param {number} step The step to add to the current zoom.
|
|
349
406
|
* @param {number} cx The zoom center X coordinate.
|
|
@@ -351,20 +408,21 @@ export declare class App {
|
|
|
351
408
|
*/
|
|
352
409
|
zoom(step: number, cx: number, cy: number): void;
|
|
353
410
|
/**
|
|
354
|
-
* Apply a translation to the layers.
|
|
411
|
+
* Apply a translation to the layers of the active layer group.
|
|
355
412
|
*
|
|
356
413
|
* @param {number} tx The translation along X.
|
|
357
414
|
* @param {number} ty The translation along Y.
|
|
358
415
|
*/
|
|
359
416
|
translate(tx: number, ty: number): void;
|
|
360
417
|
/**
|
|
361
|
-
* Set the
|
|
418
|
+
* Set the active view layer (of the active layer group) opacity.
|
|
362
419
|
*
|
|
363
420
|
* @param {number} alpha The opacity ([0:1] range).
|
|
421
|
+
* @deprecated Please set the opacity of the desired view layer directly.
|
|
364
422
|
*/
|
|
365
423
|
setOpacity(alpha: number): void;
|
|
366
424
|
/**
|
|
367
|
-
* Set the drawings
|
|
425
|
+
* Set the drawings of the active layer group.
|
|
368
426
|
*
|
|
369
427
|
* @param {Array} drawings An array of drawings.
|
|
370
428
|
* @param {Array} drawingsDetails An array of drawings details.
|
|
@@ -386,6 +444,8 @@ export declare class App {
|
|
|
386
444
|
* Handle resize: fit the display to the window.
|
|
387
445
|
* To be called once the image is loaded.
|
|
388
446
|
* Can be connected to a window 'resize' event.
|
|
447
|
+
*
|
|
448
|
+
* @function
|
|
389
449
|
*/
|
|
390
450
|
onResize: () => void;
|
|
391
451
|
/**
|
|
@@ -393,6 +453,7 @@ export declare class App {
|
|
|
393
453
|
*
|
|
394
454
|
* @param {KeyboardEvent} event The key down event.
|
|
395
455
|
* @fires App#keydown
|
|
456
|
+
* @function
|
|
396
457
|
*/
|
|
397
458
|
onKeydown: (event: KeyboardEvent) => void;
|
|
398
459
|
/**
|
|
@@ -403,10 +464,12 @@ export declare class App {
|
|
|
403
464
|
* - CRTL-ARROW_UP: next element on third dim
|
|
404
465
|
* - CRTL-ARROW_RIGHT: previous element on fourth dim
|
|
405
466
|
* - CRTL-ARROW_DOWN: previous element on third dim
|
|
467
|
+
* (applies to the active view of the active layer group)
|
|
406
468
|
*
|
|
407
469
|
* @param {KeyboardEvent} event The key down event.
|
|
408
470
|
* @fires UndoStack#undo
|
|
409
471
|
* @fires UndoStack#redo
|
|
472
|
+
* @function
|
|
410
473
|
*/
|
|
411
474
|
defaultOnKeydown: (event: KeyboardEvent) => void;
|
|
412
475
|
/**
|
|
@@ -418,17 +481,19 @@ export declare class App {
|
|
|
418
481
|
*/
|
|
419
482
|
resetZoom(): void;
|
|
420
483
|
/**
|
|
421
|
-
* Set the colour map.
|
|
484
|
+
* Set the colour map of the active view of the active layer group.
|
|
422
485
|
*
|
|
423
|
-
* @param {string}
|
|
486
|
+
* @param {string} name The colour map name.
|
|
487
|
+
* @deprecated Please use the ViewController equivalent directly instead.
|
|
424
488
|
*/
|
|
425
|
-
setColourMap(
|
|
489
|
+
setColourMap(name: string): void;
|
|
426
490
|
/**
|
|
427
|
-
* Set the window/level preset.
|
|
491
|
+
* Set the window/level preset of the active view of the active layer group.
|
|
428
492
|
*
|
|
429
|
-
* @param {
|
|
493
|
+
* @param {string} preset The window/level preset.
|
|
494
|
+
* @deprecated Please use the ViewController equivalent directly instead.
|
|
430
495
|
*/
|
|
431
|
-
setWindowLevelPreset(preset:
|
|
496
|
+
setWindowLevelPreset(preset: string): void;
|
|
432
497
|
/**
|
|
433
498
|
* Set the tool
|
|
434
499
|
*
|
|
@@ -481,6 +546,68 @@ export declare class App {
|
|
|
481
546
|
#private;
|
|
482
547
|
}
|
|
483
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Application options.
|
|
551
|
+
*/
|
|
552
|
+
export declare class AppOptions {
|
|
553
|
+
/**
|
|
554
|
+
* @param {Object<string, ViewConfig[]>} [dataViewConfigs] Optional dataId
|
|
555
|
+
* indexed object containing the data view configurations.
|
|
556
|
+
*/
|
|
557
|
+
constructor(dataViewConfigs?: {
|
|
558
|
+
[x: string]: ViewConfig[];
|
|
559
|
+
});
|
|
560
|
+
/**
|
|
561
|
+
* DataId indexed object containing the data view configurations.
|
|
562
|
+
*
|
|
563
|
+
* @type {Object<string, ViewConfig[]>|undefined}
|
|
564
|
+
*/
|
|
565
|
+
dataViewConfigs: {
|
|
566
|
+
[x: string]: ViewConfig[];
|
|
567
|
+
} | undefined;
|
|
568
|
+
/**
|
|
569
|
+
* Tool name indexed object containing individual tool configurations.
|
|
570
|
+
*
|
|
571
|
+
* @type {Object<string, ToolConfig>|undefined}
|
|
572
|
+
*/
|
|
573
|
+
tools: {
|
|
574
|
+
[x: string]: ToolConfig;
|
|
575
|
+
} | undefined;
|
|
576
|
+
/**
|
|
577
|
+
* Optional array of layerGroup binder names.
|
|
578
|
+
*
|
|
579
|
+
* @type {string[]|undefined}
|
|
580
|
+
*/
|
|
581
|
+
binders: string[] | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* Optional boolean flag to trigger the first data render
|
|
584
|
+
* after the first loaded data or not. Defaults to true;
|
|
585
|
+
*
|
|
586
|
+
* @type {boolean|undefined}
|
|
587
|
+
*/
|
|
588
|
+
viewOnFirstLoadItem: boolean | undefined;
|
|
589
|
+
/**
|
|
590
|
+
* Optional default chraracter set string used for DICOM parsing if
|
|
591
|
+
* not passed in DICOM file.
|
|
592
|
+
* Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings
|
|
593
|
+
*
|
|
594
|
+
* @type {string|undefined}
|
|
595
|
+
*/
|
|
596
|
+
defaultCharacterSet: string | undefined;
|
|
597
|
+
/**
|
|
598
|
+
* Optional overlay config.
|
|
599
|
+
*
|
|
600
|
+
* @type {object|undefined}
|
|
601
|
+
*/
|
|
602
|
+
overlayConfig: object | undefined;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export declare namespace BLACK {
|
|
606
|
+
let r: number;
|
|
607
|
+
let g: number;
|
|
608
|
+
let b: number;
|
|
609
|
+
}
|
|
610
|
+
|
|
484
611
|
/**
|
|
485
612
|
* Build a multipart message.
|
|
486
613
|
* See: https://en.wikipedia.org/wiki/MIME#Multipart_messages
|
|
@@ -493,30 +620,117 @@ export declare class App {
|
|
|
493
620
|
*/
|
|
494
621
|
export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
|
|
495
622
|
|
|
623
|
+
/**
|
|
624
|
+
* Change segment colour command.
|
|
625
|
+
*/
|
|
626
|
+
export declare class ChangeSegmentColourCommand {
|
|
627
|
+
/**
|
|
628
|
+
* @param {Image} mask The mask image.
|
|
629
|
+
* @param {MaskSegment} segment The segment to modify.
|
|
630
|
+
* @param {RGB|number} newColour The new segment colour.
|
|
631
|
+
* @param {boolean} [silent] Whether to send a creation event or not.
|
|
632
|
+
*/
|
|
633
|
+
constructor(mask: Image_2, segment: MaskSegment, newColour: RGB | number, silent?: boolean);
|
|
634
|
+
/**
|
|
635
|
+
* Get the command name.
|
|
636
|
+
*
|
|
637
|
+
* @returns {string} The command name.
|
|
638
|
+
*/
|
|
639
|
+
getName(): string;
|
|
640
|
+
/**
|
|
641
|
+
* Check if a command is valid and can be executed.
|
|
642
|
+
*
|
|
643
|
+
* @returns {boolean} True if the command is valid.
|
|
644
|
+
*/
|
|
645
|
+
isValid(): boolean;
|
|
646
|
+
/**
|
|
647
|
+
* Execute the command.
|
|
648
|
+
*
|
|
649
|
+
* @fires ChangeSegmentColourCommand#changemasksegmentcolour
|
|
650
|
+
*/
|
|
651
|
+
execute(): void;
|
|
652
|
+
/**
|
|
653
|
+
* Undo the command.
|
|
654
|
+
*
|
|
655
|
+
* @fires ChangeSegmentColourCommand#changemasksegmentcolour
|
|
656
|
+
*/
|
|
657
|
+
undo(): void;
|
|
658
|
+
/**
|
|
659
|
+
* Handle an execute event.
|
|
660
|
+
*
|
|
661
|
+
* @param {object} _event The execute event with type and id.
|
|
662
|
+
*/
|
|
663
|
+
onExecute(_event: object): void;
|
|
664
|
+
/**
|
|
665
|
+
* Handle an undo event.
|
|
666
|
+
*
|
|
667
|
+
* @param {object} _event The undo event with type and id.
|
|
668
|
+
*/
|
|
669
|
+
onUndo(_event: object): void;
|
|
670
|
+
#private;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Colour map: red, green and blue components
|
|
675
|
+
* to associate with intensity values.
|
|
676
|
+
*/
|
|
677
|
+
export declare class ColourMap {
|
|
678
|
+
/**
|
|
679
|
+
* @param {number[]} red Red component.
|
|
680
|
+
* @param {number[]} green Green component.
|
|
681
|
+
* @param {number[]} blue Blue component.
|
|
682
|
+
*/
|
|
683
|
+
constructor(red: number[], green: number[], blue: number[]);
|
|
684
|
+
/**
|
|
685
|
+
* Red component: 256 values in the [0, 255] range.
|
|
686
|
+
*
|
|
687
|
+
* @type {number[]}
|
|
688
|
+
*/
|
|
689
|
+
red: number[];
|
|
690
|
+
/**
|
|
691
|
+
* Green component: 256 values in the [0, 255] range.
|
|
692
|
+
*
|
|
693
|
+
* @type {number[]}
|
|
694
|
+
*/
|
|
695
|
+
green: number[];
|
|
696
|
+
/**
|
|
697
|
+
* Blue component: 256 values in the [0, 255] range.
|
|
698
|
+
*
|
|
699
|
+
* @type {number[]}
|
|
700
|
+
*/
|
|
701
|
+
blue: number[];
|
|
702
|
+
}
|
|
703
|
+
|
|
496
704
|
/**
|
|
497
705
|
* Create an Image from DICOM elements.
|
|
498
706
|
*
|
|
499
|
-
* @param {
|
|
707
|
+
* @param {Object<string, DataElement>} elements The DICOM elements.
|
|
500
708
|
* @returns {Image} The Image object.
|
|
501
709
|
*/
|
|
502
|
-
export declare function createImage(elements:
|
|
710
|
+
export declare function createImage(elements: {
|
|
711
|
+
[x: string]: DataElement;
|
|
712
|
+
}): Image_2;
|
|
503
713
|
|
|
504
714
|
/**
|
|
505
715
|
* Create a mask Image from DICOM elements.
|
|
506
716
|
*
|
|
507
|
-
* @param {
|
|
717
|
+
* @param {Object<string, DataElement>} elements The DICOM elements.
|
|
508
718
|
* @returns {Image} The mask Image object.
|
|
509
719
|
*/
|
|
510
|
-
export declare function createMaskImage(elements:
|
|
720
|
+
export declare function createMaskImage(elements: {
|
|
721
|
+
[x: string]: DataElement;
|
|
722
|
+
}): Image_2;
|
|
511
723
|
|
|
512
724
|
/**
|
|
513
725
|
* Create a View from DICOM elements and image.
|
|
514
726
|
*
|
|
515
|
-
* @param {
|
|
727
|
+
* @param {Object<string, DataElement>} elements The DICOM elements.
|
|
516
728
|
* @param {Image} image The associated image.
|
|
517
729
|
* @returns {View} The View object.
|
|
518
730
|
*/
|
|
519
|
-
export declare function createView(elements:
|
|
731
|
+
export declare function createView(elements: {
|
|
732
|
+
[x: string]: DataElement;
|
|
733
|
+
}, image: Image_2): View;
|
|
520
734
|
|
|
521
735
|
export declare namespace customUI {
|
|
522
736
|
/**
|
|
@@ -528,6 +742,64 @@ export declare namespace customUI {
|
|
|
528
742
|
export function openRoiDialog(data: any, callback: Function): void;
|
|
529
743
|
}
|
|
530
744
|
|
|
745
|
+
/**
|
|
746
|
+
* DICOM data element.
|
|
747
|
+
*/
|
|
748
|
+
export declare class DataElement {
|
|
749
|
+
/**
|
|
750
|
+
* @param {string} vr The element VR (Value Representation).
|
|
751
|
+
*/
|
|
752
|
+
constructor(vr: string);
|
|
753
|
+
/**
|
|
754
|
+
* The element Value Representation.
|
|
755
|
+
*
|
|
756
|
+
* @type {string}
|
|
757
|
+
*/
|
|
758
|
+
vr: string;
|
|
759
|
+
/**
|
|
760
|
+
* The element value.
|
|
761
|
+
*
|
|
762
|
+
* @type {Array}
|
|
763
|
+
*/
|
|
764
|
+
value: any[];
|
|
765
|
+
/**
|
|
766
|
+
* The element dicom tag.
|
|
767
|
+
*
|
|
768
|
+
* @type {Tag}
|
|
769
|
+
*/
|
|
770
|
+
tag: Tag;
|
|
771
|
+
/**
|
|
772
|
+
* The element Value Length.
|
|
773
|
+
*
|
|
774
|
+
* @type {number}
|
|
775
|
+
*/
|
|
776
|
+
vl: number;
|
|
777
|
+
/**
|
|
778
|
+
* Flag to know if defined or undefined sequence length.
|
|
779
|
+
*
|
|
780
|
+
* @type {boolean}
|
|
781
|
+
*/
|
|
782
|
+
undefinedLength: boolean;
|
|
783
|
+
/**
|
|
784
|
+
* The element start offset.
|
|
785
|
+
*
|
|
786
|
+
* @type {number}
|
|
787
|
+
*/
|
|
788
|
+
startOffset: number;
|
|
789
|
+
/**
|
|
790
|
+
* The element end offset.
|
|
791
|
+
*
|
|
792
|
+
* @type {number}
|
|
793
|
+
*/
|
|
794
|
+
endOffset: number;
|
|
795
|
+
/**
|
|
796
|
+
* The sequence items.
|
|
797
|
+
*
|
|
798
|
+
* @type {Array}
|
|
799
|
+
*/
|
|
800
|
+
items: any[];
|
|
801
|
+
}
|
|
802
|
+
|
|
531
803
|
/**
|
|
532
804
|
* Decoder scripts to be passed to web workers for image decoding.
|
|
533
805
|
*/
|
|
@@ -541,14 +813,11 @@ export declare const decoderScripts: {
|
|
|
541
813
|
/**
|
|
542
814
|
* List of default window level presets.
|
|
543
815
|
*
|
|
544
|
-
* @type {Object.<string, Object.<string,
|
|
816
|
+
* @type {Object.<string, Object.<string, WindowLevel>>}
|
|
545
817
|
*/
|
|
546
818
|
export declare const defaultPresets: {
|
|
547
819
|
[x: string]: {
|
|
548
|
-
[x: string]:
|
|
549
|
-
center: number;
|
|
550
|
-
width: number;
|
|
551
|
-
};
|
|
820
|
+
[x: string]: WindowLevel;
|
|
552
821
|
};
|
|
553
822
|
};
|
|
554
823
|
|
|
@@ -560,6 +829,97 @@ export declare namespace defaults {
|
|
|
560
829
|
};
|
|
561
830
|
}
|
|
562
831
|
|
|
832
|
+
/**
|
|
833
|
+
* Delete segment command.
|
|
834
|
+
*/
|
|
835
|
+
export declare class DeleteSegmentCommand {
|
|
836
|
+
/**
|
|
837
|
+
* @param {Image} mask The mask image.
|
|
838
|
+
* @param {MaskSegment} segment The segment to remove.
|
|
839
|
+
* @param {boolean} [silent] Whether to send a creation event or not.
|
|
840
|
+
*/
|
|
841
|
+
constructor(mask: Image_2, segment: MaskSegment, silent?: boolean);
|
|
842
|
+
/**
|
|
843
|
+
* Get the command name.
|
|
844
|
+
*
|
|
845
|
+
* @returns {string} The command name.
|
|
846
|
+
*/
|
|
847
|
+
getName(): string;
|
|
848
|
+
/**
|
|
849
|
+
* Check if a command is valid and can be executed.
|
|
850
|
+
*
|
|
851
|
+
* @returns {boolean} True if the command is valid.
|
|
852
|
+
*/
|
|
853
|
+
isValid(): boolean;
|
|
854
|
+
/**
|
|
855
|
+
* Execute the command.
|
|
856
|
+
*
|
|
857
|
+
* @fires DeleteSegmentCommand#masksegmentdelete
|
|
858
|
+
*/
|
|
859
|
+
execute(): void;
|
|
860
|
+
/**
|
|
861
|
+
* Undo the command.
|
|
862
|
+
*
|
|
863
|
+
* @fires DeleteSegmentCommand#masksegmentredraw
|
|
864
|
+
*/
|
|
865
|
+
undo(): void;
|
|
866
|
+
/**
|
|
867
|
+
* Handle an execute event.
|
|
868
|
+
*
|
|
869
|
+
* @param {object} _event The execute event with type and id.
|
|
870
|
+
*/
|
|
871
|
+
onExecute(_event: object): void;
|
|
872
|
+
/**
|
|
873
|
+
* Handle an undo event.
|
|
874
|
+
*
|
|
875
|
+
* @param {object} _event The undo event with type and id.
|
|
876
|
+
*/
|
|
877
|
+
onUndo(_event: object): void;
|
|
878
|
+
#private;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* DICOM code: item of a basic code sequence.
|
|
883
|
+
*
|
|
884
|
+
* @see https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_8.8.html
|
|
885
|
+
*/
|
|
886
|
+
export declare class DicomCode {
|
|
887
|
+
/**
|
|
888
|
+
* @param {string} meaning The code meaning.
|
|
889
|
+
*/
|
|
890
|
+
constructor(meaning: string);
|
|
891
|
+
/**
|
|
892
|
+
* Code meaning (0008,0104).
|
|
893
|
+
*
|
|
894
|
+
* @type {string}
|
|
895
|
+
*/
|
|
896
|
+
meaning: string;
|
|
897
|
+
/**
|
|
898
|
+
* Code value (0008,0100).
|
|
899
|
+
*
|
|
900
|
+
* @type {string|undefined}
|
|
901
|
+
*/
|
|
902
|
+
value: string | undefined;
|
|
903
|
+
/**
|
|
904
|
+
* Long code value (0008,0119).
|
|
905
|
+
*
|
|
906
|
+
* @type {string|undefined}
|
|
907
|
+
*/
|
|
908
|
+
longValue: string | undefined;
|
|
909
|
+
/**
|
|
910
|
+
* URN code value (0008,0120).
|
|
911
|
+
*
|
|
912
|
+
* @type {string|undefined}
|
|
913
|
+
*/
|
|
914
|
+
urnValue: string | undefined;
|
|
915
|
+
/**
|
|
916
|
+
* Coding scheme designator (0008,0102).
|
|
917
|
+
*
|
|
918
|
+
* @type {string|undefined}
|
|
919
|
+
*/
|
|
920
|
+
schemeDesignator: string | undefined;
|
|
921
|
+
}
|
|
922
|
+
|
|
563
923
|
/**
|
|
564
924
|
* DicomParser class.
|
|
565
925
|
*
|
|
@@ -606,14 +966,16 @@ export declare class DicomParser {
|
|
|
606
966
|
*/
|
|
607
967
|
setDecoderCharacterSet(characterSet: string): void;
|
|
608
968
|
/**
|
|
609
|
-
* Get the
|
|
969
|
+
* Get the DICOM data elements.
|
|
610
970
|
*
|
|
611
|
-
* @returns {
|
|
971
|
+
* @returns {Object<string, DataElement>} The data elements.
|
|
612
972
|
*/
|
|
613
|
-
getDicomElements():
|
|
973
|
+
getDicomElements(): {
|
|
974
|
+
[x: string]: DataElement;
|
|
975
|
+
};
|
|
614
976
|
/**
|
|
615
977
|
* Parse the complete DICOM file (given as input to the class).
|
|
616
|
-
* Fills in the member object '
|
|
978
|
+
* Fills in the member object 'dataElements'.
|
|
617
979
|
*
|
|
618
980
|
* @param {ArrayBuffer} buffer The input array buffer.
|
|
619
981
|
*/
|
|
@@ -624,16 +986,33 @@ export declare class DicomParser {
|
|
|
624
986
|
/**
|
|
625
987
|
* DICOM writer.
|
|
626
988
|
*
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
989
|
+
* @example
|
|
990
|
+
* // add link to html
|
|
991
|
+
* const link = document.createElement("a");
|
|
992
|
+
* link.appendChild(document.createTextNode("download"));
|
|
993
|
+
* const div = document.getElementById("dwv");
|
|
994
|
+
* div.appendChild(link);
|
|
995
|
+
* // XMLHttpRequest onload callback
|
|
996
|
+
* const onload = function (event) {
|
|
997
|
+
* const parser = new dwv.DicomParser();
|
|
998
|
+
* parser.parse(event.target.response);
|
|
999
|
+
* // create writer
|
|
1000
|
+
* const writer = new dwv.DicomWriter();
|
|
1001
|
+
* // get buffer using default rules
|
|
1002
|
+
* const dicomBuffer = writer.getBuffer(parser.getDicomElements());
|
|
1003
|
+
* // create blob
|
|
1004
|
+
* const blob = new Blob([dicomBuffer], {type: 'application/dicom'});
|
|
1005
|
+
* // add blob to download link
|
|
1006
|
+
* link.href = URL.createObjectURL(blob);
|
|
1007
|
+
* link.download = "anonym.dcm";
|
|
1008
|
+
* };
|
|
1009
|
+
* // DICOM file request
|
|
1010
|
+
* const request = new XMLHttpRequest();
|
|
1011
|
+
* const url = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm';
|
|
1012
|
+
* request.open('GET', url);
|
|
1013
|
+
* request.responseType = 'arraybuffer';
|
|
1014
|
+
* request.onload = onload;
|
|
1015
|
+
* request.send();
|
|
637
1016
|
*/
|
|
638
1017
|
export declare class DicomWriter {
|
|
639
1018
|
/**
|
|
@@ -642,30 +1021,186 @@ export declare class DicomWriter {
|
|
|
642
1021
|
* @param {boolean} flag True to use UN VR.
|
|
643
1022
|
*/
|
|
644
1023
|
setUseUnVrForPrivateSq(flag: boolean): void;
|
|
1024
|
+
/**
|
|
1025
|
+
* Set the vr=UN check and fix flag.
|
|
1026
|
+
*
|
|
1027
|
+
* @param {boolean} flag True to activate the check and fix.
|
|
1028
|
+
*/
|
|
1029
|
+
setFixUnknownVR(flag: boolean): void;
|
|
645
1030
|
/**
|
|
646
1031
|
* Set the writing rules.
|
|
1032
|
+
* List of writer rules indexed by either `default`,
|
|
1033
|
+
* tagKey, tagName or groupName.
|
|
1034
|
+
* Each DICOM element will be checked to see if a rule is applicable.
|
|
1035
|
+
* First checked by tagKey, tagName and then by groupName,
|
|
1036
|
+
* if nothing is found the default rule is applied.
|
|
647
1037
|
*
|
|
648
|
-
* @param {
|
|
1038
|
+
* @param {Object<string, WriterRule>} rules The input rules.
|
|
1039
|
+
* @param {boolean} [addMissingTags] if true, explicit tags that
|
|
1040
|
+
* have replace rule and a value will be
|
|
1041
|
+
* added if missing. Defaults to false.
|
|
649
1042
|
*/
|
|
650
|
-
setRules(rules:
|
|
1043
|
+
setRules(rules: {
|
|
1044
|
+
[x: string]: WriterRule;
|
|
1045
|
+
}, addMissingTags?: boolean): void;
|
|
651
1046
|
/**
|
|
652
1047
|
* Use a TextEncoder instead of the default text decoder.
|
|
653
1048
|
*/
|
|
654
1049
|
useSpecialTextEncoder(): void;
|
|
655
1050
|
/**
|
|
656
|
-
*
|
|
1051
|
+
* Get the element to write according to the class rules.
|
|
1052
|
+
* Priority order: tagName, groupName, default.
|
|
1053
|
+
*
|
|
1054
|
+
* @param {DataElement} element The element to check
|
|
1055
|
+
* @returns {DataElement|null} The element to write, can be null.
|
|
657
1056
|
*/
|
|
658
|
-
|
|
1057
|
+
getElementToWrite(element: DataElement): DataElement | null;
|
|
659
1058
|
/**
|
|
660
1059
|
* Get the ArrayBuffer corresponding to input DICOM elements.
|
|
661
1060
|
*
|
|
662
|
-
* @param {
|
|
1061
|
+
* @param {Object<string, DataElement>} dataElements The elements to write.
|
|
663
1062
|
* @returns {ArrayBuffer} The elements as a buffer.
|
|
664
1063
|
*/
|
|
665
|
-
getBuffer(
|
|
1064
|
+
getBuffer(dataElements: {
|
|
1065
|
+
[x: string]: DataElement;
|
|
1066
|
+
}): ArrayBuffer;
|
|
1067
|
+
#private;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Draw controller.
|
|
1072
|
+
*/
|
|
1073
|
+
export declare class DrawController {
|
|
1074
|
+
/**
|
|
1075
|
+
* @param {DrawLayer} drawLayer The draw layer.
|
|
1076
|
+
*/
|
|
1077
|
+
constructor(drawLayer: DrawLayer);
|
|
1078
|
+
/**
|
|
1079
|
+
* Get the current position group.
|
|
1080
|
+
*
|
|
1081
|
+
* @returns {Konva.Group|undefined} The Konva.Group.
|
|
1082
|
+
*/
|
|
1083
|
+
getCurrentPosGroup(): Konva.Group | undefined;
|
|
1084
|
+
/**
|
|
1085
|
+
* Reset: clear the layers array.
|
|
1086
|
+
*/
|
|
1087
|
+
reset(): void;
|
|
1088
|
+
/**
|
|
1089
|
+
* Get a Konva group using its id.
|
|
1090
|
+
*
|
|
1091
|
+
* @param {string} id The group id.
|
|
1092
|
+
* @returns {object|undefined} The Konva group.
|
|
1093
|
+
*/
|
|
1094
|
+
getGroup(id: string): object | undefined;
|
|
1095
|
+
/**
|
|
1096
|
+
* Activate the current draw layer.
|
|
1097
|
+
*
|
|
1098
|
+
* @param {Index} index The current position.
|
|
1099
|
+
* @param {number} scrollIndex The scroll index.
|
|
1100
|
+
*/
|
|
1101
|
+
activateDrawLayer(index: Index, scrollIndex: number): void;
|
|
1102
|
+
/**
|
|
1103
|
+
* Get a list of drawing display details.
|
|
1104
|
+
*
|
|
1105
|
+
* @returns {DrawDetails[]} A list of draw details.
|
|
1106
|
+
*/
|
|
1107
|
+
getDrawDisplayDetails(): DrawDetails[];
|
|
1108
|
+
/**
|
|
1109
|
+
* Get a list of drawing store details. Used in state.
|
|
1110
|
+
*
|
|
1111
|
+
* @returns {object} A list of draw details including id, text, quant...
|
|
1112
|
+
* TODO Unify with getDrawDisplayDetails?
|
|
1113
|
+
*/
|
|
1114
|
+
getDrawStoreDetails(): object;
|
|
1115
|
+
/**
|
|
1116
|
+
* Set the drawings on the current stage.
|
|
1117
|
+
*
|
|
1118
|
+
* @param {Array} drawings An array of drawings.
|
|
1119
|
+
* @param {DrawDetails[]} drawingsDetails An array of drawings details.
|
|
1120
|
+
* @param {object} cmdCallback The DrawCommand callback.
|
|
1121
|
+
* @param {object} exeCallback The callback to call once the
|
|
1122
|
+
* DrawCommand has been executed.
|
|
1123
|
+
*/
|
|
1124
|
+
setDrawings(drawings: any[], drawingsDetails: DrawDetails[], cmdCallback: object, exeCallback: object): void;
|
|
1125
|
+
/**
|
|
1126
|
+
* Update a drawing from its details.
|
|
1127
|
+
*
|
|
1128
|
+
* @param {DrawDetails} drawDetails Details of the drawing to update.
|
|
1129
|
+
*/
|
|
1130
|
+
updateDraw(drawDetails: DrawDetails): void;
|
|
1131
|
+
/**
|
|
1132
|
+
* Delete a Draw from the stage.
|
|
1133
|
+
*
|
|
1134
|
+
* @param {Konva.Group} group The group to delete.
|
|
1135
|
+
* @param {object} cmdCallback The DeleteCommand callback.
|
|
1136
|
+
* @param {object} exeCallback The callback to call once the
|
|
1137
|
+
* DeleteCommand has been executed.
|
|
1138
|
+
*/
|
|
1139
|
+
deleteDrawGroup(group: Konva.Group, cmdCallback: object, exeCallback: object): void;
|
|
1140
|
+
/**
|
|
1141
|
+
* Delete a Draw from the stage.
|
|
1142
|
+
*
|
|
1143
|
+
* @param {string} id The id of the group to delete.
|
|
1144
|
+
* @param {Function} cmdCallback The DeleteCommand callback.
|
|
1145
|
+
* @param {Function} exeCallback The callback to call once the
|
|
1146
|
+
* DeleteCommand has been executed.
|
|
1147
|
+
* @returns {boolean} False if the group cannot be found.
|
|
1148
|
+
*/
|
|
1149
|
+
deleteDraw(id: string, cmdCallback: Function, exeCallback: Function): boolean;
|
|
1150
|
+
/**
|
|
1151
|
+
* Delete all Draws from the stage.
|
|
1152
|
+
*
|
|
1153
|
+
* @param {Function} cmdCallback The DeleteCommand callback.
|
|
1154
|
+
* @param {Function} exeCallback The callback to call once the
|
|
1155
|
+
* DeleteCommand has been executed.
|
|
1156
|
+
*/
|
|
1157
|
+
deleteDraws(cmdCallback: Function, exeCallback: Function): void;
|
|
1158
|
+
/**
|
|
1159
|
+
* Get the total number of draws
|
|
1160
|
+
* (at all positions).
|
|
1161
|
+
*
|
|
1162
|
+
* @returns {number} The total number of draws.
|
|
1163
|
+
*/
|
|
1164
|
+
getNumberOfDraws(): number;
|
|
666
1165
|
#private;
|
|
667
1166
|
}
|
|
668
1167
|
|
|
1168
|
+
/**
|
|
1169
|
+
* Draw details.
|
|
1170
|
+
*/
|
|
1171
|
+
export declare class DrawDetails {
|
|
1172
|
+
/**
|
|
1173
|
+
* The draw ID.
|
|
1174
|
+
*
|
|
1175
|
+
* @type {number}
|
|
1176
|
+
*/
|
|
1177
|
+
id: number;
|
|
1178
|
+
/**
|
|
1179
|
+
* The draw position: an Index converted to string.
|
|
1180
|
+
*
|
|
1181
|
+
* @type {string}
|
|
1182
|
+
*/
|
|
1183
|
+
position: string;
|
|
1184
|
+
/**
|
|
1185
|
+
* The draw type.
|
|
1186
|
+
*
|
|
1187
|
+
* @type {string}
|
|
1188
|
+
*/
|
|
1189
|
+
type: string;
|
|
1190
|
+
/**
|
|
1191
|
+
* The draw color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
|
|
1192
|
+
*
|
|
1193
|
+
* @type {string}
|
|
1194
|
+
*/
|
|
1195
|
+
color: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* The draw meta.
|
|
1198
|
+
*
|
|
1199
|
+
* @type {DrawMeta}
|
|
1200
|
+
*/
|
|
1201
|
+
meta: DrawMeta;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
669
1204
|
/**
|
|
670
1205
|
* Draw layer.
|
|
671
1206
|
*/
|
|
@@ -702,9 +1237,9 @@ export declare class DrawLayer {
|
|
|
702
1237
|
/**
|
|
703
1238
|
* Set the plane helper.
|
|
704
1239
|
*
|
|
705
|
-
* @param {
|
|
1240
|
+
* @param {PlaneHelper} helper The helper.
|
|
706
1241
|
*/
|
|
707
|
-
setPlaneHelper(helper:
|
|
1242
|
+
setPlaneHelper(helper: PlaneHelper): void;
|
|
708
1243
|
/**
|
|
709
1244
|
* Get the id of the layer.
|
|
710
1245
|
*
|
|
@@ -714,9 +1249,9 @@ export declare class DrawLayer {
|
|
|
714
1249
|
/**
|
|
715
1250
|
* Get the layer base size (without scale).
|
|
716
1251
|
*
|
|
717
|
-
* @returns {
|
|
1252
|
+
* @returns {Scalar2D} The size as {x,y}.
|
|
718
1253
|
*/
|
|
719
|
-
getBaseSize():
|
|
1254
|
+
getBaseSize(): Scalar2D;
|
|
720
1255
|
/**
|
|
721
1256
|
* Get the layer opacity.
|
|
722
1257
|
*
|
|
@@ -737,19 +1272,31 @@ export declare class DrawLayer {
|
|
|
737
1272
|
* Add a flip offset along the layer Y axis.
|
|
738
1273
|
*/
|
|
739
1274
|
addFlipOffsetY(): void;
|
|
1275
|
+
/**
|
|
1276
|
+
* Flip the scale along the layer X axis.
|
|
1277
|
+
*/
|
|
1278
|
+
flipScaleX(): void;
|
|
1279
|
+
/**
|
|
1280
|
+
* Flip the scale along the layer Y axis.
|
|
1281
|
+
*/
|
|
1282
|
+
flipScaleY(): void;
|
|
1283
|
+
/**
|
|
1284
|
+
* Flip the scale along the layer Z axis.
|
|
1285
|
+
*/
|
|
1286
|
+
flipScaleZ(): void;
|
|
740
1287
|
/**
|
|
741
1288
|
* Set the layer scale.
|
|
742
1289
|
*
|
|
743
|
-
* @param {
|
|
744
|
-
* @param {Point3D} center The scale center.
|
|
1290
|
+
* @param {Scalar3D} newScale The scale as {x,y,z}.
|
|
1291
|
+
* @param {Point3D} [center] The scale center.
|
|
745
1292
|
*/
|
|
746
|
-
setScale(newScale:
|
|
1293
|
+
setScale(newScale: Scalar3D, center?: Point3D): void;
|
|
747
1294
|
/**
|
|
748
1295
|
* Set the layer offset.
|
|
749
1296
|
*
|
|
750
|
-
* @param {
|
|
1297
|
+
* @param {Scalar3D} newOffset The offset as {x,y,z}.
|
|
751
1298
|
*/
|
|
752
|
-
setOffset(newOffset:
|
|
1299
|
+
setOffset(newOffset: Scalar3D): void;
|
|
753
1300
|
/**
|
|
754
1301
|
* Set the base layer offset. Updates the layer offset.
|
|
755
1302
|
*
|
|
@@ -778,19 +1325,19 @@ export declare class DrawLayer {
|
|
|
778
1325
|
/**
|
|
779
1326
|
* Initialise the layer: set the canvas and context
|
|
780
1327
|
*
|
|
781
|
-
* @param {
|
|
782
|
-
* @param {
|
|
1328
|
+
* @param {Scalar2D} size The image size as {x,y}.
|
|
1329
|
+
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
783
1330
|
* @param {string} dataId The associated data id.
|
|
784
1331
|
*/
|
|
785
|
-
initialise(size:
|
|
1332
|
+
initialise(size: Scalar2D, spacing: Scalar2D, dataId: string): void;
|
|
786
1333
|
/**
|
|
787
1334
|
* Fit the layer to its parent container.
|
|
788
1335
|
*
|
|
789
1336
|
* @param {number} fitScale1D The 1D fit scale.
|
|
790
|
-
* @param {
|
|
791
|
-
* @param {
|
|
1337
|
+
* @param {Scalar2D} fitSize The fit size as {x,y}.
|
|
1338
|
+
* @param {Scalar2D} fitOffset The fit offset as {x,y}.
|
|
792
1339
|
*/
|
|
793
|
-
fitToContainer(fitScale1D: number, fitSize:
|
|
1340
|
+
fitToContainer(fitScale1D: number, fitSize: Scalar2D, fitOffset: Scalar2D): void;
|
|
794
1341
|
/**
|
|
795
1342
|
* Check the visibility of a given group.
|
|
796
1343
|
*
|
|
@@ -804,7 +1351,7 @@ export declare class DrawLayer {
|
|
|
804
1351
|
* @param {string} id The id of the group.
|
|
805
1352
|
* @returns {boolean} False if the group cannot be found.
|
|
806
1353
|
*/
|
|
807
|
-
|
|
1354
|
+
toggleGroupVisibility(id: string): boolean;
|
|
808
1355
|
/**
|
|
809
1356
|
* Delete a Draw from the stage.
|
|
810
1357
|
*
|
|
@@ -820,6 +1367,13 @@ export declare class DrawLayer {
|
|
|
820
1367
|
* DeleteCommand has been executed.
|
|
821
1368
|
*/
|
|
822
1369
|
deleteDraws(exeCallback: object): void;
|
|
1370
|
+
/**
|
|
1371
|
+
* Get the total number of draws of this layer
|
|
1372
|
+
* (at all positions).
|
|
1373
|
+
*
|
|
1374
|
+
* @returns {number|undefined} The total number of draws.
|
|
1375
|
+
*/
|
|
1376
|
+
getNumberOfDraws(): number | undefined;
|
|
823
1377
|
/**
|
|
824
1378
|
* Enable and listen to container interaction events.
|
|
825
1379
|
*/
|
|
@@ -840,21 +1394,40 @@ export declare class DrawLayer {
|
|
|
840
1394
|
* Add an event listener to this class.
|
|
841
1395
|
*
|
|
842
1396
|
* @param {string} type The event type.
|
|
843
|
-
* @param {
|
|
1397
|
+
* @param {Function} callback The function associated with the provided
|
|
844
1398
|
* event type, will be called with the fired event.
|
|
845
1399
|
*/
|
|
846
|
-
addEventListener(type: string, callback:
|
|
1400
|
+
addEventListener(type: string, callback: Function): void;
|
|
847
1401
|
/**
|
|
848
1402
|
* Remove an event listener from this class.
|
|
849
1403
|
*
|
|
850
1404
|
* @param {string} type The event type.
|
|
851
|
-
* @param {
|
|
1405
|
+
* @param {Function} callback The function associated with the provided
|
|
852
1406
|
* event type.
|
|
853
1407
|
*/
|
|
854
|
-
removeEventListener(type: string, callback:
|
|
1408
|
+
removeEventListener(type: string, callback: Function): void;
|
|
855
1409
|
#private;
|
|
856
1410
|
}
|
|
857
1411
|
|
|
1412
|
+
/**
|
|
1413
|
+
* Draw meta data.
|
|
1414
|
+
*/
|
|
1415
|
+
export declare class DrawMeta {
|
|
1416
|
+
/**
|
|
1417
|
+
* Draw quantification.
|
|
1418
|
+
*
|
|
1419
|
+
* @type {object}
|
|
1420
|
+
*/
|
|
1421
|
+
quantification: object;
|
|
1422
|
+
/**
|
|
1423
|
+
* Draw text expression. Can contain variables surrounded with '{}' that will
|
|
1424
|
+
* be extracted from the quantification object.
|
|
1425
|
+
*
|
|
1426
|
+
* @type {string}
|
|
1427
|
+
*/
|
|
1428
|
+
textExpr: string;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
858
1431
|
/**
|
|
859
1432
|
* 2D/3D Geometry class.
|
|
860
1433
|
*/
|
|
@@ -907,9 +1480,9 @@ export declare class Geometry {
|
|
|
907
1480
|
/**
|
|
908
1481
|
* Get the object origins.
|
|
909
1482
|
*
|
|
910
|
-
* @returns {
|
|
1483
|
+
* @returns {Point3D[]} The object origins.
|
|
911
1484
|
*/
|
|
912
|
-
getOrigins():
|
|
1485
|
+
getOrigins(): Point3D[];
|
|
913
1486
|
/**
|
|
914
1487
|
* Check if a point is in the origin list.
|
|
915
1488
|
*
|
|
@@ -1002,10 +1575,10 @@ export declare class Geometry {
|
|
|
1002
1575
|
* Check that a index is within bounds.
|
|
1003
1576
|
*
|
|
1004
1577
|
* @param {Index} index The index to check.
|
|
1005
|
-
* @param {
|
|
1578
|
+
* @param {number[]} [dirs] Optional list of directions to check.
|
|
1006
1579
|
* @returns {boolean} True if the given coordinates are within bounds.
|
|
1007
1580
|
*/
|
|
1008
|
-
isIndexInBounds(index: Index, dirs?:
|
|
1581
|
+
isIndexInBounds(index: Index, dirs?: number[]): boolean;
|
|
1009
1582
|
/**
|
|
1010
1583
|
* Convert an index into world coordinates.
|
|
1011
1584
|
*
|
|
@@ -1037,6 +1610,19 @@ export declare class Geometry {
|
|
|
1037
1610
|
#private;
|
|
1038
1611
|
}
|
|
1039
1612
|
|
|
1613
|
+
/**
|
|
1614
|
+
* Get the default DICOM seg tags as an object.
|
|
1615
|
+
*
|
|
1616
|
+
* @returns {object} The default tags.
|
|
1617
|
+
*/
|
|
1618
|
+
export declare function getDefaultDicomSegJson(): object;
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* List of DICOM data elements indexed via a 8 character string formed from
|
|
1622
|
+
* the group and element numbers.
|
|
1623
|
+
*
|
|
1624
|
+
* @typedef {Object<string, DataElement>} DataElements
|
|
1625
|
+
*/
|
|
1040
1626
|
/**
|
|
1041
1627
|
* Get the version of the library.
|
|
1042
1628
|
*
|
|
@@ -1045,23 +1631,56 @@ export declare class Geometry {
|
|
|
1045
1631
|
export declare function getDwvVersion(): string;
|
|
1046
1632
|
|
|
1047
1633
|
/**
|
|
1048
|
-
* Get the DICOM elements from a DICOM
|
|
1049
|
-
* The
|
|
1634
|
+
* Get the DICOM elements from a 'simple' DICOM tags object.
|
|
1635
|
+
* The input object is a simplified version of the oficial DICOM json with
|
|
1050
1636
|
* tag names instead of keys and direct values (no value property) for
|
|
1051
|
-
* simple tags.
|
|
1637
|
+
* simple tags. See synthetic test data (in tests/dicom) for examples.
|
|
1638
|
+
*
|
|
1639
|
+
* @param {Object<string, any>} simpleTags The 'simple' DICOM
|
|
1640
|
+
* tags object.
|
|
1641
|
+
* @returns {Object<string, DataElement>} The DICOM elements.
|
|
1642
|
+
*/
|
|
1643
|
+
export declare function getElementsFromJSONTags(simpleTags: {
|
|
1644
|
+
[x: string]: any;
|
|
1645
|
+
}): {
|
|
1646
|
+
[x: string]: DataElement;
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* Get the indices that form a ellpise.
|
|
1651
|
+
*
|
|
1652
|
+
* @param {Index} center The ellipse center.
|
|
1653
|
+
* @param {number[]} radius The 2 ellipse radiuses.
|
|
1654
|
+
* @param {number[]} dir The 2 ellipse directions.
|
|
1655
|
+
* @returns {Index[]} The indices of the ellipse.
|
|
1656
|
+
*/
|
|
1657
|
+
export declare function getEllipseIndices(center: Index, radius: number[], dir: number[]): Index[];
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Get the layer details from a mouse event.
|
|
1661
|
+
*
|
|
1662
|
+
* @param {object} event The event to get the layer div id from. Expecting
|
|
1663
|
+
* an event origininating from a canvas inside a layer HTML div
|
|
1664
|
+
* with the 'layer' class and id generated with `getLayerDivId`.
|
|
1665
|
+
* @returns {object} The layer details as {groupDivId, layerId}.
|
|
1666
|
+
*/
|
|
1667
|
+
export declare function getLayerDetailsFromEvent(event: object): object;
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Get the offset of an input mouse event.
|
|
1052
1671
|
*
|
|
1053
|
-
* @param {object}
|
|
1054
|
-
* @returns {
|
|
1672
|
+
* @param {object} event The event to get the offset from.
|
|
1673
|
+
* @returns {Point2D} The 2D point.
|
|
1055
1674
|
*/
|
|
1056
|
-
export declare function
|
|
1675
|
+
export declare function getMousePoint(event: object): Point2D;
|
|
1057
1676
|
|
|
1058
1677
|
/**
|
|
1059
1678
|
* Get the name of an image orientation patient.
|
|
1060
1679
|
*
|
|
1061
|
-
* @param {
|
|
1680
|
+
* @param {number[]} orientation The image orientation patient.
|
|
1062
1681
|
* @returns {string} The orientation name: axial, coronal or sagittal.
|
|
1063
1682
|
*/
|
|
1064
|
-
export declare function getOrientationName(orientation:
|
|
1683
|
+
export declare function getOrientationName(orientation: number[]): string;
|
|
1065
1684
|
|
|
1066
1685
|
/**
|
|
1067
1686
|
* Get the PixelData Tag.
|
|
@@ -1086,6 +1705,14 @@ export declare function getReverseOrientation(ori: string): string;
|
|
|
1086
1705
|
*/
|
|
1087
1706
|
export declare function getTagFromKey(key: string): Tag;
|
|
1088
1707
|
|
|
1708
|
+
/**
|
|
1709
|
+
* Get the offsets of an input touch event.
|
|
1710
|
+
*
|
|
1711
|
+
* @param {object} event The event to get the offset from.
|
|
1712
|
+
* @returns {Point2D[]} The array of points.
|
|
1713
|
+
*/
|
|
1714
|
+
export declare function getTouchPoints(event: object): Point2D[];
|
|
1715
|
+
|
|
1089
1716
|
/**
|
|
1090
1717
|
* Get the appropriate TypedArray in function of arguments.
|
|
1091
1718
|
*
|
|
@@ -1111,6 +1738,16 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
|
|
|
1111
1738
|
*/
|
|
1112
1739
|
export declare function getUID(tagName: string): string;
|
|
1113
1740
|
|
|
1741
|
+
/**
|
|
1742
|
+
* Check that an input buffer includes the DICOM prefix 'DICM'
|
|
1743
|
+
* after the 128 bytes preamble.
|
|
1744
|
+
* Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}
|
|
1745
|
+
*
|
|
1746
|
+
* @param {ArrayBuffer} buffer The buffer to check.
|
|
1747
|
+
* @returns {boolean} True if the buffer includes the prefix.
|
|
1748
|
+
*/
|
|
1749
|
+
export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
|
|
1750
|
+
|
|
1114
1751
|
export declare namespace i18n {
|
|
1115
1752
|
/**
|
|
1116
1753
|
* Get the translated text.
|
|
@@ -1163,9 +1800,9 @@ declare class Image_2 {
|
|
|
1163
1800
|
/**
|
|
1164
1801
|
* @param {Geometry} geometry The geometry of the image.
|
|
1165
1802
|
* @param {TypedArray} buffer The image data as a one dimensional buffer.
|
|
1166
|
-
* @param {
|
|
1803
|
+
* @param {string[]} [imageUids] An array of Uids indexed to slice number.
|
|
1167
1804
|
*/
|
|
1168
|
-
constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?:
|
|
1805
|
+
constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]);
|
|
1169
1806
|
/**
|
|
1170
1807
|
* Get the image UID at a given index.
|
|
1171
1808
|
*
|
|
@@ -1173,6 +1810,13 @@ declare class Image_2 {
|
|
|
1173
1810
|
* @returns {string} The UID.
|
|
1174
1811
|
*/
|
|
1175
1812
|
getImageUid(index?: Index): string;
|
|
1813
|
+
/**
|
|
1814
|
+
* Check if this image includes the input uids.
|
|
1815
|
+
*
|
|
1816
|
+
* @param {string[]} uids UIDs to test for presence.
|
|
1817
|
+
* @returns {boolean} True if all uids are in this image uids.
|
|
1818
|
+
*/
|
|
1819
|
+
containsImageUids(uids: string[]): boolean;
|
|
1176
1820
|
/**
|
|
1177
1821
|
* Get the geometry of the image.
|
|
1178
1822
|
*
|
|
@@ -1196,8 +1840,15 @@ declare class Image_2 {
|
|
|
1196
1840
|
* Can window and level be applied to the data?
|
|
1197
1841
|
*
|
|
1198
1842
|
* @returns {boolean} True if the data is monochrome.
|
|
1843
|
+
* @deprecated Please use isMonochrome instead.
|
|
1199
1844
|
*/
|
|
1200
1845
|
canWindowLevel(): boolean;
|
|
1846
|
+
/**
|
|
1847
|
+
* Is the data monochrome.
|
|
1848
|
+
*
|
|
1849
|
+
* @returns {boolean} True if the data is monochrome.
|
|
1850
|
+
*/
|
|
1851
|
+
isMonochrome(): boolean;
|
|
1201
1852
|
/**
|
|
1202
1853
|
* Can the data be scrolled?
|
|
1203
1854
|
*
|
|
@@ -1274,15 +1925,19 @@ declare class Image_2 {
|
|
|
1274
1925
|
/**
|
|
1275
1926
|
* Get the meta information of the image.
|
|
1276
1927
|
*
|
|
1277
|
-
* @returns {
|
|
1928
|
+
* @returns {Object<string, any>} The meta information of the image.
|
|
1278
1929
|
*/
|
|
1279
|
-
getMeta():
|
|
1930
|
+
getMeta(): {
|
|
1931
|
+
[x: string]: any;
|
|
1932
|
+
};
|
|
1280
1933
|
/**
|
|
1281
1934
|
* Set the meta information of the image.
|
|
1282
1935
|
*
|
|
1283
|
-
* @param {
|
|
1936
|
+
* @param {Object<string, any>} rhs The meta information of the image.
|
|
1284
1937
|
*/
|
|
1285
|
-
setMeta(rhs:
|
|
1938
|
+
setMeta(rhs: {
|
|
1939
|
+
[x: string]: any;
|
|
1940
|
+
}): void;
|
|
1286
1941
|
/**
|
|
1287
1942
|
* Get value at offset. Warning: No size check...
|
|
1288
1943
|
*
|
|
@@ -1294,19 +1949,19 @@ declare class Image_2 {
|
|
|
1294
1949
|
* Get the offsets where the buffer equals the input value.
|
|
1295
1950
|
* Loops through the whole volume, can get long for big data...
|
|
1296
1951
|
*
|
|
1297
|
-
* @param {number|
|
|
1298
|
-
* @returns {
|
|
1952
|
+
* @param {number|RGB} value The value to check.
|
|
1953
|
+
* @returns {number[]} The list of offsets.
|
|
1299
1954
|
*/
|
|
1300
|
-
getOffsets(value: number |
|
|
1955
|
+
getOffsets(value: number | RGB): number[];
|
|
1301
1956
|
/**
|
|
1302
1957
|
* Check if the input values are in the buffer.
|
|
1303
1958
|
* Could loop through the whole volume, can get long for big data...
|
|
1304
1959
|
*
|
|
1305
1960
|
* @param {Array} values The values to check.
|
|
1306
|
-
* @returns {
|
|
1961
|
+
* @returns {boolean[]} A list of booleans for each input value,
|
|
1307
1962
|
* set to true if the value is present in the buffer.
|
|
1308
1963
|
*/
|
|
1309
|
-
hasValues(values: any[]):
|
|
1964
|
+
hasValues(values: any[]): boolean[];
|
|
1310
1965
|
/**
|
|
1311
1966
|
* Clone the image.
|
|
1312
1967
|
*
|
|
@@ -1317,6 +1972,7 @@ declare class Image_2 {
|
|
|
1317
1972
|
* Append a slice to the image.
|
|
1318
1973
|
*
|
|
1319
1974
|
* @param {Image} rhs The slice to append.
|
|
1975
|
+
* @fires Image#imagegeometrychange
|
|
1320
1976
|
*/
|
|
1321
1977
|
appendSlice(rhs: Image_2): void;
|
|
1322
1978
|
/**
|
|
@@ -1355,44 +2011,46 @@ declare class Image_2 {
|
|
|
1355
2011
|
* Add an event listener to this class.
|
|
1356
2012
|
*
|
|
1357
2013
|
* @param {string} type The event type.
|
|
1358
|
-
* @param {
|
|
2014
|
+
* @param {Function} callback The function associated with the provided
|
|
1359
2015
|
* event type, will be called with the fired event.
|
|
1360
2016
|
*/
|
|
1361
|
-
addEventListener(type: string, callback:
|
|
2017
|
+
addEventListener(type: string, callback: Function): void;
|
|
1362
2018
|
/**
|
|
1363
2019
|
* Remove an event listener from this class.
|
|
1364
2020
|
*
|
|
1365
2021
|
* @param {string} type The event type.
|
|
1366
|
-
* @param {
|
|
2022
|
+
* @param {Function} callback The function associated with the provided
|
|
1367
2023
|
* event type.
|
|
1368
2024
|
*/
|
|
1369
|
-
removeEventListener(type: string, callback:
|
|
2025
|
+
removeEventListener(type: string, callback: Function): void;
|
|
1370
2026
|
/**
|
|
1371
2027
|
* Set the inner buffer values at given offsets.
|
|
1372
2028
|
*
|
|
1373
|
-
* @param {
|
|
1374
|
-
* @param {
|
|
1375
|
-
* @fires Image#
|
|
2029
|
+
* @param {number[]} offsets List of offsets where to set the data.
|
|
2030
|
+
* @param {number|RGB} value The value to set at the given offsets.
|
|
2031
|
+
* @fires Image#imagecontentchange
|
|
1376
2032
|
*/
|
|
1377
|
-
setAtOffsets(offsets:
|
|
2033
|
+
setAtOffsets(offsets: number[], value: number | RGB): void;
|
|
1378
2034
|
/**
|
|
1379
2035
|
* Set the inner buffer values at given offsets.
|
|
1380
2036
|
*
|
|
1381
|
-
* @param {
|
|
1382
|
-
*
|
|
2037
|
+
* @param {number[][]} offsetsLists List of offset lists where
|
|
2038
|
+
* to set the data.
|
|
2039
|
+
* @param {RGB} value The value to set at the given offsets.
|
|
1383
2040
|
* @returns {Array} A list of objects representing the original values before
|
|
1384
2041
|
* replacing them.
|
|
1385
|
-
* @fires Image#
|
|
2042
|
+
* @fires Image#imagecontentchange
|
|
1386
2043
|
*/
|
|
1387
|
-
setAtOffsetsAndGetOriginals(offsetsLists:
|
|
2044
|
+
setAtOffsetsAndGetOriginals(offsetsLists: number[][], value: RGB): any[];
|
|
1388
2045
|
/**
|
|
1389
2046
|
* Set the inner buffer values at given offsets.
|
|
1390
2047
|
*
|
|
1391
|
-
* @param {
|
|
1392
|
-
*
|
|
1393
|
-
* @
|
|
2048
|
+
* @param {number[][]} offsetsLists List of offset lists
|
|
2049
|
+
* where to set the data.
|
|
2050
|
+
* @param {RGB|Array} value The value to set at the given offsets.
|
|
2051
|
+
* @fires Image#imagecontentchange
|
|
1394
2052
|
*/
|
|
1395
|
-
setAtOffsetsWithIterator(offsetsLists:
|
|
2053
|
+
setAtOffsetsWithIterator(offsetsLists: number[][], value: RGB | any[]): void;
|
|
1396
2054
|
/**
|
|
1397
2055
|
* Get the value of the image at a specific coordinate.
|
|
1398
2056
|
*
|
|
@@ -1464,20 +2122,20 @@ declare class Image_2 {
|
|
|
1464
2122
|
*
|
|
1465
2123
|
* Note: Uses raw buffer values.
|
|
1466
2124
|
*
|
|
1467
|
-
* @param {
|
|
2125
|
+
* @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
|
|
1468
2126
|
* @returns {Image} The convoluted image.
|
|
1469
2127
|
*/
|
|
1470
|
-
convolute2D(weights:
|
|
2128
|
+
convolute2D(weights: number[]): Image_2;
|
|
1471
2129
|
/**
|
|
1472
2130
|
* Convolute an image buffer with a given 2D kernel.
|
|
1473
2131
|
*
|
|
1474
2132
|
* Note: Uses raw buffer values.
|
|
1475
2133
|
*
|
|
1476
|
-
* @param {
|
|
2134
|
+
* @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
|
|
1477
2135
|
* @param {TypedArray} buffer The buffer to convolute.
|
|
1478
2136
|
* @param {number} startOffset The index to start at.
|
|
1479
2137
|
*/
|
|
1480
|
-
convoluteBuffer(weights:
|
|
2138
|
+
convoluteBuffer(weights: number[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
|
|
1481
2139
|
/**
|
|
1482
2140
|
* Transform an image using a specific operator.
|
|
1483
2141
|
* WARNING: no size check!
|
|
@@ -1508,9 +2166,9 @@ export { Image_2 as Image }
|
|
|
1508
2166
|
*/
|
|
1509
2167
|
export declare class Index {
|
|
1510
2168
|
/**
|
|
1511
|
-
* @param {
|
|
2169
|
+
* @param {number[]} values The index values.
|
|
1512
2170
|
*/
|
|
1513
|
-
constructor(values:
|
|
2171
|
+
constructor(values: number[]);
|
|
1514
2172
|
/**
|
|
1515
2173
|
* Get the index value at the given array index.
|
|
1516
2174
|
*
|
|
@@ -1533,9 +2191,9 @@ export declare class Index {
|
|
|
1533
2191
|
/**
|
|
1534
2192
|
* Get the values of this index.
|
|
1535
2193
|
*
|
|
1536
|
-
* @returns {
|
|
2194
|
+
* @returns {number[]} The array of values.
|
|
1537
2195
|
*/
|
|
1538
|
-
getValues():
|
|
2196
|
+
getValues(): number[];
|
|
1539
2197
|
/**
|
|
1540
2198
|
* Check if the input index can be compared to this one.
|
|
1541
2199
|
*
|
|
@@ -1554,9 +2212,9 @@ export declare class Index {
|
|
|
1554
2212
|
* Compare indices and return different dimensions.
|
|
1555
2213
|
*
|
|
1556
2214
|
* @param {Index} rhs The index to compare to.
|
|
1557
|
-
* @returns {
|
|
2215
|
+
* @returns {number[]} The list of different dimensions.
|
|
1558
2216
|
*/
|
|
1559
|
-
compare(rhs: Index):
|
|
2217
|
+
compare(rhs: Index): number[];
|
|
1560
2218
|
/**
|
|
1561
2219
|
* Add another index to this one.
|
|
1562
2220
|
*
|
|
@@ -1575,13 +2233,31 @@ export declare class Index {
|
|
|
1575
2233
|
/**
|
|
1576
2234
|
* Get a string id from the index values in the form of: '#0-1_#1-2'.
|
|
1577
2235
|
*
|
|
1578
|
-
* @param {
|
|
2236
|
+
* @param {number[]} [dims] Optional list of dimensions to use.
|
|
1579
2237
|
* @returns {string} The string id.
|
|
1580
2238
|
*/
|
|
1581
|
-
toStringId(dims?:
|
|
2239
|
+
toStringId(dims?: number[]): string;
|
|
1582
2240
|
#private;
|
|
1583
2241
|
}
|
|
1584
2242
|
|
|
2243
|
+
/**
|
|
2244
|
+
* Check if two rgb objects are equal.
|
|
2245
|
+
*
|
|
2246
|
+
* @param {RGB} c1 The first colour.
|
|
2247
|
+
* @param {RGB} c2 The second colour.
|
|
2248
|
+
* @returns {boolean} True if both colour are equal.
|
|
2249
|
+
*/
|
|
2250
|
+
export declare function isEqualRgb(c1: RGB, c2: RGB): boolean;
|
|
2251
|
+
|
|
2252
|
+
/**
|
|
2253
|
+
* CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
|
|
2254
|
+
* unsigned int CIE LAB ([0, 65535]).
|
|
2255
|
+
*
|
|
2256
|
+
* @param {object} triplet CIE XYZ triplet as {l,a,b} with CIE LAB range.
|
|
2257
|
+
* @returns {object} CIE LAB triplet as {l,a,b} with unsigned range.
|
|
2258
|
+
*/
|
|
2259
|
+
export declare function labToUintLab(triplet: object): object;
|
|
2260
|
+
|
|
1585
2261
|
/**
|
|
1586
2262
|
* Layer group.
|
|
1587
2263
|
*
|
|
@@ -1603,18 +2279,6 @@ export declare class LayerGroup {
|
|
|
1603
2279
|
* @param {HTMLElement} containerDiv The associated HTML div.
|
|
1604
2280
|
*/
|
|
1605
2281
|
constructor(containerDiv: HTMLElement);
|
|
1606
|
-
/**
|
|
1607
|
-
* Get the target orientation.
|
|
1608
|
-
*
|
|
1609
|
-
* @returns {Matrix33} The orientation matrix.
|
|
1610
|
-
*/
|
|
1611
|
-
getTargetOrientation(): Matrix33;
|
|
1612
|
-
/**
|
|
1613
|
-
* Set the target orientation.
|
|
1614
|
-
*
|
|
1615
|
-
* @param {Matrix33} orientation The orientation matrix.
|
|
1616
|
-
*/
|
|
1617
|
-
setTargetOrientation(orientation: Matrix33): void;
|
|
1618
2282
|
/**
|
|
1619
2283
|
* Get the showCrosshair flag.
|
|
1620
2284
|
*
|
|
@@ -1642,39 +2306,51 @@ export declare class LayerGroup {
|
|
|
1642
2306
|
/**
|
|
1643
2307
|
* Get the layer scale.
|
|
1644
2308
|
*
|
|
1645
|
-
* @returns {
|
|
2309
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
1646
2310
|
*/
|
|
1647
|
-
getScale():
|
|
2311
|
+
getScale(): Scalar3D;
|
|
1648
2312
|
/**
|
|
1649
2313
|
* Get the base scale.
|
|
1650
2314
|
*
|
|
1651
|
-
* @returns {
|
|
2315
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
1652
2316
|
*/
|
|
1653
|
-
getBaseScale():
|
|
2317
|
+
getBaseScale(): Scalar3D;
|
|
1654
2318
|
/**
|
|
1655
2319
|
* Get the added scale: the scale added to the base scale
|
|
1656
2320
|
*
|
|
1657
|
-
* @returns {
|
|
2321
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
1658
2322
|
*/
|
|
1659
|
-
getAddedScale():
|
|
2323
|
+
getAddedScale(): Scalar3D;
|
|
1660
2324
|
/**
|
|
1661
2325
|
* Get the layer offset.
|
|
1662
2326
|
*
|
|
1663
|
-
* @returns {
|
|
2327
|
+
* @returns {Scalar3D} The offset as {x,y,z}.
|
|
1664
2328
|
*/
|
|
1665
|
-
getOffset():
|
|
2329
|
+
getOffset(): Scalar3D;
|
|
1666
2330
|
/**
|
|
1667
2331
|
* Get the number of layers handled by this class.
|
|
1668
2332
|
*
|
|
1669
2333
|
* @returns {number} The number of layers.
|
|
1670
2334
|
*/
|
|
1671
2335
|
getNumberOfLayers(): number;
|
|
2336
|
+
/**
|
|
2337
|
+
* Get the number of view layers handled by this class.
|
|
2338
|
+
*
|
|
2339
|
+
* @returns {number} The number of layers.
|
|
2340
|
+
*/
|
|
2341
|
+
getNumberOfViewLayers(): number;
|
|
1672
2342
|
/**
|
|
1673
2343
|
* Get the active image layer.
|
|
1674
2344
|
*
|
|
1675
2345
|
* @returns {ViewLayer|undefined} The layer.
|
|
1676
2346
|
*/
|
|
1677
2347
|
getActiveViewLayer(): ViewLayer | undefined;
|
|
2348
|
+
/**
|
|
2349
|
+
* Get the base view layer.
|
|
2350
|
+
*
|
|
2351
|
+
* @returns {ViewLayer|undefined} The layer.
|
|
2352
|
+
*/
|
|
2353
|
+
getBaseViewLayer(): ViewLayer | undefined;
|
|
1678
2354
|
/**
|
|
1679
2355
|
* Get the view layers associated to a data id.
|
|
1680
2356
|
*
|
|
@@ -1692,9 +2368,9 @@ export declare class LayerGroup {
|
|
|
1692
2368
|
/**
|
|
1693
2369
|
* Get the view layers data indices.
|
|
1694
2370
|
*
|
|
1695
|
-
* @returns {
|
|
2371
|
+
* @returns {string[]} The list of indices.
|
|
1696
2372
|
*/
|
|
1697
|
-
getViewDataIndices():
|
|
2373
|
+
getViewDataIndices(): string[];
|
|
1698
2374
|
/**
|
|
1699
2375
|
* Get the active draw layer.
|
|
1700
2376
|
*
|
|
@@ -1748,6 +2424,12 @@ export declare class LayerGroup {
|
|
|
1748
2424
|
* Empty the layer list.
|
|
1749
2425
|
*/
|
|
1750
2426
|
empty(): void;
|
|
2427
|
+
/**
|
|
2428
|
+
* Remove all layers for a specific data.
|
|
2429
|
+
*
|
|
2430
|
+
* @param {string} dataId The data to remove its layers.
|
|
2431
|
+
*/
|
|
2432
|
+
removeLayersByDataId(dataId: string): void;
|
|
1751
2433
|
/**
|
|
1752
2434
|
* Remove a layer from this layer group.
|
|
1753
2435
|
* Warning: if current active layer, the index will
|
|
@@ -1757,10 +2439,40 @@ export declare class LayerGroup {
|
|
|
1757
2439
|
* @param {ViewLayer | DrawLayer} layer The layer to remove.
|
|
1758
2440
|
*/
|
|
1759
2441
|
removeLayer(layer: ViewLayer | DrawLayer): void;
|
|
2442
|
+
/**
|
|
2443
|
+
* Test if one of the view layers satisfies an input callbackFn.
|
|
2444
|
+
*
|
|
2445
|
+
* @param {Function} callbackFn A function that takes a ViewLayer as input
|
|
2446
|
+
* and returns a boolean.
|
|
2447
|
+
* @returns {boolean} True if one of the ViewLayers satisfies the callbackFn.
|
|
2448
|
+
*/
|
|
2449
|
+
someViewLayer(callbackFn: Function): boolean;
|
|
2450
|
+
/**
|
|
2451
|
+
* Can the input position be set on one of the view layers.
|
|
2452
|
+
*
|
|
2453
|
+
* @param {Point} position The input position.
|
|
2454
|
+
* @returns {boolean} True if one view layer accepts the input position.
|
|
2455
|
+
*/
|
|
2456
|
+
isPositionInBounds(position: Point): boolean;
|
|
2457
|
+
/**
|
|
2458
|
+
* Can one of the view layers be scrolled.
|
|
2459
|
+
*
|
|
2460
|
+
* @returns {boolean} True if one view layer can be scrolled.
|
|
2461
|
+
*/
|
|
2462
|
+
canScroll(): boolean;
|
|
2463
|
+
/**
|
|
2464
|
+
* Does one of the view layer have more than one slice in the
|
|
2465
|
+
* given dimension.
|
|
2466
|
+
*
|
|
2467
|
+
* @param {number} dim The input dimension.
|
|
2468
|
+
* @returns {boolean} True if one view layer has more than one slice.
|
|
2469
|
+
*/
|
|
2470
|
+
moreThanOne(dim: number): boolean;
|
|
1760
2471
|
/**
|
|
1761
2472
|
* Update layers (but not the active view layer) to a position change.
|
|
1762
2473
|
*
|
|
1763
2474
|
* @param {object} event The position change event.
|
|
2475
|
+
* @function
|
|
1764
2476
|
*/
|
|
1765
2477
|
updateLayersToPositionChange: (event: object) => void;
|
|
1766
2478
|
/**
|
|
@@ -1778,9 +2490,9 @@ export declare class LayerGroup {
|
|
|
1778
2490
|
/**
|
|
1779
2491
|
* Get the largest data size.
|
|
1780
2492
|
*
|
|
1781
|
-
* @returns {
|
|
2493
|
+
* @returns {Scalar2D|undefined} The largest size as {x,y}.
|
|
1782
2494
|
*/
|
|
1783
|
-
getMaxSize():
|
|
2495
|
+
getMaxSize(): Scalar2D | undefined;
|
|
1784
2496
|
/**
|
|
1785
2497
|
* Flip all layers along the Z axis without offset compensation.
|
|
1786
2498
|
*/
|
|
@@ -1795,24 +2507,24 @@ export declare class LayerGroup {
|
|
|
1795
2507
|
/**
|
|
1796
2508
|
* Set the layers' scale.
|
|
1797
2509
|
*
|
|
1798
|
-
* @param {
|
|
2510
|
+
* @param {Scalar3D} newScale The scale to apply as {x,y,z}.
|
|
1799
2511
|
* @param {Point3D} [center] The scale center Point3D.
|
|
1800
2512
|
* @fires LayerGroup#zoomchange
|
|
1801
2513
|
*/
|
|
1802
|
-
setScale(newScale:
|
|
2514
|
+
setScale(newScale: Scalar3D, center?: Point3D): void;
|
|
1803
2515
|
/**
|
|
1804
2516
|
* Add translation to the layers.
|
|
1805
2517
|
*
|
|
1806
|
-
* @param {
|
|
2518
|
+
* @param {Scalar3D} translation The translation as {x,y,z}.
|
|
1807
2519
|
*/
|
|
1808
|
-
addTranslation(translation:
|
|
2520
|
+
addTranslation(translation: Scalar3D): void;
|
|
1809
2521
|
/**
|
|
1810
2522
|
* Set the layers' offset.
|
|
1811
2523
|
*
|
|
1812
|
-
* @param {
|
|
2524
|
+
* @param {Scalar3D} newOffset The offset as {x,y,z}.
|
|
1813
2525
|
* @fires LayerGroup#offsetchange
|
|
1814
2526
|
*/
|
|
1815
|
-
setOffset(newOffset:
|
|
2527
|
+
setOffset(newOffset: Scalar3D): void;
|
|
1816
2528
|
/**
|
|
1817
2529
|
* Reset the stage to its initial scale and no offset.
|
|
1818
2530
|
*/
|
|
@@ -1831,18 +2543,18 @@ export declare class LayerGroup {
|
|
|
1831
2543
|
* Add an event listener to this class.
|
|
1832
2544
|
*
|
|
1833
2545
|
* @param {string} type The event type.
|
|
1834
|
-
* @param {
|
|
2546
|
+
* @param {Function} callback The function associated with the provided
|
|
1835
2547
|
* event type, will be called with the fired event.
|
|
1836
2548
|
*/
|
|
1837
|
-
addEventListener(type: string, callback:
|
|
2549
|
+
addEventListener(type: string, callback: Function): void;
|
|
1838
2550
|
/**
|
|
1839
2551
|
* Remove an event listener from this class.
|
|
1840
2552
|
*
|
|
1841
2553
|
* @param {string} type The event type.
|
|
1842
|
-
* @param {
|
|
2554
|
+
* @param {Function} callback The function associated with the provided
|
|
1843
2555
|
* event type.
|
|
1844
2556
|
*/
|
|
1845
|
-
removeEventListener(type: string, callback:
|
|
2557
|
+
removeEventListener(type: string, callback: Function): void;
|
|
1846
2558
|
#private;
|
|
1847
2559
|
}
|
|
1848
2560
|
|
|
@@ -1865,32 +2577,244 @@ export declare namespace logger {
|
|
|
1865
2577
|
/**
|
|
1866
2578
|
* List of available lookup tables (lut).
|
|
1867
2579
|
*
|
|
1868
|
-
* @type {Object<string,
|
|
2580
|
+
* @type {Object<string, ColourMap>}
|
|
1869
2581
|
*/
|
|
1870
|
-
export declare const
|
|
1871
|
-
[x: string]:
|
|
1872
|
-
red: number[];
|
|
1873
|
-
green: number[];
|
|
1874
|
-
blue: number[];
|
|
1875
|
-
};
|
|
2582
|
+
export declare const luts: {
|
|
2583
|
+
[x: string]: ColourMap;
|
|
1876
2584
|
};
|
|
1877
2585
|
|
|
2586
|
+
/**
|
|
2587
|
+
* Mask {@link Image} factory.
|
|
2588
|
+
*/
|
|
2589
|
+
export declare class MaskFactory {
|
|
2590
|
+
/**
|
|
2591
|
+
* Get a warning string if elements are not as expected.
|
|
2592
|
+
* Created by checkElements.
|
|
2593
|
+
*
|
|
2594
|
+
* @returns {string|undefined} The warning.
|
|
2595
|
+
*/
|
|
2596
|
+
getWarning(): string | undefined;
|
|
2597
|
+
/**
|
|
2598
|
+
* Check dicom elements. Throws an error if not suitable.
|
|
2599
|
+
*
|
|
2600
|
+
* @param {Object<string, DataElement>} _dicomElements The DICOM tags.
|
|
2601
|
+
* @returns {string|undefined} A possible warning.
|
|
2602
|
+
*/
|
|
2603
|
+
checkElements(_dicomElements: {
|
|
2604
|
+
[x: string]: DataElement;
|
|
2605
|
+
}): string | undefined;
|
|
2606
|
+
/**
|
|
2607
|
+
* Get an {@link Image} object from the read DICOM file.
|
|
2608
|
+
*
|
|
2609
|
+
* @param {Object<string, DataElement>} dataElements The DICOM tags.
|
|
2610
|
+
* @param {Uint8Array | Int8Array |
|
|
2611
|
+
* Uint16Array | Int16Array |
|
|
2612
|
+
* Uint32Array | Int32Array} pixelBuffer The pixel buffer.
|
|
2613
|
+
* @returns {Image} A new Image.
|
|
2614
|
+
*/
|
|
2615
|
+
create(dataElements: {
|
|
2616
|
+
[x: string]: DataElement;
|
|
2617
|
+
}, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
|
|
2618
|
+
/**
|
|
2619
|
+
* Convert a mask image into a DICOM segmentation object.
|
|
2620
|
+
*
|
|
2621
|
+
* @param {Image} image The mask image.
|
|
2622
|
+
* @param {MaskSegment[]} segments The mask segments.
|
|
2623
|
+
* @param {Image} sourceImage The source image.
|
|
2624
|
+
* @param {Object<string, any>} [extraTags] Optional list of extra tags.
|
|
2625
|
+
* @returns {Object<string, DataElement>} A list of dicom elements.
|
|
2626
|
+
*/
|
|
2627
|
+
toDicom(image: Image_2, segments: MaskSegment[], sourceImage: Image_2, extraTags?: {
|
|
2628
|
+
[x: string]: any;
|
|
2629
|
+
}): {
|
|
2630
|
+
[x: string]: DataElement;
|
|
2631
|
+
};
|
|
2632
|
+
#private;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
/**
|
|
2636
|
+
* DICOM (mask) segment: item of a SegmentSequence (0062,0002).
|
|
2637
|
+
*
|
|
2638
|
+
* @see https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.8.20.4.html
|
|
2639
|
+
*/
|
|
2640
|
+
export declare class MaskSegment {
|
|
2641
|
+
/**
|
|
2642
|
+
* @param {number} number The segment number.
|
|
2643
|
+
* @param {string} label The segment label.
|
|
2644
|
+
* @param {string} algorithmType The segment number.
|
|
2645
|
+
*/
|
|
2646
|
+
constructor(number: number, label: string, algorithmType: string);
|
|
2647
|
+
/**
|
|
2648
|
+
* Segment number (0062,0004).
|
|
2649
|
+
*
|
|
2650
|
+
* @type {number}
|
|
2651
|
+
*/
|
|
2652
|
+
number: number;
|
|
2653
|
+
/**
|
|
2654
|
+
* Segment label (0062,0005).
|
|
2655
|
+
*
|
|
2656
|
+
* @type {string}
|
|
2657
|
+
*/
|
|
2658
|
+
label: string;
|
|
2659
|
+
/**
|
|
2660
|
+
* Segment algorithm type (0062,0008).
|
|
2661
|
+
*
|
|
2662
|
+
* @type {string}
|
|
2663
|
+
*/
|
|
2664
|
+
algorithmType: string;
|
|
2665
|
+
/**
|
|
2666
|
+
* Segment algorithm name (0062,0009).
|
|
2667
|
+
*
|
|
2668
|
+
* @type {string|undefined}
|
|
2669
|
+
*/
|
|
2670
|
+
algorithmName: string | undefined;
|
|
2671
|
+
/**
|
|
2672
|
+
* Segment display value as simple value.
|
|
2673
|
+
*
|
|
2674
|
+
* @type {number|undefined}
|
|
2675
|
+
*/
|
|
2676
|
+
displayValue: number | undefined;
|
|
2677
|
+
/**
|
|
2678
|
+
* Segment display value as RGB colour ({r,g,b}).
|
|
2679
|
+
*
|
|
2680
|
+
* @type {RGB|undefined}
|
|
2681
|
+
*/
|
|
2682
|
+
displayRGBValue: RGB | undefined;
|
|
2683
|
+
/**
|
|
2684
|
+
* Segment property code: specific property
|
|
2685
|
+
* the segment represents (0062,000F).
|
|
2686
|
+
*
|
|
2687
|
+
* @type {DicomCode|undefined}
|
|
2688
|
+
*/
|
|
2689
|
+
propertyTypeCode: DicomCode | undefined;
|
|
2690
|
+
/**
|
|
2691
|
+
* Segment property category code: general category
|
|
2692
|
+
* of the property the segment represents (0062,0003).
|
|
2693
|
+
*
|
|
2694
|
+
* @type {DicomCode|undefined}
|
|
2695
|
+
*/
|
|
2696
|
+
propertyCategoryCode: DicomCode | undefined;
|
|
2697
|
+
/**
|
|
2698
|
+
* Segment tracking UID (0062,0021).
|
|
2699
|
+
*
|
|
2700
|
+
* @type {string|undefined}
|
|
2701
|
+
*/
|
|
2702
|
+
trackingUid: string | undefined;
|
|
2703
|
+
/**
|
|
2704
|
+
* Segment tracking id: text label for the UID (0062,0020).
|
|
2705
|
+
*
|
|
2706
|
+
* @type {string|undefined}
|
|
2707
|
+
*/
|
|
2708
|
+
trackingId: string | undefined;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
/**
|
|
2712
|
+
* Mask segment helper: helps handling the segments list,
|
|
2713
|
+
* but does *NOT* update the associated mask (use special commands
|
|
2714
|
+
* for that such as DeleteSegmentCommand, ChangeSegmentColourCommand...).
|
|
2715
|
+
*/
|
|
2716
|
+
export declare class MaskSegmentHelper {
|
|
2717
|
+
/**
|
|
2718
|
+
* @param {Image} mask The associated mask image.
|
|
2719
|
+
*/
|
|
2720
|
+
constructor(mask: Image_2);
|
|
2721
|
+
/**
|
|
2722
|
+
* Check if a segment is part of the segments list.
|
|
2723
|
+
*
|
|
2724
|
+
* @param {number} segmentNumber The segment number.
|
|
2725
|
+
* @returns {boolean} True if the segment is included.
|
|
2726
|
+
*/
|
|
2727
|
+
hasSegment(segmentNumber: number): boolean;
|
|
2728
|
+
/**
|
|
2729
|
+
* Check if a segment is present in a mask image.
|
|
2730
|
+
*
|
|
2731
|
+
* @param {number[]} numbers Array of segment numbers.
|
|
2732
|
+
* @returns {boolean[]} Array of boolean set to true
|
|
2733
|
+
* if the segment is present in the mask.
|
|
2734
|
+
*/
|
|
2735
|
+
maskHasSegments(numbers: number[]): boolean[];
|
|
2736
|
+
/**
|
|
2737
|
+
* Get a segment from the inner segment list.
|
|
2738
|
+
*
|
|
2739
|
+
* @param {number} segmentNumber The segment number.
|
|
2740
|
+
* @returns {MaskSegment|undefined} The segment or undefined if not found.
|
|
2741
|
+
*/
|
|
2742
|
+
getSegment(segmentNumber: number): MaskSegment | undefined;
|
|
2743
|
+
/**
|
|
2744
|
+
* Add a segment to the segments list.
|
|
2745
|
+
*
|
|
2746
|
+
* @param {MaskSegment} segment The segment to add.
|
|
2747
|
+
*/
|
|
2748
|
+
addSegment(segment: MaskSegment): void;
|
|
2749
|
+
/**
|
|
2750
|
+
* Remove a segment from the segments list.
|
|
2751
|
+
*
|
|
2752
|
+
* @param {number} segmentNumber The segment number.
|
|
2753
|
+
*/
|
|
2754
|
+
removeSegment(segmentNumber: number): void;
|
|
2755
|
+
/**
|
|
2756
|
+
* Update a segment of the segments list.
|
|
2757
|
+
*
|
|
2758
|
+
* @param {MaskSegment} segment The segment to update.
|
|
2759
|
+
*/
|
|
2760
|
+
updateSegment(segment: MaskSegment): void;
|
|
2761
|
+
#private;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
/**
|
|
2765
|
+
* Mask segment view helper: handles hidden segments.
|
|
2766
|
+
*/
|
|
2767
|
+
export declare class MaskSegmentViewHelper {
|
|
2768
|
+
/**
|
|
2769
|
+
* Check if a segment is in the hidden list.
|
|
2770
|
+
*
|
|
2771
|
+
* @param {number} segmentNumber The segment number.
|
|
2772
|
+
* @returns {boolean} True if the segment is in the list.
|
|
2773
|
+
*/
|
|
2774
|
+
isHidden(segmentNumber: number): boolean;
|
|
2775
|
+
/**
|
|
2776
|
+
* Add a segment to the hidden list.
|
|
2777
|
+
*
|
|
2778
|
+
* @param {MaskSegment} segment The segment to add.
|
|
2779
|
+
*/
|
|
2780
|
+
addToHidden(segment: MaskSegment): void;
|
|
2781
|
+
/**
|
|
2782
|
+
* Remove a segment from the hidden list.
|
|
2783
|
+
*
|
|
2784
|
+
* @param {number} segmentNumber The segment number.
|
|
2785
|
+
*/
|
|
2786
|
+
removeFromHidden(segmentNumber: number): void;
|
|
2787
|
+
/**
|
|
2788
|
+
* @callback alphaFn@callback alphaFn
|
|
2789
|
+
* @param {number[]|number} value The pixel value.
|
|
2790
|
+
* @param {number} index The values' index.
|
|
2791
|
+
* @returns {number} The opacity of the input value.
|
|
2792
|
+
*/
|
|
2793
|
+
/**
|
|
2794
|
+
* Get the alpha function to apply hidden colors.
|
|
2795
|
+
*
|
|
2796
|
+
* @returns {alphaFn} The corresponding alpha function.
|
|
2797
|
+
*/
|
|
2798
|
+
getAlphaFunc(): (value: number[] | number, index: number) => number;
|
|
2799
|
+
#private;
|
|
2800
|
+
}
|
|
2801
|
+
|
|
1878
2802
|
/**
|
|
1879
2803
|
* Immutable 3x3 Matrix.
|
|
1880
2804
|
*/
|
|
1881
2805
|
export declare class Matrix33 {
|
|
1882
2806
|
/**
|
|
1883
|
-
* @param {
|
|
2807
|
+
* @param {number[]} values row-major ordered 9 values.
|
|
1884
2808
|
*/
|
|
1885
|
-
constructor(values:
|
|
2809
|
+
constructor(values: number[]);
|
|
1886
2810
|
/**
|
|
1887
2811
|
* Get a value of the matrix.
|
|
1888
2812
|
*
|
|
1889
2813
|
* @param {number} row The row at wich to get the value.
|
|
1890
2814
|
* @param {number} col The column at wich to get the value.
|
|
1891
|
-
* @returns {number} The value at the position.
|
|
2815
|
+
* @returns {number|undefined} The value at the position.
|
|
1892
2816
|
*/
|
|
1893
|
-
get(row: number, col: number): number;
|
|
2817
|
+
get(row: number, col: number): number | undefined;
|
|
1894
2818
|
/**
|
|
1895
2819
|
* Get the inverse of this matrix.
|
|
1896
2820
|
*
|
|
@@ -1929,10 +2853,10 @@ export declare class Matrix33 {
|
|
|
1929
2853
|
/**
|
|
1930
2854
|
* Multiply this matrix by a 3D array.
|
|
1931
2855
|
*
|
|
1932
|
-
* @param {
|
|
1933
|
-
* @returns {
|
|
2856
|
+
* @param {number[]} array3D The input 3D array.
|
|
2857
|
+
* @returns {number[]} The result 3D array.
|
|
1934
2858
|
*/
|
|
1935
|
-
multiplyArray3D(array3D:
|
|
2859
|
+
multiplyArray3D(array3D: number[]): number[];
|
|
1936
2860
|
/**
|
|
1937
2861
|
* Multiply this matrix by a 3D vector.
|
|
1938
2862
|
*
|
|
@@ -1983,6 +2907,12 @@ export declare class Matrix33 {
|
|
|
1983
2907
|
#private;
|
|
1984
2908
|
}
|
|
1985
2909
|
|
|
2910
|
+
export declare namespace Orientation {
|
|
2911
|
+
let Axial: string;
|
|
2912
|
+
let Coronal: string;
|
|
2913
|
+
let Sagittal: string;
|
|
2914
|
+
}
|
|
2915
|
+
|
|
1986
2916
|
/**
|
|
1987
2917
|
* DICOM Header overlay info.
|
|
1988
2918
|
*/
|
|
@@ -2036,6 +2966,101 @@ export declare class OverlayData {
|
|
|
2036
2966
|
#private;
|
|
2037
2967
|
}
|
|
2038
2968
|
|
|
2969
|
+
/**
|
|
2970
|
+
* Plane geometry helper.
|
|
2971
|
+
*/
|
|
2972
|
+
export declare class PlaneHelper {
|
|
2973
|
+
/**
|
|
2974
|
+
* @param {Spacing} spacing The spacing.
|
|
2975
|
+
* @param {Matrix33} imageOrientation The image oientation.
|
|
2976
|
+
* @param {Matrix33} viewOrientation The view orientation.
|
|
2977
|
+
*/
|
|
2978
|
+
constructor(spacing: Spacing, imageOrientation: Matrix33, viewOrientation: Matrix33);
|
|
2979
|
+
/**
|
|
2980
|
+
* Get a 3D offset from a plane one.
|
|
2981
|
+
*
|
|
2982
|
+
* @param {Scalar2D} offset2D The plane offset as {x,y}.
|
|
2983
|
+
* @returns {Vector3D} The 3D world offset.
|
|
2984
|
+
*/
|
|
2985
|
+
getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
|
|
2986
|
+
/**
|
|
2987
|
+
* Get a plane offset from a 3D one.
|
|
2988
|
+
*
|
|
2989
|
+
* @param {Scalar3D} offset3D The 3D offset as {x,y,z}.
|
|
2990
|
+
* @returns {Scalar2D} The plane offset as {x,y}.
|
|
2991
|
+
*/
|
|
2992
|
+
getPlaneOffsetFromOffset3D(offset3D: Scalar3D): Scalar2D;
|
|
2993
|
+
/**
|
|
2994
|
+
* Orient an input vector from real to target space.
|
|
2995
|
+
*
|
|
2996
|
+
* @param {Vector3D} vector The input vector.
|
|
2997
|
+
* @returns {Vector3D} The oriented vector.
|
|
2998
|
+
*/
|
|
2999
|
+
getTargetOrientedVector3D(vector: Vector3D): Vector3D;
|
|
3000
|
+
/**
|
|
3001
|
+
* De-orient an input vector from target to real space.
|
|
3002
|
+
*
|
|
3003
|
+
* @param {Vector3D} planeVector The input vector.
|
|
3004
|
+
* @returns {Vector3D} The de-orienteded vector.
|
|
3005
|
+
*/
|
|
3006
|
+
getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D;
|
|
3007
|
+
/**
|
|
3008
|
+
* De-orient an input point from target to real space.
|
|
3009
|
+
*
|
|
3010
|
+
* @param {Point3D} planePoint The input point.
|
|
3011
|
+
* @returns {Point3D} The de-orienteded point.
|
|
3012
|
+
*/
|
|
3013
|
+
getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D;
|
|
3014
|
+
/**
|
|
3015
|
+
* Orient an input vector from target to image space.
|
|
3016
|
+
*
|
|
3017
|
+
* @param {Vector3D} planeVector The input vector.
|
|
3018
|
+
* @returns {Vector3D} The orienteded vector.
|
|
3019
|
+
*/
|
|
3020
|
+
getImageOrientedVector3D(planeVector: Vector3D): Vector3D;
|
|
3021
|
+
/**
|
|
3022
|
+
* Orient an input point from target to image space.
|
|
3023
|
+
*
|
|
3024
|
+
* @param {Point3D} planePoint The input vector.
|
|
3025
|
+
* @returns {Point3D} The orienteded vector.
|
|
3026
|
+
*/
|
|
3027
|
+
getImageOrientedPoint3D(planePoint: Point3D): Point3D;
|
|
3028
|
+
/**
|
|
3029
|
+
* De-orient an input vector from image to target space.
|
|
3030
|
+
*
|
|
3031
|
+
* @param {Vector3D} vector The input vector.
|
|
3032
|
+
* @returns {Vector3D} The de-orienteded vector.
|
|
3033
|
+
*/
|
|
3034
|
+
getImageDeOrientedVector3D(vector: Vector3D): Vector3D;
|
|
3035
|
+
/**
|
|
3036
|
+
* De-orient an input point from image to target space.
|
|
3037
|
+
*
|
|
3038
|
+
* @param {Point3D} point The input point.
|
|
3039
|
+
* @returns {Point3D} The de-orienteded point.
|
|
3040
|
+
*/
|
|
3041
|
+
getImageDeOrientedPoint3D(point: Point3D): Point3D;
|
|
3042
|
+
/**
|
|
3043
|
+
* Reorder values to follow target orientation.
|
|
3044
|
+
*
|
|
3045
|
+
* @param {Scalar3D} values Values as {x,y,z}.
|
|
3046
|
+
* @returns {Scalar3D} Reoriented values as {x,y,z}.
|
|
3047
|
+
*/
|
|
3048
|
+
getTargetOrientedPositiveXYZ(values: Scalar3D): Scalar3D;
|
|
3049
|
+
/**
|
|
3050
|
+
* Get the (view) scroll dimension index.
|
|
3051
|
+
*
|
|
3052
|
+
* @returns {number} The index.
|
|
3053
|
+
*/
|
|
3054
|
+
getScrollIndex(): number;
|
|
3055
|
+
/**
|
|
3056
|
+
* Get the native (image) scroll dimension index.
|
|
3057
|
+
*
|
|
3058
|
+
* @returns {number} The index.
|
|
3059
|
+
*/
|
|
3060
|
+
getNativeScrollIndex(): number;
|
|
3061
|
+
#private;
|
|
3062
|
+
}
|
|
3063
|
+
|
|
2039
3064
|
/**
|
|
2040
3065
|
* Immutable point.
|
|
2041
3066
|
* Warning: the input array is NOT cloned, modifying it will
|
|
@@ -2043,9 +3068,9 @@ export declare class OverlayData {
|
|
|
2043
3068
|
*/
|
|
2044
3069
|
export declare class Point {
|
|
2045
3070
|
/**
|
|
2046
|
-
* @param {
|
|
3071
|
+
* @param {number[]} values The point values.
|
|
2047
3072
|
*/
|
|
2048
|
-
constructor(values:
|
|
3073
|
+
constructor(values: number[]);
|
|
2049
3074
|
/**
|
|
2050
3075
|
* Get the index value at the given array index.
|
|
2051
3076
|
*
|
|
@@ -2068,9 +3093,9 @@ export declare class Point {
|
|
|
2068
3093
|
/**
|
|
2069
3094
|
* Get the values of this index.
|
|
2070
3095
|
*
|
|
2071
|
-
* @returns {
|
|
3096
|
+
* @returns {number[]} The array of values.
|
|
2072
3097
|
*/
|
|
2073
|
-
getValues():
|
|
3098
|
+
getValues(): number[];
|
|
2074
3099
|
/**
|
|
2075
3100
|
* Check if the input point can be compared to this one.
|
|
2076
3101
|
*
|
|
@@ -2089,9 +3114,9 @@ export declare class Point {
|
|
|
2089
3114
|
* Compare points and return different dimensions.
|
|
2090
3115
|
*
|
|
2091
3116
|
* @param {Point} rhs The point to compare to.
|
|
2092
|
-
* @returns {
|
|
3117
|
+
* @returns {number[]} The list of different dimensions.
|
|
2093
3118
|
*/
|
|
2094
|
-
compare(rhs: Point):
|
|
3119
|
+
compare(rhs: Point): number[];
|
|
2095
3120
|
/**
|
|
2096
3121
|
* Get the 3D part of this point.
|
|
2097
3122
|
*
|
|
@@ -2149,19 +3174,6 @@ export declare class Point2D {
|
|
|
2149
3174
|
* @returns {string} The point as a string.
|
|
2150
3175
|
*/
|
|
2151
3176
|
toString(): string;
|
|
2152
|
-
/**
|
|
2153
|
-
* Get the distance to another Point2D.
|
|
2154
|
-
*
|
|
2155
|
-
* @param {Point2D} point2D The input point.
|
|
2156
|
-
* @returns {number} The distance to the input point.
|
|
2157
|
-
*/
|
|
2158
|
-
getDistance(point2D: Point2D): number;
|
|
2159
|
-
/**
|
|
2160
|
-
* Round a Point2D.
|
|
2161
|
-
*
|
|
2162
|
-
* @returns {Point2D} The rounded point.
|
|
2163
|
-
*/
|
|
2164
|
-
getRound(): Point2D;
|
|
2165
3177
|
#private;
|
|
2166
3178
|
}
|
|
2167
3179
|
|
|
@@ -2222,6 +3234,13 @@ export declare class Point3D {
|
|
|
2222
3234
|
* @returns {number} Ths distance to the input point.
|
|
2223
3235
|
*/
|
|
2224
3236
|
getDistance(point3D: Point3D): number;
|
|
3237
|
+
/**
|
|
3238
|
+
* Get the closest point to this in a Point3D list.
|
|
3239
|
+
*
|
|
3240
|
+
* @param {Point3D[]} pointList The list to check.
|
|
3241
|
+
* @returns {number} The index of the closest point in the input list.
|
|
3242
|
+
*/
|
|
3243
|
+
getClosest(pointList: Point3D[]): number;
|
|
2225
3244
|
/**
|
|
2226
3245
|
* Get the difference to another Point3D.
|
|
2227
3246
|
*
|
|
@@ -2236,47 +3255,14 @@ export declare class Point3D {
|
|
|
2236
3255
|
* Round a float number to a given precision.
|
|
2237
3256
|
* Inspired from https://stackoverflow.com/a/49729715/3639892.
|
|
2238
3257
|
* Can be a solution to not have trailing zero as when
|
|
2239
|
-
* using toFixed or toPrecision.
|
|
2240
|
-
* '+number.toFixed(precision)' does not pass all the tests...
|
|
2241
|
-
*
|
|
2242
|
-
* @param {number} number The number to round.
|
|
2243
|
-
* @param {number} precision The rounding precision.
|
|
2244
|
-
* @returns {number} The rounded number.
|
|
2245
|
-
*/
|
|
2246
|
-
export declare function precisionRound(number: number, precision: number): number;
|
|
2247
|
-
|
|
2248
|
-
/**
|
|
2249
|
-
* Rescale LUT class.
|
|
2250
|
-
* Typically converts from integer to float.
|
|
2251
|
-
*/
|
|
2252
|
-
export declare class RescaleLut {
|
|
2253
|
-
/**
|
|
2254
|
-
* @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
|
|
2255
|
-
* @param {number} bitsStored The number of bits used to store the data.
|
|
2256
|
-
*/
|
|
2257
|
-
constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
|
|
2258
|
-
/**
|
|
2259
|
-
* Get the Rescale Slope and Intercept (RSI).
|
|
2260
|
-
*
|
|
2261
|
-
* @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
|
|
2262
|
-
*/
|
|
2263
|
-
getRSI(): RescaleSlopeAndIntercept;
|
|
2264
|
-
/**
|
|
2265
|
-
* Get the length of the LUT array.
|
|
2266
|
-
*
|
|
2267
|
-
* @returns {number} The length of the LUT array.
|
|
2268
|
-
*/
|
|
2269
|
-
getLength(): number;
|
|
2270
|
-
/**
|
|
2271
|
-
* Get the value of the LUT at the given offset.
|
|
2272
|
-
*
|
|
2273
|
-
* @param {number} offset The input offset in [0,2^bitsStored] range
|
|
2274
|
-
* or full range for ID rescale.
|
|
2275
|
-
* @returns {number} The float32 value of the LUT at the given offset.
|
|
2276
|
-
*/
|
|
2277
|
-
getValue(offset: number): number;
|
|
2278
|
-
#private;
|
|
2279
|
-
}
|
|
3258
|
+
* using toFixed or toPrecision.
|
|
3259
|
+
* '+number.toFixed(precision)' does not pass all the tests...
|
|
3260
|
+
*
|
|
3261
|
+
* @param {number} number The number to round.
|
|
3262
|
+
* @param {number} precision The rounding precision.
|
|
3263
|
+
* @returns {number} The rounded number.
|
|
3264
|
+
*/
|
|
3265
|
+
export declare function precisionRound(number: number, precision: number): number;
|
|
2280
3266
|
|
|
2281
3267
|
/**
|
|
2282
3268
|
* Rescale Slope and Intercept
|
|
@@ -2322,6 +3308,96 @@ export declare class RescaleSlopeAndIntercept {
|
|
|
2322
3308
|
#private;
|
|
2323
3309
|
}
|
|
2324
3310
|
|
|
3311
|
+
/**
|
|
3312
|
+
* RGB colour class.
|
|
3313
|
+
*/
|
|
3314
|
+
export declare class RGB {
|
|
3315
|
+
/**
|
|
3316
|
+
* @param {number} r Red component.
|
|
3317
|
+
* @param {number} g Green component.
|
|
3318
|
+
* @param {number} b Blue component.
|
|
3319
|
+
*/
|
|
3320
|
+
constructor(r: number, g: number, b: number);
|
|
3321
|
+
/**
|
|
3322
|
+
* Red component.
|
|
3323
|
+
*
|
|
3324
|
+
* @type {number}
|
|
3325
|
+
*/
|
|
3326
|
+
r: number;
|
|
3327
|
+
/**
|
|
3328
|
+
* Green component.
|
|
3329
|
+
*
|
|
3330
|
+
* @type {number}
|
|
3331
|
+
*/
|
|
3332
|
+
g: number;
|
|
3333
|
+
/**
|
|
3334
|
+
* Blue component.
|
|
3335
|
+
*
|
|
3336
|
+
* @type {number}
|
|
3337
|
+
*/
|
|
3338
|
+
b: number;
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
/**
|
|
3342
|
+
* Mutable 2D scalar ({x,y}).
|
|
3343
|
+
*/
|
|
3344
|
+
export declare class Scalar2D {
|
|
3345
|
+
/**
|
|
3346
|
+
* X value.
|
|
3347
|
+
*
|
|
3348
|
+
* @type {number}
|
|
3349
|
+
*/
|
|
3350
|
+
x: number;
|
|
3351
|
+
/**
|
|
3352
|
+
* Y value.
|
|
3353
|
+
*
|
|
3354
|
+
* @type {number}
|
|
3355
|
+
*/
|
|
3356
|
+
y: number;
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
/**
|
|
3360
|
+
* Mutable 3D scalar ({x,y,z}).
|
|
3361
|
+
*/
|
|
3362
|
+
export declare class Scalar3D {
|
|
3363
|
+
/**
|
|
3364
|
+
* X value.
|
|
3365
|
+
*
|
|
3366
|
+
* @type {number}
|
|
3367
|
+
*/
|
|
3368
|
+
x: number;
|
|
3369
|
+
/**
|
|
3370
|
+
* Y value.
|
|
3371
|
+
*
|
|
3372
|
+
* @type {number}
|
|
3373
|
+
*/
|
|
3374
|
+
y: number;
|
|
3375
|
+
/**
|
|
3376
|
+
* Z value.
|
|
3377
|
+
*
|
|
3378
|
+
* @type {number}
|
|
3379
|
+
*/
|
|
3380
|
+
z: number;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
/**
|
|
3384
|
+
* Scroll wheel class: provides a wheel event handler
|
|
3385
|
+
* that scroll the corresponding data.
|
|
3386
|
+
*/
|
|
3387
|
+
export declare class ScrollWheel {
|
|
3388
|
+
/**
|
|
3389
|
+
* @param {App} app The associated application.
|
|
3390
|
+
*/
|
|
3391
|
+
constructor(app: App);
|
|
3392
|
+
/**
|
|
3393
|
+
* Handle mouse wheel event.
|
|
3394
|
+
*
|
|
3395
|
+
* @param {WheelEvent} event The mouse wheel event.
|
|
3396
|
+
*/
|
|
3397
|
+
wheel(event: WheelEvent): void;
|
|
3398
|
+
#private;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
2325
3401
|
/**
|
|
2326
3402
|
* Immutable Size class.
|
|
2327
3403
|
* Warning: the input array is NOT cloned, modifying it will
|
|
@@ -2329,9 +3405,9 @@ export declare class RescaleSlopeAndIntercept {
|
|
|
2329
3405
|
*/
|
|
2330
3406
|
export declare class Size {
|
|
2331
3407
|
/**
|
|
2332
|
-
* @param {
|
|
3408
|
+
* @param {number[]} values The size values.
|
|
2333
3409
|
*/
|
|
2334
|
-
constructor(values:
|
|
3410
|
+
constructor(values: number[]);
|
|
2335
3411
|
/**
|
|
2336
3412
|
* Get the size value at the given array index.
|
|
2337
3413
|
*
|
|
@@ -2354,9 +3430,9 @@ export declare class Size {
|
|
|
2354
3430
|
/**
|
|
2355
3431
|
* Get the values of this index.
|
|
2356
3432
|
*
|
|
2357
|
-
* @returns {
|
|
3433
|
+
* @returns {number[]} The array of values.
|
|
2358
3434
|
*/
|
|
2359
|
-
getValues():
|
|
3435
|
+
getValues(): number[];
|
|
2360
3436
|
/**
|
|
2361
3437
|
* Check if a dimension exists and has more than one element.
|
|
2362
3438
|
*
|
|
@@ -2405,10 +3481,10 @@ export declare class Size {
|
|
|
2405
3481
|
* Check that an index is within bounds.
|
|
2406
3482
|
*
|
|
2407
3483
|
* @param {Index} index The index to check.
|
|
2408
|
-
* @param {
|
|
3484
|
+
* @param {number[]} dirs Optional list of directions to check.
|
|
2409
3485
|
* @returns {boolean} True if the given coordinates are within bounds.
|
|
2410
3486
|
*/
|
|
2411
|
-
isInBounds(index: Index, dirs:
|
|
3487
|
+
isInBounds(index: Index, dirs: number[]): boolean;
|
|
2412
3488
|
/**
|
|
2413
3489
|
* Convert an index to an offset in memory.
|
|
2414
3490
|
*
|
|
@@ -2427,9 +3503,9 @@ export declare class Size {
|
|
|
2427
3503
|
/**
|
|
2428
3504
|
* Get the 2D base of this size.
|
|
2429
3505
|
*
|
|
2430
|
-
* @returns {
|
|
3506
|
+
* @returns {Scalar2D} The 2D base [0,1] as {x,y}.
|
|
2431
3507
|
*/
|
|
2432
|
-
get2D():
|
|
3508
|
+
get2D(): Scalar2D;
|
|
2433
3509
|
#private;
|
|
2434
3510
|
}
|
|
2435
3511
|
|
|
@@ -2440,9 +3516,9 @@ export declare class Size {
|
|
|
2440
3516
|
*/
|
|
2441
3517
|
export declare class Spacing {
|
|
2442
3518
|
/**
|
|
2443
|
-
* @param {
|
|
3519
|
+
* @param {number[]} values The spacing values.
|
|
2444
3520
|
*/
|
|
2445
|
-
constructor(values:
|
|
3521
|
+
constructor(values: number[]);
|
|
2446
3522
|
/**
|
|
2447
3523
|
* Get the spacing value at the given array index.
|
|
2448
3524
|
*
|
|
@@ -2465,9 +3541,9 @@ export declare class Spacing {
|
|
|
2465
3541
|
/**
|
|
2466
3542
|
* Get the values of this spacing.
|
|
2467
3543
|
*
|
|
2468
|
-
* @returns {
|
|
3544
|
+
* @returns {number[]} The array of values.
|
|
2469
3545
|
*/
|
|
2470
|
-
getValues():
|
|
3546
|
+
getValues(): number[];
|
|
2471
3547
|
/**
|
|
2472
3548
|
* Check for equality.
|
|
2473
3549
|
*
|
|
@@ -2478,12 +3554,20 @@ export declare class Spacing {
|
|
|
2478
3554
|
/**
|
|
2479
3555
|
* Get the 2D base of this size.
|
|
2480
3556
|
*
|
|
2481
|
-
* @returns {
|
|
3557
|
+
* @returns {Scalar2D} The 2D base [col,row] as {x,y}.
|
|
2482
3558
|
*/
|
|
2483
|
-
get2D():
|
|
3559
|
+
get2D(): Scalar2D;
|
|
2484
3560
|
#private;
|
|
2485
3561
|
}
|
|
2486
3562
|
|
|
3563
|
+
/**
|
|
3564
|
+
* Convert sRGB to CIE LAB (standard illuminant D65).
|
|
3565
|
+
*
|
|
3566
|
+
* @param {RGB} triplet sRGB triplet as {r,g,b}.
|
|
3567
|
+
* @returns {object} CIE LAB triplet as {l,a,b}.
|
|
3568
|
+
*/
|
|
3569
|
+
export declare function srgbToCielab(triplet: RGB): object;
|
|
3570
|
+
|
|
2487
3571
|
/**
|
|
2488
3572
|
* Immutable tag.
|
|
2489
3573
|
*/
|
|
@@ -2546,12 +3630,6 @@ export declare class Tag {
|
|
|
2546
3630
|
* ie if its group is an odd number.
|
|
2547
3631
|
*/
|
|
2548
3632
|
isPrivate(): boolean;
|
|
2549
|
-
/**
|
|
2550
|
-
* Get the tag info from the dicom dictionary.
|
|
2551
|
-
*
|
|
2552
|
-
* @returns {Array|undefined} The info as [vr, multiplicity, name].
|
|
2553
|
-
*/
|
|
2554
|
-
getInfoFromDictionary(): any[] | undefined;
|
|
2555
3633
|
/**
|
|
2556
3634
|
* Get the tag Value Representation (VR) from the dicom dictionary.
|
|
2557
3635
|
*
|
|
@@ -2576,12 +3654,110 @@ export declare class TagValueExtractor {
|
|
|
2576
3654
|
/**
|
|
2577
3655
|
* Get the time.
|
|
2578
3656
|
*
|
|
2579
|
-
* @param {
|
|
3657
|
+
* @param {Object<string, DataElement>} _elements The DICOM elements.
|
|
2580
3658
|
* @returns {number|undefined} The time value if available.
|
|
2581
3659
|
*/
|
|
2582
|
-
getTime(_elements:
|
|
3660
|
+
getTime(_elements: {
|
|
3661
|
+
[x: string]: DataElement;
|
|
3662
|
+
}): number | undefined;
|
|
2583
3663
|
}
|
|
2584
3664
|
|
|
3665
|
+
/**
|
|
3666
|
+
* Toolbox controller.
|
|
3667
|
+
*/
|
|
3668
|
+
export declare class ToolboxController {
|
|
3669
|
+
/**
|
|
3670
|
+
* @param {object} toolList The list of tool objects.
|
|
3671
|
+
*/
|
|
3672
|
+
constructor(toolList: object);
|
|
3673
|
+
/**
|
|
3674
|
+
* Initialise.
|
|
3675
|
+
*/
|
|
3676
|
+
init(): void;
|
|
3677
|
+
/**
|
|
3678
|
+
* Enable or disable shortcuts. The 'init' methods enables shortcuts
|
|
3679
|
+
* by default. Call this method after init to disable shortcuts.
|
|
3680
|
+
*
|
|
3681
|
+
* @param {boolean} flag True to enable shortcuts.
|
|
3682
|
+
*/
|
|
3683
|
+
enableShortcuts(flag: boolean): void;
|
|
3684
|
+
/**
|
|
3685
|
+
* Get the tool list.
|
|
3686
|
+
*
|
|
3687
|
+
* @returns {Array} The list of tool objects.
|
|
3688
|
+
*/
|
|
3689
|
+
getToolList(): any[];
|
|
3690
|
+
/**
|
|
3691
|
+
* Check if a tool is in the tool list.
|
|
3692
|
+
*
|
|
3693
|
+
* @param {string} name The name to check.
|
|
3694
|
+
* @returns {boolean} The tool list element for the given name.
|
|
3695
|
+
*/
|
|
3696
|
+
hasTool(name: string): boolean;
|
|
3697
|
+
/**
|
|
3698
|
+
* Get the selected tool.
|
|
3699
|
+
*
|
|
3700
|
+
* @returns {object} The selected tool.
|
|
3701
|
+
*/
|
|
3702
|
+
getSelectedTool(): object;
|
|
3703
|
+
/**
|
|
3704
|
+
* Get the selected tool event handler.
|
|
3705
|
+
*
|
|
3706
|
+
* @param {string} eventType The event type, for example
|
|
3707
|
+
* mousedown, touchstart...
|
|
3708
|
+
* @returns {Function} The event handler.
|
|
3709
|
+
*/
|
|
3710
|
+
getSelectedToolEventHandler(eventType: string): Function;
|
|
3711
|
+
/**
|
|
3712
|
+
* Set the selected tool.
|
|
3713
|
+
*
|
|
3714
|
+
* @param {string} name The name of the tool.
|
|
3715
|
+
*/
|
|
3716
|
+
setSelectedTool(name: string): void;
|
|
3717
|
+
/**
|
|
3718
|
+
* Set the selected tool live features.
|
|
3719
|
+
*
|
|
3720
|
+
* @param {object} list The list of features.
|
|
3721
|
+
*/
|
|
3722
|
+
setToolFeatures(list: object): void;
|
|
3723
|
+
/**
|
|
3724
|
+
* Listen to layer interaction events.
|
|
3725
|
+
*
|
|
3726
|
+
* @param {LayerGroup} layerGroup The associated layer group.
|
|
3727
|
+
* @param {ViewLayer|DrawLayer} layer The layer to listen to.
|
|
3728
|
+
*/
|
|
3729
|
+
bindLayerGroup(layerGroup: LayerGroup, layer: ViewLayer | DrawLayer): void;
|
|
3730
|
+
#private;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
/**
|
|
3734
|
+
* Tool configuration.
|
|
3735
|
+
*/
|
|
3736
|
+
export declare class ToolConfig {
|
|
3737
|
+
/**
|
|
3738
|
+
* @param {string[]} [options] Optional tool options.
|
|
3739
|
+
*/
|
|
3740
|
+
constructor(options?: string[]);
|
|
3741
|
+
/**
|
|
3742
|
+
* Optional tool options.
|
|
3743
|
+
* For Draw: list of shape names.
|
|
3744
|
+
* For Filter: list of filter names.
|
|
3745
|
+
*
|
|
3746
|
+
* @type {string[]|undefined}
|
|
3747
|
+
*/
|
|
3748
|
+
options: string[] | undefined;
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
/**
|
|
3752
|
+
* List of client provided tools to be added to
|
|
3753
|
+
* the default ones.
|
|
3754
|
+
*
|
|
3755
|
+
* @type {Object<string, any>}
|
|
3756
|
+
*/
|
|
3757
|
+
export declare const toolList: {
|
|
3758
|
+
[x: string]: any;
|
|
3759
|
+
};
|
|
3760
|
+
|
|
2585
3761
|
/**
|
|
2586
3762
|
* Immutable 3D vector.
|
|
2587
3763
|
*/
|
|
@@ -2613,10 +3789,10 @@ export declare class Vector3D {
|
|
|
2613
3789
|
/**
|
|
2614
3790
|
* Check for Vector3D equality.
|
|
2615
3791
|
*
|
|
2616
|
-
* @param {
|
|
3792
|
+
* @param {Vector3D} rhs The other vector to compare to.
|
|
2617
3793
|
* @returns {boolean} True if both vectors are equal.
|
|
2618
3794
|
*/
|
|
2619
|
-
equals(rhs:
|
|
3795
|
+
equals(rhs: Vector3D): boolean;
|
|
2620
3796
|
/**
|
|
2621
3797
|
* Get a string representation of the Vector3D.
|
|
2622
3798
|
*
|
|
@@ -2647,6 +3823,13 @@ export declare class Vector3D {
|
|
|
2647
3823
|
* @returns {number} The dot product.
|
|
2648
3824
|
*/
|
|
2649
3825
|
dotProduct(vector3D: Vector3D): number;
|
|
3826
|
+
/**
|
|
3827
|
+
* Is this vector codirectional to an input one.
|
|
3828
|
+
*
|
|
3829
|
+
* @param {Vector3D} vector3D The vector to test.
|
|
3830
|
+
* @returns {boolean} True if codirectional, false is opposite.
|
|
3831
|
+
*/
|
|
3832
|
+
isCodirectional(vector3D: Vector3D): boolean;
|
|
2650
3833
|
#private;
|
|
2651
3834
|
}
|
|
2652
3835
|
|
|
@@ -2663,9 +3846,9 @@ export declare class Vector3D {
|
|
|
2663
3846
|
* const dicomParser = new dwv.DicomParser();
|
|
2664
3847
|
* dicomParser.parse(event.target.response);
|
|
2665
3848
|
* // create the image object
|
|
2666
|
-
* const image = createImage(dicomParser.getDicomElements());
|
|
3849
|
+
* const image = dwv.createImage(dicomParser.getDicomElements());
|
|
2667
3850
|
* // create the view
|
|
2668
|
-
* const view = createView(dicomParser.getDicomElements(), image);
|
|
3851
|
+
* const view = dwv.createView(dicomParser.getDicomElements(), image);
|
|
2669
3852
|
* // setup canvas
|
|
2670
3853
|
* const canvas = document.createElement('canvas');
|
|
2671
3854
|
* canvas.width = 256;
|
|
@@ -2733,31 +3916,23 @@ export declare class View {
|
|
|
2733
3916
|
getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
|
|
2734
3917
|
/**
|
|
2735
3918
|
* @callback alphaFn@callback alphaFn
|
|
2736
|
-
* @param {
|
|
2737
|
-
* @param {
|
|
2738
|
-
* @returns {number} The
|
|
3919
|
+
* @param {number[]|number} value The pixel value.
|
|
3920
|
+
* @param {number} index The values' index.
|
|
3921
|
+
* @returns {number} The opacity of the input value.
|
|
2739
3922
|
*/
|
|
2740
3923
|
/**
|
|
2741
3924
|
* Get the alpha function.
|
|
2742
3925
|
*
|
|
2743
3926
|
* @returns {alphaFn} The function.
|
|
2744
3927
|
*/
|
|
2745
|
-
getAlphaFunction(): (value:
|
|
3928
|
+
getAlphaFunction(): (value: number[] | number, index: number) => number;
|
|
2746
3929
|
/**
|
|
2747
3930
|
* Set alpha function.
|
|
2748
3931
|
*
|
|
2749
3932
|
* @param {alphaFn} func The function.
|
|
2750
3933
|
* @fires View#alphafuncchange
|
|
2751
3934
|
*/
|
|
2752
|
-
setAlphaFunction(func: (value:
|
|
2753
|
-
/**
|
|
2754
|
-
* Get the window LUT of the image.
|
|
2755
|
-
* Warning: can be undefined in no window/level was set.
|
|
2756
|
-
*
|
|
2757
|
-
* @returns {WindowLut} The window LUT of the image.
|
|
2758
|
-
* @fires View#wlchange
|
|
2759
|
-
*/
|
|
2760
|
-
getCurrentWindowLut(): WindowLut;
|
|
3935
|
+
setAlphaFunction(func: (value: number[] | number, index: number) => number): void;
|
|
2761
3936
|
/**
|
|
2762
3937
|
* Get the window presets.
|
|
2763
3938
|
*
|
|
@@ -2767,21 +3942,15 @@ export declare class View {
|
|
|
2767
3942
|
/**
|
|
2768
3943
|
* Get the window presets names.
|
|
2769
3944
|
*
|
|
2770
|
-
* @returns {
|
|
3945
|
+
* @returns {string[]} The list of window presets names.
|
|
2771
3946
|
*/
|
|
2772
|
-
getWindowPresetsNames():
|
|
3947
|
+
getWindowPresetsNames(): string[];
|
|
2773
3948
|
/**
|
|
2774
3949
|
* Set the window presets.
|
|
2775
3950
|
*
|
|
2776
3951
|
* @param {object} presets The window presets.
|
|
2777
3952
|
*/
|
|
2778
3953
|
setWindowPresets(presets: object): void;
|
|
2779
|
-
/**
|
|
2780
|
-
* Set the default colour map.
|
|
2781
|
-
*
|
|
2782
|
-
* @param {object} map The colour map.
|
|
2783
|
-
*/
|
|
2784
|
-
setDefaultColourMap(map: object): void;
|
|
2785
3954
|
/**
|
|
2786
3955
|
* Add window presets to the existing ones.
|
|
2787
3956
|
*
|
|
@@ -2797,16 +3966,16 @@ export declare class View {
|
|
|
2797
3966
|
/**
|
|
2798
3967
|
* Get the colour map of the image.
|
|
2799
3968
|
*
|
|
2800
|
-
* @returns {
|
|
3969
|
+
* @returns {string} The colour map name.
|
|
2801
3970
|
*/
|
|
2802
|
-
getColourMap():
|
|
3971
|
+
getColourMap(): string;
|
|
2803
3972
|
/**
|
|
2804
3973
|
* Set the colour map of the image.
|
|
2805
3974
|
*
|
|
2806
|
-
* @param {
|
|
2807
|
-
* @fires View#
|
|
3975
|
+
* @param {string} name The colour map name.
|
|
3976
|
+
* @fires View#colourmapchange
|
|
2808
3977
|
*/
|
|
2809
|
-
setColourMap(
|
|
3978
|
+
setColourMap(name: string): void;
|
|
2810
3979
|
/**
|
|
2811
3980
|
* Get the current position.
|
|
2812
3981
|
*
|
|
@@ -2820,19 +3989,20 @@ export declare class View {
|
|
|
2820
3989
|
*/
|
|
2821
3990
|
getCurrentIndex(): Index;
|
|
2822
3991
|
/**
|
|
2823
|
-
* Check
|
|
3992
|
+
* Check if the current position (default) or
|
|
3993
|
+
* the provided position is in bounds.
|
|
2824
3994
|
*
|
|
2825
|
-
* @param {Point} position
|
|
3995
|
+
* @param {Point} [position] Optional position.
|
|
2826
3996
|
* @returns {boolean} True is the position is in bounds.
|
|
2827
3997
|
*/
|
|
2828
|
-
|
|
3998
|
+
isPositionInBounds(position?: Point): boolean;
|
|
2829
3999
|
/**
|
|
2830
|
-
* Get the origin at a given position.
|
|
4000
|
+
* Get the first origin or at a given position.
|
|
2831
4001
|
*
|
|
2832
|
-
* @param {Point} position
|
|
2833
|
-
* @returns {
|
|
4002
|
+
* @param {Point} [position] Optional position.
|
|
4003
|
+
* @returns {Point3D} The origin.
|
|
2834
4004
|
*/
|
|
2835
|
-
getOrigin(position
|
|
4005
|
+
getOrigin(position?: Point): Point3D;
|
|
2836
4006
|
/**
|
|
2837
4007
|
* Set the current position.
|
|
2838
4008
|
*
|
|
@@ -2854,14 +4024,19 @@ export declare class View {
|
|
|
2854
4024
|
/**
|
|
2855
4025
|
* Set the view window/level.
|
|
2856
4026
|
*
|
|
2857
|
-
* @param {
|
|
2858
|
-
* @param {number} width The window width.
|
|
4027
|
+
* @param {WindowLevel} wl The window and level.
|
|
2859
4028
|
* @param {string} [name] Associated preset name, defaults to 'manual'.
|
|
2860
4029
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
2861
4030
|
* @param {boolean} [silent] Flag to launch events with skipGenerate.
|
|
2862
4031
|
* @fires View#wlchange
|
|
2863
4032
|
*/
|
|
2864
|
-
setWindowLevel(
|
|
4033
|
+
setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
|
|
4034
|
+
/**
|
|
4035
|
+
* Get the window/level.
|
|
4036
|
+
*
|
|
4037
|
+
* @returns {WindowLevel} The window and level.
|
|
4038
|
+
*/
|
|
4039
|
+
getWindowLevel(): WindowLevel;
|
|
2865
4040
|
/**
|
|
2866
4041
|
* Set the window level to the preset with the input name.
|
|
2867
4042
|
*
|
|
@@ -2880,25 +4055,25 @@ export declare class View {
|
|
|
2880
4055
|
* Add an event listener to this class.
|
|
2881
4056
|
*
|
|
2882
4057
|
* @param {string} type The event type.
|
|
2883
|
-
* @param {
|
|
4058
|
+
* @param {Function} callback The function associated with the provided
|
|
2884
4059
|
* event type, will be called with the fired event.
|
|
2885
4060
|
*/
|
|
2886
|
-
addEventListener(type: string, callback:
|
|
4061
|
+
addEventListener(type: string, callback: Function): void;
|
|
2887
4062
|
/**
|
|
2888
4063
|
* Remove an event listener from this class.
|
|
2889
4064
|
*
|
|
2890
4065
|
* @param {string} type The event type.
|
|
2891
|
-
* @param {
|
|
4066
|
+
* @param {Function} callback The function associated with the provided
|
|
2892
4067
|
* event type.
|
|
2893
4068
|
*/
|
|
2894
|
-
removeEventListener(type: string, callback:
|
|
4069
|
+
removeEventListener(type: string, callback: Function): void;
|
|
2895
4070
|
/**
|
|
2896
4071
|
* Get the image window/level that covers the full data range.
|
|
2897
4072
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
2898
4073
|
*
|
|
2899
|
-
* @returns {
|
|
4074
|
+
* @returns {WindowLevel} A min/max window level.
|
|
2900
4075
|
*/
|
|
2901
|
-
getWindowLevelMinMax():
|
|
4076
|
+
getWindowLevelMinMax(): WindowLevel;
|
|
2902
4077
|
/**
|
|
2903
4078
|
* Set the image window/level to cover the full data range.
|
|
2904
4079
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
@@ -2913,42 +4088,68 @@ export declare class View {
|
|
|
2913
4088
|
*/
|
|
2914
4089
|
generateImageData(data: ImageData, index: Index): void;
|
|
2915
4090
|
/**
|
|
2916
|
-
*
|
|
4091
|
+
* Get the scroll dimension index.
|
|
2917
4092
|
*
|
|
2918
|
-
* @
|
|
2919
|
-
|
|
2920
|
-
|
|
4093
|
+
* @returns {number} The index.
|
|
4094
|
+
*/
|
|
4095
|
+
getScrollIndex(): number;
|
|
4096
|
+
#private;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
/**
|
|
4100
|
+
* View configuration: mainly defines the ´divId´
|
|
4101
|
+
* of the associated HTML div.
|
|
4102
|
+
*/
|
|
4103
|
+
export declare class ViewConfig {
|
|
4104
|
+
/**
|
|
4105
|
+
* @param {string} divId The associated HTML div id.
|
|
2921
4106
|
*/
|
|
2922
|
-
|
|
4107
|
+
constructor(divId: string);
|
|
2923
4108
|
/**
|
|
2924
|
-
*
|
|
4109
|
+
* Associated HTML div id.
|
|
2925
4110
|
*
|
|
2926
|
-
* @
|
|
2927
|
-
* @param {boolean} silent Do not send event.
|
|
2928
|
-
* @returns {boolean} False if not in bounds.
|
|
4111
|
+
* @type {string}
|
|
2929
4112
|
*/
|
|
2930
|
-
|
|
4113
|
+
divId: string;
|
|
2931
4114
|
/**
|
|
2932
|
-
*
|
|
4115
|
+
* Optional orientation of the data; 'axial', 'coronal' or 'sagittal'.
|
|
4116
|
+
* If undefined, will use the data aquisition plane.
|
|
2933
4117
|
*
|
|
2934
|
-
* @
|
|
4118
|
+
* @type {string|undefined}
|
|
2935
4119
|
*/
|
|
2936
|
-
|
|
4120
|
+
orientation: string | undefined;
|
|
2937
4121
|
/**
|
|
2938
|
-
*
|
|
4122
|
+
* Optional view colour map name.
|
|
2939
4123
|
*
|
|
2940
|
-
* @
|
|
2941
|
-
* @returns {boolean} False if not in bounds.
|
|
4124
|
+
* @type {string|undefined}
|
|
2942
4125
|
*/
|
|
2943
|
-
|
|
4126
|
+
colourMap: string | undefined;
|
|
2944
4127
|
/**
|
|
2945
|
-
*
|
|
4128
|
+
* Optional layer opacity; in [0, 1] range.
|
|
2946
4129
|
*
|
|
2947
|
-
* @
|
|
2948
|
-
* @returns {boolean} False if not in bounds.
|
|
4130
|
+
* @type {number|undefined}
|
|
2949
4131
|
*/
|
|
2950
|
-
|
|
2951
|
-
|
|
4132
|
+
opacity: number | undefined;
|
|
4133
|
+
/**
|
|
4134
|
+
* Optional layer window level preset name.
|
|
4135
|
+
* If present, the preset name will be used and
|
|
4136
|
+
* the window centre and width ignored.
|
|
4137
|
+
*
|
|
4138
|
+
* @type {string|undefined}
|
|
4139
|
+
*/
|
|
4140
|
+
wlPresetName: string | undefined;
|
|
4141
|
+
/**
|
|
4142
|
+
* Optional layer window center.
|
|
4143
|
+
*
|
|
4144
|
+
* @type {number|undefined}
|
|
4145
|
+
*/
|
|
4146
|
+
windowCenter: number | undefined;
|
|
4147
|
+
/**
|
|
4148
|
+
* Optional layer window width.
|
|
4149
|
+
*
|
|
4150
|
+
* @type {number|undefined}
|
|
4151
|
+
*/
|
|
4152
|
+
windowWidth: number | undefined;
|
|
2952
4153
|
}
|
|
2953
4154
|
|
|
2954
4155
|
/**
|
|
@@ -2963,33 +4164,15 @@ export declare class ViewController {
|
|
|
2963
4164
|
/**
|
|
2964
4165
|
* Get the plane helper.
|
|
2965
4166
|
*
|
|
2966
|
-
* @returns {
|
|
4167
|
+
* @returns {PlaneHelper} The helper.
|
|
2967
4168
|
*/
|
|
2968
|
-
getPlaneHelper():
|
|
4169
|
+
getPlaneHelper(): PlaneHelper;
|
|
2969
4170
|
/**
|
|
2970
4171
|
* Check is the associated image is a mask.
|
|
2971
4172
|
*
|
|
2972
4173
|
* @returns {boolean} True if the associated image is a mask.
|
|
2973
4174
|
*/
|
|
2974
4175
|
isMask(): boolean;
|
|
2975
|
-
/**
|
|
2976
|
-
* Get the mask segment helper.
|
|
2977
|
-
*
|
|
2978
|
-
* @returns {object} The helper.
|
|
2979
|
-
*/
|
|
2980
|
-
getMaskSegmentHelper(): object;
|
|
2981
|
-
/**
|
|
2982
|
-
* Apply the hidden segments list by setting
|
|
2983
|
-
* the corresponding alpha function.
|
|
2984
|
-
*/
|
|
2985
|
-
applyHiddenSegments(): void;
|
|
2986
|
-
/**
|
|
2987
|
-
* Delete a segment.
|
|
2988
|
-
*
|
|
2989
|
-
* @param {number} segmentNumber The segment number.
|
|
2990
|
-
* @param {Function} exeCallback The post execution callback.
|
|
2991
|
-
*/
|
|
2992
|
-
deleteSegment(segmentNumber: number, exeCallback: Function): void;
|
|
2993
4176
|
/**
|
|
2994
4177
|
* Initialise the controller.
|
|
2995
4178
|
*/
|
|
@@ -3003,9 +4186,9 @@ export declare class ViewController {
|
|
|
3003
4186
|
/**
|
|
3004
4187
|
* Get the window/level presets names.
|
|
3005
4188
|
*
|
|
3006
|
-
* @returns {
|
|
4189
|
+
* @returns {string[]} The presets names.
|
|
3007
4190
|
*/
|
|
3008
|
-
getWindowLevelPresetsNames():
|
|
4191
|
+
getWindowLevelPresetsNames(): string[];
|
|
3009
4192
|
/**
|
|
3010
4193
|
* Add window/level presets to the view.
|
|
3011
4194
|
*
|
|
@@ -3062,12 +4245,12 @@ export declare class ViewController {
|
|
|
3062
4245
|
*/
|
|
3063
4246
|
getCurrentScrollIndexValue(): object;
|
|
3064
4247
|
/**
|
|
3065
|
-
* Get the origin at a given
|
|
4248
|
+
* Get the first origin or at a given position.
|
|
3066
4249
|
*
|
|
3067
|
-
* @param {Point} position
|
|
3068
|
-
* @returns {
|
|
4250
|
+
* @param {Point} [position] Opitonal position.
|
|
4251
|
+
* @returns {Point3D} The origin.
|
|
3069
4252
|
*/
|
|
3070
|
-
getOrigin(position
|
|
4253
|
+
getOrigin(position?: Point): Point3D;
|
|
3071
4254
|
/**
|
|
3072
4255
|
* Get the current scroll position value.
|
|
3073
4256
|
*
|
|
@@ -3078,10 +4261,10 @@ export declare class ViewController {
|
|
|
3078
4261
|
* Generate display image data to be given to a canvas.
|
|
3079
4262
|
*
|
|
3080
4263
|
* @param {ImageData} array The array to fill in.
|
|
3081
|
-
* @param {Index} index Optional index at which to generate,
|
|
4264
|
+
* @param {Index} [index] Optional index at which to generate,
|
|
3082
4265
|
* otherwise generates at current index.
|
|
3083
4266
|
*/
|
|
3084
|
-
generateImageData(array: ImageData, index
|
|
4267
|
+
generateImageData(array: ImageData, index?: Index): void;
|
|
3085
4268
|
/**
|
|
3086
4269
|
* Set the associated image.
|
|
3087
4270
|
*
|
|
@@ -3090,11 +4273,11 @@ export declare class ViewController {
|
|
|
3090
4273
|
*/
|
|
3091
4274
|
setImage(img: Image_2, dataId: string): void;
|
|
3092
4275
|
/**
|
|
3093
|
-
* Get the current spacing.
|
|
4276
|
+
* Get the current view (2D) spacing.
|
|
3094
4277
|
*
|
|
3095
|
-
* @returns {
|
|
4278
|
+
* @returns {Scalar2D} The spacing as a 2D array.
|
|
3096
4279
|
*/
|
|
3097
|
-
get2DSpacing():
|
|
4280
|
+
get2DSpacing(): Scalar2D;
|
|
3098
4281
|
/**
|
|
3099
4282
|
* Get the image rescaled value at the input position.
|
|
3100
4283
|
*
|
|
@@ -3134,8 +4317,15 @@ export declare class ViewController {
|
|
|
3134
4317
|
* Can window and level be applied to the data?
|
|
3135
4318
|
*
|
|
3136
4319
|
* @returns {boolean} True if possible.
|
|
4320
|
+
* @deprecated Please use isMonochrome instead.
|
|
3137
4321
|
*/
|
|
3138
4322
|
canWindowLevel(): boolean;
|
|
4323
|
+
/**
|
|
4324
|
+
* Is the data monochrome.
|
|
4325
|
+
*
|
|
4326
|
+
* @returns {boolean} True if the data is monochrome.
|
|
4327
|
+
*/
|
|
4328
|
+
isMonochrome(): boolean;
|
|
3139
4329
|
/**
|
|
3140
4330
|
* Can the data be scrolled?
|
|
3141
4331
|
*
|
|
@@ -3144,17 +4334,25 @@ export declare class ViewController {
|
|
|
3144
4334
|
*/
|
|
3145
4335
|
canScroll(): boolean;
|
|
3146
4336
|
/**
|
|
3147
|
-
* Get the image size.
|
|
4337
|
+
* Get the oriented image size.
|
|
3148
4338
|
*
|
|
3149
4339
|
* @returns {Size} The size.
|
|
3150
4340
|
*/
|
|
3151
4341
|
getImageSize(): Size;
|
|
4342
|
+
/**
|
|
4343
|
+
* Is the data size larger than one in the given dimension?
|
|
4344
|
+
*
|
|
4345
|
+
* @param {number} dim The dimension.
|
|
4346
|
+
* @returns {boolean} True if the image size is larger than one
|
|
4347
|
+
* in the given dimension.
|
|
4348
|
+
*/
|
|
4349
|
+
moreThanOne(dim: number): boolean;
|
|
3152
4350
|
/**
|
|
3153
4351
|
* Get the image world (mm) 2D size.
|
|
3154
4352
|
*
|
|
3155
|
-
* @returns {
|
|
4353
|
+
* @returns {Scalar2D} The 2D size as {x,y}.
|
|
3156
4354
|
*/
|
|
3157
|
-
getImageWorldSize():
|
|
4355
|
+
getImageWorldSize(): Scalar2D;
|
|
3158
4356
|
/**
|
|
3159
4357
|
* Get the image rescaled data range.
|
|
3160
4358
|
*
|
|
@@ -3169,12 +4367,13 @@ export declare class ViewController {
|
|
|
3169
4367
|
*/
|
|
3170
4368
|
equalImageMeta(meta: object): boolean;
|
|
3171
4369
|
/**
|
|
3172
|
-
* Check
|
|
4370
|
+
* Check if the current position (default) or
|
|
4371
|
+
* the provided position is in bounds.
|
|
3173
4372
|
*
|
|
3174
|
-
* @param {Point} position
|
|
4373
|
+
* @param {Point} [position] Optional position.
|
|
3175
4374
|
* @returns {boolean} True is the position is in bounds.
|
|
3176
4375
|
*/
|
|
3177
|
-
|
|
4376
|
+
isPositionInBounds(position?: Point): boolean;
|
|
3178
4377
|
/**
|
|
3179
4378
|
* Set the current position.
|
|
3180
4379
|
*
|
|
@@ -3185,20 +4384,19 @@ export declare class ViewController {
|
|
|
3185
4384
|
*/
|
|
3186
4385
|
setCurrentPosition(pos: Point, silent?: boolean): boolean;
|
|
3187
4386
|
/**
|
|
3188
|
-
* Get a position from a 2D
|
|
4387
|
+
* Get a world position from a 2D plane position.
|
|
3189
4388
|
*
|
|
3190
|
-
* @param {
|
|
3191
|
-
* @param {number} y The row position.
|
|
4389
|
+
* @param {Point2D} point2D The input point.
|
|
3192
4390
|
* @returns {Point} The associated position.
|
|
3193
4391
|
*/
|
|
3194
|
-
getPositionFromPlanePoint(
|
|
4392
|
+
getPositionFromPlanePoint(point2D: Point2D): Point;
|
|
3195
4393
|
/**
|
|
3196
|
-
* Get a 2D
|
|
4394
|
+
* Get a 2D plane position from a world position.
|
|
3197
4395
|
*
|
|
3198
4396
|
* @param {Point} point The 3D position.
|
|
3199
|
-
* @returns {
|
|
4397
|
+
* @returns {Point2D} The 2D position.
|
|
3200
4398
|
*/
|
|
3201
|
-
getPlanePositionFromPosition(point: Point):
|
|
4399
|
+
getPlanePositionFromPosition(point: Point): Point2D;
|
|
3202
4400
|
/**
|
|
3203
4401
|
* Set the current index.
|
|
3204
4402
|
*
|
|
@@ -3211,17 +4409,43 @@ export declare class ViewController {
|
|
|
3211
4409
|
* Get a plane 3D position from a plane 2D position: does not compensate
|
|
3212
4410
|
* for the image origin. Needed for setting the scale center...
|
|
3213
4411
|
*
|
|
3214
|
-
* @param {
|
|
4412
|
+
* @param {Point2D} point2D The 2D position.
|
|
3215
4413
|
* @returns {Point3D} The 3D point.
|
|
3216
4414
|
*/
|
|
3217
|
-
getPlanePositionFromPlanePoint(point2D:
|
|
4415
|
+
getPlanePositionFromPlanePoint(point2D: Point2D): Point3D;
|
|
3218
4416
|
/**
|
|
3219
4417
|
* Get a 3D offset from a plane one.
|
|
3220
4418
|
*
|
|
3221
|
-
* @param {
|
|
4419
|
+
* @param {Scalar2D} offset2D The plane offset as {x,y}.
|
|
3222
4420
|
* @returns {Vector3D} The 3D world offset.
|
|
3223
4421
|
*/
|
|
3224
|
-
getOffset3DFromPlaneOffset(offset2D:
|
|
4422
|
+
getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
|
|
4423
|
+
/**
|
|
4424
|
+
* Get the current position incremented in the input direction.
|
|
4425
|
+
*
|
|
4426
|
+
* @param {number} dim The direction in which to increment.
|
|
4427
|
+
* @returns {Point} The resulting point.
|
|
4428
|
+
*/
|
|
4429
|
+
getIncrementPosition(dim: number): Point;
|
|
4430
|
+
/**
|
|
4431
|
+
* Get the current position decremented in the input direction.
|
|
4432
|
+
*
|
|
4433
|
+
* @param {number} dim The direction in which to decrement.
|
|
4434
|
+
* @returns {Point} The resulting point.
|
|
4435
|
+
*/
|
|
4436
|
+
getDecrementPosition(dim: number): Point;
|
|
4437
|
+
/**
|
|
4438
|
+
* Get the current position decremented in the scroll direction.
|
|
4439
|
+
*
|
|
4440
|
+
* @returns {Point} The resulting point.
|
|
4441
|
+
*/
|
|
4442
|
+
getIncrementScrollPosition(): Point;
|
|
4443
|
+
/**
|
|
4444
|
+
* Get the current position decremented in the scroll direction.
|
|
4445
|
+
*
|
|
4446
|
+
* @returns {Point} The resulting point.
|
|
4447
|
+
*/
|
|
4448
|
+
getDecrementScrollPosition(): Point;
|
|
3225
4449
|
/**
|
|
3226
4450
|
* Increment the provided dimension.
|
|
3227
4451
|
*
|
|
@@ -3263,9 +4487,9 @@ export declare class ViewController {
|
|
|
3263
4487
|
/**
|
|
3264
4488
|
* Get the window/level.
|
|
3265
4489
|
*
|
|
3266
|
-
* @returns {
|
|
4490
|
+
* @returns {WindowLevel} The window and level.
|
|
3267
4491
|
*/
|
|
3268
|
-
getWindowLevel():
|
|
4492
|
+
getWindowLevel(): WindowLevel;
|
|
3269
4493
|
/**
|
|
3270
4494
|
* Get the current window level preset name.
|
|
3271
4495
|
*
|
|
@@ -3273,58 +4497,51 @@ export declare class ViewController {
|
|
|
3273
4497
|
*/
|
|
3274
4498
|
getCurrentWindowPresetName(): string;
|
|
3275
4499
|
/**
|
|
3276
|
-
* Set the window
|
|
4500
|
+
* Set the window and level.
|
|
3277
4501
|
*
|
|
3278
|
-
* @param {
|
|
3279
|
-
* @param {number} ww The window width.
|
|
4502
|
+
* @param {WindowLevel} wl The window and level.
|
|
3280
4503
|
*/
|
|
3281
|
-
setWindowLevel(
|
|
4504
|
+
setWindowLevel(wl: WindowLevel): void;
|
|
3282
4505
|
/**
|
|
3283
4506
|
* Get the colour map.
|
|
3284
4507
|
*
|
|
3285
|
-
* @returns {
|
|
4508
|
+
* @returns {string} The colour map name.
|
|
3286
4509
|
*/
|
|
3287
|
-
getColourMap():
|
|
4510
|
+
getColourMap(): string;
|
|
3288
4511
|
/**
|
|
3289
4512
|
* Set the colour map.
|
|
3290
4513
|
*
|
|
3291
|
-
* @param {
|
|
4514
|
+
* @param {string} name The colour map name.
|
|
3292
4515
|
*/
|
|
3293
|
-
setColourMap(
|
|
4516
|
+
setColourMap(name: string): void;
|
|
3294
4517
|
/**
|
|
3295
4518
|
* @callback alphaFn@callback alphaFn
|
|
3296
|
-
* @param {
|
|
3297
|
-
* @param {
|
|
3298
|
-
* @returns {number} The
|
|
4519
|
+
* @param {number[]|number} value The pixel value.
|
|
4520
|
+
* @param {number} index The values' index.
|
|
4521
|
+
* @returns {number} The opacity of the input value.
|
|
3299
4522
|
*/
|
|
3300
4523
|
/**
|
|
3301
4524
|
* Set the view per value alpha function.
|
|
3302
4525
|
*
|
|
3303
4526
|
* @param {alphaFn} func The function.
|
|
3304
4527
|
*/
|
|
3305
|
-
setViewAlphaFunction(func: (value:
|
|
3306
|
-
/**
|
|
3307
|
-
* Set the colour map from a name.
|
|
3308
|
-
*
|
|
3309
|
-
* @param {string} name The name of the colour map to set.
|
|
3310
|
-
*/
|
|
3311
|
-
setColourMapFromName(name: string): void;
|
|
4528
|
+
setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
|
|
3312
4529
|
/**
|
|
3313
4530
|
* Add an event listener to this class.
|
|
3314
4531
|
*
|
|
3315
4532
|
* @param {string} type The event type.
|
|
3316
|
-
* @param {
|
|
4533
|
+
* @param {Function} callback The function associated with the provided
|
|
3317
4534
|
* event type, will be called with the fired event.
|
|
3318
4535
|
*/
|
|
3319
|
-
addEventListener(type: string, callback:
|
|
4536
|
+
addEventListener(type: string, callback: Function): void;
|
|
3320
4537
|
/**
|
|
3321
4538
|
* Remove an event listener from this class.
|
|
3322
4539
|
*
|
|
3323
4540
|
* @param {string} type The event type.
|
|
3324
|
-
* @param {
|
|
4541
|
+
* @param {Function} callback The function associated with the provided
|
|
3325
4542
|
* event type.
|
|
3326
4543
|
*/
|
|
3327
|
-
removeEventListener(type: string, callback:
|
|
4544
|
+
removeEventListener(type: string, callback: Function): void;
|
|
3328
4545
|
#private;
|
|
3329
4546
|
}
|
|
3330
4547
|
|
|
@@ -3343,6 +4560,18 @@ export declare class ViewLayer {
|
|
|
3343
4560
|
* @returns {string} The data id.
|
|
3344
4561
|
*/
|
|
3345
4562
|
getDataId(): string;
|
|
4563
|
+
/**
|
|
4564
|
+
* Get the layer scale.
|
|
4565
|
+
*
|
|
4566
|
+
* @returns {Scalar2D} The scale as {x,y}.
|
|
4567
|
+
*/
|
|
4568
|
+
getScale(): Scalar2D;
|
|
4569
|
+
/**
|
|
4570
|
+
* Get the layer zoom offset.
|
|
4571
|
+
*
|
|
4572
|
+
* @returns {Scalar2D} The offset as {x,y}.
|
|
4573
|
+
*/
|
|
4574
|
+
getZoomOffset(): Scalar2D;
|
|
3346
4575
|
/**
|
|
3347
4576
|
* Set the imageSmoothing flag value.
|
|
3348
4577
|
*
|
|
@@ -3372,14 +4601,23 @@ export declare class ViewLayer {
|
|
|
3372
4601
|
* Handle an image set event.
|
|
3373
4602
|
*
|
|
3374
4603
|
* @param {object} event The event.
|
|
4604
|
+
* @function
|
|
3375
4605
|
*/
|
|
3376
4606
|
onimageset: (event: object) => void;
|
|
4607
|
+
/**
|
|
4608
|
+
* Handle an image content change event.
|
|
4609
|
+
*
|
|
4610
|
+
* @param {object} event The event.
|
|
4611
|
+
* @function
|
|
4612
|
+
*/
|
|
4613
|
+
onimagecontentchange: (event: object) => void;
|
|
3377
4614
|
/**
|
|
3378
4615
|
* Handle an image change event.
|
|
3379
4616
|
*
|
|
3380
4617
|
* @param {object} event The event.
|
|
4618
|
+
* @function
|
|
3381
4619
|
*/
|
|
3382
|
-
|
|
4620
|
+
onimagegeometrychange: (event: object) => void;
|
|
3383
4621
|
/**
|
|
3384
4622
|
* Get the id of the layer.
|
|
3385
4623
|
*
|
|
@@ -3389,15 +4627,15 @@ export declare class ViewLayer {
|
|
|
3389
4627
|
/**
|
|
3390
4628
|
* Get the layer base size (without scale).
|
|
3391
4629
|
*
|
|
3392
|
-
* @returns {
|
|
4630
|
+
* @returns {Scalar2D} The size as {x,y}.
|
|
3393
4631
|
*/
|
|
3394
|
-
getBaseSize():
|
|
4632
|
+
getBaseSize(): Scalar2D;
|
|
3395
4633
|
/**
|
|
3396
4634
|
* Get the image world (mm) 2D size.
|
|
3397
4635
|
*
|
|
3398
|
-
* @returns {
|
|
4636
|
+
* @returns {Scalar2D} The 2D size as {x,y}.
|
|
3399
4637
|
*/
|
|
3400
|
-
getImageWorldSize():
|
|
4638
|
+
getImageWorldSize(): Scalar2D;
|
|
3401
4639
|
/**
|
|
3402
4640
|
* Get the layer opacity.
|
|
3403
4641
|
*
|
|
@@ -3418,67 +4656,85 @@ export declare class ViewLayer {
|
|
|
3418
4656
|
* Add a flip offset along the layer Y axis.
|
|
3419
4657
|
*/
|
|
3420
4658
|
addFlipOffsetY(): void;
|
|
4659
|
+
/**
|
|
4660
|
+
* Flip the scale along the layer X axis.
|
|
4661
|
+
*/
|
|
4662
|
+
flipScaleX(): void;
|
|
4663
|
+
/**
|
|
4664
|
+
* Flip the scale along the layer Y axis.
|
|
4665
|
+
*/
|
|
4666
|
+
flipScaleY(): void;
|
|
4667
|
+
/**
|
|
4668
|
+
* Flip the scale along the layer Z axis.
|
|
4669
|
+
*/
|
|
4670
|
+
flipScaleZ(): void;
|
|
3421
4671
|
/**
|
|
3422
4672
|
* Set the layer scale.
|
|
3423
4673
|
*
|
|
3424
|
-
* @param {
|
|
3425
|
-
* @param {Point3D} center The scale center.
|
|
4674
|
+
* @param {Scalar3D} newScale The scale as {x,y,z}.
|
|
4675
|
+
* @param {Point3D} [center] The scale center.
|
|
3426
4676
|
*/
|
|
3427
|
-
setScale(newScale:
|
|
4677
|
+
setScale(newScale: Scalar3D, center?: Point3D): void;
|
|
4678
|
+
/**
|
|
4679
|
+
* Initialise the layer scale. Works with a zoom offset that
|
|
4680
|
+
* comes from a equal view layer (size, scale, offset...).
|
|
4681
|
+
*
|
|
4682
|
+
* @param {Scalar3D} newScale The scale as {x,y,z}.
|
|
4683
|
+
* @param {Scalar2D} zoomOffset The zoom offset as {x,y}.
|
|
4684
|
+
*/
|
|
4685
|
+
initScale(newScale: Scalar3D, zoomOffset: Scalar2D): void;
|
|
3428
4686
|
/**
|
|
3429
4687
|
* Set the base layer offset. Updates the layer offset.
|
|
3430
4688
|
*
|
|
3431
4689
|
* @param {Vector3D} scrollOffset The scroll offset vector.
|
|
3432
4690
|
* @param {Vector3D} planeOffset The plane offset vector.
|
|
4691
|
+
* @param {Point3D} [layerGroupOrigin] The layer group origin.
|
|
4692
|
+
* @param {Point3D} [layerGroupOrigin0] The layer group first origin.
|
|
3433
4693
|
* @returns {boolean} True if the offset was updated.
|
|
3434
4694
|
*/
|
|
3435
|
-
setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D): boolean;
|
|
4695
|
+
setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D, layerGroupOrigin?: Point3D, layerGroupOrigin0?: Point3D): boolean;
|
|
3436
4696
|
/**
|
|
3437
4697
|
* Set the layer offset.
|
|
3438
4698
|
*
|
|
3439
|
-
* @param {
|
|
4699
|
+
* @param {Scalar3D} newOffset The offset as {x,y,z}.
|
|
3440
4700
|
*/
|
|
3441
|
-
setOffset(newOffset:
|
|
4701
|
+
setOffset(newOffset: Scalar3D): void;
|
|
3442
4702
|
/**
|
|
3443
|
-
* Transform a display position to
|
|
4703
|
+
* Transform a display position to a 2D index.
|
|
3444
4704
|
*
|
|
3445
|
-
* @param {
|
|
3446
|
-
* @
|
|
3447
|
-
* @returns {Index} The equivalent index.
|
|
4705
|
+
* @param {Point2D} point2D The input point.
|
|
4706
|
+
* @returns {Index} The equivalent 2D index.
|
|
3448
4707
|
*/
|
|
3449
|
-
displayToPlaneIndex(
|
|
4708
|
+
displayToPlaneIndex(point2D: Point2D): Index;
|
|
3450
4709
|
/**
|
|
3451
4710
|
* Remove scale from a display position.
|
|
3452
4711
|
*
|
|
3453
|
-
* @param {
|
|
3454
|
-
* @
|
|
3455
|
-
* @returns {object} The de-scaled position as {x,y}.
|
|
4712
|
+
* @param {Point2D} point2D The input point.
|
|
4713
|
+
* @returns {Point2D} The de-scaled point.
|
|
3456
4714
|
*/
|
|
3457
|
-
displayToPlaneScale(
|
|
4715
|
+
displayToPlaneScale(point2D: Point2D): Point2D;
|
|
3458
4716
|
/**
|
|
3459
4717
|
* Get a plane position from a display position.
|
|
3460
4718
|
*
|
|
3461
|
-
* @param {
|
|
3462
|
-
* @
|
|
3463
|
-
* @returns {object} The plane position as {x,y}.
|
|
4719
|
+
* @param {Point2D} point2D The input point.
|
|
4720
|
+
* @returns {Point2D} The plane position.
|
|
3464
4721
|
*/
|
|
3465
|
-
displayToPlanePos(
|
|
4722
|
+
displayToPlanePos(point2D: Point2D): Point2D;
|
|
3466
4723
|
/**
|
|
3467
4724
|
* Get a display position from a plane position.
|
|
3468
4725
|
*
|
|
3469
|
-
* @param {
|
|
3470
|
-
* @
|
|
3471
|
-
*
|
|
4726
|
+
* @param {Point2D} point2D The input point.
|
|
4727
|
+
* @returns {Point2D} The display position, can be individually
|
|
4728
|
+
* undefined if out of bounds.
|
|
3472
4729
|
*/
|
|
3473
|
-
planePosToDisplay(
|
|
4730
|
+
planePosToDisplay(point2D: Point2D): Point2D;
|
|
3474
4731
|
/**
|
|
3475
4732
|
* Get a main plane position from a display position.
|
|
3476
4733
|
*
|
|
3477
|
-
* @param {
|
|
3478
|
-
* @
|
|
3479
|
-
* @returns {object} The main plane position as {x,y}.
|
|
4734
|
+
* @param {Point2D} point2D The input point.
|
|
4735
|
+
* @returns {Point2D} The main plane position.
|
|
3480
4736
|
*/
|
|
3481
|
-
displayToMainPlanePos(
|
|
4737
|
+
displayToMainPlanePos(point2D: Point2D): Point2D;
|
|
3482
4738
|
/**
|
|
3483
4739
|
* Display the layer.
|
|
3484
4740
|
*
|
|
@@ -3502,19 +4758,19 @@ export declare class ViewLayer {
|
|
|
3502
4758
|
/**
|
|
3503
4759
|
* Initialise the layer: set the canvas and context
|
|
3504
4760
|
*
|
|
3505
|
-
* @param {
|
|
3506
|
-
* @param {
|
|
4761
|
+
* @param {Scalar2D} size The image size as {x,y}.
|
|
4762
|
+
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
3507
4763
|
* @param {number} alpha The initial data opacity.
|
|
3508
4764
|
*/
|
|
3509
|
-
initialise(size:
|
|
4765
|
+
initialise(size: Scalar2D, spacing: Scalar2D, alpha: number): void;
|
|
3510
4766
|
/**
|
|
3511
4767
|
* Fit the layer to its parent container.
|
|
3512
4768
|
*
|
|
3513
4769
|
* @param {number} fitScale1D The 1D fit scale.
|
|
3514
|
-
* @param {
|
|
3515
|
-
* @param {
|
|
4770
|
+
* @param {Scalar2D} fitSize The fit size as {x,y}.
|
|
4771
|
+
* @param {Scalar2D} fitOffset The fit offset as {x,y}.
|
|
3516
4772
|
*/
|
|
3517
|
-
fitToContainer(fitScale1D: number, fitSize:
|
|
4773
|
+
fitToContainer(fitScale1D: number, fitSize: Scalar2D, fitOffset: Scalar2D): void;
|
|
3518
4774
|
/**
|
|
3519
4775
|
* Enable and listen to container interaction events.
|
|
3520
4776
|
*/
|
|
@@ -3527,18 +4783,18 @@ export declare class ViewLayer {
|
|
|
3527
4783
|
* Add an event listener to this class.
|
|
3528
4784
|
*
|
|
3529
4785
|
* @param {string} type The event type.
|
|
3530
|
-
* @param {
|
|
4786
|
+
* @param {Function} callback The function associated with the provided
|
|
3531
4787
|
* event type, will be called with the fired event.
|
|
3532
4788
|
*/
|
|
3533
|
-
addEventListener(type: string, callback:
|
|
4789
|
+
addEventListener(type: string, callback: Function): void;
|
|
3534
4790
|
/**
|
|
3535
4791
|
* Remove an event listener from this class.
|
|
3536
4792
|
*
|
|
3537
4793
|
* @param {string} type The event type.
|
|
3538
|
-
* @param {
|
|
4794
|
+
* @param {Function} callback The function associated with the provided
|
|
3539
4795
|
* event type.
|
|
3540
4796
|
*/
|
|
3541
|
-
removeEventListener(type: string, callback:
|
|
4797
|
+
removeEventListener(type: string, callback: Function): void;
|
|
3542
4798
|
/**
|
|
3543
4799
|
* Set the current position.
|
|
3544
4800
|
*
|
|
@@ -3555,101 +4811,55 @@ export declare class ViewLayer {
|
|
|
3555
4811
|
}
|
|
3556
4812
|
|
|
3557
4813
|
/**
|
|
3558
|
-
*
|
|
3559
|
-
* <br>Pseudo-code:
|
|
3560
|
-
* <pre>
|
|
3561
|
-
* if (x <= c - 0.5 - (w-1)/2), then y = ymin
|
|
3562
|
-
* else if (x > c - 0.5 + (w-1)/2), then y = ymax,
|
|
3563
|
-
* else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
|
|
3564
|
-
* </pre>
|
|
3565
|
-
*
|
|
3566
|
-
* @see DICOM doc for [Window Center and Window Width]{@link http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.11.html#sect_C.11.2.1.2}
|
|
4814
|
+
* Window and Level also known as window width and center.
|
|
3567
4815
|
*/
|
|
3568
|
-
export declare class
|
|
4816
|
+
export declare class WindowLevel {
|
|
3569
4817
|
/**
|
|
3570
4818
|
* @param {number} center The window center.
|
|
3571
4819
|
* @param {number} width The window width.
|
|
3572
4820
|
*/
|
|
3573
4821
|
constructor(center: number, width: number);
|
|
3574
4822
|
/**
|
|
3575
|
-
*
|
|
3576
|
-
*
|
|
3577
|
-
* @returns {number} The window center.
|
|
3578
|
-
*/
|
|
3579
|
-
getCenter(): number;
|
|
3580
|
-
/**
|
|
3581
|
-
* Get the window width.
|
|
3582
|
-
*
|
|
3583
|
-
* @returns {number} The window width.
|
|
3584
|
-
*/
|
|
3585
|
-
getWidth(): number;
|
|
3586
|
-
/**
|
|
3587
|
-
* Set the signed offset.
|
|
4823
|
+
* The window center.
|
|
3588
4824
|
*
|
|
3589
|
-
* @
|
|
3590
|
-
* typically: slope * ( size / 2).
|
|
4825
|
+
* @type {number}
|
|
3591
4826
|
*/
|
|
3592
|
-
|
|
4827
|
+
center: number;
|
|
3593
4828
|
/**
|
|
3594
|
-
*
|
|
4829
|
+
* The window width.
|
|
3595
4830
|
*
|
|
3596
|
-
* @
|
|
3597
|
-
* @returns {number} The leveled value, in the
|
|
3598
|
-
* [ymin, ymax] range (default [0,255]).
|
|
4831
|
+
* @type {number}
|
|
3599
4832
|
*/
|
|
3600
|
-
|
|
4833
|
+
width: number;
|
|
3601
4834
|
/**
|
|
3602
|
-
* Check for
|
|
4835
|
+
* Check for equality.
|
|
3603
4836
|
*
|
|
3604
|
-
* @param {
|
|
3605
|
-
* @returns {boolean} True if both
|
|
4837
|
+
* @param {WindowLevel} rhs The other object to compare to.
|
|
4838
|
+
* @returns {boolean} True if both objects are equal.
|
|
3606
4839
|
*/
|
|
3607
|
-
equals(rhs:
|
|
3608
|
-
#private;
|
|
4840
|
+
equals(rhs: WindowLevel): boolean;
|
|
3609
4841
|
}
|
|
3610
4842
|
|
|
3611
4843
|
/**
|
|
3612
|
-
*
|
|
3613
|
-
* Typically converts from float to integer.
|
|
4844
|
+
* Writer rule.
|
|
3614
4845
|
*/
|
|
3615
|
-
export declare class
|
|
4846
|
+
export declare class WriterRule {
|
|
3616
4847
|
/**
|
|
3617
|
-
*
|
|
3618
|
-
* the 'setWindowLevel' method.
|
|
3619
|
-
*
|
|
3620
|
-
* @param {RescaleLut} rescaleLut The associated rescale LUT.
|
|
3621
|
-
* @param {boolean} isSigned Flag to know if the data is signed or not.
|
|
3622
|
-
* @param {boolean} isDiscrete Flag to know if the input data is discrete.
|
|
3623
|
-
*/
|
|
3624
|
-
constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
|
|
3625
|
-
/**
|
|
3626
|
-
* Get the window / level.
|
|
3627
|
-
*
|
|
3628
|
-
* @returns {WindowCenterAndWidth} The window / level.
|
|
4848
|
+
* @param {string} action The rule action.
|
|
3629
4849
|
*/
|
|
3630
|
-
|
|
4850
|
+
constructor(action: string);
|
|
3631
4851
|
/**
|
|
3632
|
-
*
|
|
4852
|
+
* Rule action: `copy`, `remove`, `clear` or `replace`.
|
|
3633
4853
|
*
|
|
3634
|
-
* @
|
|
4854
|
+
* @type {string}
|
|
3635
4855
|
*/
|
|
3636
|
-
|
|
4856
|
+
action: string;
|
|
3637
4857
|
/**
|
|
3638
|
-
*
|
|
4858
|
+
* Optional value to use for replace action.
|
|
3639
4859
|
*
|
|
3640
|
-
* @
|
|
4860
|
+
* @type {any|undefined}
|
|
3641
4861
|
*/
|
|
3642
|
-
|
|
3643
|
-
/**
|
|
3644
|
-
* Get the value of the LUT at the given offset.
|
|
3645
|
-
*
|
|
3646
|
-
* @param {number} offset The input offset in [0,2^bitsStored] range
|
|
3647
|
-
* for discrete data or full range for non discrete.
|
|
3648
|
-
* @returns {number} The integer value (default [0,255]) of the LUT
|
|
3649
|
-
* at the given offset.
|
|
3650
|
-
*/
|
|
3651
|
-
getValue(offset: number): number;
|
|
3652
|
-
#private;
|
|
4862
|
+
value: any | undefined;
|
|
3653
4863
|
}
|
|
3654
4864
|
|
|
3655
4865
|
export { }
|