dwv 0.33.0-beta.2 → 0.33.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dwv.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import Konva from 'konva';
2
+
1
3
  /**
2
4
  * Add tags to the dictionary.
3
5
  *
@@ -6,6 +8,11 @@
6
8
  */
7
9
  export declare function addTagsToDictionary(group: string, tags: object): void;
8
10
 
11
+ /**
12
+ * List of ViewConfigs indexed by dataIds.
13
+ *
14
+ * @typedef {Object<string, ViewConfig[]>} DataViewConfigs
15
+ */
9
16
  /**
10
17
  * Main application class.
11
18
  *
@@ -13,9 +20,10 @@ export declare function addTagsToDictionary(group: string, tags: object): void;
13
20
  * // create the dwv app
14
21
  * const app = new dwv.App();
15
22
  * // initialise
16
- * app.init({
17
- * dataViewConfigs: {'*': [{divId: 'layerGroup0'}]}
18
- * });
23
+ * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
24
+ * const viewConfigs = {'*': [viewConfig0]};
25
+ * const options = new dwv.AppOptions(viewConfigs);
26
+ * app.init(options);
19
27
  * // load dicom data
20
28
  * app.loadURLs([
21
29
  * 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
@@ -25,23 +33,23 @@ export declare class App {
25
33
  /**
26
34
  * Get the image.
27
35
  *
28
- * @param {number} index The data index.
29
- * @returns {Image} The associated image.
36
+ * @param {string} dataId The data id.
37
+ * @returns {Image|undefined} The associated image.
30
38
  */
31
- getImage(index: number): Image_2;
39
+ getImage(dataId: string): Image_2 | undefined;
32
40
  /**
33
41
  * Get the last loaded image.
34
42
  *
35
- * @returns {Image} The image.
43
+ * @returns {Image|undefined} The image.
36
44
  */
37
- getLastImage(): Image_2;
45
+ getLastImage(): Image_2 | undefined;
38
46
  /**
39
- * Set the image at the given index.
47
+ * Set the image at the given id.
40
48
  *
41
- * @param {number} index The data index.
49
+ * @param {string} dataId The data id.
42
50
  * @param {Image} img The associated image.
43
51
  */
44
- setImage(index: number, img: Image_2): void;
52
+ setImage(dataId: string, img: Image_2): void;
45
53
  /**
46
54
  * Set the last image.
47
55
  *
@@ -53,48 +61,62 @@ export declare class App {
53
61
  *
54
62
  * @param {Image} image The new image.
55
63
  * @param {object} meta The image meta.
56
- * @returns {number} The new image id.
64
+ * @param {string} source The source of the new image,
65
+ * will be passed with load events.
66
+ * @returns {string} The new image data id.
57
67
  */
58
- addNewImage(image: Image_2, meta: object): number;
68
+ addNewImage(image: Image_2, meta: object, source: string): string;
59
69
  /**
60
70
  * Get the meta data.
61
71
  *
62
- * @param {number} index The data index.
63
- * @returns {object} The list of meta data.
72
+ * @param {string} dataId The data id.
73
+ * @returns {Object<string, DataElement>|undefined} The list of meta data.
64
74
  */
65
- getMetaData(index: number): object;
75
+ getMetaData(dataId: string): {
76
+ [x: string]: DataElement;
77
+ } | undefined;
66
78
  /**
67
79
  * Get the list of ids in the data storage.
68
80
  *
69
- * @returns {Array} The list of data ids.
81
+ * @returns {string[]} The list of data ids.
70
82
  */
71
- getDataIds(): any[];
83
+ getDataIds(): string[];
72
84
  /**
73
- * Can the data be scrolled?
85
+ * Get the list of dataIds that contain the input UIDs.
86
+ *
87
+ * @param {string[]} uids A list of UIDs.
88
+ * @returns {string[]} The list of dataIds that contain the UIDs.
89
+ */
90
+ getDataIdsFromSopUids(uids: string[]): string[];
91
+ /**
92
+ * Can the data (of the active view of the active layer) be scrolled?
74
93
  *
75
94
  * @returns {boolean} True if the data has a third dimension greater than one.
95
+ * @deprecated Please use the ViewController equivalent directly instead.
76
96
  */
77
97
  canScroll(): boolean;
78
98
  /**
79
- * Can window and level be applied to the data?
99
+ * Can window and level be applied to the data
100
+ * (of the active view of the active layer)?
80
101
  *
81
102
  * @returns {boolean} True if the data is monochrome.
103
+ * @deprecated Please use the ViewController equivalent directly instead.
82
104
  */
83
105
  canWindowLevel(): boolean;
84
106
  /**
85
- * Get the layer scale on top of the base scale.
107
+ * Get the active layer group scale on top of the base scale.
86
108
  *
87
109
  * @returns {object} The scale as {x,y}.
88
110
  */
89
111
  getAddedScale(): object;
90
112
  /**
91
- * Get the base scale.
113
+ * Get the base scale of the active layer group.
92
114
  *
93
115
  * @returns {object} The scale as {x,y}.
94
116
  */
95
117
  getBaseScale(): object;
96
118
  /**
97
- * Get the layer offset.
119
+ * Get the layer offset of the active layer group.
98
120
  *
99
121
  * @returns {object} The offset.
100
122
  */
@@ -102,9 +124,9 @@ export declare class App {
102
124
  /**
103
125
  * Get the toolbox controller.
104
126
  *
105
- * @returns {object} The controller.
127
+ * @returns {ToolboxController} The controller.
106
128
  */
107
- getToolboxController(): object;
129
+ getToolboxController(): ToolboxController;
108
130
  /**
109
131
  * Get the active layer group.
110
132
  * The layer is available after the first loaded item.
@@ -113,21 +135,27 @@ export declare class App {
113
135
  */
114
136
  getActiveLayerGroup(): LayerGroup;
115
137
  /**
116
- * Get the view layers associated to a data index.
138
+ * Set the active layer group.
139
+ *
140
+ * @param {number} index The layer group index.
141
+ */
142
+ setActiveLayerGroup(index: number): void;
143
+ /**
144
+ * Get the view layers associated to a data id.
117
145
  * The layer are available after the first loaded item.
118
146
  *
119
- * @param {number} index The data index.
120
- * @returns {Array} The layers.
147
+ * @param {string} dataId The data id.
148
+ * @returns {ViewLayer[]} The layers.
121
149
  */
122
- getViewLayersByDataIndex(index: number): any[];
150
+ getViewLayersByDataId(dataId: string): ViewLayer[];
123
151
  /**
124
- * Get the draw layers associated to a data index.
152
+ * Get the draw layers associated to a data id.
125
153
  * The layer are available after the first loaded item.
126
154
  *
127
- * @param {number} index The data index.
128
- * @returns {Array} The layers.
155
+ * @param {string} dataId The data id.
156
+ * @returns {DrawLayer[]} The layers.
129
157
  */
130
- getDrawLayersByDataIndex(index: number): any[];
158
+ getDrawLayersByDataId(dataId: string): DrawLayer[];
131
159
  /**
132
160
  * Get a layer group by div id.
133
161
  * The layer is available after the first loaded item.
@@ -153,34 +181,22 @@ export declare class App {
153
181
  *
154
182
  * @param {object} cmd The command to add.
155
183
  * @fires UndoStack#undoadd
184
+ * @function
156
185
  */
157
186
  addToUndoStack: (cmd: object) => void;
158
187
  /**
159
188
  * Initialise the application.
160
189
  *
161
- * @param {object} opt The application option with:
162
- * - `dataViewConfigs`: data indexed object containing the data view
163
- * configurations in the form of a list of objects containing:
164
- * - divId: the HTML div id
165
- * - orientation: optional 'axial', 'coronal' or 'sagittal' orientation
166
- * string (default undefined keeps the original slice order)
167
- * - `binders`: array of layerGroup binders
168
- * - `tools`: tool name indexed object containing individual tool
169
- * configurations in the form of a list of objects containing:
170
- * - options: array of tool options
171
- * - `viewOnFirstLoadItem`: boolean flag to trigger the first data render
172
- * after the first loaded data or not
173
- * - `defaultCharacterSet`: the default chraracter set string used for DICOM
174
- * parsing
175
- * - `overlayConfig`: list of tags / properties used as overlay information.
190
+ * @param {AppOptions} opt The application options
176
191
  * @example
177
192
  * // create the dwv app
178
193
  * const app = new dwv.App();
179
194
  * // initialise
180
- * app.init({
181
- * dataViewConfigs: {'*': [{divId: 'layerGroup0'}]},
182
- * viewOnFirstLoadItem: false
183
- * });
195
+ * const viewConfig0 = new dwv.ViewConfig('layerGroup0');
196
+ * const viewConfigs = {'*': [viewConfig0]};
197
+ * const options = new dwv.AppOptions(viewConfigs);
198
+ * options.viewOnFirstLoadItem = false;
199
+ * app.init(options);
184
200
  * // render button
185
201
  * const button = document.createElement('button');
186
202
  * button.id = 'render';
@@ -200,7 +216,7 @@ export declare class App {
200
216
  * 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
201
217
  * ]);
202
218
  */
203
- init(opt: object): void;
219
+ init(opt: AppOptions): void;
204
220
  /**
205
221
  * Reset the application.
206
222
  */
@@ -213,34 +229,35 @@ export declare class App {
213
229
  * Add an event listener to this class.
214
230
  *
215
231
  * @param {string} type The event type.
216
- * @param {object} callback The method associated with the provided
232
+ * @param {Function} callback The function associated with the provided
217
233
  * event type, will be called with the fired event.
218
234
  */
219
- addEventListener(type: string, callback: object): void;
235
+ addEventListener(type: string, callback: Function): void;
220
236
  /**
221
237
  * Remove an event listener from this class.
222
238
  *
223
239
  * @param {string} type The event type.
224
- * @param {object} callback The method associated with the provided
240
+ * @param {Function} callback The function associated with the provided
225
241
  * event type.
226
242
  */
227
- removeEventListener(type: string, callback: object): void;
243
+ removeEventListener(type: string, callback: Function): void;
228
244
  /**
229
245
  * Load a list of files. Can be image files or a state file.
230
246
  *
231
- * @param {FileList} files The list of files to load.
247
+ * @param {File[]} files The list of files to load.
232
248
  * @fires App#loadstart
233
249
  * @fires App#loadprogress
234
250
  * @fires App#loaditem
235
251
  * @fires App#loadend
236
- * @fires App#loaderror
237
- * @fires App#loadabort
252
+ * @fires App#error
253
+ * @fires App#abort
254
+ * @function
238
255
  */
239
- loadFiles: (files: FileList) => void;
256
+ loadFiles: (files: File[]) => void;
240
257
  /**
241
258
  * Load a list of URLs. Can be image files or a state file.
242
259
  *
243
- * @param {Array} urls The list of urls to load.
260
+ * @param {string[]} urls The list of urls to load.
244
261
  * @param {object} [options] The options object, can contain:
245
262
  * - requestHeaders: an array of {name, value} to use as request headers
246
263
  * - withCredentials: boolean xhr.withCredentials flag to pass to the request
@@ -249,15 +266,17 @@ export declare class App {
249
266
  * @fires App#loadprogress
250
267
  * @fires App#loaditem
251
268
  * @fires App#loadend
252
- * @fires App#loaderror
253
- * @fires App#loadabort
269
+ * @fires App#error
270
+ * @fires App#abort
271
+ * @function
254
272
  */
255
- loadURLs: (urls: any[], options?: object) => void;
273
+ loadURLs: (urls: string[], options?: object) => void;
256
274
  /**
257
275
  * Load from an input uri.
258
276
  *
259
277
  * @param {string} uri The input uri, for example: 'window.location.href'.
260
278
  * @param {object} [options] Optional url request options.
279
+ * @function
261
280
  */
262
281
  loadFromUri: (uri: string, options?: object) => void;
263
282
  /**
@@ -269,8 +288,9 @@ export declare class App {
269
288
  * @fires App#loadprogress
270
289
  * @fires App#loaditem
271
290
  * @fires App#loadend
272
- * @fires App#loaderror
273
- * @fires App#loadabort
291
+ * @fires App#error
292
+ * @fires App#abort
293
+ * @function
274
294
  */
275
295
  loadImageObject: (data: any[]) => void;
276
296
  /**
@@ -284,58 +304,93 @@ export declare class App {
284
304
  fitToContainer(): void;
285
305
  /**
286
306
  * Init the Window/Level display
307
+ * (of the active layer of the active layer group).
308
+ *
309
+ * @deprecated Please set the opacity of the desired view layer directly.
287
310
  */
288
311
  initWLDisplay(): void;
312
+ /**
313
+ * Set the imageSmoothing flag value. Default is false.
314
+ *
315
+ * @param {boolean} flag True to enable smoothing.
316
+ */
317
+ setImageSmoothing(flag: boolean): void;
318
+ /**
319
+ * Get the layer group configuration from a data id.
320
+ *
321
+ * @param {string} dataId The data id.
322
+ * @param {boolean} [excludeStarConfig] Exclude the star config
323
+ * (default to false).
324
+ * @returns {ViewConfig[]} The list of associated configs.
325
+ */
326
+ getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
327
+ /**
328
+ * Get the layer group configuration for a data id and group
329
+ * div id.
330
+ *
331
+ * @param {string} dataId The data id.
332
+ * @param {string} groupDivId The layer group div id.
333
+ * @param {boolean} [excludeStarConfig] Exclude the star config
334
+ * (default to false).
335
+ * @returns {ViewConfig|undefined} The associated config.
336
+ */
337
+ getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
289
338
  /**
290
339
  * Get the data view config.
291
340
  * Carefull, returns a reference, do not modify without resetting.
292
341
  *
293
- * @returns {object} The configuration list.
342
+ * @returns {Object<string, ViewConfig[]>} The configuration list.
294
343
  */
295
- getDataViewConfig(): object;
344
+ getDataViewConfigs(): {
345
+ [x: string]: ViewConfig[];
346
+ };
296
347
  /**
297
- * Set the data view configuration (see the init options for details).
348
+ * Set the data view configuration.
349
+ * Resets the stage and recreates all the views.
298
350
  *
299
- * @param {object} configs The configuration list.
351
+ * @param {Object<string, ViewConfig[]>} configs The configuration list.
300
352
  */
301
- setDataViewConfig(configs: object): void;
353
+ setDataViewConfigs(configs: {
354
+ [x: string]: ViewConfig[];
355
+ }): void;
302
356
  /**
303
357
  * Add a data view config.
304
358
  *
305
- * @param {number} dataId The data id.
306
- * @param {object} config The view configuration.
359
+ * @param {string} dataId The data id.
360
+ * @param {ViewConfig} config The view configuration.
307
361
  */
308
- addDataViewConfig(dataId: number, config: object): void;
362
+ addDataViewConfig(dataId: string, config: ViewConfig): void;
309
363
  /**
310
364
  * Remove a data view config.
311
365
  *
312
- * @param {number} dataId The data id.
313
- * @param {object} config The view configuration.
366
+ * @param {string} dataId The data id.
367
+ * @param {ViewConfig} config The view configuration.
314
368
  */
315
- removeDataViewConfig(dataId: number, config: object): void;
369
+ removeDataViewConfig(dataId: string, config: ViewConfig): void;
316
370
  /**
317
- * Update a data view config.
371
+ * Update an existing data view config.
372
+ * Removes and re-creates the layer if found.
318
373
  *
319
- * @param {number} dataId The data id.
374
+ * @param {string} dataId The data id.
320
375
  * @param {string} divId The div id.
321
- * @param {object} config The view configuration.
376
+ * @param {ViewConfig} config The view configuration.
322
377
  */
323
- updateDataViewConfig(dataId: number, divId: string, config: object): void;
378
+ updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void;
324
379
  /**
325
380
  * Set the layer groups binders.
326
381
  *
327
- * @param {Array} list The list of binder names.
382
+ * @param {string[]} list The list of binder names.
328
383
  */
329
- setLayerGroupsBinders(list: any[]): void;
384
+ setLayerGroupsBinders(list: string[]): void;
330
385
  /**
331
386
  * Render the current data.
332
387
  *
333
- * @param {number} dataIndex The data index to render.
334
- * @param {Array} [viewConfigs] The list of configs to render.
388
+ * @param {string} dataId The data id to render.
389
+ * @param {ViewConfig[]} [viewConfigs] The list of configs to render.
335
390
  */
336
- render(dataIndex: number, viewConfigs?: any[]): void;
391
+ render(dataId: string, viewConfigs?: ViewConfig[]): void;
337
392
  /**
338
- * Zoom to the layers.
393
+ * Zoom the layers of the active layer group.
339
394
  *
340
395
  * @param {number} step The step to add to the current zoom.
341
396
  * @param {number} cx The zoom center X coordinate.
@@ -343,20 +398,21 @@ export declare class App {
343
398
  */
344
399
  zoom(step: number, cx: number, cy: number): void;
345
400
  /**
346
- * Apply a translation to the layers.
401
+ * Apply a translation to the layers of the active layer group.
347
402
  *
348
403
  * @param {number} tx The translation along X.
349
404
  * @param {number} ty The translation along Y.
350
405
  */
351
406
  translate(tx: number, ty: number): void;
352
407
  /**
353
- * Set the image layer opacity.
408
+ * Set the active view layer (of the active layer group) opacity.
354
409
  *
355
410
  * @param {number} alpha The opacity ([0:1] range).
411
+ * @deprecated Please set the opacity of the desired view layer directly.
356
412
  */
357
413
  setOpacity(alpha: number): void;
358
414
  /**
359
- * Set the drawings on the current stage.
415
+ * Set the drawings of the active layer group.
360
416
  *
361
417
  * @param {Array} drawings An array of drawings.
362
418
  * @param {Array} drawingsDetails An array of drawings details.
@@ -378,6 +434,8 @@ export declare class App {
378
434
  * Handle resize: fit the display to the window.
379
435
  * To be called once the image is loaded.
380
436
  * Can be connected to a window 'resize' event.
437
+ *
438
+ * @function
381
439
  */
382
440
  onResize: () => void;
383
441
  /**
@@ -385,6 +443,7 @@ export declare class App {
385
443
  *
386
444
  * @param {KeyboardEvent} event The key down event.
387
445
  * @fires App#keydown
446
+ * @function
388
447
  */
389
448
  onKeydown: (event: KeyboardEvent) => void;
390
449
  /**
@@ -395,10 +454,12 @@ export declare class App {
395
454
  * - CRTL-ARROW_UP: next element on third dim
396
455
  * - CRTL-ARROW_RIGHT: previous element on fourth dim
397
456
  * - CRTL-ARROW_DOWN: previous element on third dim
457
+ * (applies to the active view of the active layer group)
398
458
  *
399
459
  * @param {KeyboardEvent} event The key down event.
400
460
  * @fires UndoStack#undo
401
461
  * @fires UndoStack#redo
462
+ * @function
402
463
  */
403
464
  defaultOnKeydown: (event: KeyboardEvent) => void;
404
465
  /**
@@ -410,17 +471,19 @@ export declare class App {
410
471
  */
411
472
  resetZoom(): void;
412
473
  /**
413
- * Set the colour map.
474
+ * Set the colour map of the active view of the active layer group.
414
475
  *
415
- * @param {string} colourMap The colour map name.
476
+ * @param {string} name The colour map name.
477
+ * @deprecated Please use the ViewController equivalent directly instead.
416
478
  */
417
- setColourMap(colourMap: string): void;
479
+ setColourMap(name: string): void;
418
480
  /**
419
- * Set the window/level preset.
481
+ * Set the window/level preset of the active view of the active layer group.
420
482
  *
421
- * @param {object} preset The window/level preset.
483
+ * @param {string} preset The window/level preset.
484
+ * @deprecated Please use the ViewController equivalent directly instead.
422
485
  */
423
- setWindowLevelPreset(preset: object): void;
486
+ setWindowLevelPreset(preset: string): void;
424
487
  /**
425
488
  * Set the tool
426
489
  *
@@ -458,21 +521,77 @@ export declare class App {
458
521
  */
459
522
  getCurrentStackIndex(): number;
460
523
  /**
461
- * Get the overlay data for a data index.
524
+ * Get the overlay data for a data id.
462
525
  *
463
- * @param {number} dataIndex The data index.
464
- * @returns {OverlayData} The overlay data.
526
+ * @param {string} dataId The data id.
527
+ * @returns {OverlayData|undefined} The overlay data.
465
528
  */
466
- getOverlayData(dataIndex: number): OverlayData;
529
+ getOverlayData(dataId: string): OverlayData | undefined;
467
530
  /**
468
531
  * Toggle overlay listeners.
469
532
  *
470
- * @param {number} dataIndex The data index.
533
+ * @param {string} dataId The data id.
471
534
  */
472
- toggleOverlayListeners(dataIndex: number): void;
535
+ toggleOverlayListeners(dataId: string): void;
473
536
  #private;
474
537
  }
475
538
 
539
+ /**
540
+ * Application options.
541
+ */
542
+ export declare class AppOptions {
543
+ /**
544
+ * @param {Object<string, ViewConfig[]>} [dataViewConfigs] Optional dataId
545
+ * indexed object containing the data view configurations.
546
+ */
547
+ constructor(dataViewConfigs?: {
548
+ [x: string]: ViewConfig[];
549
+ });
550
+ /**
551
+ * DataId indexed object containing the data view configurations.
552
+ *
553
+ * @type {Object<string, ViewConfig[]>|undefined}
554
+ */
555
+ dataViewConfigs: {
556
+ [x: string]: ViewConfig[];
557
+ } | undefined;
558
+ /**
559
+ * Tool name indexed object containing individual tool configurations.
560
+ *
561
+ * @type {Object<string, ToolConfig>|undefined}
562
+ */
563
+ tools: {
564
+ [x: string]: ToolConfig;
565
+ } | undefined;
566
+ /**
567
+ * Optional array of layerGroup binder names.
568
+ *
569
+ * @type {string[]|undefined}
570
+ */
571
+ binders: string[] | undefined;
572
+ /**
573
+ * Optional boolean flag to trigger the first data render
574
+ * after the first loaded data or not. Defaults to true;
575
+ *
576
+ * @type {boolean|undefined}
577
+ */
578
+ viewOnFirstLoadItem: boolean | undefined;
579
+ /**
580
+ * Optional default chraracter set string used for DICOM parsing if
581
+ * not passed in DICOM file.
582
+ * Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings
583
+ *
584
+ * @type {string|undefined}
585
+ */
586
+ defaultCharacterSet: string | undefined;
587
+ /**
588
+ * Optional overlay config.
589
+ *
590
+ * @type {object|undefined}
591
+ */
592
+ overlayConfig: object | undefined;
593
+ }
594
+
476
595
  /**
477
596
  * Build a multipart message.
478
597
  * See: https://en.wikipedia.org/wiki/MIME#Multipart_messages
@@ -485,30 +604,67 @@ export declare class App {
485
604
  */
486
605
  export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
487
606
 
607
+ /**
608
+ * Colour map: red, green and blue components
609
+ * to associate with intensity values.
610
+ */
611
+ export declare class ColourMap {
612
+ /**
613
+ * @param {number[]} red Red component.
614
+ * @param {number[]} green Green component.
615
+ * @param {number[]} blue Blue component.
616
+ */
617
+ constructor(red: number[], green: number[], blue: number[]);
618
+ /**
619
+ * Red component: 256 values in the [0, 255] range.
620
+ *
621
+ * @type {number[]}
622
+ */
623
+ red: number[];
624
+ /**
625
+ * Green component: 256 values in the [0, 255] range.
626
+ *
627
+ * @type {number[]}
628
+ */
629
+ green: number[];
630
+ /**
631
+ * Blue component: 256 values in the [0, 255] range.
632
+ *
633
+ * @type {number[]}
634
+ */
635
+ blue: number[];
636
+ }
637
+
488
638
  /**
489
639
  * Create an Image from DICOM elements.
490
640
  *
491
- * @param {object} elements The DICOM elements.
641
+ * @param {Object<string, DataElement>} elements The DICOM elements.
492
642
  * @returns {Image} The Image object.
493
643
  */
494
- export declare function createImage(elements: object): Image_2;
644
+ export declare function createImage(elements: {
645
+ [x: string]: DataElement;
646
+ }): Image_2;
495
647
 
496
648
  /**
497
649
  * Create a mask Image from DICOM elements.
498
650
  *
499
- * @param {object} elements The DICOM elements.
651
+ * @param {Object<string, DataElement>} elements The DICOM elements.
500
652
  * @returns {Image} The mask Image object.
501
653
  */
502
- export declare function createMaskImage(elements: object): Image_2;
654
+ export declare function createMaskImage(elements: {
655
+ [x: string]: DataElement;
656
+ }): Image_2;
503
657
 
504
658
  /**
505
659
  * Create a View from DICOM elements and image.
506
660
  *
507
- * @param {object} elements The DICOM elements.
661
+ * @param {Object<string, DataElement>} elements The DICOM elements.
508
662
  * @param {Image} image The associated image.
509
663
  * @returns {View} The View object.
510
664
  */
511
- export declare function createView(elements: object, image: Image_2): View;
665
+ export declare function createView(elements: {
666
+ [x: string]: DataElement;
667
+ }, image: Image_2): View;
512
668
 
513
669
  export declare namespace customUI {
514
670
  /**
@@ -520,6 +676,64 @@ export declare namespace customUI {
520
676
  export function openRoiDialog(data: any, callback: Function): void;
521
677
  }
522
678
 
679
+ /**
680
+ * DICOM data element.
681
+ */
682
+ export declare class DataElement {
683
+ /**
684
+ * @param {string} vr The element VR (Value Representation).
685
+ */
686
+ constructor(vr: string);
687
+ /**
688
+ * The element Value Representation.
689
+ *
690
+ * @type {string}
691
+ */
692
+ vr: string;
693
+ /**
694
+ * The element value.
695
+ *
696
+ * @type {Array}
697
+ */
698
+ value: any[];
699
+ /**
700
+ * The element dicom tag.
701
+ *
702
+ * @type {Tag}
703
+ */
704
+ tag: Tag;
705
+ /**
706
+ * The element Value Length.
707
+ *
708
+ * @type {number}
709
+ */
710
+ vl: number;
711
+ /**
712
+ * Flag to know if defined or undefined sequence length.
713
+ *
714
+ * @type {boolean}
715
+ */
716
+ undefinedLength: boolean;
717
+ /**
718
+ * The element start offset.
719
+ *
720
+ * @type {number}
721
+ */
722
+ startOffset: number;
723
+ /**
724
+ * The element end offset.
725
+ *
726
+ * @type {number}
727
+ */
728
+ endOffset: number;
729
+ /**
730
+ * The sequence items.
731
+ *
732
+ * @type {Array}
733
+ */
734
+ items: any[];
735
+ }
736
+
523
737
  /**
524
738
  * Decoder scripts to be passed to web workers for image decoding.
525
739
  */
@@ -533,14 +747,11 @@ export declare const decoderScripts: {
533
747
  /**
534
748
  * List of default window level presets.
535
749
  *
536
- * @type {Object.<string, Object.<string, {center: number, width: number}>>}
750
+ * @type {Object.<string, Object.<string, WindowLevel>>}
537
751
  */
538
752
  export declare const defaultPresets: {
539
753
  [x: string]: {
540
- [x: string]: {
541
- center: number;
542
- width: number;
543
- };
754
+ [x: string]: WindowLevel;
544
755
  };
545
756
  };
546
757
 
@@ -552,6 +763,46 @@ export declare namespace defaults {
552
763
  };
553
764
  }
554
765
 
766
+ /**
767
+ * DICOM code.
768
+ */
769
+ export declare class DicomCode {
770
+ /**
771
+ * @param {string} meaning The code meaning.
772
+ */
773
+ constructor(meaning: string);
774
+ /**
775
+ * Code meaning (0008,0104).
776
+ *
777
+ * @type {string}
778
+ */
779
+ meaning: string;
780
+ /**
781
+ * Code value (0008,0100).
782
+ *
783
+ * @type {string|undefined}
784
+ */
785
+ value: string | undefined;
786
+ /**
787
+ * Long code value (0008,0119).
788
+ *
789
+ * @type {string|undefined}
790
+ */
791
+ longValue: string | undefined;
792
+ /**
793
+ * URN code value (0008,0120).
794
+ *
795
+ * @type {string|undefined}
796
+ */
797
+ urnValue: string | undefined;
798
+ /**
799
+ * Coding scheme designator (0008,0102).
800
+ *
801
+ * @type {string|undefined}
802
+ */
803
+ schemeDesignator: string | undefined;
804
+ }
805
+
555
806
  /**
556
807
  * DicomParser class.
557
808
  *
@@ -598,14 +849,16 @@ export declare class DicomParser {
598
849
  */
599
850
  setDecoderCharacterSet(characterSet: string): void;
600
851
  /**
601
- * Get the raw DICOM data elements.
852
+ * Get the DICOM data elements.
602
853
  *
603
- * @returns {object} The raw DICOM elements.
854
+ * @returns {Object<string, DataElement>} The data elements.
604
855
  */
605
- getDicomElements(): object;
856
+ getDicomElements(): {
857
+ [x: string]: DataElement;
858
+ };
606
859
  /**
607
860
  * Parse the complete DICOM file (given as input to the class).
608
- * Fills in the member object 'dicomElements'.
861
+ * Fills in the member object 'dataElements'.
609
862
  *
610
863
  * @param {ArrayBuffer} buffer The input array buffer.
611
864
  */
@@ -616,16 +869,33 @@ export declare class DicomParser {
616
869
  /**
617
870
  * DICOM writer.
618
871
  *
619
- * Example usage:
620
- * const parser = new DicomParser();
621
- * parser.parse(this.response);
622
- *
623
- * const writer = new DicomWriter(parser.getDicomElements());
624
- * const blob = new Blob([writer.getBuffer()], {type: 'application/dicom'});
625
- *
626
- * const element = document.getElementById("download");
627
- * element.href = URL.createObjectURL(blob);
628
- * element.download = "anonym.dcm";
872
+ * @example
873
+ * // add link to html
874
+ * const link = document.createElement("a");
875
+ * link.appendChild(document.createTextNode("download"));
876
+ * const div = document.getElementById("dwv");
877
+ * div.appendChild(link);
878
+ * // XMLHttpRequest onload callback
879
+ * const onload = function (event) {
880
+ * const parser = new dwv.DicomParser();
881
+ * parser.parse(event.target.response);
882
+ * // create writer
883
+ * const writer = new dwv.DicomWriter();
884
+ * // get buffer using default rules
885
+ * const dicomBuffer = writer.getBuffer(parser.getDicomElements());
886
+ * // create blob
887
+ * const blob = new Blob([dicomBuffer], {type: 'application/dicom'});
888
+ * // add blob to download link
889
+ * link.href = URL.createObjectURL(blob);
890
+ * link.download = "anonym.dcm";
891
+ * };
892
+ * // DICOM file request
893
+ * const request = new XMLHttpRequest();
894
+ * const url = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm';
895
+ * request.open('GET', url);
896
+ * request.responseType = 'arraybuffer';
897
+ * request.onload = onload;
898
+ * request.send();
629
899
  */
630
900
  export declare class DicomWriter {
631
901
  /**
@@ -636,10 +906,20 @@ export declare class DicomWriter {
636
906
  setUseUnVrForPrivateSq(flag: boolean): void;
637
907
  /**
638
908
  * Set the writing rules.
909
+ * List of writer rules indexed by either `default`,
910
+ * tagKey, tagName or groupName.
911
+ * Each DICOM element will be checked to see if a rule is applicable.
912
+ * First checked by tagKey, tagName and then by groupName,
913
+ * if nothing is found the default rule is applied.
639
914
  *
640
- * @param {object} rules The input rules.
915
+ * @param {Object<string, WriterRule>} rules The input rules.
916
+ * @param {boolean} [addMissingTags] if true, explicit tags that
917
+ * have replace rule and a value will be
918
+ * added if missing. Defaults to false.
641
919
  */
642
- setRules(rules: object): void;
920
+ setRules(rules: {
921
+ [x: string]: WriterRule;
922
+ }, addMissingTags?: boolean): void;
643
923
  /**
644
924
  * Use a TextEncoder instead of the default text decoder.
645
925
  */
@@ -648,16 +928,160 @@ export declare class DicomWriter {
648
928
  * Use default anonymisation rules.
649
929
  */
650
930
  useDefaultAnonymisationRules(): void;
931
+ /**
932
+ * Get the element to write according to the class rules.
933
+ * Priority order: tagName, groupName, default.
934
+ *
935
+ * @param {DataElement} element The element to check
936
+ * @returns {DataElement|null} The element to write, can be null.
937
+ */
938
+ getElementToWrite(element: DataElement): DataElement | null;
651
939
  /**
652
940
  * Get the ArrayBuffer corresponding to input DICOM elements.
653
941
  *
654
- * @param {Array} dicomElements The wrapped elements to write.
942
+ * @param {Object<string, DataElement>} dataElements The elements to write.
655
943
  * @returns {ArrayBuffer} The elements as a buffer.
656
944
  */
657
- getBuffer(dicomElements: any[]): ArrayBuffer;
945
+ getBuffer(dataElements: {
946
+ [x: string]: DataElement;
947
+ }): ArrayBuffer;
658
948
  #private;
659
949
  }
660
950
 
951
+ /**
952
+ * Draw controller.
953
+ */
954
+ export declare class DrawController {
955
+ /**
956
+ * @param {DrawLayer} drawLayer The draw layer.
957
+ */
958
+ constructor(drawLayer: DrawLayer);
959
+ /**
960
+ * Get the current position group.
961
+ *
962
+ * @returns {Konva.Group|undefined} The Konva.Group.
963
+ */
964
+ getCurrentPosGroup(): Konva.Group | undefined;
965
+ /**
966
+ * Reset: clear the layers array.
967
+ */
968
+ reset(): void;
969
+ /**
970
+ * Get a Konva group using its id.
971
+ *
972
+ * @param {string} id The group id.
973
+ * @returns {object|undefined} The Konva group.
974
+ */
975
+ getGroup(id: string): object | undefined;
976
+ /**
977
+ * Activate the current draw layer.
978
+ *
979
+ * @param {Index} index The current position.
980
+ * @param {number} scrollIndex The scroll index.
981
+ */
982
+ activateDrawLayer(index: Index, scrollIndex: number): void;
983
+ /**
984
+ * Get a list of drawing display details.
985
+ *
986
+ * @returns {DrawDetails[]} A list of draw details.
987
+ */
988
+ getDrawDisplayDetails(): DrawDetails[];
989
+ /**
990
+ * Get a list of drawing store details. Used in state.
991
+ *
992
+ * @returns {object} A list of draw details including id, text, quant...
993
+ * TODO Unify with getDrawDisplayDetails?
994
+ */
995
+ getDrawStoreDetails(): object;
996
+ /**
997
+ * Set the drawings on the current stage.
998
+ *
999
+ * @param {Array} drawings An array of drawings.
1000
+ * @param {DrawDetails[]} drawingsDetails An array of drawings details.
1001
+ * @param {object} cmdCallback The DrawCommand callback.
1002
+ * @param {object} exeCallback The callback to call once the
1003
+ * DrawCommand has been executed.
1004
+ */
1005
+ setDrawings(drawings: any[], drawingsDetails: DrawDetails[], cmdCallback: object, exeCallback: object): void;
1006
+ /**
1007
+ * Update a drawing from its details.
1008
+ *
1009
+ * @param {DrawDetails} drawDetails Details of the drawing to update.
1010
+ */
1011
+ updateDraw(drawDetails: DrawDetails): void;
1012
+ /**
1013
+ * Delete a Draw from the stage.
1014
+ *
1015
+ * @param {Konva.Group} group The group to delete.
1016
+ * @param {object} cmdCallback The DeleteCommand callback.
1017
+ * @param {object} exeCallback The callback to call once the
1018
+ * DeleteCommand has been executed.
1019
+ */
1020
+ deleteDrawGroup(group: Konva.Group, cmdCallback: object, exeCallback: object): void;
1021
+ /**
1022
+ * Delete a Draw from the stage.
1023
+ *
1024
+ * @param {string} id The id of the group to delete.
1025
+ * @param {Function} cmdCallback The DeleteCommand callback.
1026
+ * @param {Function} exeCallback The callback to call once the
1027
+ * DeleteCommand has been executed.
1028
+ * @returns {boolean} False if the group cannot be found.
1029
+ */
1030
+ deleteDraw(id: string, cmdCallback: Function, exeCallback: Function): boolean;
1031
+ /**
1032
+ * Delete all Draws from the stage.
1033
+ *
1034
+ * @param {Function} cmdCallback The DeleteCommand callback.
1035
+ * @param {Function} exeCallback The callback to call once the
1036
+ * DeleteCommand has been executed.
1037
+ */
1038
+ deleteDraws(cmdCallback: Function, exeCallback: Function): void;
1039
+ /**
1040
+ * Get the total number of draws
1041
+ * (at all positions).
1042
+ *
1043
+ * @returns {number} The total number of draws.
1044
+ */
1045
+ getNumberOfDraws(): number;
1046
+ #private;
1047
+ }
1048
+
1049
+ /**
1050
+ * Draw details.
1051
+ */
1052
+ export declare class DrawDetails {
1053
+ /**
1054
+ * The draw ID.
1055
+ *
1056
+ * @type {number}
1057
+ */
1058
+ id: number;
1059
+ /**
1060
+ * The draw position: an Index converted to string.
1061
+ *
1062
+ * @type {string}
1063
+ */
1064
+ position: string;
1065
+ /**
1066
+ * The draw type.
1067
+ *
1068
+ * @type {string}
1069
+ */
1070
+ type: string;
1071
+ /**
1072
+ * The draw color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
1073
+ *
1074
+ * @type {string}
1075
+ */
1076
+ color: string;
1077
+ /**
1078
+ * The draw meta.
1079
+ *
1080
+ * @type {DrawMeta}
1081
+ */
1082
+ meta: DrawMeta;
1083
+ }
1084
+
661
1085
  /**
662
1086
  * Draw layer.
663
1087
  */
@@ -668,23 +1092,23 @@ export declare class DrawLayer {
668
1092
  */
669
1093
  constructor(containerDiv: HTMLDivElement);
670
1094
  /**
671
- * Get the associated data index.
1095
+ * Get the associated data id.
672
1096
  *
673
- * @returns {number} The index.
1097
+ * @returns {string} The id.
674
1098
  */
675
- getDataIndex(): number;
1099
+ getDataId(): string;
676
1100
  /**
677
1101
  * Get the Konva stage.
678
1102
  *
679
- * @returns {object} The stage.
1103
+ * @returns {Konva.Stage} The stage.
680
1104
  */
681
- getKonvaStage(): object;
1105
+ getKonvaStage(): Konva.Stage;
682
1106
  /**
683
1107
  * Get the Konva layer.
684
1108
  *
685
- * @returns {object} The layer.
1109
+ * @returns {Konva.Layer} The layer.
686
1110
  */
687
- getKonvaLayer(): object;
1111
+ getKonvaLayer(): Konva.Layer;
688
1112
  /**
689
1113
  * Get the draw controller.
690
1114
  *
@@ -729,13 +1153,25 @@ export declare class DrawLayer {
729
1153
  * Add a flip offset along the layer Y axis.
730
1154
  */
731
1155
  addFlipOffsetY(): void;
1156
+ /**
1157
+ * Flip the scale along the layer X axis.
1158
+ */
1159
+ flipScaleX(): void;
1160
+ /**
1161
+ * Flip the scale along the layer Y axis.
1162
+ */
1163
+ flipScaleY(): void;
1164
+ /**
1165
+ * Flip the scale along the layer Z axis.
1166
+ */
1167
+ flipScaleZ(): void;
732
1168
  /**
733
1169
  * Set the layer scale.
734
1170
  *
735
1171
  * @param {object} newScale The scale as {x,y}.
736
- * @param {Point3D} center The scale center.
1172
+ * @param {Point3D} [center] The scale center.
737
1173
  */
738
- setScale(newScale: object, center: Point3D): void;
1174
+ setScale(newScale: object, center?: Point3D): void;
739
1175
  /**
740
1176
  * Set the layer offset.
741
1177
  *
@@ -772,9 +1208,9 @@ export declare class DrawLayer {
772
1208
  *
773
1209
  * @param {object} size The image size as {x,y}.
774
1210
  * @param {object} spacing The image spacing as {x,y}.
775
- * @param {number} index The associated data index.
1211
+ * @param {string} dataId The associated data id.
776
1212
  */
777
- initialise(size: object, spacing: object, index: number): void;
1213
+ initialise(size: object, spacing: object, dataId: string): void;
778
1214
  /**
779
1215
  * Fit the layer to its parent container.
780
1216
  *
@@ -796,7 +1232,7 @@ export declare class DrawLayer {
796
1232
  * @param {string} id The id of the group.
797
1233
  * @returns {boolean} False if the group cannot be found.
798
1234
  */
799
- toogleGroupVisibility(id: string): boolean;
1235
+ toggleGroupVisibility(id: string): boolean;
800
1236
  /**
801
1237
  * Delete a Draw from the stage.
802
1238
  *
@@ -812,6 +1248,13 @@ export declare class DrawLayer {
812
1248
  * DeleteCommand has been executed.
813
1249
  */
814
1250
  deleteDraws(exeCallback: object): void;
1251
+ /**
1252
+ * Get the total number of draws of this layer
1253
+ * (at all positions).
1254
+ *
1255
+ * @returns {number|undefined} The total number of draws.
1256
+ */
1257
+ getNumberOfDraws(): number | undefined;
815
1258
  /**
816
1259
  * Enable and listen to container interaction events.
817
1260
  */
@@ -832,21 +1275,40 @@ export declare class DrawLayer {
832
1275
  * Add an event listener to this class.
833
1276
  *
834
1277
  * @param {string} type The event type.
835
- * @param {object} callback The method associated with the provided
1278
+ * @param {Function} callback The function associated with the provided
836
1279
  * event type, will be called with the fired event.
837
1280
  */
838
- addEventListener(type: string, callback: object): void;
1281
+ addEventListener(type: string, callback: Function): void;
839
1282
  /**
840
1283
  * Remove an event listener from this class.
841
1284
  *
842
1285
  * @param {string} type The event type.
843
- * @param {object} callback The method associated with the provided
1286
+ * @param {Function} callback The function associated with the provided
844
1287
  * event type.
845
1288
  */
846
- removeEventListener(type: string, callback: object): void;
1289
+ removeEventListener(type: string, callback: Function): void;
847
1290
  #private;
848
1291
  }
849
1292
 
1293
+ /**
1294
+ * Draw meta data.
1295
+ */
1296
+ export declare class DrawMeta {
1297
+ /**
1298
+ * Draw quantification.
1299
+ *
1300
+ * @type {object}
1301
+ */
1302
+ quantification: object;
1303
+ /**
1304
+ * Draw text expression. Can contain variables surrounded with '{}' that will
1305
+ * be extracted from the quantification object.
1306
+ *
1307
+ * @type {string}
1308
+ */
1309
+ textExpr: string;
1310
+ }
1311
+
850
1312
  /**
851
1313
  * 2D/3D Geometry class.
852
1314
  */
@@ -899,9 +1361,9 @@ export declare class Geometry {
899
1361
  /**
900
1362
  * Get the object origins.
901
1363
  *
902
- * @returns {Array} The object origins.
1364
+ * @returns {Point3D[]} The object origins.
903
1365
  */
904
- getOrigins(): any[];
1366
+ getOrigins(): Point3D[];
905
1367
  /**
906
1368
  * Check if a point is in the origin list.
907
1369
  *
@@ -994,10 +1456,10 @@ export declare class Geometry {
994
1456
  * Check that a index is within bounds.
995
1457
  *
996
1458
  * @param {Index} index The index to check.
997
- * @param {Array} [dirs] Optional list of directions to check.
1459
+ * @param {number[]} [dirs] Optional list of directions to check.
998
1460
  * @returns {boolean} True if the given coordinates are within bounds.
999
1461
  */
1000
- isIndexInBounds(index: Index, dirs?: any[]): boolean;
1462
+ isIndexInBounds(index: Index, dirs?: number[]): boolean;
1001
1463
  /**
1002
1464
  * Convert an index into world coordinates.
1003
1465
  *
@@ -1029,6 +1491,19 @@ export declare class Geometry {
1029
1491
  #private;
1030
1492
  }
1031
1493
 
1494
+ /**
1495
+ * Get the default DICOM seg tags as an object.
1496
+ *
1497
+ * @returns {object} The default tags.
1498
+ */
1499
+ export declare function getDefaultDicomSegJson(): object;
1500
+
1501
+ /**
1502
+ * List of DICOM data elements indexed via a 8 character string formed from
1503
+ * the group and element numbers.
1504
+ *
1505
+ * @typedef {Object<string, DataElement>} DataElements
1506
+ */
1032
1507
  /**
1033
1508
  * Get the version of the library.
1034
1509
  *
@@ -1037,23 +1512,56 @@ export declare class Geometry {
1037
1512
  export declare function getDwvVersion(): string;
1038
1513
 
1039
1514
  /**
1040
- * Get the DICOM elements from a DICOM json tags object.
1041
- * The json is a simplified version of the oficial DICOM json with
1515
+ * Get the DICOM elements from a 'simple' DICOM tags object.
1516
+ * The input object is a simplified version of the oficial DICOM json with
1042
1517
  * tag names instead of keys and direct values (no value property) for
1043
- * simple tags.
1518
+ * simple tags. See synthetic test data (in tests/dicom) for examples.
1044
1519
  *
1045
- * @param {object} jsonTags The DICOM json tags object.
1046
- * @returns {object} The DICOM elements.
1520
+ * @param {Object<string, any>} simpleTags The 'simple' DICOM
1521
+ * tags object.
1522
+ * @returns {Object<string, DataElement>} The DICOM elements.
1047
1523
  */
1048
- export declare function getElementsFromJSONTags(jsonTags: object): object;
1524
+ export declare function getElementsFromJSONTags(simpleTags: {
1525
+ [x: string]: any;
1526
+ }): {
1527
+ [x: string]: DataElement;
1528
+ };
1529
+
1530
+ /**
1531
+ * Get the indices that form a ellpise.
1532
+ *
1533
+ * @param {Index} center The ellipse center.
1534
+ * @param {number[]} radius The 2 ellipse radiuses.
1535
+ * @param {number[]} dir The 2 ellipse directions.
1536
+ * @returns {Index[]} The indices of the ellipse.
1537
+ */
1538
+ export declare function getEllipseIndices(center: Index, radius: number[], dir: number[]): Index[];
1539
+
1540
+ /**
1541
+ * Get the layer details from a mouse event.
1542
+ *
1543
+ * @param {object} event The event to get the layer div id from. Expecting
1544
+ * an event origininating from a canvas inside a layer HTML div
1545
+ * with the 'layer' class and id generated with `getLayerDivId`.
1546
+ * @returns {object} The layer details as {groupDivId, layerId}.
1547
+ */
1548
+ export declare function getLayerDetailsFromEvent(event: object): object;
1549
+
1550
+ /**
1551
+ * Get the offset of an input mouse event.
1552
+ *
1553
+ * @param {object} event The event to get the offset from.
1554
+ * @returns {Point2D} The 2D point.
1555
+ */
1556
+ export declare function getMousePoint(event: object): Point2D;
1049
1557
 
1050
1558
  /**
1051
1559
  * Get the name of an image orientation patient.
1052
1560
  *
1053
- * @param {Array} orientation The image orientation patient.
1561
+ * @param {number[]} orientation The image orientation patient.
1054
1562
  * @returns {string} The orientation name: axial, coronal or sagittal.
1055
1563
  */
1056
- export declare function getOrientationName(orientation: any[]): string;
1564
+ export declare function getOrientationName(orientation: number[]): string;
1057
1565
 
1058
1566
  /**
1059
1567
  * Get the PixelData Tag.
@@ -1078,6 +1586,14 @@ export declare function getReverseOrientation(ori: string): string;
1078
1586
  */
1079
1587
  export declare function getTagFromKey(key: string): Tag;
1080
1588
 
1589
+ /**
1590
+ * Get the offsets of an input touch event.
1591
+ *
1592
+ * @param {object} event The event to get the offset from.
1593
+ * @returns {Point2D[]} The array of points.
1594
+ */
1595
+ export declare function getTouchPoints(event: object): Point2D[];
1596
+
1081
1597
  /**
1082
1598
  * Get the appropriate TypedArray in function of arguments.
1083
1599
  *
@@ -1103,6 +1619,16 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
1103
1619
  */
1104
1620
  export declare function getUID(tagName: string): string;
1105
1621
 
1622
+ /**
1623
+ * Check that an input buffer includes the DICOM prefix 'DICM'
1624
+ * after the 128 bytes preamble.
1625
+ * Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}
1626
+ *
1627
+ * @param {ArrayBuffer} buffer The buffer to check.
1628
+ * @returns {boolean} True if the buffer includes the prefix.
1629
+ */
1630
+ export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
1631
+
1106
1632
  export declare namespace i18n {
1107
1633
  /**
1108
1634
  * Get the translated text.
@@ -1155,9 +1681,9 @@ declare class Image_2 {
1155
1681
  /**
1156
1682
  * @param {Geometry} geometry The geometry of the image.
1157
1683
  * @param {TypedArray} buffer The image data as a one dimensional buffer.
1158
- * @param {Array} [imageUids] An array of Uids indexed to slice number.
1684
+ * @param {string[]} [imageUids] An array of Uids indexed to slice number.
1159
1685
  */
1160
- constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: any[]);
1686
+ constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]);
1161
1687
  /**
1162
1688
  * Get the image UID at a given index.
1163
1689
  *
@@ -1165,6 +1691,13 @@ declare class Image_2 {
1165
1691
  * @returns {string} The UID.
1166
1692
  */
1167
1693
  getImageUid(index?: Index): string;
1694
+ /**
1695
+ * Check if this image includes the input uids.
1696
+ *
1697
+ * @param {string[]} uids UIDs to test for presence.
1698
+ * @returns {boolean} True if all uids are in this image uids.
1699
+ */
1700
+ containsImageUids(uids: string[]): boolean;
1168
1701
  /**
1169
1702
  * Get the geometry of the image.
1170
1703
  *
@@ -1188,8 +1721,15 @@ declare class Image_2 {
1188
1721
  * Can window and level be applied to the data?
1189
1722
  *
1190
1723
  * @returns {boolean} True if the data is monochrome.
1724
+ * @deprecated Please use isMonochrome instead.
1191
1725
  */
1192
1726
  canWindowLevel(): boolean;
1727
+ /**
1728
+ * Is the data monochrome.
1729
+ *
1730
+ * @returns {boolean} True if the data is monochrome.
1731
+ */
1732
+ isMonochrome(): boolean;
1193
1733
  /**
1194
1734
  * Can the data be scrolled?
1195
1735
  *
@@ -1266,15 +1806,19 @@ declare class Image_2 {
1266
1806
  /**
1267
1807
  * Get the meta information of the image.
1268
1808
  *
1269
- * @returns {object} The meta information of the image.
1809
+ * @returns {Object<string, any>} The meta information of the image.
1270
1810
  */
1271
- getMeta(): object;
1811
+ getMeta(): {
1812
+ [x: string]: any;
1813
+ };
1272
1814
  /**
1273
1815
  * Set the meta information of the image.
1274
1816
  *
1275
- * @param {object} rhs The meta information of the image.
1817
+ * @param {Object<string, any>} rhs The meta information of the image.
1276
1818
  */
1277
- setMeta(rhs: object): void;
1819
+ setMeta(rhs: {
1820
+ [x: string]: any;
1821
+ }): void;
1278
1822
  /**
1279
1823
  * Get value at offset. Warning: No size check...
1280
1824
  *
@@ -1286,19 +1830,19 @@ declare class Image_2 {
1286
1830
  * Get the offsets where the buffer equals the input value.
1287
1831
  * Loops through the whole volume, can get long for big data...
1288
1832
  *
1289
- * @param {number|object} value The value to check.
1290
- * @returns {Array} The list of offsets.
1833
+ * @param {number|RGB} value The value to check.
1834
+ * @returns {number[]} The list of offsets.
1291
1835
  */
1292
- getOffsets(value: number | object): any[];
1836
+ getOffsets(value: number | RGB): number[];
1293
1837
  /**
1294
1838
  * Check if the input values are in the buffer.
1295
1839
  * Could loop through the whole volume, can get long for big data...
1296
1840
  *
1297
1841
  * @param {Array} values The values to check.
1298
- * @returns {Array} A list of booleans for each input value,
1842
+ * @returns {boolean[]} A list of booleans for each input value,
1299
1843
  * set to true if the value is present in the buffer.
1300
1844
  */
1301
- hasValues(values: any[]): any[];
1845
+ hasValues(values: any[]): boolean[];
1302
1846
  /**
1303
1847
  * Clone the image.
1304
1848
  *
@@ -1347,44 +1891,46 @@ declare class Image_2 {
1347
1891
  * Add an event listener to this class.
1348
1892
  *
1349
1893
  * @param {string} type The event type.
1350
- * @param {object} callback The method associated with the provided
1894
+ * @param {Function} callback The function associated with the provided
1351
1895
  * event type, will be called with the fired event.
1352
1896
  */
1353
- addEventListener(type: string, callback: object): void;
1897
+ addEventListener(type: string, callback: Function): void;
1354
1898
  /**
1355
1899
  * Remove an event listener from this class.
1356
1900
  *
1357
1901
  * @param {string} type The event type.
1358
- * @param {object} callback The method associated with the provided
1902
+ * @param {Function} callback The function associated with the provided
1359
1903
  * event type.
1360
1904
  */
1361
- removeEventListener(type: string, callback: object): void;
1905
+ removeEventListener(type: string, callback: Function): void;
1362
1906
  /**
1363
1907
  * Set the inner buffer values at given offsets.
1364
1908
  *
1365
- * @param {Array} offsets List of offsets where to set the data.
1366
- * @param {object} value The value to set at the given offsets.
1909
+ * @param {number[]} offsets List of offsets where to set the data.
1910
+ * @param {number|RGB} value The value to set at the given offsets.
1367
1911
  * @fires Image#imagechange
1368
1912
  */
1369
- setAtOffsets(offsets: any[], value: object): void;
1913
+ setAtOffsets(offsets: number[], value: number | RGB): void;
1370
1914
  /**
1371
1915
  * Set the inner buffer values at given offsets.
1372
1916
  *
1373
- * @param {Array} offsetsLists List of offset lists where to set the data.
1374
- * @param {object} value The value to set at the given offsets.
1917
+ * @param {number[][]} offsetsLists List of offset lists where
1918
+ * to set the data.
1919
+ * @param {RGB} value The value to set at the given offsets.
1375
1920
  * @returns {Array} A list of objects representing the original values before
1376
1921
  * replacing them.
1377
1922
  * @fires Image#imagechange
1378
1923
  */
1379
- setAtOffsetsAndGetOriginals(offsetsLists: any[], value: object): any[];
1924
+ setAtOffsetsAndGetOriginals(offsetsLists: number[][], value: RGB): any[];
1380
1925
  /**
1381
1926
  * Set the inner buffer values at given offsets.
1382
1927
  *
1383
- * @param {Array} offsetsLists List of offset lists where to set the data.
1928
+ * @param {number[][]} offsetsLists List of offset lists
1929
+ * where to set the data.
1384
1930
  * @param {object|Array} value The value to set at the given offsets.
1385
1931
  * @fires Image#imagechange
1386
1932
  */
1387
- setAtOffsetsWithIterator(offsetsLists: any[], value: object | any[]): void;
1933
+ setAtOffsetsWithIterator(offsetsLists: number[][], value: object | any[]): void;
1388
1934
  /**
1389
1935
  * Get the value of the image at a specific coordinate.
1390
1936
  *
@@ -1456,20 +2002,20 @@ declare class Image_2 {
1456
2002
  *
1457
2003
  * Note: Uses raw buffer values.
1458
2004
  *
1459
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2005
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1460
2006
  * @returns {Image} The convoluted image.
1461
2007
  */
1462
- convolute2D(weights: any[]): Image_2;
2008
+ convolute2D(weights: number[]): Image_2;
1463
2009
  /**
1464
2010
  * Convolute an image buffer with a given 2D kernel.
1465
2011
  *
1466
2012
  * Note: Uses raw buffer values.
1467
2013
  *
1468
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2014
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1469
2015
  * @param {TypedArray} buffer The buffer to convolute.
1470
2016
  * @param {number} startOffset The index to start at.
1471
2017
  */
1472
- convoluteBuffer(weights: any[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
2018
+ convoluteBuffer(weights: number[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
1473
2019
  /**
1474
2020
  * Transform an image using a specific operator.
1475
2021
  * WARNING: no size check!
@@ -1500,9 +2046,9 @@ export { Image_2 as Image }
1500
2046
  */
1501
2047
  export declare class Index {
1502
2048
  /**
1503
- * @param {Array} values The index values.
2049
+ * @param {number[]} values The index values.
1504
2050
  */
1505
- constructor(values: any[]);
2051
+ constructor(values: number[]);
1506
2052
  /**
1507
2053
  * Get the index value at the given array index.
1508
2054
  *
@@ -1525,9 +2071,9 @@ export declare class Index {
1525
2071
  /**
1526
2072
  * Get the values of this index.
1527
2073
  *
1528
- * @returns {Array} The array of values.
2074
+ * @returns {number[]} The array of values.
1529
2075
  */
1530
- getValues(): any[];
2076
+ getValues(): number[];
1531
2077
  /**
1532
2078
  * Check if the input index can be compared to this one.
1533
2079
  *
@@ -1546,9 +2092,9 @@ export declare class Index {
1546
2092
  * Compare indices and return different dimensions.
1547
2093
  *
1548
2094
  * @param {Index} rhs The index to compare to.
1549
- * @returns {Array} The list of different dimensions.
2095
+ * @returns {number[]} The list of different dimensions.
1550
2096
  */
1551
- compare(rhs: Index): any[];
2097
+ compare(rhs: Index): number[];
1552
2098
  /**
1553
2099
  * Add another index to this one.
1554
2100
  *
@@ -1567,13 +2113,22 @@ export declare class Index {
1567
2113
  /**
1568
2114
  * Get a string id from the index values in the form of: '#0-1_#1-2'.
1569
2115
  *
1570
- * @param {Array} [dims] Optional list of dimensions to use.
2116
+ * @param {number[]} [dims] Optional list of dimensions to use.
1571
2117
  * @returns {string} The string id.
1572
2118
  */
1573
- toStringId(dims?: any[]): string;
2119
+ toStringId(dims?: number[]): string;
1574
2120
  #private;
1575
2121
  }
1576
2122
 
2123
+ /**
2124
+ * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
2125
+ * unsigned int CIE LAB ([0, 65535]).
2126
+ *
2127
+ * @param {object} triplet CIE XYZ triplet as {x,y,z} with CIE LAB range.
2128
+ * @returns {object} CIE LAB triplet as {l,a,b} with unsigned range.
2129
+ */
2130
+ export declare function labToUintLab(triplet: object): object;
2131
+
1577
2132
  /**
1578
2133
  * Layer group.
1579
2134
  *
@@ -1595,18 +2150,6 @@ export declare class LayerGroup {
1595
2150
  * @param {HTMLElement} containerDiv The associated HTML div.
1596
2151
  */
1597
2152
  constructor(containerDiv: HTMLElement);
1598
- /**
1599
- * Get the target orientation.
1600
- *
1601
- * @returns {Matrix33} The orientation matrix.
1602
- */
1603
- getTargetOrientation(): Matrix33;
1604
- /**
1605
- * Set the target orientation.
1606
- *
1607
- * @param {Matrix33} orientation The orientation matrix.
1608
- */
1609
- setTargetOrientation(orientation: Matrix33): void;
1610
2153
  /**
1611
2154
  * Get the showCrosshair flag.
1612
2155
  *
@@ -1619,6 +2162,12 @@ export declare class LayerGroup {
1619
2162
  * @param {boolean} flag True to display the crosshair.
1620
2163
  */
1621
2164
  setShowCrosshair(flag: boolean): void;
2165
+ /**
2166
+ * Set the imageSmoothing flag value.
2167
+ *
2168
+ * @param {boolean} flag True to enable smoothing.
2169
+ */
2170
+ setImageSmoothing(flag: boolean): void;
1622
2171
  /**
1623
2172
  * Get the Id of the container div.
1624
2173
  *
@@ -1655,19 +2204,25 @@ export declare class LayerGroup {
1655
2204
  * @returns {number} The number of layers.
1656
2205
  */
1657
2206
  getNumberOfLayers(): number;
2207
+ /**
2208
+ * Get the number of view layers handled by this class.
2209
+ *
2210
+ * @returns {number} The number of layers.
2211
+ */
2212
+ getNumberOfViewLayers(): number;
1658
2213
  /**
1659
2214
  * Get the active image layer.
1660
2215
  *
1661
- * @returns {ViewLayer} The layer.
2216
+ * @returns {ViewLayer|undefined} The layer.
1662
2217
  */
1663
- getActiveViewLayer(): ViewLayer;
2218
+ getActiveViewLayer(): ViewLayer | undefined;
1664
2219
  /**
1665
- * Get the view layers associated to a data index.
2220
+ * Get the view layers associated to a data id.
1666
2221
  *
1667
- * @param {number} index The data index.
2222
+ * @param {string} dataId The data id.
1668
2223
  * @returns {ViewLayer[]} The layers.
1669
2224
  */
1670
- getViewLayersByDataIndex(index: number): ViewLayer[];
2225
+ getViewLayersByDataId(dataId: string): ViewLayer[];
1671
2226
  /**
1672
2227
  * Search view layers for equal imae meta data.
1673
2228
  *
@@ -1678,22 +2233,22 @@ export declare class LayerGroup {
1678
2233
  /**
1679
2234
  * Get the view layers data indices.
1680
2235
  *
1681
- * @returns {Array} The list of indices.
2236
+ * @returns {string[]} The list of indices.
1682
2237
  */
1683
- getViewDataIndices(): any[];
2238
+ getViewDataIndices(): string[];
1684
2239
  /**
1685
2240
  * Get the active draw layer.
1686
2241
  *
1687
- * @returns {DrawLayer} The layer.
2242
+ * @returns {DrawLayer|undefined} The layer.
1688
2243
  */
1689
- getActiveDrawLayer(): DrawLayer;
2244
+ getActiveDrawLayer(): DrawLayer | undefined;
1690
2245
  /**
1691
- * Get the draw layers associated to a data index.
2246
+ * Get the draw layers associated to a data id.
1692
2247
  *
1693
- * @param {number} index The data index.
2248
+ * @param {string} dataId The data id.
1694
2249
  * @returns {DrawLayer[]} The layers.
1695
2250
  */
1696
- getDrawLayersByDataIndex(index: number): DrawLayer[];
2251
+ getDrawLayersByDataId(dataId: string): DrawLayer[];
1697
2252
  /**
1698
2253
  * Set the active view layer.
1699
2254
  *
@@ -1701,11 +2256,11 @@ export declare class LayerGroup {
1701
2256
  */
1702
2257
  setActiveViewLayer(index: number): void;
1703
2258
  /**
1704
- * Set the active view layer with a data index.
2259
+ * Set the active view layer with a data id.
1705
2260
  *
1706
- * @param {number} index The data index.
2261
+ * @param {string} dataId The data id.
1707
2262
  */
1708
- setActiveViewLayerByDataIndex(index: number): void;
2263
+ setActiveViewLayerByDataId(dataId: string): void;
1709
2264
  /**
1710
2265
  * Set the active draw layer.
1711
2266
  *
@@ -1713,11 +2268,11 @@ export declare class LayerGroup {
1713
2268
  */
1714
2269
  setActiveDrawLayer(index: number): void;
1715
2270
  /**
1716
- * Set the active draw layer with a data index.
2271
+ * Set the active draw layer with a data id.
1717
2272
  *
1718
- * @param {number} index The data index.
2273
+ * @param {string} dataId The data id.
1719
2274
  */
1720
- setActiveDrawLayerByDataIndex(index: number): void;
2275
+ setActiveDrawLayerByDataId(dataId: string): void;
1721
2276
  /**
1722
2277
  * Add a view layer.
1723
2278
  *
@@ -1736,6 +2291,9 @@ export declare class LayerGroup {
1736
2291
  empty(): void;
1737
2292
  /**
1738
2293
  * Remove a layer from this layer group.
2294
+ * Warning: if current active layer, the index will
2295
+ * be set to `undefined`. Call one of the setActive
2296
+ * methods to define the active index.
1739
2297
  *
1740
2298
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
1741
2299
  */
@@ -1744,6 +2302,7 @@ export declare class LayerGroup {
1744
2302
  * Update layers (but not the active view layer) to a position change.
1745
2303
  *
1746
2304
  * @param {object} event The position change event.
2305
+ * @function
1747
2306
  */
1748
2307
  updateLayersToPositionChange: (event: object) => void;
1749
2308
  /**
@@ -1814,18 +2373,18 @@ export declare class LayerGroup {
1814
2373
  * Add an event listener to this class.
1815
2374
  *
1816
2375
  * @param {string} type The event type.
1817
- * @param {object} callback The method associated with the provided
2376
+ * @param {Function} callback The function associated with the provided
1818
2377
  * event type, will be called with the fired event.
1819
2378
  */
1820
- addEventListener(type: string, callback: object): void;
2379
+ addEventListener(type: string, callback: Function): void;
1821
2380
  /**
1822
2381
  * Remove an event listener from this class.
1823
2382
  *
1824
2383
  * @param {string} type The event type.
1825
- * @param {object} callback The method associated with the provided
2384
+ * @param {Function} callback The function associated with the provided
1826
2385
  * event type.
1827
2386
  */
1828
- removeEventListener(type: string, callback: object): void;
2387
+ removeEventListener(type: string, callback: Function): void;
1829
2388
  #private;
1830
2389
  }
1831
2390
 
@@ -1845,35 +2404,227 @@ export declare namespace logger {
1845
2404
  export function error(msg: string): void;
1846
2405
  }
1847
2406
 
1848
- /**
1849
- * List of available lookup tables (lut).
1850
- *
1851
- * @type {Object<string, {red: number[], green: number[], blue: number[]}>}
1852
- */
1853
- export declare const lut: {
1854
- [x: string]: {
1855
- red: number[];
1856
- green: number[];
1857
- blue: number[];
1858
- };
1859
- };
1860
-
2407
+ /**
2408
+ * List of available lookup tables (lut).
2409
+ *
2410
+ * @type {Object<string, ColourMap>}
2411
+ */
2412
+ export declare const luts: {
2413
+ [x: string]: ColourMap;
2414
+ };
2415
+
2416
+ /**
2417
+ * Mask {@link Image} factory.
2418
+ */
2419
+ export declare class MaskFactory {
2420
+ /**
2421
+ * Check dicom elements. Throws an error if not suitable.
2422
+ *
2423
+ * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
2424
+ * @returns {object|undefined} A possible warning.
2425
+ */
2426
+ checkElements(_dicomElements: {
2427
+ [x: string]: DataElement;
2428
+ }): object | undefined;
2429
+ /**
2430
+ * Get an {@link Image} object from the read DICOM file.
2431
+ *
2432
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
2433
+ * @param {Uint8Array | Int8Array |
2434
+ * Uint16Array | Int16Array |
2435
+ * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
2436
+ * @returns {Image} A new Image.
2437
+ */
2438
+ create(dataElements: {
2439
+ [x: string]: DataElement;
2440
+ }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
2441
+ }
2442
+
2443
+ /**
2444
+ * DICOM (mask) segment.
2445
+ */
2446
+ export declare class MaskSegment {
2447
+ /**
2448
+ * @param {number} number The segment number.
2449
+ * @param {string} label The segment label.
2450
+ * @param {string} algorithmType The segment number.
2451
+ */
2452
+ constructor(number: number, label: string, algorithmType: string);
2453
+ /**
2454
+ * Segment number (0062,0004).
2455
+ *
2456
+ * @type {number}
2457
+ */
2458
+ number: number;
2459
+ /**
2460
+ * Segment label (0062,0005).
2461
+ *
2462
+ * @type {string}
2463
+ */
2464
+ label: string;
2465
+ /**
2466
+ * Segment algorithm type (0062,0008).
2467
+ *
2468
+ * @type {string}
2469
+ */
2470
+ algorithmType: string;
2471
+ /**
2472
+ * Segment algorithm name (0062,0009).
2473
+ *
2474
+ * @type {string|undefined}
2475
+ */
2476
+ algorithmName: string | undefined;
2477
+ /**
2478
+ * Segment display value as simple value.
2479
+ *
2480
+ * @type {number|undefined}
2481
+ */
2482
+ displayValue: number | undefined;
2483
+ /**
2484
+ * Segment display value as RGB colour ({r,g,b}).
2485
+ *
2486
+ * @type {RGB|undefined}
2487
+ */
2488
+ displayRGBValue: RGB | undefined;
2489
+ /**
2490
+ * Segment property code: specific property
2491
+ * the segment represents (0062,000F).
2492
+ *
2493
+ * @type {DicomCode|undefined}
2494
+ */
2495
+ propertyTypeCode: DicomCode | undefined;
2496
+ /**
2497
+ * Segment property category code: general category
2498
+ * of the property the segment represents (0062,0003).
2499
+ *
2500
+ * @type {DicomCode|undefined}
2501
+ */
2502
+ propertyCategoryCode: DicomCode | undefined;
2503
+ /**
2504
+ * Segment tracking UID (0062,0021).
2505
+ *
2506
+ * @type {string|undefined}
2507
+ */
2508
+ trackingUid: string | undefined;
2509
+ /**
2510
+ * Segment tracking id: text label for the UID (0062,0020).
2511
+ *
2512
+ * @type {string|undefined}
2513
+ */
2514
+ trackingId: string | undefined;
2515
+ }
2516
+
2517
+ /**
2518
+ * Mask segment helper.
2519
+ */
2520
+ export declare class MaskSegmentHelper {
2521
+ /**
2522
+ * @param {Image} mask The associated mask image.
2523
+ */
2524
+ constructor(mask: Image_2);
2525
+ /**
2526
+ * Check if a segment is part of the inner segment list.
2527
+ *
2528
+ * @param {number} segmentNumber The segment number.
2529
+ * @returns {boolean} True if the segment is included.
2530
+ */
2531
+ hasSegment(segmentNumber: number): boolean;
2532
+ /**
2533
+ * Check if a segment is present in a mask image.
2534
+ *
2535
+ * @param {number[]} numbers Array of segment numbers.
2536
+ * @returns {boolean[]} Array of boolean set to true
2537
+ * if the segment is present in the mask.
2538
+ */
2539
+ maskHasSegments(numbers: number[]): boolean[];
2540
+ /**
2541
+ * Get a segment from the inner segment list.
2542
+ *
2543
+ * @param {number} segmentNumber The segment number.
2544
+ * @returns {MaskSegment|undefined} The segment.
2545
+ */
2546
+ getSegment(segmentNumber: number): MaskSegment | undefined;
2547
+ /**
2548
+ * Get the inner segment list.
2549
+ *
2550
+ * @returns {MaskSegment[]} The list of segments.
2551
+ */
2552
+ getSegments(): MaskSegment[];
2553
+ /**
2554
+ * Set the inner segment list.
2555
+ *
2556
+ * @param {MaskSegment[]} list The segment list.
2557
+ */
2558
+ setSegments(list: MaskSegment[]): void;
2559
+ /**
2560
+ * Set the hidden segment list.
2561
+ * TODO: not sure if needed...
2562
+ *
2563
+ * @param {number[]} list The list of hidden segment numbers.
2564
+ */
2565
+ setHiddenSegments(list: number[]): void;
2566
+ /**
2567
+ * Check if a segment is in the hidden list.
2568
+ *
2569
+ * @param {number} segmentNumber The segment number.
2570
+ * @returns {boolean} True if the segment is in the list.
2571
+ */
2572
+ isHidden(segmentNumber: number): boolean;
2573
+ /**
2574
+ * Add a segment to the hidden list.
2575
+ *
2576
+ * @param {number} segmentNumber The segment number.
2577
+ */
2578
+ addToHidden(segmentNumber: number): void;
2579
+ /**
2580
+ * Remove a segment from the hidden list.
2581
+ *
2582
+ * @param {number} segmentNumber The segment number.
2583
+ */
2584
+ removeFromHidden(segmentNumber: number): void;
2585
+ /**
2586
+ * @callback alphaFn@callback alphaFn
2587
+ * @param {number[]|number} value The pixel value.
2588
+ * @param {number} index The values' index.
2589
+ * @returns {number} The opacity of the input value.
2590
+ */
2591
+ /**
2592
+ * Get the alpha function to apply hidden colors.
2593
+ *
2594
+ * @returns {alphaFn} The corresponding alpha function.
2595
+ */
2596
+ getAlphaFunc(): (value: number[] | number, index: number) => number;
2597
+ /**
2598
+ * @callback eventFn@callback eventFn
2599
+ * @param {object} event The event.
2600
+ */
2601
+ /**
2602
+ * Delete a segment.
2603
+ *
2604
+ * @param {number} segmentNumber The segment number.
2605
+ * @param {eventFn} cmdCallback The command event callback.
2606
+ * @param {Function} exeCallback The post execution callback.
2607
+ */
2608
+ deleteSegment(segmentNumber: number, cmdCallback: (event: object) => any, exeCallback: Function): void;
2609
+ #private;
2610
+ }
2611
+
1861
2612
  /**
1862
2613
  * Immutable 3x3 Matrix.
1863
2614
  */
1864
2615
  export declare class Matrix33 {
1865
2616
  /**
1866
- * @param {Array} values row-major ordered 9 values.
2617
+ * @param {number[]} values row-major ordered 9 values.
1867
2618
  */
1868
- constructor(values: any[]);
2619
+ constructor(values: number[]);
1869
2620
  /**
1870
2621
  * Get a value of the matrix.
1871
2622
  *
1872
2623
  * @param {number} row The row at wich to get the value.
1873
2624
  * @param {number} col The column at wich to get the value.
1874
- * @returns {number} The value at the position.
2625
+ * @returns {number|undefined} The value at the position.
1875
2626
  */
1876
- get(row: number, col: number): number;
2627
+ get(row: number, col: number): number | undefined;
1877
2628
  /**
1878
2629
  * Get the inverse of this matrix.
1879
2630
  *
@@ -1912,10 +2663,10 @@ export declare class Matrix33 {
1912
2663
  /**
1913
2664
  * Multiply this matrix by a 3D array.
1914
2665
  *
1915
- * @param {Array} array3D The input 3D array.
1916
- * @returns {Array} The result 3D array.
2666
+ * @param {number[]} array3D The input 3D array.
2667
+ * @returns {number[]} The result 3D array.
1917
2668
  */
1918
- multiplyArray3D(array3D: any[]): any[];
2669
+ multiplyArray3D(array3D: number[]): number[];
1919
2670
  /**
1920
2671
  * Multiply this matrix by a 3D vector.
1921
2672
  *
@@ -1972,10 +2723,10 @@ export declare class Matrix33 {
1972
2723
  export declare class OverlayData {
1973
2724
  /**
1974
2725
  * @param {App} app The associated application.
1975
- * @param {number} dataId The associated data ID.
2726
+ * @param {string} dataId The associated data id.
1976
2727
  * @param {object} configs The overlay config.
1977
2728
  */
1978
- constructor(app: App, dataId: number, configs: object);
2729
+ constructor(app: App, dataId: string, configs: object);
1979
2730
  /**
1980
2731
  * Reset the data.
1981
2732
  */
@@ -2019,6 +2770,101 @@ export declare class OverlayData {
2019
2770
  #private;
2020
2771
  }
2021
2772
 
2773
+ /**
2774
+ * Plane geometry helper.
2775
+ */
2776
+ export declare class PlaneHelper {
2777
+ /**
2778
+ * @param {Spacing} spacing The spacing.
2779
+ * @param {Matrix33} imageOrientation The image oientation.
2780
+ * @param {Matrix33} viewOrientation The view orientation.
2781
+ */
2782
+ constructor(spacing: Spacing, imageOrientation: Matrix33, viewOrientation: Matrix33);
2783
+ /**
2784
+ * Get a 3D offset from a plane one.
2785
+ *
2786
+ * @param {object} offset2D The plane offset as {x,y}.
2787
+ * @returns {Vector3D} The 3D world offset.
2788
+ */
2789
+ getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
2790
+ /**
2791
+ * Get a plane offset from a 3D one.
2792
+ *
2793
+ * @param {object} offset3D The 3D offset as {x,y,z}.
2794
+ * @returns {object} The plane offset as {x,y}.
2795
+ */
2796
+ getPlaneOffsetFromOffset3D(offset3D: object): object;
2797
+ /**
2798
+ * Orient an input vector from real to target space.
2799
+ *
2800
+ * @param {Vector3D} vector The input vector.
2801
+ * @returns {Vector3D} The oriented vector.
2802
+ */
2803
+ getTargetOrientedVector3D(vector: Vector3D): Vector3D;
2804
+ /**
2805
+ * De-orient an input vector from target to real space.
2806
+ *
2807
+ * @param {Vector3D} planeVector The input vector.
2808
+ * @returns {Vector3D} The de-orienteded vector.
2809
+ */
2810
+ getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D;
2811
+ /**
2812
+ * De-orient an input point from target to real space.
2813
+ *
2814
+ * @param {Point3D} planePoint The input point.
2815
+ * @returns {Point3D} The de-orienteded point.
2816
+ */
2817
+ getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D;
2818
+ /**
2819
+ * Orient an input vector from target to image space.
2820
+ *
2821
+ * @param {Vector3D} planeVector The input vector.
2822
+ * @returns {Vector3D} The orienteded vector.
2823
+ */
2824
+ getImageOrientedVector3D(planeVector: Vector3D): Vector3D;
2825
+ /**
2826
+ * Orient an input point from target to image space.
2827
+ *
2828
+ * @param {Point3D} planePoint The input vector.
2829
+ * @returns {Point3D} The orienteded vector.
2830
+ */
2831
+ getImageOrientedPoint3D(planePoint: Point3D): Point3D;
2832
+ /**
2833
+ * De-orient an input vector from image to target space.
2834
+ *
2835
+ * @param {Vector3D} vector The input vector.
2836
+ * @returns {Vector3D} The de-orienteded vector.
2837
+ */
2838
+ getImageDeOrientedVector3D(vector: Vector3D): Vector3D;
2839
+ /**
2840
+ * De-orient an input point from image to target space.
2841
+ *
2842
+ * @param {Point3D} point The input point.
2843
+ * @returns {Point3D} The de-orienteded point.
2844
+ */
2845
+ getImageDeOrientedPoint3D(point: Point3D): Point3D;
2846
+ /**
2847
+ * Reorder values to follow target orientation.
2848
+ *
2849
+ * @param {object} values Values as {x,y,z}.
2850
+ * @returns {object} Reoriented values as {x,y,z}.
2851
+ */
2852
+ getTargetOrientedPositiveXYZ(values: object): object;
2853
+ /**
2854
+ * Get the (view) scroll dimension index.
2855
+ *
2856
+ * @returns {number} The index.
2857
+ */
2858
+ getScrollIndex(): number;
2859
+ /**
2860
+ * Get the native (image) scroll dimension index.
2861
+ *
2862
+ * @returns {number} The index.
2863
+ */
2864
+ getNativeScrollIndex(): number;
2865
+ #private;
2866
+ }
2867
+
2022
2868
  /**
2023
2869
  * Immutable point.
2024
2870
  * Warning: the input array is NOT cloned, modifying it will
@@ -2026,9 +2872,9 @@ export declare class OverlayData {
2026
2872
  */
2027
2873
  export declare class Point {
2028
2874
  /**
2029
- * @param {Array} values The point values.
2875
+ * @param {number[]} values The point values.
2030
2876
  */
2031
- constructor(values: any[]);
2877
+ constructor(values: number[]);
2032
2878
  /**
2033
2879
  * Get the index value at the given array index.
2034
2880
  *
@@ -2051,9 +2897,9 @@ export declare class Point {
2051
2897
  /**
2052
2898
  * Get the values of this index.
2053
2899
  *
2054
- * @returns {Array} The array of values.
2900
+ * @returns {number[]} The array of values.
2055
2901
  */
2056
- getValues(): any[];
2902
+ getValues(): number[];
2057
2903
  /**
2058
2904
  * Check if the input point can be compared to this one.
2059
2905
  *
@@ -2072,9 +2918,9 @@ export declare class Point {
2072
2918
  * Compare points and return different dimensions.
2073
2919
  *
2074
2920
  * @param {Point} rhs The point to compare to.
2075
- * @returns {Array} The list of different dimensions.
2921
+ * @returns {number[]} The list of different dimensions.
2076
2922
  */
2077
- compare(rhs: Point): any[];
2923
+ compare(rhs: Point): number[];
2078
2924
  /**
2079
2925
  * Get the 3D part of this point.
2080
2926
  *
@@ -2132,19 +2978,6 @@ export declare class Point2D {
2132
2978
  * @returns {string} The point as a string.
2133
2979
  */
2134
2980
  toString(): string;
2135
- /**
2136
- * Get the distance to another Point2D.
2137
- *
2138
- * @param {Point2D} point2D The input point.
2139
- * @returns {number} The distance to the input point.
2140
- */
2141
- getDistance(point2D: Point2D): number;
2142
- /**
2143
- * Round a Point2D.
2144
- *
2145
- * @returns {Point2D} The rounded point.
2146
- */
2147
- getRound(): Point2D;
2148
2981
  #private;
2149
2982
  }
2150
2983
 
@@ -2228,39 +3061,6 @@ export declare class Point3D {
2228
3061
  */
2229
3062
  export declare function precisionRound(number: number, precision: number): number;
2230
3063
 
2231
- /**
2232
- * Rescale LUT class.
2233
- * Typically converts from integer to float.
2234
- */
2235
- export declare class RescaleLut {
2236
- /**
2237
- * @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
2238
- * @param {number} bitsStored The number of bits used to store the data.
2239
- */
2240
- constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
2241
- /**
2242
- * Get the Rescale Slope and Intercept (RSI).
2243
- *
2244
- * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
2245
- */
2246
- getRSI(): RescaleSlopeAndIntercept;
2247
- /**
2248
- * Get the length of the LUT array.
2249
- *
2250
- * @returns {number} The length of the LUT array.
2251
- */
2252
- getLength(): number;
2253
- /**
2254
- * Get the value of the LUT at the given offset.
2255
- *
2256
- * @param {number} offset The input offset in [0,2^bitsStored] range
2257
- * or full range for ID rescale.
2258
- * @returns {number} The float32 value of the LUT at the given offset.
2259
- */
2260
- getValue(offset: number): number;
2261
- #private;
2262
- }
2263
-
2264
3064
  /**
2265
3065
  * Rescale Slope and Intercept
2266
3066
  */
@@ -2305,6 +3105,36 @@ export declare class RescaleSlopeAndIntercept {
2305
3105
  #private;
2306
3106
  }
2307
3107
 
3108
+ /**
3109
+ * RGB colour class.
3110
+ */
3111
+ export declare class RGB {
3112
+ /**
3113
+ * @param {number} r Red component.
3114
+ * @param {number} g Green component.
3115
+ * @param {number} b Blue component.
3116
+ */
3117
+ constructor(r: number, g: number, b: number);
3118
+ /**
3119
+ * Red component.
3120
+ *
3121
+ * @type {number}
3122
+ */
3123
+ r: number;
3124
+ /**
3125
+ * Green component.
3126
+ *
3127
+ * @type {number}
3128
+ */
3129
+ g: number;
3130
+ /**
3131
+ * Blue component.
3132
+ *
3133
+ * @type {number}
3134
+ */
3135
+ b: number;
3136
+ }
3137
+
2308
3138
  /**
2309
3139
  * Immutable Size class.
2310
3140
  * Warning: the input array is NOT cloned, modifying it will
@@ -2312,9 +3142,9 @@ export declare class RescaleSlopeAndIntercept {
2312
3142
  */
2313
3143
  export declare class Size {
2314
3144
  /**
2315
- * @param {Array} values The size values.
3145
+ * @param {number[]} values The size values.
2316
3146
  */
2317
- constructor(values: any[]);
3147
+ constructor(values: number[]);
2318
3148
  /**
2319
3149
  * Get the size value at the given array index.
2320
3150
  *
@@ -2337,9 +3167,9 @@ export declare class Size {
2337
3167
  /**
2338
3168
  * Get the values of this index.
2339
3169
  *
2340
- * @returns {Array} The array of values.
3170
+ * @returns {number[]} The array of values.
2341
3171
  */
2342
- getValues(): any[];
3172
+ getValues(): number[];
2343
3173
  /**
2344
3174
  * Check if a dimension exists and has more than one element.
2345
3175
  *
@@ -2388,10 +3218,10 @@ export declare class Size {
2388
3218
  * Check that an index is within bounds.
2389
3219
  *
2390
3220
  * @param {Index} index The index to check.
2391
- * @param {Array} dirs Optional list of directions to check.
3221
+ * @param {number[]} dirs Optional list of directions to check.
2392
3222
  * @returns {boolean} True if the given coordinates are within bounds.
2393
3223
  */
2394
- isInBounds(index: Index, dirs: any[]): boolean;
3224
+ isInBounds(index: Index, dirs: number[]): boolean;
2395
3225
  /**
2396
3226
  * Convert an index to an offset in memory.
2397
3227
  *
@@ -2423,9 +3253,9 @@ export declare class Size {
2423
3253
  */
2424
3254
  export declare class Spacing {
2425
3255
  /**
2426
- * @param {Array} values The spacing values.
3256
+ * @param {number[]} values The spacing values.
2427
3257
  */
2428
- constructor(values: any[]);
3258
+ constructor(values: number[]);
2429
3259
  /**
2430
3260
  * Get the spacing value at the given array index.
2431
3261
  *
@@ -2448,9 +3278,9 @@ export declare class Spacing {
2448
3278
  /**
2449
3279
  * Get the values of this spacing.
2450
3280
  *
2451
- * @returns {Array} The array of values.
3281
+ * @returns {number[]} The array of values.
2452
3282
  */
2453
- getValues(): any[];
3283
+ getValues(): number[];
2454
3284
  /**
2455
3285
  * Check for equality.
2456
3286
  *
@@ -2467,6 +3297,14 @@ export declare class Spacing {
2467
3297
  #private;
2468
3298
  }
2469
3299
 
3300
+ /**
3301
+ * Convert sRGB to CIE LAB (standard illuminant D65).
3302
+ *
3303
+ * @param {RGB} triplet sRGB triplet as {r,g,b}.
3304
+ * @returns {object} CIE LAB triplet as {l,a,b}.
3305
+ */
3306
+ export declare function srgbToCielab(triplet: RGB): object;
3307
+
2470
3308
  /**
2471
3309
  * Immutable tag.
2472
3310
  */
@@ -2559,12 +3397,103 @@ export declare class TagValueExtractor {
2559
3397
  /**
2560
3398
  * Get the time.
2561
3399
  *
2562
- * @param {object} _elements The DICOM elements.
3400
+ * @param {Object<string, DataElement>} _elements The DICOM elements.
2563
3401
  * @returns {number|undefined} The time value if available.
2564
3402
  */
2565
- getTime(_elements: object): number | undefined;
3403
+ getTime(_elements: {
3404
+ [x: string]: DataElement;
3405
+ }): number | undefined;
3406
+ }
3407
+
3408
+ /**
3409
+ * Toolbox controller.
3410
+ */
3411
+ export declare class ToolboxController {
3412
+ /**
3413
+ * @param {object} toolList The list of tool objects.
3414
+ */
3415
+ constructor(toolList: object);
3416
+ /**
3417
+ * Initialise.
3418
+ */
3419
+ init(): void;
3420
+ /**
3421
+ * Get the tool list.
3422
+ *
3423
+ * @returns {Array} The list of tool objects.
3424
+ */
3425
+ getToolList(): any[];
3426
+ /**
3427
+ * Check if a tool is in the tool list.
3428
+ *
3429
+ * @param {string} name The name to check.
3430
+ * @returns {boolean} The tool list element for the given name.
3431
+ */
3432
+ hasTool(name: string): boolean;
3433
+ /**
3434
+ * Get the selected tool.
3435
+ *
3436
+ * @returns {object} The selected tool.
3437
+ */
3438
+ getSelectedTool(): object;
3439
+ /**
3440
+ * Get the selected tool event handler.
3441
+ *
3442
+ * @param {string} eventType The event type, for example
3443
+ * mousedown, touchstart...
3444
+ * @returns {Function} The event handler.
3445
+ */
3446
+ getSelectedToolEventHandler(eventType: string): Function;
3447
+ /**
3448
+ * Set the selected tool.
3449
+ *
3450
+ * @param {string} name The name of the tool.
3451
+ */
3452
+ setSelectedTool(name: string): void;
3453
+ /**
3454
+ * Set the selected tool live features.
3455
+ *
3456
+ * @param {object} list The list of features.
3457
+ */
3458
+ setToolFeatures(list: object): void;
3459
+ /**
3460
+ * Listen to layer interaction events.
3461
+ *
3462
+ * @param {LayerGroup} layerGroup The associated layer group.
3463
+ * @param {ViewLayer|DrawLayer} layer The layer to listen to.
3464
+ */
3465
+ bindLayerGroup(layerGroup: LayerGroup, layer: ViewLayer | DrawLayer): void;
3466
+ #private;
3467
+ }
3468
+
3469
+ /**
3470
+ * Tool configuration.
3471
+ */
3472
+ export declare class ToolConfig {
3473
+ /**
3474
+ * @param {string[]} [options] Optional tool options.
3475
+ */
3476
+ constructor(options?: string[]);
3477
+ /**
3478
+ * Optional tool options.
3479
+ * For Draw: list of shape names.
3480
+ * For Filter: list of filter names.
3481
+ *
3482
+ * @type {string[]|undefined}
3483
+ */
3484
+ options: string[] | undefined;
2566
3485
  }
2567
3486
 
3487
+ /**
3488
+ * List of client provided tools to be added to
3489
+ * the default ones.
3490
+ *
3491
+ * @type {Object<string, any>}
3492
+ */
3493
+ export declare const toolList: {
3494
+ [x: string]: any;
3495
+ };
3496
+
2568
3497
  /**
2569
3498
  * Immutable 3D vector.
2570
3499
  */
@@ -2596,10 +3525,10 @@ export declare class Vector3D {
2596
3525
  /**
2597
3526
  * Check for Vector3D equality.
2598
3527
  *
2599
- * @param {object} rhs The other vector to compare to.
3528
+ * @param {Vector3D} rhs The other vector to compare to.
2600
3529
  * @returns {boolean} True if both vectors are equal.
2601
3530
  */
2602
- equals(rhs: object): boolean;
3531
+ equals(rhs: Vector3D): boolean;
2603
3532
  /**
2604
3533
  * Get a string representation of the Vector3D.
2605
3534
  *
@@ -2646,9 +3575,9 @@ export declare class Vector3D {
2646
3575
  * const dicomParser = new dwv.DicomParser();
2647
3576
  * dicomParser.parse(event.target.response);
2648
3577
  * // create the image object
2649
- * const image = createImage(dicomParser.getDicomElements());
3578
+ * const image = dwv.createImage(dicomParser.getDicomElements());
2650
3579
  * // create the view
2651
- * const view = createView(dicomParser.getDicomElements(), image);
3580
+ * const view = dwv.createView(dicomParser.getDicomElements(), image);
2652
3581
  * // setup canvas
2653
3582
  * const canvas = document.createElement('canvas');
2654
3583
  * canvas.width = 256;
@@ -2716,31 +3645,23 @@ export declare class View {
2716
3645
  getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
2717
3646
  /**
2718
3647
  * @callback alphaFn@callback alphaFn
2719
- * @param {object} value The pixel value.
2720
- * @param {object} index The values' index.
2721
- * @returns {number} The value to display.
3648
+ * @param {number[]|number} value The pixel value.
3649
+ * @param {number} index The values' index.
3650
+ * @returns {number} The opacity of the input value.
2722
3651
  */
2723
3652
  /**
2724
3653
  * Get the alpha function.
2725
3654
  *
2726
3655
  * @returns {alphaFn} The function.
2727
3656
  */
2728
- getAlphaFunction(): (value: object, index: object) => number;
3657
+ getAlphaFunction(): (value: number[] | number, index: number) => number;
2729
3658
  /**
2730
3659
  * Set alpha function.
2731
3660
  *
2732
3661
  * @param {alphaFn} func The function.
2733
3662
  * @fires View#alphafuncchange
2734
3663
  */
2735
- setAlphaFunction(func: (value: object, index: object) => number): void;
2736
- /**
2737
- * Get the window LUT of the image.
2738
- * Warning: can be undefined in no window/level was set.
2739
- *
2740
- * @returns {WindowLut} The window LUT of the image.
2741
- * @fires View#wlchange
2742
- */
2743
- getCurrentWindowLut(): WindowLut;
3664
+ setAlphaFunction(func: (value: number[] | number, index: number) => number): void;
2744
3665
  /**
2745
3666
  * Get the window presets.
2746
3667
  *
@@ -2750,21 +3671,15 @@ export declare class View {
2750
3671
  /**
2751
3672
  * Get the window presets names.
2752
3673
  *
2753
- * @returns {object} The list of window presets names.
3674
+ * @returns {string[]} The list of window presets names.
2754
3675
  */
2755
- getWindowPresetsNames(): object;
3676
+ getWindowPresetsNames(): string[];
2756
3677
  /**
2757
3678
  * Set the window presets.
2758
3679
  *
2759
3680
  * @param {object} presets The window presets.
2760
3681
  */
2761
3682
  setWindowPresets(presets: object): void;
2762
- /**
2763
- * Set the default colour map.
2764
- *
2765
- * @param {object} map The colour map.
2766
- */
2767
- setDefaultColourMap(map: object): void;
2768
3683
  /**
2769
3684
  * Add window presets to the existing ones.
2770
3685
  *
@@ -2780,16 +3695,16 @@ export declare class View {
2780
3695
  /**
2781
3696
  * Get the colour map of the image.
2782
3697
  *
2783
- * @returns {object} The colour map of the image.
3698
+ * @returns {string} The colour map name.
2784
3699
  */
2785
- getColourMap(): object;
3700
+ getColourMap(): string;
2786
3701
  /**
2787
3702
  * Set the colour map of the image.
2788
3703
  *
2789
- * @param {object} map The colour map of the image.
2790
- * @fires View#colourchange
3704
+ * @param {string} name The colour map name.
3705
+ * @fires View#colourmapchange
2791
3706
  */
2792
- setColourMap(map: object): void;
3707
+ setColourMap(name: string): void;
2793
3708
  /**
2794
3709
  * Get the current position.
2795
3710
  *
@@ -2810,12 +3725,12 @@ export declare class View {
2810
3725
  */
2811
3726
  canSetPosition(position: Point): boolean;
2812
3727
  /**
2813
- * Get the origin at a given position.
3728
+ * Get the first origin or at a given position.
2814
3729
  *
2815
- * @param {Point} position The position.
2816
- * @returns {Point} The origin.
3730
+ * @param {Point} [position] Optional position.
3731
+ * @returns {Point3D} The origin.
2817
3732
  */
2818
- getOrigin(position: Point): Point;
3733
+ getOrigin(position?: Point): Point3D;
2819
3734
  /**
2820
3735
  * Set the current position.
2821
3736
  *
@@ -2837,14 +3752,19 @@ export declare class View {
2837
3752
  /**
2838
3753
  * Set the view window/level.
2839
3754
  *
2840
- * @param {number} center The window center.
2841
- * @param {number} width The window width.
3755
+ * @param {WindowLevel} wl The window and level.
2842
3756
  * @param {string} [name] Associated preset name, defaults to 'manual'.
2843
3757
  * Warning: uses the latest set rescale LUT or the default linear one.
2844
3758
  * @param {boolean} [silent] Flag to launch events with skipGenerate.
2845
3759
  * @fires View#wlchange
2846
3760
  */
2847
- setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void;
3761
+ setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
3762
+ /**
3763
+ * Get the window/level.
3764
+ *
3765
+ * @returns {WindowLevel} The window and level.
3766
+ */
3767
+ getWindowLevel(): WindowLevel;
2848
3768
  /**
2849
3769
  * Set the window level to the preset with the input name.
2850
3770
  *
@@ -2863,25 +3783,25 @@ export declare class View {
2863
3783
  * Add an event listener to this class.
2864
3784
  *
2865
3785
  * @param {string} type The event type.
2866
- * @param {object} callback The method associated with the provided
3786
+ * @param {Function} callback The function associated with the provided
2867
3787
  * event type, will be called with the fired event.
2868
3788
  */
2869
- addEventListener(type: string, callback: object): void;
3789
+ addEventListener(type: string, callback: Function): void;
2870
3790
  /**
2871
3791
  * Remove an event listener from this class.
2872
3792
  *
2873
3793
  * @param {string} type The event type.
2874
- * @param {object} callback The method associated with the provided
3794
+ * @param {Function} callback The function associated with the provided
2875
3795
  * event type.
2876
3796
  */
2877
- removeEventListener(type: string, callback: object): void;
3797
+ removeEventListener(type: string, callback: Function): void;
2878
3798
  /**
2879
3799
  * Get the image window/level that covers the full data range.
2880
3800
  * Warning: uses the latest set rescale LUT or the default linear one.
2881
3801
  *
2882
- * @returns {WindowCenterAndWidth} A min/max window level.
3802
+ * @returns {WindowLevel} A min/max window level.
2883
3803
  */
2884
- getWindowLevelMinMax(): WindowCenterAndWidth;
3804
+ getWindowLevelMinMax(): WindowLevel;
2885
3805
  /**
2886
3806
  * Set the image window/level to cover the full data range.
2887
3807
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -2934,21 +3854,69 @@ export declare class View {
2934
3854
  #private;
2935
3855
  }
2936
3856
 
3857
+ /**
3858
+ * View configuration: mainly defines the ´divId´
3859
+ * of the associated HTML div.
3860
+ */
3861
+ export declare class ViewConfig {
3862
+ /**
3863
+ * @param {string} divId The associated HTML div id.
3864
+ */
3865
+ constructor(divId: string);
3866
+ /**
3867
+ * Associated HTML div id.
3868
+ *
3869
+ * @type {string}
3870
+ */
3871
+ divId: string;
3872
+ /**
3873
+ * Optional orientation of the data; 'axial', 'coronal' or 'sagittal'.
3874
+ * If undefined, will use the data aquisition plane.
3875
+ *
3876
+ * @type {string|undefined}
3877
+ */
3878
+ orientation: string | undefined;
3879
+ /**
3880
+ * Optional view colour map name.
3881
+ *
3882
+ * @type {string|undefined}
3883
+ */
3884
+ colourMap: string | undefined;
3885
+ /**
3886
+ * Optional layer opacity; in [0, 1] range.
3887
+ *
3888
+ * @type {number|undefined}
3889
+ */
3890
+ opacity: number | undefined;
3891
+ /**
3892
+ * Optional layer window center.
3893
+ *
3894
+ * @type {number|undefined}
3895
+ */
3896
+ windowCenter: number | undefined;
3897
+ /**
3898
+ * Optional layer window width.
3899
+ *
3900
+ * @type {number|undefined}
3901
+ */
3902
+ windowWidth: number | undefined;
3903
+ }
3904
+
2937
3905
  /**
2938
3906
  * View controller.
2939
3907
  */
2940
3908
  export declare class ViewController {
2941
3909
  /**
2942
3910
  * @param {View} view The associated view.
2943
- * @param {number} index The associated data index.
3911
+ * @param {string} dataId The associated data id.
2944
3912
  */
2945
- constructor(view: View, index: number);
3913
+ constructor(view: View, dataId: string);
2946
3914
  /**
2947
3915
  * Get the plane helper.
2948
3916
  *
2949
- * @returns {object} The helper.
3917
+ * @returns {PlaneHelper} The helper.
2950
3918
  */
2951
- getPlaneHelper(): object;
3919
+ getPlaneHelper(): PlaneHelper;
2952
3920
  /**
2953
3921
  * Check is the associated image is a mask.
2954
3922
  *
@@ -2958,9 +3926,9 @@ export declare class ViewController {
2958
3926
  /**
2959
3927
  * Get the mask segment helper.
2960
3928
  *
2961
- * @returns {object} The helper.
3929
+ * @returns {MaskSegmentHelper} The helper.
2962
3930
  */
2963
- getMaskSegmentHelper(): object;
3931
+ getMaskSegmentHelper(): MaskSegmentHelper;
2964
3932
  /**
2965
3933
  * Apply the hidden segments list by setting
2966
3934
  * the corresponding alpha function.
@@ -2986,9 +3954,9 @@ export declare class ViewController {
2986
3954
  /**
2987
3955
  * Get the window/level presets names.
2988
3956
  *
2989
- * @returns {Array} The presets names.
3957
+ * @returns {string[]} The presets names.
2990
3958
  */
2991
- getWindowLevelPresetsNames(): any[];
3959
+ getWindowLevelPresetsNames(): string[];
2992
3960
  /**
2993
3961
  * Add window/level presets to the view.
2994
3962
  *
@@ -3045,12 +4013,12 @@ export declare class ViewController {
3045
4013
  */
3046
4014
  getCurrentScrollIndexValue(): object;
3047
4015
  /**
3048
- * Get the origin at a given posittion.
4016
+ * Get the first origin or at a given position.
3049
4017
  *
3050
- * @param {Point} position The input position.
3051
- * @returns {Point} The origin.
4018
+ * @param {Point} [position] Opitonal position.
4019
+ * @returns {Point3D} The origin.
3052
4020
  */
3053
- getOrigin(position: Point): Point;
4021
+ getOrigin(position?: Point): Point3D;
3054
4022
  /**
3055
4023
  * Get the current scroll position value.
3056
4024
  *
@@ -3061,23 +4029,23 @@ export declare class ViewController {
3061
4029
  * Generate display image data to be given to a canvas.
3062
4030
  *
3063
4031
  * @param {ImageData} array The array to fill in.
3064
- * @param {Index} index Optional index at which to generate,
4032
+ * @param {Index} [index] Optional index at which to generate,
3065
4033
  * otherwise generates at current index.
3066
4034
  */
3067
- generateImageData(array: ImageData, index: Index): void;
4035
+ generateImageData(array: ImageData, index?: Index): void;
3068
4036
  /**
3069
4037
  * Set the associated image.
3070
4038
  *
3071
4039
  * @param {Image} img The associated image.
3072
- * @param {number} index The data index of the image.
4040
+ * @param {string} dataId The data id of the image.
3073
4041
  */
3074
- setImage(img: Image_2, index: number): void;
4042
+ setImage(img: Image_2, dataId: string): void;
3075
4043
  /**
3076
- * Get the current spacing.
4044
+ * Get the current view (2D) spacing.
3077
4045
  *
3078
- * @returns {Array} The 2D spacing.
4046
+ * @returns {number[]} The spacing as a 2D array.
3079
4047
  */
3080
- get2DSpacing(): any[];
4048
+ get2DSpacing(): number[];
3081
4049
  /**
3082
4050
  * Get the image rescaled value at the input position.
3083
4051
  *
@@ -3117,8 +4085,15 @@ export declare class ViewController {
3117
4085
  * Can window and level be applied to the data?
3118
4086
  *
3119
4087
  * @returns {boolean} True if possible.
4088
+ * @deprecated Please use isMonochrome instead.
3120
4089
  */
3121
4090
  canWindowLevel(): boolean;
4091
+ /**
4092
+ * Is the data monochrome.
4093
+ *
4094
+ * @returns {boolean} True if the data is monochrome.
4095
+ */
4096
+ isMonochrome(): boolean;
3122
4097
  /**
3123
4098
  * Can the data be scrolled?
3124
4099
  *
@@ -3168,20 +4143,19 @@ export declare class ViewController {
3168
4143
  */
3169
4144
  setCurrentPosition(pos: Point, silent?: boolean): boolean;
3170
4145
  /**
3171
- * Get a position from a 2D (x,y) position.
4146
+ * Get a world position from a 2D plane position.
3172
4147
  *
3173
- * @param {number} x The column position.
3174
- * @param {number} y The row position.
4148
+ * @param {Point2D} point2D The input point.
3175
4149
  * @returns {Point} The associated position.
3176
4150
  */
3177
- getPositionFromPlanePoint(x: number, y: number): Point;
4151
+ getPositionFromPlanePoint(point2D: Point2D): Point;
3178
4152
  /**
3179
- * Get a 2D (x,y) position from a position.
4153
+ * Get a 2D plane position from a world position.
3180
4154
  *
3181
4155
  * @param {Point} point The 3D position.
3182
- * @returns {object} The 2D position.
4156
+ * @returns {Point2D} The 2D position.
3183
4157
  */
3184
- getPlanePositionFromPosition(point: Point): object;
4158
+ getPlanePositionFromPosition(point: Point): Point2D;
3185
4159
  /**
3186
4160
  * Set the current index.
3187
4161
  *
@@ -3194,10 +4168,10 @@ export declare class ViewController {
3194
4168
  * Get a plane 3D position from a plane 2D position: does not compensate
3195
4169
  * for the image origin. Needed for setting the scale center...
3196
4170
  *
3197
- * @param {object} point2D The 2D position as {x,y}.
4171
+ * @param {Point2D} point2D The 2D position.
3198
4172
  * @returns {Point3D} The 3D point.
3199
4173
  */
3200
- getPlanePositionFromPlanePoint(point2D: object): Point3D;
4174
+ getPlanePositionFromPlanePoint(point2D: Point2D): Point3D;
3201
4175
  /**
3202
4176
  * Get a 3D offset from a plane one.
3203
4177
  *
@@ -3246,9 +4220,9 @@ export declare class ViewController {
3246
4220
  /**
3247
4221
  * Get the window/level.
3248
4222
  *
3249
- * @returns {object} The window center and width.
4223
+ * @returns {WindowLevel} The window and level.
3250
4224
  */
3251
- getWindowLevel(): object;
4225
+ getWindowLevel(): WindowLevel;
3252
4226
  /**
3253
4227
  * Get the current window level preset name.
3254
4228
  *
@@ -3256,58 +4230,51 @@ export declare class ViewController {
3256
4230
  */
3257
4231
  getCurrentWindowPresetName(): string;
3258
4232
  /**
3259
- * Set the window/level.
4233
+ * Set the window and level.
3260
4234
  *
3261
- * @param {number} wc The window center.
3262
- * @param {number} ww The window width.
4235
+ * @param {WindowLevel} wl The window and level.
3263
4236
  */
3264
- setWindowLevel(wc: number, ww: number): void;
4237
+ setWindowLevel(wl: WindowLevel): void;
3265
4238
  /**
3266
4239
  * Get the colour map.
3267
4240
  *
3268
- * @returns {object} The colour map.
4241
+ * @returns {string} The colour map name.
3269
4242
  */
3270
- getColourMap(): object;
4243
+ getColourMap(): string;
3271
4244
  /**
3272
4245
  * Set the colour map.
3273
4246
  *
3274
- * @param {object} colourMap The colour map.
4247
+ * @param {string} name The colour map name.
3275
4248
  */
3276
- setColourMap(colourMap: object): void;
4249
+ setColourMap(name: string): void;
3277
4250
  /**
3278
4251
  * @callback alphaFn@callback alphaFn
3279
- * @param {object} value The pixel value.
3280
- * @param {object} index The values' index.
3281
- * @returns {number} The value to display.
4252
+ * @param {number[]|number} value The pixel value.
4253
+ * @param {number} index The values' index.
4254
+ * @returns {number} The opacity of the input value.
3282
4255
  */
3283
4256
  /**
3284
4257
  * Set the view per value alpha function.
3285
4258
  *
3286
4259
  * @param {alphaFn} func The function.
3287
4260
  */
3288
- setViewAlphaFunction(func: (value: object, index: object) => number): void;
3289
- /**
3290
- * Set the colour map from a name.
3291
- *
3292
- * @param {string} name The name of the colour map to set.
3293
- */
3294
- setColourMapFromName(name: string): void;
4261
+ setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
3295
4262
  /**
3296
4263
  * Add an event listener to this class.
3297
4264
  *
3298
4265
  * @param {string} type The event type.
3299
- * @param {object} callback The method associated with the provided
4266
+ * @param {Function} callback The function associated with the provided
3300
4267
  * event type, will be called with the fired event.
3301
4268
  */
3302
- addEventListener(type: string, callback: object): void;
4269
+ addEventListener(type: string, callback: Function): void;
3303
4270
  /**
3304
4271
  * Remove an event listener from this class.
3305
4272
  *
3306
4273
  * @param {string} type The event type.
3307
- * @param {object} callback The method associated with the provided
4274
+ * @param {Function} callback The function associated with the provided
3308
4275
  * event type.
3309
4276
  */
3310
- removeEventListener(type: string, callback: object): void;
4277
+ removeEventListener(type: string, callback: Function): void;
3311
4278
  #private;
3312
4279
  }
3313
4280
 
@@ -3321,24 +4288,24 @@ export declare class ViewLayer {
3321
4288
  */
3322
4289
  constructor(containerDiv: HTMLElement);
3323
4290
  /**
3324
- * Get the associated data index.
4291
+ * Get the associated data id.
3325
4292
  *
3326
- * @returns {number} The index.
4293
+ * @returns {string} The data id.
3327
4294
  */
3328
- getDataIndex(): number;
4295
+ getDataId(): string;
3329
4296
  /**
3330
- * Set the imageSmoothingEnabled flag value.
4297
+ * Set the imageSmoothing flag value.
3331
4298
  *
3332
4299
  * @param {boolean} flag True to enable smoothing.
3333
4300
  */
3334
- enableImageSmoothing(flag: boolean): void;
4301
+ setImageSmoothing(flag: boolean): void;
3335
4302
  /**
3336
4303
  * Set the associated view.
3337
4304
  *
3338
4305
  * @param {object} view The view.
3339
- * @param {number} index The associated data index.
4306
+ * @param {string} dataId The associated data id.
3340
4307
  */
3341
- setView(view: object, index: number): void;
4308
+ setView(view: object, dataId: string): void;
3342
4309
  /**
3343
4310
  * Get the view controller.
3344
4311
  *
@@ -3355,12 +4322,14 @@ export declare class ViewLayer {
3355
4322
  * Handle an image set event.
3356
4323
  *
3357
4324
  * @param {object} event The event.
4325
+ * @function
3358
4326
  */
3359
4327
  onimageset: (event: object) => void;
3360
4328
  /**
3361
4329
  * Handle an image change event.
3362
4330
  *
3363
4331
  * @param {object} event The event.
4332
+ * @function
3364
4333
  */
3365
4334
  onimagechange: (event: object) => void;
3366
4335
  /**
@@ -3401,13 +4370,25 @@ export declare class ViewLayer {
3401
4370
  * Add a flip offset along the layer Y axis.
3402
4371
  */
3403
4372
  addFlipOffsetY(): void;
4373
+ /**
4374
+ * Flip the scale along the layer X axis.
4375
+ */
4376
+ flipScaleX(): void;
4377
+ /**
4378
+ * Flip the scale along the layer Y axis.
4379
+ */
4380
+ flipScaleY(): void;
4381
+ /**
4382
+ * Flip the scale along the layer Z axis.
4383
+ */
4384
+ flipScaleZ(): void;
3404
4385
  /**
3405
4386
  * Set the layer scale.
3406
4387
  *
3407
4388
  * @param {object} newScale The scale as {x,y}.
3408
- * @param {Point3D} center The scale center.
4389
+ * @param {Point3D} [center] The scale center.
3409
4390
  */
3410
- setScale(newScale: object, center: Point3D): void;
4391
+ setScale(newScale: object, center?: Point3D): void;
3411
4392
  /**
3412
4393
  * Set the base layer offset. Updates the layer offset.
3413
4394
  *
@@ -3423,45 +4404,41 @@ export declare class ViewLayer {
3423
4404
  */
3424
4405
  setOffset(newOffset: object): void;
3425
4406
  /**
3426
- * Transform a display position to an index.
4407
+ * Transform a display position to a 2D index.
3427
4408
  *
3428
- * @param {number} x The X position.
3429
- * @param {number} y The Y position.
3430
- * @returns {Index} The equivalent index.
4409
+ * @param {Point2D} point2D The input point.
4410
+ * @returns {Index} The equivalent 2D index.
3431
4411
  */
3432
- displayToPlaneIndex(x: number, y: number): Index;
4412
+ displayToPlaneIndex(point2D: Point2D): Index;
3433
4413
  /**
3434
4414
  * Remove scale from a display position.
3435
4415
  *
3436
- * @param {number} x The X position.
3437
- * @param {number} y The Y position.
3438
- * @returns {object} The de-scaled position as {x,y}.
4416
+ * @param {Point2D} point2D The input point.
4417
+ * @returns {Point2D} The de-scaled point.
3439
4418
  */
3440
- displayToPlaneScale(x: number, y: number): object;
4419
+ displayToPlaneScale(point2D: Point2D): Point2D;
3441
4420
  /**
3442
4421
  * Get a plane position from a display position.
3443
4422
  *
3444
- * @param {number} x The X position.
3445
- * @param {number} y The Y position.
3446
- * @returns {object} The plane position as {x,y}.
4423
+ * @param {Point2D} point2D The input point.
4424
+ * @returns {Point2D} The plane position.
3447
4425
  */
3448
- displayToPlanePos(x: number, y: number): object;
4426
+ displayToPlanePos(point2D: Point2D): Point2D;
3449
4427
  /**
3450
4428
  * Get a display position from a plane position.
3451
4429
  *
3452
- * @param {number} x The X position.
3453
- * @param {number} y The Y position.
3454
- * @returns {object} The display position as {x,y}.
4430
+ * @param {Point2D} point2D The input point.
4431
+ * @returns {Point2D} The display position, can be individually
4432
+ * undefined if out of bounds.
3455
4433
  */
3456
- planePosToDisplay(x: number, y: number): object;
4434
+ planePosToDisplay(point2D: Point2D): Point2D;
3457
4435
  /**
3458
4436
  * Get a main plane position from a display position.
3459
4437
  *
3460
- * @param {number} x The X position.
3461
- * @param {number} y The Y position.
3462
- * @returns {object} The main plane position as {x,y}.
4438
+ * @param {Point2D} point2D The input point.
4439
+ * @returns {Point2D} The main plane position.
3463
4440
  */
3464
- displayToMainPlanePos(x: number, y: number): object;
4441
+ displayToMainPlanePos(point2D: Point2D): Point2D;
3465
4442
  /**
3466
4443
  * Display the layer.
3467
4444
  *
@@ -3510,18 +4487,18 @@ export declare class ViewLayer {
3510
4487
  * Add an event listener to this class.
3511
4488
  *
3512
4489
  * @param {string} type The event type.
3513
- * @param {object} callback The method associated with the provided
4490
+ * @param {Function} callback The function associated with the provided
3514
4491
  * event type, will be called with the fired event.
3515
4492
  */
3516
- addEventListener(type: string, callback: object): void;
4493
+ addEventListener(type: string, callback: Function): void;
3517
4494
  /**
3518
4495
  * Remove an event listener from this class.
3519
4496
  *
3520
4497
  * @param {string} type The event type.
3521
- * @param {object} callback The method associated with the provided
4498
+ * @param {Function} callback The function associated with the provided
3522
4499
  * event type.
3523
4500
  */
3524
- removeEventListener(type: string, callback: object): void;
4501
+ removeEventListener(type: string, callback: Function): void;
3525
4502
  /**
3526
4503
  * Set the current position.
3527
4504
  *
@@ -3538,101 +4515,55 @@ export declare class ViewLayer {
3538
4515
  }
3539
4516
 
3540
4517
  /**
3541
- * WindowCenterAndWidth class.
3542
- * <br>Pseudo-code:
3543
- * <pre>
3544
- * if (x &lt;= c - 0.5 - (w-1)/2), then y = ymin
3545
- * else if (x > c - 0.5 + (w-1)/2), then y = ymax,
3546
- * else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
3547
- * </pre>
3548
- *
3549
- * @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}
4518
+ * Window and Level also known as window width and center.
3550
4519
  */
3551
- export declare class WindowCenterAndWidth {
4520
+ export declare class WindowLevel {
3552
4521
  /**
3553
4522
  * @param {number} center The window center.
3554
4523
  * @param {number} width The window width.
3555
4524
  */
3556
4525
  constructor(center: number, width: number);
3557
4526
  /**
3558
- * Get the window center.
3559
- *
3560
- * @returns {number} The window center.
3561
- */
3562
- getCenter(): number;
3563
- /**
3564
- * Get the window width.
3565
- *
3566
- * @returns {number} The window width.
3567
- */
3568
- getWidth(): number;
3569
- /**
3570
- * Set the signed offset.
4527
+ * The window center.
3571
4528
  *
3572
- * @param {number} offset The signed data offset,
3573
- * typically: slope * ( size / 2).
4529
+ * @type {number}
3574
4530
  */
3575
- setSignedOffset(offset: number): void;
4531
+ center: number;
3576
4532
  /**
3577
- * Apply the window level on an input value.
4533
+ * The window width.
3578
4534
  *
3579
- * @param {number} value The value to rescale as an integer.
3580
- * @returns {number} The leveled value, in the
3581
- * [ymin, ymax] range (default [0,255]).
4535
+ * @type {number}
3582
4536
  */
3583
- apply(value: number): number;
4537
+ width: number;
3584
4538
  /**
3585
- * Check for window level equality.
4539
+ * Check for equality.
3586
4540
  *
3587
- * @param {WindowCenterAndWidth} rhs The other window level to compare to.
3588
- * @returns {boolean} True if both window level are equal.
4541
+ * @param {WindowLevel} rhs The other object to compare to.
4542
+ * @returns {boolean} True if both objects are equal.
3589
4543
  */
3590
- equals(rhs: WindowCenterAndWidth): boolean;
3591
- #private;
4544
+ equals(rhs: WindowLevel): boolean;
3592
4545
  }
3593
4546
 
3594
4547
  /**
3595
- * Window LUT class.
3596
- * Typically converts from float to integer.
4548
+ * Writer rule.
3597
4549
  */
3598
- export declare class WindowLut {
4550
+ export declare class WriterRule {
3599
4551
  /**
3600
- * Construct a window LUT object, window level is set with
3601
- * the 'setWindowLevel' method.
3602
- *
3603
- * @param {RescaleLut} rescaleLut The associated rescale LUT.
3604
- * @param {boolean} isSigned Flag to know if the data is signed or not.
3605
- * @param {boolean} isDiscrete Flag to know if the input data is discrete.
3606
- */
3607
- constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
3608
- /**
3609
- * Get the window / level.
3610
- *
3611
- * @returns {WindowCenterAndWidth} The window / level.
4552
+ * @param {string} action The rule action.
3612
4553
  */
3613
- getWindowLevel(): WindowCenterAndWidth;
4554
+ constructor(action: string);
3614
4555
  /**
3615
- * Get the rescale lut.
4556
+ * Rule action: `copy`, `remove`, `clear` or `replace`.
3616
4557
  *
3617
- * @returns {RescaleLut} The rescale lut.
4558
+ * @type {string}
3618
4559
  */
3619
- getRescaleLut(): RescaleLut;
4560
+ action: string;
3620
4561
  /**
3621
- * Set the window center and width.
4562
+ * Optional value to use for replace action.
3622
4563
  *
3623
- * @param {WindowCenterAndWidth} wl The window level.
4564
+ * @type {any|undefined}
3624
4565
  */
3625
- setWindowLevel(wl: WindowCenterAndWidth): void;
3626
- /**
3627
- * Get the value of the LUT at the given offset.
3628
- *
3629
- * @param {number} offset The input offset in [0,2^bitsStored] range
3630
- * for discrete data or full range for non discrete.
3631
- * @returns {number} The integer value (default [0,255]) of the LUT
3632
- * at the given offset.
3633
- */
3634
- getValue(offset: number): number;
3635
- #private;
4566
+ value: any | undefined;
3636
4567
  }
3637
4568
 
3638
4569
  export { }