dwv 0.33.0-beta.2 → 0.33.0-beta.21

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,14 +288,21 @@ 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
  /**
277
- * Abort the current load.
297
+ * Abort all the current loads.
298
+ */
299
+ abortAllLoads(): void;
300
+ /**
301
+ * Abort an individual data load.
302
+ *
303
+ * @param {string} dataId The data to stop loading.
278
304
  */
279
- abortLoad(): void;
305
+ abortLoad(dataId: string): void;
280
306
  /**
281
307
  * Fit the display to the data of each layer group.
282
308
  * To be called once the image is loaded.
@@ -284,58 +310,93 @@ export declare class App {
284
310
  fitToContainer(): void;
285
311
  /**
286
312
  * Init the Window/Level display
313
+ * (of the active layer of the active layer group).
314
+ *
315
+ * @deprecated Please set the opacity of the desired view layer directly.
287
316
  */
288
317
  initWLDisplay(): void;
318
+ /**
319
+ * Set the imageSmoothing flag value. Default is false.
320
+ *
321
+ * @param {boolean} flag True to enable smoothing.
322
+ */
323
+ setImageSmoothing(flag: boolean): void;
324
+ /**
325
+ * Get the layer group configuration from a data id.
326
+ *
327
+ * @param {string} dataId The data id.
328
+ * @param {boolean} [excludeStarConfig] Exclude the star config
329
+ * (default to false).
330
+ * @returns {ViewConfig[]} The list of associated configs.
331
+ */
332
+ getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
333
+ /**
334
+ * Get the layer group configuration for a data id and group
335
+ * div id.
336
+ *
337
+ * @param {string} dataId The data id.
338
+ * @param {string} groupDivId The layer group div id.
339
+ * @param {boolean} [excludeStarConfig] Exclude the star config
340
+ * (default to false).
341
+ * @returns {ViewConfig|undefined} The associated config.
342
+ */
343
+ getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
289
344
  /**
290
345
  * Get the data view config.
291
346
  * Carefull, returns a reference, do not modify without resetting.
292
347
  *
293
- * @returns {object} The configuration list.
348
+ * @returns {Object<string, ViewConfig[]>} The configuration list.
294
349
  */
295
- getDataViewConfig(): object;
350
+ getDataViewConfigs(): {
351
+ [x: string]: ViewConfig[];
352
+ };
296
353
  /**
297
- * Set the data view configuration (see the init options for details).
354
+ * Set the data view configuration.
355
+ * Resets the stage and recreates all the views.
298
356
  *
299
- * @param {object} configs The configuration list.
357
+ * @param {Object<string, ViewConfig[]>} configs The configuration list.
300
358
  */
301
- setDataViewConfig(configs: object): void;
359
+ setDataViewConfigs(configs: {
360
+ [x: string]: ViewConfig[];
361
+ }): void;
302
362
  /**
303
363
  * Add a data view config.
304
364
  *
305
- * @param {number} dataId The data id.
306
- * @param {object} config The view configuration.
365
+ * @param {string} dataId The data id.
366
+ * @param {ViewConfig} config The view configuration.
307
367
  */
308
- addDataViewConfig(dataId: number, config: object): void;
368
+ addDataViewConfig(dataId: string, config: ViewConfig): void;
309
369
  /**
310
370
  * Remove a data view config.
311
371
  *
312
- * @param {number} dataId The data id.
313
- * @param {object} config The view configuration.
372
+ * @param {string} dataId The data id.
373
+ * @param {string} divId The div id.
314
374
  */
315
- removeDataViewConfig(dataId: number, config: object): void;
375
+ removeDataViewConfig(dataId: string, divId: string): void;
316
376
  /**
317
- * Update a data view config.
377
+ * Update an existing data view config.
378
+ * Removes and re-creates the layer if found.
318
379
  *
319
- * @param {number} dataId The data id.
380
+ * @param {string} dataId The data id.
320
381
  * @param {string} divId The div id.
321
- * @param {object} config The view configuration.
382
+ * @param {ViewConfig} config The view configuration.
322
383
  */
323
- updateDataViewConfig(dataId: number, divId: string, config: object): void;
384
+ updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void;
324
385
  /**
325
386
  * Set the layer groups binders.
326
387
  *
327
- * @param {Array} list The list of binder names.
388
+ * @param {string[]} list The list of binder names.
328
389
  */
329
- setLayerGroupsBinders(list: any[]): void;
390
+ setLayerGroupsBinders(list: string[]): void;
330
391
  /**
331
392
  * Render the current data.
332
393
  *
333
- * @param {number} dataIndex The data index to render.
334
- * @param {Array} [viewConfigs] The list of configs to render.
394
+ * @param {string} dataId The data id to render.
395
+ * @param {ViewConfig[]} [viewConfigs] The list of configs to render.
335
396
  */
336
- render(dataIndex: number, viewConfigs?: any[]): void;
397
+ render(dataId: string, viewConfigs?: ViewConfig[]): void;
337
398
  /**
338
- * Zoom to the layers.
399
+ * Zoom the layers of the active layer group.
339
400
  *
340
401
  * @param {number} step The step to add to the current zoom.
341
402
  * @param {number} cx The zoom center X coordinate.
@@ -343,20 +404,21 @@ export declare class App {
343
404
  */
344
405
  zoom(step: number, cx: number, cy: number): void;
345
406
  /**
346
- * Apply a translation to the layers.
407
+ * Apply a translation to the layers of the active layer group.
347
408
  *
348
409
  * @param {number} tx The translation along X.
349
410
  * @param {number} ty The translation along Y.
350
411
  */
351
412
  translate(tx: number, ty: number): void;
352
413
  /**
353
- * Set the image layer opacity.
414
+ * Set the active view layer (of the active layer group) opacity.
354
415
  *
355
416
  * @param {number} alpha The opacity ([0:1] range).
417
+ * @deprecated Please set the opacity of the desired view layer directly.
356
418
  */
357
419
  setOpacity(alpha: number): void;
358
420
  /**
359
- * Set the drawings on the current stage.
421
+ * Set the drawings of the active layer group.
360
422
  *
361
423
  * @param {Array} drawings An array of drawings.
362
424
  * @param {Array} drawingsDetails An array of drawings details.
@@ -378,6 +440,8 @@ export declare class App {
378
440
  * Handle resize: fit the display to the window.
379
441
  * To be called once the image is loaded.
380
442
  * Can be connected to a window 'resize' event.
443
+ *
444
+ * @function
381
445
  */
382
446
  onResize: () => void;
383
447
  /**
@@ -385,6 +449,7 @@ export declare class App {
385
449
  *
386
450
  * @param {KeyboardEvent} event The key down event.
387
451
  * @fires App#keydown
452
+ * @function
388
453
  */
389
454
  onKeydown: (event: KeyboardEvent) => void;
390
455
  /**
@@ -395,10 +460,12 @@ export declare class App {
395
460
  * - CRTL-ARROW_UP: next element on third dim
396
461
  * - CRTL-ARROW_RIGHT: previous element on fourth dim
397
462
  * - CRTL-ARROW_DOWN: previous element on third dim
463
+ * (applies to the active view of the active layer group)
398
464
  *
399
465
  * @param {KeyboardEvent} event The key down event.
400
466
  * @fires UndoStack#undo
401
467
  * @fires UndoStack#redo
468
+ * @function
402
469
  */
403
470
  defaultOnKeydown: (event: KeyboardEvent) => void;
404
471
  /**
@@ -410,17 +477,19 @@ export declare class App {
410
477
  */
411
478
  resetZoom(): void;
412
479
  /**
413
- * Set the colour map.
480
+ * Set the colour map of the active view of the active layer group.
414
481
  *
415
- * @param {string} colourMap The colour map name.
482
+ * @param {string} name The colour map name.
483
+ * @deprecated Please use the ViewController equivalent directly instead.
416
484
  */
417
- setColourMap(colourMap: string): void;
485
+ setColourMap(name: string): void;
418
486
  /**
419
- * Set the window/level preset.
487
+ * Set the window/level preset of the active view of the active layer group.
420
488
  *
421
- * @param {object} preset The window/level preset.
489
+ * @param {string} preset The window/level preset.
490
+ * @deprecated Please use the ViewController equivalent directly instead.
422
491
  */
423
- setWindowLevelPreset(preset: object): void;
492
+ setWindowLevelPreset(preset: string): void;
424
493
  /**
425
494
  * Set the tool
426
495
  *
@@ -458,21 +527,77 @@ export declare class App {
458
527
  */
459
528
  getCurrentStackIndex(): number;
460
529
  /**
461
- * Get the overlay data for a data index.
530
+ * Get the overlay data for a data id.
462
531
  *
463
- * @param {number} dataIndex The data index.
464
- * @returns {OverlayData} The overlay data.
532
+ * @param {string} dataId The data id.
533
+ * @returns {OverlayData|undefined} The overlay data.
465
534
  */
466
- getOverlayData(dataIndex: number): OverlayData;
535
+ getOverlayData(dataId: string): OverlayData | undefined;
467
536
  /**
468
537
  * Toggle overlay listeners.
469
538
  *
470
- * @param {number} dataIndex The data index.
539
+ * @param {string} dataId The data id.
471
540
  */
472
- toggleOverlayListeners(dataIndex: number): void;
541
+ toggleOverlayListeners(dataId: string): void;
473
542
  #private;
474
543
  }
475
544
 
545
+ /**
546
+ * Application options.
547
+ */
548
+ export declare class AppOptions {
549
+ /**
550
+ * @param {Object<string, ViewConfig[]>} [dataViewConfigs] Optional dataId
551
+ * indexed object containing the data view configurations.
552
+ */
553
+ constructor(dataViewConfigs?: {
554
+ [x: string]: ViewConfig[];
555
+ });
556
+ /**
557
+ * DataId indexed object containing the data view configurations.
558
+ *
559
+ * @type {Object<string, ViewConfig[]>|undefined}
560
+ */
561
+ dataViewConfigs: {
562
+ [x: string]: ViewConfig[];
563
+ } | undefined;
564
+ /**
565
+ * Tool name indexed object containing individual tool configurations.
566
+ *
567
+ * @type {Object<string, ToolConfig>|undefined}
568
+ */
569
+ tools: {
570
+ [x: string]: ToolConfig;
571
+ } | undefined;
572
+ /**
573
+ * Optional array of layerGroup binder names.
574
+ *
575
+ * @type {string[]|undefined}
576
+ */
577
+ binders: string[] | undefined;
578
+ /**
579
+ * Optional boolean flag to trigger the first data render
580
+ * after the first loaded data or not. Defaults to true;
581
+ *
582
+ * @type {boolean|undefined}
583
+ */
584
+ viewOnFirstLoadItem: boolean | undefined;
585
+ /**
586
+ * Optional default chraracter set string used for DICOM parsing if
587
+ * not passed in DICOM file.
588
+ * Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings
589
+ *
590
+ * @type {string|undefined}
591
+ */
592
+ defaultCharacterSet: string | undefined;
593
+ /**
594
+ * Optional overlay config.
595
+ *
596
+ * @type {object|undefined}
597
+ */
598
+ overlayConfig: object | undefined;
599
+ }
600
+
476
601
  /**
477
602
  * Build a multipart message.
478
603
  * See: https://en.wikipedia.org/wiki/MIME#Multipart_messages
@@ -485,30 +610,67 @@ export declare class App {
485
610
  */
486
611
  export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
487
612
 
613
+ /**
614
+ * Colour map: red, green and blue components
615
+ * to associate with intensity values.
616
+ */
617
+ export declare class ColourMap {
618
+ /**
619
+ * @param {number[]} red Red component.
620
+ * @param {number[]} green Green component.
621
+ * @param {number[]} blue Blue component.
622
+ */
623
+ constructor(red: number[], green: number[], blue: number[]);
624
+ /**
625
+ * Red component: 256 values in the [0, 255] range.
626
+ *
627
+ * @type {number[]}
628
+ */
629
+ red: number[];
630
+ /**
631
+ * Green component: 256 values in the [0, 255] range.
632
+ *
633
+ * @type {number[]}
634
+ */
635
+ green: number[];
636
+ /**
637
+ * Blue component: 256 values in the [0, 255] range.
638
+ *
639
+ * @type {number[]}
640
+ */
641
+ blue: number[];
642
+ }
643
+
488
644
  /**
489
645
  * Create an Image from DICOM elements.
490
646
  *
491
- * @param {object} elements The DICOM elements.
647
+ * @param {Object<string, DataElement>} elements The DICOM elements.
492
648
  * @returns {Image} The Image object.
493
649
  */
494
- export declare function createImage(elements: object): Image_2;
650
+ export declare function createImage(elements: {
651
+ [x: string]: DataElement;
652
+ }): Image_2;
495
653
 
496
654
  /**
497
655
  * Create a mask Image from DICOM elements.
498
656
  *
499
- * @param {object} elements The DICOM elements.
657
+ * @param {Object<string, DataElement>} elements The DICOM elements.
500
658
  * @returns {Image} The mask Image object.
501
659
  */
502
- export declare function createMaskImage(elements: object): Image_2;
660
+ export declare function createMaskImage(elements: {
661
+ [x: string]: DataElement;
662
+ }): Image_2;
503
663
 
504
664
  /**
505
665
  * Create a View from DICOM elements and image.
506
666
  *
507
- * @param {object} elements The DICOM elements.
667
+ * @param {Object<string, DataElement>} elements The DICOM elements.
508
668
  * @param {Image} image The associated image.
509
669
  * @returns {View} The View object.
510
670
  */
511
- export declare function createView(elements: object, image: Image_2): View;
671
+ export declare function createView(elements: {
672
+ [x: string]: DataElement;
673
+ }, image: Image_2): View;
512
674
 
513
675
  export declare namespace customUI {
514
676
  /**
@@ -520,6 +682,64 @@ export declare namespace customUI {
520
682
  export function openRoiDialog(data: any, callback: Function): void;
521
683
  }
522
684
 
685
+ /**
686
+ * DICOM data element.
687
+ */
688
+ export declare class DataElement {
689
+ /**
690
+ * @param {string} vr The element VR (Value Representation).
691
+ */
692
+ constructor(vr: string);
693
+ /**
694
+ * The element Value Representation.
695
+ *
696
+ * @type {string}
697
+ */
698
+ vr: string;
699
+ /**
700
+ * The element value.
701
+ *
702
+ * @type {Array}
703
+ */
704
+ value: any[];
705
+ /**
706
+ * The element dicom tag.
707
+ *
708
+ * @type {Tag}
709
+ */
710
+ tag: Tag;
711
+ /**
712
+ * The element Value Length.
713
+ *
714
+ * @type {number}
715
+ */
716
+ vl: number;
717
+ /**
718
+ * Flag to know if defined or undefined sequence length.
719
+ *
720
+ * @type {boolean}
721
+ */
722
+ undefinedLength: boolean;
723
+ /**
724
+ * The element start offset.
725
+ *
726
+ * @type {number}
727
+ */
728
+ startOffset: number;
729
+ /**
730
+ * The element end offset.
731
+ *
732
+ * @type {number}
733
+ */
734
+ endOffset: number;
735
+ /**
736
+ * The sequence items.
737
+ *
738
+ * @type {Array}
739
+ */
740
+ items: any[];
741
+ }
742
+
523
743
  /**
524
744
  * Decoder scripts to be passed to web workers for image decoding.
525
745
  */
@@ -533,14 +753,11 @@ export declare const decoderScripts: {
533
753
  /**
534
754
  * List of default window level presets.
535
755
  *
536
- * @type {Object.<string, Object.<string, {center: number, width: number}>>}
756
+ * @type {Object.<string, Object.<string, WindowLevel>>}
537
757
  */
538
758
  export declare const defaultPresets: {
539
759
  [x: string]: {
540
- [x: string]: {
541
- center: number;
542
- width: number;
543
- };
760
+ [x: string]: WindowLevel;
544
761
  };
545
762
  };
546
763
 
@@ -552,6 +769,46 @@ export declare namespace defaults {
552
769
  };
553
770
  }
554
771
 
772
+ /**
773
+ * DICOM code.
774
+ */
775
+ export declare class DicomCode {
776
+ /**
777
+ * @param {string} meaning The code meaning.
778
+ */
779
+ constructor(meaning: string);
780
+ /**
781
+ * Code meaning (0008,0104).
782
+ *
783
+ * @type {string}
784
+ */
785
+ meaning: string;
786
+ /**
787
+ * Code value (0008,0100).
788
+ *
789
+ * @type {string|undefined}
790
+ */
791
+ value: string | undefined;
792
+ /**
793
+ * Long code value (0008,0119).
794
+ *
795
+ * @type {string|undefined}
796
+ */
797
+ longValue: string | undefined;
798
+ /**
799
+ * URN code value (0008,0120).
800
+ *
801
+ * @type {string|undefined}
802
+ */
803
+ urnValue: string | undefined;
804
+ /**
805
+ * Coding scheme designator (0008,0102).
806
+ *
807
+ * @type {string|undefined}
808
+ */
809
+ schemeDesignator: string | undefined;
810
+ }
811
+
555
812
  /**
556
813
  * DicomParser class.
557
814
  *
@@ -598,14 +855,16 @@ export declare class DicomParser {
598
855
  */
599
856
  setDecoderCharacterSet(characterSet: string): void;
600
857
  /**
601
- * Get the raw DICOM data elements.
858
+ * Get the DICOM data elements.
602
859
  *
603
- * @returns {object} The raw DICOM elements.
860
+ * @returns {Object<string, DataElement>} The data elements.
604
861
  */
605
- getDicomElements(): object;
862
+ getDicomElements(): {
863
+ [x: string]: DataElement;
864
+ };
606
865
  /**
607
866
  * Parse the complete DICOM file (given as input to the class).
608
- * Fills in the member object 'dicomElements'.
867
+ * Fills in the member object 'dataElements'.
609
868
  *
610
869
  * @param {ArrayBuffer} buffer The input array buffer.
611
870
  */
@@ -616,16 +875,33 @@ export declare class DicomParser {
616
875
  /**
617
876
  * DICOM writer.
618
877
  *
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";
878
+ * @example
879
+ * // add link to html
880
+ * const link = document.createElement("a");
881
+ * link.appendChild(document.createTextNode("download"));
882
+ * const div = document.getElementById("dwv");
883
+ * div.appendChild(link);
884
+ * // XMLHttpRequest onload callback
885
+ * const onload = function (event) {
886
+ * const parser = new dwv.DicomParser();
887
+ * parser.parse(event.target.response);
888
+ * // create writer
889
+ * const writer = new dwv.DicomWriter();
890
+ * // get buffer using default rules
891
+ * const dicomBuffer = writer.getBuffer(parser.getDicomElements());
892
+ * // create blob
893
+ * const blob = new Blob([dicomBuffer], {type: 'application/dicom'});
894
+ * // add blob to download link
895
+ * link.href = URL.createObjectURL(blob);
896
+ * link.download = "anonym.dcm";
897
+ * };
898
+ * // DICOM file request
899
+ * const request = new XMLHttpRequest();
900
+ * const url = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm';
901
+ * request.open('GET', url);
902
+ * request.responseType = 'arraybuffer';
903
+ * request.onload = onload;
904
+ * request.send();
629
905
  */
630
906
  export declare class DicomWriter {
631
907
  /**
@@ -636,10 +912,20 @@ export declare class DicomWriter {
636
912
  setUseUnVrForPrivateSq(flag: boolean): void;
637
913
  /**
638
914
  * Set the writing rules.
915
+ * List of writer rules indexed by either `default`,
916
+ * tagKey, tagName or groupName.
917
+ * Each DICOM element will be checked to see if a rule is applicable.
918
+ * First checked by tagKey, tagName and then by groupName,
919
+ * if nothing is found the default rule is applied.
639
920
  *
640
- * @param {object} rules The input rules.
921
+ * @param {Object<string, WriterRule>} rules The input rules.
922
+ * @param {boolean} [addMissingTags] if true, explicit tags that
923
+ * have replace rule and a value will be
924
+ * added if missing. Defaults to false.
641
925
  */
642
- setRules(rules: object): void;
926
+ setRules(rules: {
927
+ [x: string]: WriterRule;
928
+ }, addMissingTags?: boolean): void;
643
929
  /**
644
930
  * Use a TextEncoder instead of the default text decoder.
645
931
  */
@@ -648,16 +934,160 @@ export declare class DicomWriter {
648
934
  * Use default anonymisation rules.
649
935
  */
650
936
  useDefaultAnonymisationRules(): void;
937
+ /**
938
+ * Get the element to write according to the class rules.
939
+ * Priority order: tagName, groupName, default.
940
+ *
941
+ * @param {DataElement} element The element to check
942
+ * @returns {DataElement|null} The element to write, can be null.
943
+ */
944
+ getElementToWrite(element: DataElement): DataElement | null;
651
945
  /**
652
946
  * Get the ArrayBuffer corresponding to input DICOM elements.
653
947
  *
654
- * @param {Array} dicomElements The wrapped elements to write.
948
+ * @param {Object<string, DataElement>} dataElements The elements to write.
655
949
  * @returns {ArrayBuffer} The elements as a buffer.
656
950
  */
657
- getBuffer(dicomElements: any[]): ArrayBuffer;
951
+ getBuffer(dataElements: {
952
+ [x: string]: DataElement;
953
+ }): ArrayBuffer;
658
954
  #private;
659
955
  }
660
956
 
957
+ /**
958
+ * Draw controller.
959
+ */
960
+ export declare class DrawController {
961
+ /**
962
+ * @param {DrawLayer} drawLayer The draw layer.
963
+ */
964
+ constructor(drawLayer: DrawLayer);
965
+ /**
966
+ * Get the current position group.
967
+ *
968
+ * @returns {Konva.Group|undefined} The Konva.Group.
969
+ */
970
+ getCurrentPosGroup(): Konva.Group | undefined;
971
+ /**
972
+ * Reset: clear the layers array.
973
+ */
974
+ reset(): void;
975
+ /**
976
+ * Get a Konva group using its id.
977
+ *
978
+ * @param {string} id The group id.
979
+ * @returns {object|undefined} The Konva group.
980
+ */
981
+ getGroup(id: string): object | undefined;
982
+ /**
983
+ * Activate the current draw layer.
984
+ *
985
+ * @param {Index} index The current position.
986
+ * @param {number} scrollIndex The scroll index.
987
+ */
988
+ activateDrawLayer(index: Index, scrollIndex: number): void;
989
+ /**
990
+ * Get a list of drawing display details.
991
+ *
992
+ * @returns {DrawDetails[]} A list of draw details.
993
+ */
994
+ getDrawDisplayDetails(): DrawDetails[];
995
+ /**
996
+ * Get a list of drawing store details. Used in state.
997
+ *
998
+ * @returns {object} A list of draw details including id, text, quant...
999
+ * TODO Unify with getDrawDisplayDetails?
1000
+ */
1001
+ getDrawStoreDetails(): object;
1002
+ /**
1003
+ * Set the drawings on the current stage.
1004
+ *
1005
+ * @param {Array} drawings An array of drawings.
1006
+ * @param {DrawDetails[]} drawingsDetails An array of drawings details.
1007
+ * @param {object} cmdCallback The DrawCommand callback.
1008
+ * @param {object} exeCallback The callback to call once the
1009
+ * DrawCommand has been executed.
1010
+ */
1011
+ setDrawings(drawings: any[], drawingsDetails: DrawDetails[], cmdCallback: object, exeCallback: object): void;
1012
+ /**
1013
+ * Update a drawing from its details.
1014
+ *
1015
+ * @param {DrawDetails} drawDetails Details of the drawing to update.
1016
+ */
1017
+ updateDraw(drawDetails: DrawDetails): void;
1018
+ /**
1019
+ * Delete a Draw from the stage.
1020
+ *
1021
+ * @param {Konva.Group} group The group to delete.
1022
+ * @param {object} cmdCallback The DeleteCommand callback.
1023
+ * @param {object} exeCallback The callback to call once the
1024
+ * DeleteCommand has been executed.
1025
+ */
1026
+ deleteDrawGroup(group: Konva.Group, cmdCallback: object, exeCallback: object): void;
1027
+ /**
1028
+ * Delete a Draw from the stage.
1029
+ *
1030
+ * @param {string} id The id of the group to delete.
1031
+ * @param {Function} cmdCallback The DeleteCommand callback.
1032
+ * @param {Function} exeCallback The callback to call once the
1033
+ * DeleteCommand has been executed.
1034
+ * @returns {boolean} False if the group cannot be found.
1035
+ */
1036
+ deleteDraw(id: string, cmdCallback: Function, exeCallback: Function): boolean;
1037
+ /**
1038
+ * Delete all Draws from the stage.
1039
+ *
1040
+ * @param {Function} cmdCallback The DeleteCommand callback.
1041
+ * @param {Function} exeCallback The callback to call once the
1042
+ * DeleteCommand has been executed.
1043
+ */
1044
+ deleteDraws(cmdCallback: Function, exeCallback: Function): void;
1045
+ /**
1046
+ * Get the total number of draws
1047
+ * (at all positions).
1048
+ *
1049
+ * @returns {number} The total number of draws.
1050
+ */
1051
+ getNumberOfDraws(): number;
1052
+ #private;
1053
+ }
1054
+
1055
+ /**
1056
+ * Draw details.
1057
+ */
1058
+ export declare class DrawDetails {
1059
+ /**
1060
+ * The draw ID.
1061
+ *
1062
+ * @type {number}
1063
+ */
1064
+ id: number;
1065
+ /**
1066
+ * The draw position: an Index converted to string.
1067
+ *
1068
+ * @type {string}
1069
+ */
1070
+ position: string;
1071
+ /**
1072
+ * The draw type.
1073
+ *
1074
+ * @type {string}
1075
+ */
1076
+ type: string;
1077
+ /**
1078
+ * The draw color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
1079
+ *
1080
+ * @type {string}
1081
+ */
1082
+ color: string;
1083
+ /**
1084
+ * The draw meta.
1085
+ *
1086
+ * @type {DrawMeta}
1087
+ */
1088
+ meta: DrawMeta;
1089
+ }
1090
+
661
1091
  /**
662
1092
  * Draw layer.
663
1093
  */
@@ -668,23 +1098,23 @@ export declare class DrawLayer {
668
1098
  */
669
1099
  constructor(containerDiv: HTMLDivElement);
670
1100
  /**
671
- * Get the associated data index.
1101
+ * Get the associated data id.
672
1102
  *
673
- * @returns {number} The index.
1103
+ * @returns {string} The id.
674
1104
  */
675
- getDataIndex(): number;
1105
+ getDataId(): string;
676
1106
  /**
677
1107
  * Get the Konva stage.
678
1108
  *
679
- * @returns {object} The stage.
1109
+ * @returns {Konva.Stage} The stage.
680
1110
  */
681
- getKonvaStage(): object;
1111
+ getKonvaStage(): Konva.Stage;
682
1112
  /**
683
1113
  * Get the Konva layer.
684
1114
  *
685
- * @returns {object} The layer.
1115
+ * @returns {Konva.Layer} The layer.
686
1116
  */
687
- getKonvaLayer(): object;
1117
+ getKonvaLayer(): Konva.Layer;
688
1118
  /**
689
1119
  * Get the draw controller.
690
1120
  *
@@ -729,13 +1159,25 @@ export declare class DrawLayer {
729
1159
  * Add a flip offset along the layer Y axis.
730
1160
  */
731
1161
  addFlipOffsetY(): void;
1162
+ /**
1163
+ * Flip the scale along the layer X axis.
1164
+ */
1165
+ flipScaleX(): void;
1166
+ /**
1167
+ * Flip the scale along the layer Y axis.
1168
+ */
1169
+ flipScaleY(): void;
1170
+ /**
1171
+ * Flip the scale along the layer Z axis.
1172
+ */
1173
+ flipScaleZ(): void;
732
1174
  /**
733
1175
  * Set the layer scale.
734
1176
  *
735
1177
  * @param {object} newScale The scale as {x,y}.
736
- * @param {Point3D} center The scale center.
1178
+ * @param {Point3D} [center] The scale center.
737
1179
  */
738
- setScale(newScale: object, center: Point3D): void;
1180
+ setScale(newScale: object, center?: Point3D): void;
739
1181
  /**
740
1182
  * Set the layer offset.
741
1183
  *
@@ -772,9 +1214,9 @@ export declare class DrawLayer {
772
1214
  *
773
1215
  * @param {object} size The image size as {x,y}.
774
1216
  * @param {object} spacing The image spacing as {x,y}.
775
- * @param {number} index The associated data index.
1217
+ * @param {string} dataId The associated data id.
776
1218
  */
777
- initialise(size: object, spacing: object, index: number): void;
1219
+ initialise(size: object, spacing: object, dataId: string): void;
778
1220
  /**
779
1221
  * Fit the layer to its parent container.
780
1222
  *
@@ -796,7 +1238,7 @@ export declare class DrawLayer {
796
1238
  * @param {string} id The id of the group.
797
1239
  * @returns {boolean} False if the group cannot be found.
798
1240
  */
799
- toogleGroupVisibility(id: string): boolean;
1241
+ toggleGroupVisibility(id: string): boolean;
800
1242
  /**
801
1243
  * Delete a Draw from the stage.
802
1244
  *
@@ -812,6 +1254,13 @@ export declare class DrawLayer {
812
1254
  * DeleteCommand has been executed.
813
1255
  */
814
1256
  deleteDraws(exeCallback: object): void;
1257
+ /**
1258
+ * Get the total number of draws of this layer
1259
+ * (at all positions).
1260
+ *
1261
+ * @returns {number|undefined} The total number of draws.
1262
+ */
1263
+ getNumberOfDraws(): number | undefined;
815
1264
  /**
816
1265
  * Enable and listen to container interaction events.
817
1266
  */
@@ -832,21 +1281,40 @@ export declare class DrawLayer {
832
1281
  * Add an event listener to this class.
833
1282
  *
834
1283
  * @param {string} type The event type.
835
- * @param {object} callback The method associated with the provided
1284
+ * @param {Function} callback The function associated with the provided
836
1285
  * event type, will be called with the fired event.
837
1286
  */
838
- addEventListener(type: string, callback: object): void;
1287
+ addEventListener(type: string, callback: Function): void;
839
1288
  /**
840
1289
  * Remove an event listener from this class.
841
1290
  *
842
1291
  * @param {string} type The event type.
843
- * @param {object} callback The method associated with the provided
1292
+ * @param {Function} callback The function associated with the provided
844
1293
  * event type.
845
1294
  */
846
- removeEventListener(type: string, callback: object): void;
1295
+ removeEventListener(type: string, callback: Function): void;
847
1296
  #private;
848
1297
  }
849
1298
 
1299
+ /**
1300
+ * Draw meta data.
1301
+ */
1302
+ export declare class DrawMeta {
1303
+ /**
1304
+ * Draw quantification.
1305
+ *
1306
+ * @type {object}
1307
+ */
1308
+ quantification: object;
1309
+ /**
1310
+ * Draw text expression. Can contain variables surrounded with '{}' that will
1311
+ * be extracted from the quantification object.
1312
+ *
1313
+ * @type {string}
1314
+ */
1315
+ textExpr: string;
1316
+ }
1317
+
850
1318
  /**
851
1319
  * 2D/3D Geometry class.
852
1320
  */
@@ -899,9 +1367,9 @@ export declare class Geometry {
899
1367
  /**
900
1368
  * Get the object origins.
901
1369
  *
902
- * @returns {Array} The object origins.
1370
+ * @returns {Point3D[]} The object origins.
903
1371
  */
904
- getOrigins(): any[];
1372
+ getOrigins(): Point3D[];
905
1373
  /**
906
1374
  * Check if a point is in the origin list.
907
1375
  *
@@ -994,10 +1462,10 @@ export declare class Geometry {
994
1462
  * Check that a index is within bounds.
995
1463
  *
996
1464
  * @param {Index} index The index to check.
997
- * @param {Array} [dirs] Optional list of directions to check.
1465
+ * @param {number[]} [dirs] Optional list of directions to check.
998
1466
  * @returns {boolean} True if the given coordinates are within bounds.
999
1467
  */
1000
- isIndexInBounds(index: Index, dirs?: any[]): boolean;
1468
+ isIndexInBounds(index: Index, dirs?: number[]): boolean;
1001
1469
  /**
1002
1470
  * Convert an index into world coordinates.
1003
1471
  *
@@ -1029,6 +1497,19 @@ export declare class Geometry {
1029
1497
  #private;
1030
1498
  }
1031
1499
 
1500
+ /**
1501
+ * Get the default DICOM seg tags as an object.
1502
+ *
1503
+ * @returns {object} The default tags.
1504
+ */
1505
+ export declare function getDefaultDicomSegJson(): object;
1506
+
1507
+ /**
1508
+ * List of DICOM data elements indexed via a 8 character string formed from
1509
+ * the group and element numbers.
1510
+ *
1511
+ * @typedef {Object<string, DataElement>} DataElements
1512
+ */
1032
1513
  /**
1033
1514
  * Get the version of the library.
1034
1515
  *
@@ -1037,23 +1518,56 @@ export declare class Geometry {
1037
1518
  export declare function getDwvVersion(): string;
1038
1519
 
1039
1520
  /**
1040
- * Get the DICOM elements from a DICOM json tags object.
1041
- * The json is a simplified version of the oficial DICOM json with
1521
+ * Get the DICOM elements from a 'simple' DICOM tags object.
1522
+ * The input object is a simplified version of the oficial DICOM json with
1042
1523
  * tag names instead of keys and direct values (no value property) for
1043
- * simple tags.
1524
+ * simple tags. See synthetic test data (in tests/dicom) for examples.
1525
+ *
1526
+ * @param {Object<string, any>} simpleTags The 'simple' DICOM
1527
+ * tags object.
1528
+ * @returns {Object<string, DataElement>} The DICOM elements.
1529
+ */
1530
+ export declare function getElementsFromJSONTags(simpleTags: {
1531
+ [x: string]: any;
1532
+ }): {
1533
+ [x: string]: DataElement;
1534
+ };
1535
+
1536
+ /**
1537
+ * Get the indices that form a ellpise.
1538
+ *
1539
+ * @param {Index} center The ellipse center.
1540
+ * @param {number[]} radius The 2 ellipse radiuses.
1541
+ * @param {number[]} dir The 2 ellipse directions.
1542
+ * @returns {Index[]} The indices of the ellipse.
1543
+ */
1544
+ export declare function getEllipseIndices(center: Index, radius: number[], dir: number[]): Index[];
1545
+
1546
+ /**
1547
+ * Get the layer details from a mouse event.
1044
1548
  *
1045
- * @param {object} jsonTags The DICOM json tags object.
1046
- * @returns {object} The DICOM elements.
1549
+ * @param {object} event The event to get the layer div id from. Expecting
1550
+ * an event origininating from a canvas inside a layer HTML div
1551
+ * with the 'layer' class and id generated with `getLayerDivId`.
1552
+ * @returns {object} The layer details as {groupDivId, layerId}.
1047
1553
  */
1048
- export declare function getElementsFromJSONTags(jsonTags: object): object;
1554
+ export declare function getLayerDetailsFromEvent(event: object): object;
1555
+
1556
+ /**
1557
+ * Get the offset of an input mouse event.
1558
+ *
1559
+ * @param {object} event The event to get the offset from.
1560
+ * @returns {Point2D} The 2D point.
1561
+ */
1562
+ export declare function getMousePoint(event: object): Point2D;
1049
1563
 
1050
1564
  /**
1051
1565
  * Get the name of an image orientation patient.
1052
1566
  *
1053
- * @param {Array} orientation The image orientation patient.
1567
+ * @param {number[]} orientation The image orientation patient.
1054
1568
  * @returns {string} The orientation name: axial, coronal or sagittal.
1055
1569
  */
1056
- export declare function getOrientationName(orientation: any[]): string;
1570
+ export declare function getOrientationName(orientation: number[]): string;
1057
1571
 
1058
1572
  /**
1059
1573
  * Get the PixelData Tag.
@@ -1078,6 +1592,14 @@ export declare function getReverseOrientation(ori: string): string;
1078
1592
  */
1079
1593
  export declare function getTagFromKey(key: string): Tag;
1080
1594
 
1595
+ /**
1596
+ * Get the offsets of an input touch event.
1597
+ *
1598
+ * @param {object} event The event to get the offset from.
1599
+ * @returns {Point2D[]} The array of points.
1600
+ */
1601
+ export declare function getTouchPoints(event: object): Point2D[];
1602
+
1081
1603
  /**
1082
1604
  * Get the appropriate TypedArray in function of arguments.
1083
1605
  *
@@ -1103,6 +1625,16 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
1103
1625
  */
1104
1626
  export declare function getUID(tagName: string): string;
1105
1627
 
1628
+ /**
1629
+ * Check that an input buffer includes the DICOM prefix 'DICM'
1630
+ * after the 128 bytes preamble.
1631
+ * Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}
1632
+ *
1633
+ * @param {ArrayBuffer} buffer The buffer to check.
1634
+ * @returns {boolean} True if the buffer includes the prefix.
1635
+ */
1636
+ export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
1637
+
1106
1638
  export declare namespace i18n {
1107
1639
  /**
1108
1640
  * Get the translated text.
@@ -1155,9 +1687,9 @@ declare class Image_2 {
1155
1687
  /**
1156
1688
  * @param {Geometry} geometry The geometry of the image.
1157
1689
  * @param {TypedArray} buffer The image data as a one dimensional buffer.
1158
- * @param {Array} [imageUids] An array of Uids indexed to slice number.
1690
+ * @param {string[]} [imageUids] An array of Uids indexed to slice number.
1159
1691
  */
1160
- constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: any[]);
1692
+ constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]);
1161
1693
  /**
1162
1694
  * Get the image UID at a given index.
1163
1695
  *
@@ -1165,6 +1697,13 @@ declare class Image_2 {
1165
1697
  * @returns {string} The UID.
1166
1698
  */
1167
1699
  getImageUid(index?: Index): string;
1700
+ /**
1701
+ * Check if this image includes the input uids.
1702
+ *
1703
+ * @param {string[]} uids UIDs to test for presence.
1704
+ * @returns {boolean} True if all uids are in this image uids.
1705
+ */
1706
+ containsImageUids(uids: string[]): boolean;
1168
1707
  /**
1169
1708
  * Get the geometry of the image.
1170
1709
  *
@@ -1188,8 +1727,15 @@ declare class Image_2 {
1188
1727
  * Can window and level be applied to the data?
1189
1728
  *
1190
1729
  * @returns {boolean} True if the data is monochrome.
1730
+ * @deprecated Please use isMonochrome instead.
1191
1731
  */
1192
1732
  canWindowLevel(): boolean;
1733
+ /**
1734
+ * Is the data monochrome.
1735
+ *
1736
+ * @returns {boolean} True if the data is monochrome.
1737
+ */
1738
+ isMonochrome(): boolean;
1193
1739
  /**
1194
1740
  * Can the data be scrolled?
1195
1741
  *
@@ -1266,15 +1812,19 @@ declare class Image_2 {
1266
1812
  /**
1267
1813
  * Get the meta information of the image.
1268
1814
  *
1269
- * @returns {object} The meta information of the image.
1815
+ * @returns {Object<string, any>} The meta information of the image.
1270
1816
  */
1271
- getMeta(): object;
1817
+ getMeta(): {
1818
+ [x: string]: any;
1819
+ };
1272
1820
  /**
1273
1821
  * Set the meta information of the image.
1274
1822
  *
1275
- * @param {object} rhs The meta information of the image.
1823
+ * @param {Object<string, any>} rhs The meta information of the image.
1276
1824
  */
1277
- setMeta(rhs: object): void;
1825
+ setMeta(rhs: {
1826
+ [x: string]: any;
1827
+ }): void;
1278
1828
  /**
1279
1829
  * Get value at offset. Warning: No size check...
1280
1830
  *
@@ -1286,19 +1836,19 @@ declare class Image_2 {
1286
1836
  * Get the offsets where the buffer equals the input value.
1287
1837
  * Loops through the whole volume, can get long for big data...
1288
1838
  *
1289
- * @param {number|object} value The value to check.
1290
- * @returns {Array} The list of offsets.
1839
+ * @param {number|RGB} value The value to check.
1840
+ * @returns {number[]} The list of offsets.
1291
1841
  */
1292
- getOffsets(value: number | object): any[];
1842
+ getOffsets(value: number | RGB): number[];
1293
1843
  /**
1294
1844
  * Check if the input values are in the buffer.
1295
1845
  * Could loop through the whole volume, can get long for big data...
1296
1846
  *
1297
1847
  * @param {Array} values The values to check.
1298
- * @returns {Array} A list of booleans for each input value,
1848
+ * @returns {boolean[]} A list of booleans for each input value,
1299
1849
  * set to true if the value is present in the buffer.
1300
1850
  */
1301
- hasValues(values: any[]): any[];
1851
+ hasValues(values: any[]): boolean[];
1302
1852
  /**
1303
1853
  * Clone the image.
1304
1854
  *
@@ -1347,44 +1897,46 @@ declare class Image_2 {
1347
1897
  * Add an event listener to this class.
1348
1898
  *
1349
1899
  * @param {string} type The event type.
1350
- * @param {object} callback The method associated with the provided
1900
+ * @param {Function} callback The function associated with the provided
1351
1901
  * event type, will be called with the fired event.
1352
1902
  */
1353
- addEventListener(type: string, callback: object): void;
1903
+ addEventListener(type: string, callback: Function): void;
1354
1904
  /**
1355
1905
  * Remove an event listener from this class.
1356
1906
  *
1357
1907
  * @param {string} type The event type.
1358
- * @param {object} callback The method associated with the provided
1908
+ * @param {Function} callback The function associated with the provided
1359
1909
  * event type.
1360
1910
  */
1361
- removeEventListener(type: string, callback: object): void;
1911
+ removeEventListener(type: string, callback: Function): void;
1362
1912
  /**
1363
1913
  * Set the inner buffer values at given offsets.
1364
1914
  *
1365
- * @param {Array} offsets List of offsets where to set the data.
1366
- * @param {object} value The value to set at the given offsets.
1915
+ * @param {number[]} offsets List of offsets where to set the data.
1916
+ * @param {number|RGB} value The value to set at the given offsets.
1367
1917
  * @fires Image#imagechange
1368
1918
  */
1369
- setAtOffsets(offsets: any[], value: object): void;
1919
+ setAtOffsets(offsets: number[], value: number | RGB): void;
1370
1920
  /**
1371
1921
  * Set the inner buffer values at given offsets.
1372
1922
  *
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.
1923
+ * @param {number[][]} offsetsLists List of offset lists where
1924
+ * to set the data.
1925
+ * @param {RGB} value The value to set at the given offsets.
1375
1926
  * @returns {Array} A list of objects representing the original values before
1376
1927
  * replacing them.
1377
1928
  * @fires Image#imagechange
1378
1929
  */
1379
- setAtOffsetsAndGetOriginals(offsetsLists: any[], value: object): any[];
1930
+ setAtOffsetsAndGetOriginals(offsetsLists: number[][], value: RGB): any[];
1380
1931
  /**
1381
1932
  * Set the inner buffer values at given offsets.
1382
1933
  *
1383
- * @param {Array} offsetsLists List of offset lists where to set the data.
1934
+ * @param {number[][]} offsetsLists List of offset lists
1935
+ * where to set the data.
1384
1936
  * @param {object|Array} value The value to set at the given offsets.
1385
1937
  * @fires Image#imagechange
1386
1938
  */
1387
- setAtOffsetsWithIterator(offsetsLists: any[], value: object | any[]): void;
1939
+ setAtOffsetsWithIterator(offsetsLists: number[][], value: object | any[]): void;
1388
1940
  /**
1389
1941
  * Get the value of the image at a specific coordinate.
1390
1942
  *
@@ -1456,20 +2008,20 @@ declare class Image_2 {
1456
2008
  *
1457
2009
  * Note: Uses raw buffer values.
1458
2010
  *
1459
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2011
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1460
2012
  * @returns {Image} The convoluted image.
1461
2013
  */
1462
- convolute2D(weights: any[]): Image_2;
2014
+ convolute2D(weights: number[]): Image_2;
1463
2015
  /**
1464
2016
  * Convolute an image buffer with a given 2D kernel.
1465
2017
  *
1466
2018
  * Note: Uses raw buffer values.
1467
2019
  *
1468
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2020
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1469
2021
  * @param {TypedArray} buffer The buffer to convolute.
1470
2022
  * @param {number} startOffset The index to start at.
1471
2023
  */
1472
- convoluteBuffer(weights: any[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
2024
+ convoluteBuffer(weights: number[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
1473
2025
  /**
1474
2026
  * Transform an image using a specific operator.
1475
2027
  * WARNING: no size check!
@@ -1500,9 +2052,9 @@ export { Image_2 as Image }
1500
2052
  */
1501
2053
  export declare class Index {
1502
2054
  /**
1503
- * @param {Array} values The index values.
2055
+ * @param {number[]} values The index values.
1504
2056
  */
1505
- constructor(values: any[]);
2057
+ constructor(values: number[]);
1506
2058
  /**
1507
2059
  * Get the index value at the given array index.
1508
2060
  *
@@ -1525,9 +2077,9 @@ export declare class Index {
1525
2077
  /**
1526
2078
  * Get the values of this index.
1527
2079
  *
1528
- * @returns {Array} The array of values.
2080
+ * @returns {number[]} The array of values.
1529
2081
  */
1530
- getValues(): any[];
2082
+ getValues(): number[];
1531
2083
  /**
1532
2084
  * Check if the input index can be compared to this one.
1533
2085
  *
@@ -1546,9 +2098,9 @@ export declare class Index {
1546
2098
  * Compare indices and return different dimensions.
1547
2099
  *
1548
2100
  * @param {Index} rhs The index to compare to.
1549
- * @returns {Array} The list of different dimensions.
2101
+ * @returns {number[]} The list of different dimensions.
1550
2102
  */
1551
- compare(rhs: Index): any[];
2103
+ compare(rhs: Index): number[];
1552
2104
  /**
1553
2105
  * Add another index to this one.
1554
2106
  *
@@ -1567,13 +2119,22 @@ export declare class Index {
1567
2119
  /**
1568
2120
  * Get a string id from the index values in the form of: '#0-1_#1-2'.
1569
2121
  *
1570
- * @param {Array} [dims] Optional list of dimensions to use.
2122
+ * @param {number[]} [dims] Optional list of dimensions to use.
1571
2123
  * @returns {string} The string id.
1572
2124
  */
1573
- toStringId(dims?: any[]): string;
2125
+ toStringId(dims?: number[]): string;
1574
2126
  #private;
1575
2127
  }
1576
2128
 
2129
+ /**
2130
+ * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
2131
+ * unsigned int CIE LAB ([0, 65535]).
2132
+ *
2133
+ * @param {object} triplet CIE XYZ triplet as {x,y,z} with CIE LAB range.
2134
+ * @returns {object} CIE LAB triplet as {l,a,b} with unsigned range.
2135
+ */
2136
+ export declare function labToUintLab(triplet: object): object;
2137
+
1577
2138
  /**
1578
2139
  * Layer group.
1579
2140
  *
@@ -1595,18 +2156,6 @@ export declare class LayerGroup {
1595
2156
  * @param {HTMLElement} containerDiv The associated HTML div.
1596
2157
  */
1597
2158
  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
2159
  /**
1611
2160
  * Get the showCrosshair flag.
1612
2161
  *
@@ -1619,6 +2168,12 @@ export declare class LayerGroup {
1619
2168
  * @param {boolean} flag True to display the crosshair.
1620
2169
  */
1621
2170
  setShowCrosshair(flag: boolean): void;
2171
+ /**
2172
+ * Set the imageSmoothing flag value.
2173
+ *
2174
+ * @param {boolean} flag True to enable smoothing.
2175
+ */
2176
+ setImageSmoothing(flag: boolean): void;
1622
2177
  /**
1623
2178
  * Get the Id of the container div.
1624
2179
  *
@@ -1655,19 +2210,25 @@ export declare class LayerGroup {
1655
2210
  * @returns {number} The number of layers.
1656
2211
  */
1657
2212
  getNumberOfLayers(): number;
2213
+ /**
2214
+ * Get the number of view layers handled by this class.
2215
+ *
2216
+ * @returns {number} The number of layers.
2217
+ */
2218
+ getNumberOfViewLayers(): number;
1658
2219
  /**
1659
2220
  * Get the active image layer.
1660
2221
  *
1661
- * @returns {ViewLayer} The layer.
2222
+ * @returns {ViewLayer|undefined} The layer.
1662
2223
  */
1663
- getActiveViewLayer(): ViewLayer;
2224
+ getActiveViewLayer(): ViewLayer | undefined;
1664
2225
  /**
1665
- * Get the view layers associated to a data index.
2226
+ * Get the view layers associated to a data id.
1666
2227
  *
1667
- * @param {number} index The data index.
2228
+ * @param {string} dataId The data id.
1668
2229
  * @returns {ViewLayer[]} The layers.
1669
2230
  */
1670
- getViewLayersByDataIndex(index: number): ViewLayer[];
2231
+ getViewLayersByDataId(dataId: string): ViewLayer[];
1671
2232
  /**
1672
2233
  * Search view layers for equal imae meta data.
1673
2234
  *
@@ -1678,22 +2239,22 @@ export declare class LayerGroup {
1678
2239
  /**
1679
2240
  * Get the view layers data indices.
1680
2241
  *
1681
- * @returns {Array} The list of indices.
2242
+ * @returns {string[]} The list of indices.
1682
2243
  */
1683
- getViewDataIndices(): any[];
2244
+ getViewDataIndices(): string[];
1684
2245
  /**
1685
2246
  * Get the active draw layer.
1686
2247
  *
1687
- * @returns {DrawLayer} The layer.
2248
+ * @returns {DrawLayer|undefined} The layer.
1688
2249
  */
1689
- getActiveDrawLayer(): DrawLayer;
2250
+ getActiveDrawLayer(): DrawLayer | undefined;
1690
2251
  /**
1691
- * Get the draw layers associated to a data index.
2252
+ * Get the draw layers associated to a data id.
1692
2253
  *
1693
- * @param {number} index The data index.
2254
+ * @param {string} dataId The data id.
1694
2255
  * @returns {DrawLayer[]} The layers.
1695
2256
  */
1696
- getDrawLayersByDataIndex(index: number): DrawLayer[];
2257
+ getDrawLayersByDataId(dataId: string): DrawLayer[];
1697
2258
  /**
1698
2259
  * Set the active view layer.
1699
2260
  *
@@ -1701,11 +2262,11 @@ export declare class LayerGroup {
1701
2262
  */
1702
2263
  setActiveViewLayer(index: number): void;
1703
2264
  /**
1704
- * Set the active view layer with a data index.
2265
+ * Set the active view layer with a data id.
1705
2266
  *
1706
- * @param {number} index The data index.
2267
+ * @param {string} dataId The data id.
1707
2268
  */
1708
- setActiveViewLayerByDataIndex(index: number): void;
2269
+ setActiveViewLayerByDataId(dataId: string): void;
1709
2270
  /**
1710
2271
  * Set the active draw layer.
1711
2272
  *
@@ -1713,11 +2274,11 @@ export declare class LayerGroup {
1713
2274
  */
1714
2275
  setActiveDrawLayer(index: number): void;
1715
2276
  /**
1716
- * Set the active draw layer with a data index.
2277
+ * Set the active draw layer with a data id.
1717
2278
  *
1718
- * @param {number} index The data index.
2279
+ * @param {string} dataId The data id.
1719
2280
  */
1720
- setActiveDrawLayerByDataIndex(index: number): void;
2281
+ setActiveDrawLayerByDataId(dataId: string): void;
1721
2282
  /**
1722
2283
  * Add a view layer.
1723
2284
  *
@@ -1736,6 +2297,9 @@ export declare class LayerGroup {
1736
2297
  empty(): void;
1737
2298
  /**
1738
2299
  * Remove a layer from this layer group.
2300
+ * Warning: if current active layer, the index will
2301
+ * be set to `undefined`. Call one of the setActive
2302
+ * methods to define the active index.
1739
2303
  *
1740
2304
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
1741
2305
  */
@@ -1744,6 +2308,7 @@ export declare class LayerGroup {
1744
2308
  * Update layers (but not the active view layer) to a position change.
1745
2309
  *
1746
2310
  * @param {object} event The position change event.
2311
+ * @function
1747
2312
  */
1748
2313
  updateLayersToPositionChange: (event: object) => void;
1749
2314
  /**
@@ -1814,18 +2379,18 @@ export declare class LayerGroup {
1814
2379
  * Add an event listener to this class.
1815
2380
  *
1816
2381
  * @param {string} type The event type.
1817
- * @param {object} callback The method associated with the provided
2382
+ * @param {Function} callback The function associated with the provided
1818
2383
  * event type, will be called with the fired event.
1819
2384
  */
1820
- addEventListener(type: string, callback: object): void;
2385
+ addEventListener(type: string, callback: Function): void;
1821
2386
  /**
1822
2387
  * Remove an event listener from this class.
1823
2388
  *
1824
2389
  * @param {string} type The event type.
1825
- * @param {object} callback The method associated with the provided
2390
+ * @param {Function} callback The function associated with the provided
1826
2391
  * event type.
1827
2392
  */
1828
- removeEventListener(type: string, callback: object): void;
2393
+ removeEventListener(type: string, callback: Function): void;
1829
2394
  #private;
1830
2395
  }
1831
2396
 
@@ -1845,35 +2410,227 @@ export declare namespace logger {
1845
2410
  export function error(msg: string): void;
1846
2411
  }
1847
2412
 
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
-
2413
+ /**
2414
+ * List of available lookup tables (lut).
2415
+ *
2416
+ * @type {Object<string, ColourMap>}
2417
+ */
2418
+ export declare const luts: {
2419
+ [x: string]: ColourMap;
2420
+ };
2421
+
2422
+ /**
2423
+ * Mask {@link Image} factory.
2424
+ */
2425
+ export declare class MaskFactory {
2426
+ /**
2427
+ * Check dicom elements. Throws an error if not suitable.
2428
+ *
2429
+ * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
2430
+ * @returns {object|undefined} A possible warning.
2431
+ */
2432
+ checkElements(_dicomElements: {
2433
+ [x: string]: DataElement;
2434
+ }): object | undefined;
2435
+ /**
2436
+ * Get an {@link Image} object from the read DICOM file.
2437
+ *
2438
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
2439
+ * @param {Uint8Array | Int8Array |
2440
+ * Uint16Array | Int16Array |
2441
+ * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
2442
+ * @returns {Image} A new Image.
2443
+ */
2444
+ create(dataElements: {
2445
+ [x: string]: DataElement;
2446
+ }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
2447
+ }
2448
+
2449
+ /**
2450
+ * DICOM (mask) segment.
2451
+ */
2452
+ export declare class MaskSegment {
2453
+ /**
2454
+ * @param {number} number The segment number.
2455
+ * @param {string} label The segment label.
2456
+ * @param {string} algorithmType The segment number.
2457
+ */
2458
+ constructor(number: number, label: string, algorithmType: string);
2459
+ /**
2460
+ * Segment number (0062,0004).
2461
+ *
2462
+ * @type {number}
2463
+ */
2464
+ number: number;
2465
+ /**
2466
+ * Segment label (0062,0005).
2467
+ *
2468
+ * @type {string}
2469
+ */
2470
+ label: string;
2471
+ /**
2472
+ * Segment algorithm type (0062,0008).
2473
+ *
2474
+ * @type {string}
2475
+ */
2476
+ algorithmType: string;
2477
+ /**
2478
+ * Segment algorithm name (0062,0009).
2479
+ *
2480
+ * @type {string|undefined}
2481
+ */
2482
+ algorithmName: string | undefined;
2483
+ /**
2484
+ * Segment display value as simple value.
2485
+ *
2486
+ * @type {number|undefined}
2487
+ */
2488
+ displayValue: number | undefined;
2489
+ /**
2490
+ * Segment display value as RGB colour ({r,g,b}).
2491
+ *
2492
+ * @type {RGB|undefined}
2493
+ */
2494
+ displayRGBValue: RGB | undefined;
2495
+ /**
2496
+ * Segment property code: specific property
2497
+ * the segment represents (0062,000F).
2498
+ *
2499
+ * @type {DicomCode|undefined}
2500
+ */
2501
+ propertyTypeCode: DicomCode | undefined;
2502
+ /**
2503
+ * Segment property category code: general category
2504
+ * of the property the segment represents (0062,0003).
2505
+ *
2506
+ * @type {DicomCode|undefined}
2507
+ */
2508
+ propertyCategoryCode: DicomCode | undefined;
2509
+ /**
2510
+ * Segment tracking UID (0062,0021).
2511
+ *
2512
+ * @type {string|undefined}
2513
+ */
2514
+ trackingUid: string | undefined;
2515
+ /**
2516
+ * Segment tracking id: text label for the UID (0062,0020).
2517
+ *
2518
+ * @type {string|undefined}
2519
+ */
2520
+ trackingId: string | undefined;
2521
+ }
2522
+
2523
+ /**
2524
+ * Mask segment helper.
2525
+ */
2526
+ export declare class MaskSegmentHelper {
2527
+ /**
2528
+ * @param {Image} mask The associated mask image.
2529
+ */
2530
+ constructor(mask: Image_2);
2531
+ /**
2532
+ * Check if a segment is part of the inner segment list.
2533
+ *
2534
+ * @param {number} segmentNumber The segment number.
2535
+ * @returns {boolean} True if the segment is included.
2536
+ */
2537
+ hasSegment(segmentNumber: number): boolean;
2538
+ /**
2539
+ * Check if a segment is present in a mask image.
2540
+ *
2541
+ * @param {number[]} numbers Array of segment numbers.
2542
+ * @returns {boolean[]} Array of boolean set to true
2543
+ * if the segment is present in the mask.
2544
+ */
2545
+ maskHasSegments(numbers: number[]): boolean[];
2546
+ /**
2547
+ * Get a segment from the inner segment list.
2548
+ *
2549
+ * @param {number} segmentNumber The segment number.
2550
+ * @returns {MaskSegment|undefined} The segment.
2551
+ */
2552
+ getSegment(segmentNumber: number): MaskSegment | undefined;
2553
+ /**
2554
+ * Get the inner segment list.
2555
+ *
2556
+ * @returns {MaskSegment[]} The list of segments.
2557
+ */
2558
+ getSegments(): MaskSegment[];
2559
+ /**
2560
+ * Set the inner segment list.
2561
+ *
2562
+ * @param {MaskSegment[]} list The segment list.
2563
+ */
2564
+ setSegments(list: MaskSegment[]): void;
2565
+ /**
2566
+ * Set the hidden segment list.
2567
+ * TODO: not sure if needed...
2568
+ *
2569
+ * @param {number[]} list The list of hidden segment numbers.
2570
+ */
2571
+ setHiddenSegments(list: number[]): void;
2572
+ /**
2573
+ * Check if a segment is in the hidden list.
2574
+ *
2575
+ * @param {number} segmentNumber The segment number.
2576
+ * @returns {boolean} True if the segment is in the list.
2577
+ */
2578
+ isHidden(segmentNumber: number): boolean;
2579
+ /**
2580
+ * Add a segment to the hidden list.
2581
+ *
2582
+ * @param {number} segmentNumber The segment number.
2583
+ */
2584
+ addToHidden(segmentNumber: number): void;
2585
+ /**
2586
+ * Remove a segment from the hidden list.
2587
+ *
2588
+ * @param {number} segmentNumber The segment number.
2589
+ */
2590
+ removeFromHidden(segmentNumber: number): void;
2591
+ /**
2592
+ * @callback alphaFn@callback alphaFn
2593
+ * @param {number[]|number} value The pixel value.
2594
+ * @param {number} index The values' index.
2595
+ * @returns {number} The opacity of the input value.
2596
+ */
2597
+ /**
2598
+ * Get the alpha function to apply hidden colors.
2599
+ *
2600
+ * @returns {alphaFn} The corresponding alpha function.
2601
+ */
2602
+ getAlphaFunc(): (value: number[] | number, index: number) => number;
2603
+ /**
2604
+ * @callback eventFn@callback eventFn
2605
+ * @param {object} event The event.
2606
+ */
2607
+ /**
2608
+ * Delete a segment.
2609
+ *
2610
+ * @param {number} segmentNumber The segment number.
2611
+ * @param {eventFn} cmdCallback The command event callback.
2612
+ * @param {Function} exeCallback The post execution callback.
2613
+ */
2614
+ deleteSegment(segmentNumber: number, cmdCallback: (event: object) => any, exeCallback: Function): void;
2615
+ #private;
2616
+ }
2617
+
1861
2618
  /**
1862
2619
  * Immutable 3x3 Matrix.
1863
2620
  */
1864
2621
  export declare class Matrix33 {
1865
2622
  /**
1866
- * @param {Array} values row-major ordered 9 values.
2623
+ * @param {number[]} values row-major ordered 9 values.
1867
2624
  */
1868
- constructor(values: any[]);
2625
+ constructor(values: number[]);
1869
2626
  /**
1870
2627
  * Get a value of the matrix.
1871
2628
  *
1872
2629
  * @param {number} row The row at wich to get the value.
1873
2630
  * @param {number} col The column at wich to get the value.
1874
- * @returns {number} The value at the position.
2631
+ * @returns {number|undefined} The value at the position.
1875
2632
  */
1876
- get(row: number, col: number): number;
2633
+ get(row: number, col: number): number | undefined;
1877
2634
  /**
1878
2635
  * Get the inverse of this matrix.
1879
2636
  *
@@ -1912,10 +2669,10 @@ export declare class Matrix33 {
1912
2669
  /**
1913
2670
  * Multiply this matrix by a 3D array.
1914
2671
  *
1915
- * @param {Array} array3D The input 3D array.
1916
- * @returns {Array} The result 3D array.
2672
+ * @param {number[]} array3D The input 3D array.
2673
+ * @returns {number[]} The result 3D array.
1917
2674
  */
1918
- multiplyArray3D(array3D: any[]): any[];
2675
+ multiplyArray3D(array3D: number[]): number[];
1919
2676
  /**
1920
2677
  * Multiply this matrix by a 3D vector.
1921
2678
  *
@@ -1972,10 +2729,10 @@ export declare class Matrix33 {
1972
2729
  export declare class OverlayData {
1973
2730
  /**
1974
2731
  * @param {App} app The associated application.
1975
- * @param {number} dataId The associated data ID.
2732
+ * @param {string} dataId The associated data id.
1976
2733
  * @param {object} configs The overlay config.
1977
2734
  */
1978
- constructor(app: App, dataId: number, configs: object);
2735
+ constructor(app: App, dataId: string, configs: object);
1979
2736
  /**
1980
2737
  * Reset the data.
1981
2738
  */
@@ -2019,6 +2776,101 @@ export declare class OverlayData {
2019
2776
  #private;
2020
2777
  }
2021
2778
 
2779
+ /**
2780
+ * Plane geometry helper.
2781
+ */
2782
+ export declare class PlaneHelper {
2783
+ /**
2784
+ * @param {Spacing} spacing The spacing.
2785
+ * @param {Matrix33} imageOrientation The image oientation.
2786
+ * @param {Matrix33} viewOrientation The view orientation.
2787
+ */
2788
+ constructor(spacing: Spacing, imageOrientation: Matrix33, viewOrientation: Matrix33);
2789
+ /**
2790
+ * Get a 3D offset from a plane one.
2791
+ *
2792
+ * @param {object} offset2D The plane offset as {x,y}.
2793
+ * @returns {Vector3D} The 3D world offset.
2794
+ */
2795
+ getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
2796
+ /**
2797
+ * Get a plane offset from a 3D one.
2798
+ *
2799
+ * @param {object} offset3D The 3D offset as {x,y,z}.
2800
+ * @returns {object} The plane offset as {x,y}.
2801
+ */
2802
+ getPlaneOffsetFromOffset3D(offset3D: object): object;
2803
+ /**
2804
+ * Orient an input vector from real to target space.
2805
+ *
2806
+ * @param {Vector3D} vector The input vector.
2807
+ * @returns {Vector3D} The oriented vector.
2808
+ */
2809
+ getTargetOrientedVector3D(vector: Vector3D): Vector3D;
2810
+ /**
2811
+ * De-orient an input vector from target to real space.
2812
+ *
2813
+ * @param {Vector3D} planeVector The input vector.
2814
+ * @returns {Vector3D} The de-orienteded vector.
2815
+ */
2816
+ getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D;
2817
+ /**
2818
+ * De-orient an input point from target to real space.
2819
+ *
2820
+ * @param {Point3D} planePoint The input point.
2821
+ * @returns {Point3D} The de-orienteded point.
2822
+ */
2823
+ getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D;
2824
+ /**
2825
+ * Orient an input vector from target to image space.
2826
+ *
2827
+ * @param {Vector3D} planeVector The input vector.
2828
+ * @returns {Vector3D} The orienteded vector.
2829
+ */
2830
+ getImageOrientedVector3D(planeVector: Vector3D): Vector3D;
2831
+ /**
2832
+ * Orient an input point from target to image space.
2833
+ *
2834
+ * @param {Point3D} planePoint The input vector.
2835
+ * @returns {Point3D} The orienteded vector.
2836
+ */
2837
+ getImageOrientedPoint3D(planePoint: Point3D): Point3D;
2838
+ /**
2839
+ * De-orient an input vector from image to target space.
2840
+ *
2841
+ * @param {Vector3D} vector The input vector.
2842
+ * @returns {Vector3D} The de-orienteded vector.
2843
+ */
2844
+ getImageDeOrientedVector3D(vector: Vector3D): Vector3D;
2845
+ /**
2846
+ * De-orient an input point from image to target space.
2847
+ *
2848
+ * @param {Point3D} point The input point.
2849
+ * @returns {Point3D} The de-orienteded point.
2850
+ */
2851
+ getImageDeOrientedPoint3D(point: Point3D): Point3D;
2852
+ /**
2853
+ * Reorder values to follow target orientation.
2854
+ *
2855
+ * @param {object} values Values as {x,y,z}.
2856
+ * @returns {object} Reoriented values as {x,y,z}.
2857
+ */
2858
+ getTargetOrientedPositiveXYZ(values: object): object;
2859
+ /**
2860
+ * Get the (view) scroll dimension index.
2861
+ *
2862
+ * @returns {number} The index.
2863
+ */
2864
+ getScrollIndex(): number;
2865
+ /**
2866
+ * Get the native (image) scroll dimension index.
2867
+ *
2868
+ * @returns {number} The index.
2869
+ */
2870
+ getNativeScrollIndex(): number;
2871
+ #private;
2872
+ }
2873
+
2022
2874
  /**
2023
2875
  * Immutable point.
2024
2876
  * Warning: the input array is NOT cloned, modifying it will
@@ -2026,9 +2878,9 @@ export declare class OverlayData {
2026
2878
  */
2027
2879
  export declare class Point {
2028
2880
  /**
2029
- * @param {Array} values The point values.
2881
+ * @param {number[]} values The point values.
2030
2882
  */
2031
- constructor(values: any[]);
2883
+ constructor(values: number[]);
2032
2884
  /**
2033
2885
  * Get the index value at the given array index.
2034
2886
  *
@@ -2051,9 +2903,9 @@ export declare class Point {
2051
2903
  /**
2052
2904
  * Get the values of this index.
2053
2905
  *
2054
- * @returns {Array} The array of values.
2906
+ * @returns {number[]} The array of values.
2055
2907
  */
2056
- getValues(): any[];
2908
+ getValues(): number[];
2057
2909
  /**
2058
2910
  * Check if the input point can be compared to this one.
2059
2911
  *
@@ -2072,9 +2924,9 @@ export declare class Point {
2072
2924
  * Compare points and return different dimensions.
2073
2925
  *
2074
2926
  * @param {Point} rhs The point to compare to.
2075
- * @returns {Array} The list of different dimensions.
2927
+ * @returns {number[]} The list of different dimensions.
2076
2928
  */
2077
- compare(rhs: Point): any[];
2929
+ compare(rhs: Point): number[];
2078
2930
  /**
2079
2931
  * Get the 3D part of this point.
2080
2932
  *
@@ -2132,19 +2984,6 @@ export declare class Point2D {
2132
2984
  * @returns {string} The point as a string.
2133
2985
  */
2134
2986
  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
2987
  #private;
2149
2988
  }
2150
2989
 
@@ -2228,39 +3067,6 @@ export declare class Point3D {
2228
3067
  */
2229
3068
  export declare function precisionRound(number: number, precision: number): number;
2230
3069
 
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
3070
  /**
2265
3071
  * Rescale Slope and Intercept
2266
3072
  */
@@ -2305,6 +3111,36 @@ export declare class RescaleSlopeAndIntercept {
2305
3111
  #private;
2306
3112
  }
2307
3113
 
3114
+ /**
3115
+ * RGB colour class.
3116
+ */
3117
+ export declare class RGB {
3118
+ /**
3119
+ * @param {number} r Red component.
3120
+ * @param {number} g Green component.
3121
+ * @param {number} b Blue component.
3122
+ */
3123
+ constructor(r: number, g: number, b: number);
3124
+ /**
3125
+ * Red component.
3126
+ *
3127
+ * @type {number}
3128
+ */
3129
+ r: number;
3130
+ /**
3131
+ * Green component.
3132
+ *
3133
+ * @type {number}
3134
+ */
3135
+ g: number;
3136
+ /**
3137
+ * Blue component.
3138
+ *
3139
+ * @type {number}
3140
+ */
3141
+ b: number;
3142
+ }
3143
+
2308
3144
  /**
2309
3145
  * Immutable Size class.
2310
3146
  * Warning: the input array is NOT cloned, modifying it will
@@ -2312,9 +3148,9 @@ export declare class RescaleSlopeAndIntercept {
2312
3148
  */
2313
3149
  export declare class Size {
2314
3150
  /**
2315
- * @param {Array} values The size values.
3151
+ * @param {number[]} values The size values.
2316
3152
  */
2317
- constructor(values: any[]);
3153
+ constructor(values: number[]);
2318
3154
  /**
2319
3155
  * Get the size value at the given array index.
2320
3156
  *
@@ -2337,9 +3173,9 @@ export declare class Size {
2337
3173
  /**
2338
3174
  * Get the values of this index.
2339
3175
  *
2340
- * @returns {Array} The array of values.
3176
+ * @returns {number[]} The array of values.
2341
3177
  */
2342
- getValues(): any[];
3178
+ getValues(): number[];
2343
3179
  /**
2344
3180
  * Check if a dimension exists and has more than one element.
2345
3181
  *
@@ -2388,10 +3224,10 @@ export declare class Size {
2388
3224
  * Check that an index is within bounds.
2389
3225
  *
2390
3226
  * @param {Index} index The index to check.
2391
- * @param {Array} dirs Optional list of directions to check.
3227
+ * @param {number[]} dirs Optional list of directions to check.
2392
3228
  * @returns {boolean} True if the given coordinates are within bounds.
2393
3229
  */
2394
- isInBounds(index: Index, dirs: any[]): boolean;
3230
+ isInBounds(index: Index, dirs: number[]): boolean;
2395
3231
  /**
2396
3232
  * Convert an index to an offset in memory.
2397
3233
  *
@@ -2423,9 +3259,9 @@ export declare class Size {
2423
3259
  */
2424
3260
  export declare class Spacing {
2425
3261
  /**
2426
- * @param {Array} values The spacing values.
3262
+ * @param {number[]} values The spacing values.
2427
3263
  */
2428
- constructor(values: any[]);
3264
+ constructor(values: number[]);
2429
3265
  /**
2430
3266
  * Get the spacing value at the given array index.
2431
3267
  *
@@ -2448,9 +3284,9 @@ export declare class Spacing {
2448
3284
  /**
2449
3285
  * Get the values of this spacing.
2450
3286
  *
2451
- * @returns {Array} The array of values.
3287
+ * @returns {number[]} The array of values.
2452
3288
  */
2453
- getValues(): any[];
3289
+ getValues(): number[];
2454
3290
  /**
2455
3291
  * Check for equality.
2456
3292
  *
@@ -2467,6 +3303,14 @@ export declare class Spacing {
2467
3303
  #private;
2468
3304
  }
2469
3305
 
3306
+ /**
3307
+ * Convert sRGB to CIE LAB (standard illuminant D65).
3308
+ *
3309
+ * @param {RGB} triplet sRGB triplet as {r,g,b}.
3310
+ * @returns {object} CIE LAB triplet as {l,a,b}.
3311
+ */
3312
+ export declare function srgbToCielab(triplet: RGB): object;
3313
+
2470
3314
  /**
2471
3315
  * Immutable tag.
2472
3316
  */
@@ -2559,12 +3403,103 @@ export declare class TagValueExtractor {
2559
3403
  /**
2560
3404
  * Get the time.
2561
3405
  *
2562
- * @param {object} _elements The DICOM elements.
3406
+ * @param {Object<string, DataElement>} _elements The DICOM elements.
2563
3407
  * @returns {number|undefined} The time value if available.
2564
3408
  */
2565
- getTime(_elements: object): number | undefined;
3409
+ getTime(_elements: {
3410
+ [x: string]: DataElement;
3411
+ }): number | undefined;
3412
+ }
3413
+
3414
+ /**
3415
+ * Toolbox controller.
3416
+ */
3417
+ export declare class ToolboxController {
3418
+ /**
3419
+ * @param {object} toolList The list of tool objects.
3420
+ */
3421
+ constructor(toolList: object);
3422
+ /**
3423
+ * Initialise.
3424
+ */
3425
+ init(): void;
3426
+ /**
3427
+ * Get the tool list.
3428
+ *
3429
+ * @returns {Array} The list of tool objects.
3430
+ */
3431
+ getToolList(): any[];
3432
+ /**
3433
+ * Check if a tool is in the tool list.
3434
+ *
3435
+ * @param {string} name The name to check.
3436
+ * @returns {boolean} The tool list element for the given name.
3437
+ */
3438
+ hasTool(name: string): boolean;
3439
+ /**
3440
+ * Get the selected tool.
3441
+ *
3442
+ * @returns {object} The selected tool.
3443
+ */
3444
+ getSelectedTool(): object;
3445
+ /**
3446
+ * Get the selected tool event handler.
3447
+ *
3448
+ * @param {string} eventType The event type, for example
3449
+ * mousedown, touchstart...
3450
+ * @returns {Function} The event handler.
3451
+ */
3452
+ getSelectedToolEventHandler(eventType: string): Function;
3453
+ /**
3454
+ * Set the selected tool.
3455
+ *
3456
+ * @param {string} name The name of the tool.
3457
+ */
3458
+ setSelectedTool(name: string): void;
3459
+ /**
3460
+ * Set the selected tool live features.
3461
+ *
3462
+ * @param {object} list The list of features.
3463
+ */
3464
+ setToolFeatures(list: object): void;
3465
+ /**
3466
+ * Listen to layer interaction events.
3467
+ *
3468
+ * @param {LayerGroup} layerGroup The associated layer group.
3469
+ * @param {ViewLayer|DrawLayer} layer The layer to listen to.
3470
+ */
3471
+ bindLayerGroup(layerGroup: LayerGroup, layer: ViewLayer | DrawLayer): void;
3472
+ #private;
3473
+ }
3474
+
3475
+ /**
3476
+ * Tool configuration.
3477
+ */
3478
+ export declare class ToolConfig {
3479
+ /**
3480
+ * @param {string[]} [options] Optional tool options.
3481
+ */
3482
+ constructor(options?: string[]);
3483
+ /**
3484
+ * Optional tool options.
3485
+ * For Draw: list of shape names.
3486
+ * For Filter: list of filter names.
3487
+ *
3488
+ * @type {string[]|undefined}
3489
+ */
3490
+ options: string[] | undefined;
2566
3491
  }
2567
3492
 
3493
+ /**
3494
+ * List of client provided tools to be added to
3495
+ * the default ones.
3496
+ *
3497
+ * @type {Object<string, any>}
3498
+ */
3499
+ export declare const toolList: {
3500
+ [x: string]: any;
3501
+ };
3502
+
2568
3503
  /**
2569
3504
  * Immutable 3D vector.
2570
3505
  */
@@ -2596,10 +3531,10 @@ export declare class Vector3D {
2596
3531
  /**
2597
3532
  * Check for Vector3D equality.
2598
3533
  *
2599
- * @param {object} rhs The other vector to compare to.
3534
+ * @param {Vector3D} rhs The other vector to compare to.
2600
3535
  * @returns {boolean} True if both vectors are equal.
2601
3536
  */
2602
- equals(rhs: object): boolean;
3537
+ equals(rhs: Vector3D): boolean;
2603
3538
  /**
2604
3539
  * Get a string representation of the Vector3D.
2605
3540
  *
@@ -2646,9 +3581,9 @@ export declare class Vector3D {
2646
3581
  * const dicomParser = new dwv.DicomParser();
2647
3582
  * dicomParser.parse(event.target.response);
2648
3583
  * // create the image object
2649
- * const image = createImage(dicomParser.getDicomElements());
3584
+ * const image = dwv.createImage(dicomParser.getDicomElements());
2650
3585
  * // create the view
2651
- * const view = createView(dicomParser.getDicomElements(), image);
3586
+ * const view = dwv.createView(dicomParser.getDicomElements(), image);
2652
3587
  * // setup canvas
2653
3588
  * const canvas = document.createElement('canvas');
2654
3589
  * canvas.width = 256;
@@ -2716,31 +3651,23 @@ export declare class View {
2716
3651
  getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
2717
3652
  /**
2718
3653
  * @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.
3654
+ * @param {number[]|number} value The pixel value.
3655
+ * @param {number} index The values' index.
3656
+ * @returns {number} The opacity of the input value.
2722
3657
  */
2723
3658
  /**
2724
3659
  * Get the alpha function.
2725
3660
  *
2726
3661
  * @returns {alphaFn} The function.
2727
3662
  */
2728
- getAlphaFunction(): (value: object, index: object) => number;
3663
+ getAlphaFunction(): (value: number[] | number, index: number) => number;
2729
3664
  /**
2730
3665
  * Set alpha function.
2731
3666
  *
2732
3667
  * @param {alphaFn} func The function.
2733
3668
  * @fires View#alphafuncchange
2734
3669
  */
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;
3670
+ setAlphaFunction(func: (value: number[] | number, index: number) => number): void;
2744
3671
  /**
2745
3672
  * Get the window presets.
2746
3673
  *
@@ -2750,21 +3677,15 @@ export declare class View {
2750
3677
  /**
2751
3678
  * Get the window presets names.
2752
3679
  *
2753
- * @returns {object} The list of window presets names.
3680
+ * @returns {string[]} The list of window presets names.
2754
3681
  */
2755
- getWindowPresetsNames(): object;
3682
+ getWindowPresetsNames(): string[];
2756
3683
  /**
2757
3684
  * Set the window presets.
2758
3685
  *
2759
3686
  * @param {object} presets The window presets.
2760
3687
  */
2761
3688
  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
3689
  /**
2769
3690
  * Add window presets to the existing ones.
2770
3691
  *
@@ -2780,16 +3701,16 @@ export declare class View {
2780
3701
  /**
2781
3702
  * Get the colour map of the image.
2782
3703
  *
2783
- * @returns {object} The colour map of the image.
3704
+ * @returns {string} The colour map name.
2784
3705
  */
2785
- getColourMap(): object;
3706
+ getColourMap(): string;
2786
3707
  /**
2787
3708
  * Set the colour map of the image.
2788
3709
  *
2789
- * @param {object} map The colour map of the image.
2790
- * @fires View#colourchange
3710
+ * @param {string} name The colour map name.
3711
+ * @fires View#colourmapchange
2791
3712
  */
2792
- setColourMap(map: object): void;
3713
+ setColourMap(name: string): void;
2793
3714
  /**
2794
3715
  * Get the current position.
2795
3716
  *
@@ -2810,12 +3731,12 @@ export declare class View {
2810
3731
  */
2811
3732
  canSetPosition(position: Point): boolean;
2812
3733
  /**
2813
- * Get the origin at a given position.
3734
+ * Get the first origin or at a given position.
2814
3735
  *
2815
- * @param {Point} position The position.
2816
- * @returns {Point} The origin.
3736
+ * @param {Point} [position] Optional position.
3737
+ * @returns {Point3D} The origin.
2817
3738
  */
2818
- getOrigin(position: Point): Point;
3739
+ getOrigin(position?: Point): Point3D;
2819
3740
  /**
2820
3741
  * Set the current position.
2821
3742
  *
@@ -2837,14 +3758,19 @@ export declare class View {
2837
3758
  /**
2838
3759
  * Set the view window/level.
2839
3760
  *
2840
- * @param {number} center The window center.
2841
- * @param {number} width The window width.
3761
+ * @param {WindowLevel} wl The window and level.
2842
3762
  * @param {string} [name] Associated preset name, defaults to 'manual'.
2843
3763
  * Warning: uses the latest set rescale LUT or the default linear one.
2844
3764
  * @param {boolean} [silent] Flag to launch events with skipGenerate.
2845
3765
  * @fires View#wlchange
2846
3766
  */
2847
- setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void;
3767
+ setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
3768
+ /**
3769
+ * Get the window/level.
3770
+ *
3771
+ * @returns {WindowLevel} The window and level.
3772
+ */
3773
+ getWindowLevel(): WindowLevel;
2848
3774
  /**
2849
3775
  * Set the window level to the preset with the input name.
2850
3776
  *
@@ -2863,25 +3789,25 @@ export declare class View {
2863
3789
  * Add an event listener to this class.
2864
3790
  *
2865
3791
  * @param {string} type The event type.
2866
- * @param {object} callback The method associated with the provided
3792
+ * @param {Function} callback The function associated with the provided
2867
3793
  * event type, will be called with the fired event.
2868
3794
  */
2869
- addEventListener(type: string, callback: object): void;
3795
+ addEventListener(type: string, callback: Function): void;
2870
3796
  /**
2871
3797
  * Remove an event listener from this class.
2872
3798
  *
2873
3799
  * @param {string} type The event type.
2874
- * @param {object} callback The method associated with the provided
3800
+ * @param {Function} callback The function associated with the provided
2875
3801
  * event type.
2876
3802
  */
2877
- removeEventListener(type: string, callback: object): void;
3803
+ removeEventListener(type: string, callback: Function): void;
2878
3804
  /**
2879
3805
  * Get the image window/level that covers the full data range.
2880
3806
  * Warning: uses the latest set rescale LUT or the default linear one.
2881
3807
  *
2882
- * @returns {WindowCenterAndWidth} A min/max window level.
3808
+ * @returns {WindowLevel} A min/max window level.
2883
3809
  */
2884
- getWindowLevelMinMax(): WindowCenterAndWidth;
3810
+ getWindowLevelMinMax(): WindowLevel;
2885
3811
  /**
2886
3812
  * Set the image window/level to cover the full data range.
2887
3813
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -2934,21 +3860,69 @@ export declare class View {
2934
3860
  #private;
2935
3861
  }
2936
3862
 
3863
+ /**
3864
+ * View configuration: mainly defines the ´divId´
3865
+ * of the associated HTML div.
3866
+ */
3867
+ export declare class ViewConfig {
3868
+ /**
3869
+ * @param {string} divId The associated HTML div id.
3870
+ */
3871
+ constructor(divId: string);
3872
+ /**
3873
+ * Associated HTML div id.
3874
+ *
3875
+ * @type {string}
3876
+ */
3877
+ divId: string;
3878
+ /**
3879
+ * Optional orientation of the data; 'axial', 'coronal' or 'sagittal'.
3880
+ * If undefined, will use the data aquisition plane.
3881
+ *
3882
+ * @type {string|undefined}
3883
+ */
3884
+ orientation: string | undefined;
3885
+ /**
3886
+ * Optional view colour map name.
3887
+ *
3888
+ * @type {string|undefined}
3889
+ */
3890
+ colourMap: string | undefined;
3891
+ /**
3892
+ * Optional layer opacity; in [0, 1] range.
3893
+ *
3894
+ * @type {number|undefined}
3895
+ */
3896
+ opacity: number | undefined;
3897
+ /**
3898
+ * Optional layer window center.
3899
+ *
3900
+ * @type {number|undefined}
3901
+ */
3902
+ windowCenter: number | undefined;
3903
+ /**
3904
+ * Optional layer window width.
3905
+ *
3906
+ * @type {number|undefined}
3907
+ */
3908
+ windowWidth: number | undefined;
3909
+ }
3910
+
2937
3911
  /**
2938
3912
  * View controller.
2939
3913
  */
2940
3914
  export declare class ViewController {
2941
3915
  /**
2942
3916
  * @param {View} view The associated view.
2943
- * @param {number} index The associated data index.
3917
+ * @param {string} dataId The associated data id.
2944
3918
  */
2945
- constructor(view: View, index: number);
3919
+ constructor(view: View, dataId: string);
2946
3920
  /**
2947
3921
  * Get the plane helper.
2948
3922
  *
2949
- * @returns {object} The helper.
3923
+ * @returns {PlaneHelper} The helper.
2950
3924
  */
2951
- getPlaneHelper(): object;
3925
+ getPlaneHelper(): PlaneHelper;
2952
3926
  /**
2953
3927
  * Check is the associated image is a mask.
2954
3928
  *
@@ -2958,9 +3932,9 @@ export declare class ViewController {
2958
3932
  /**
2959
3933
  * Get the mask segment helper.
2960
3934
  *
2961
- * @returns {object} The helper.
3935
+ * @returns {MaskSegmentHelper} The helper.
2962
3936
  */
2963
- getMaskSegmentHelper(): object;
3937
+ getMaskSegmentHelper(): MaskSegmentHelper;
2964
3938
  /**
2965
3939
  * Apply the hidden segments list by setting
2966
3940
  * the corresponding alpha function.
@@ -2986,9 +3960,9 @@ export declare class ViewController {
2986
3960
  /**
2987
3961
  * Get the window/level presets names.
2988
3962
  *
2989
- * @returns {Array} The presets names.
3963
+ * @returns {string[]} The presets names.
2990
3964
  */
2991
- getWindowLevelPresetsNames(): any[];
3965
+ getWindowLevelPresetsNames(): string[];
2992
3966
  /**
2993
3967
  * Add window/level presets to the view.
2994
3968
  *
@@ -3045,12 +4019,12 @@ export declare class ViewController {
3045
4019
  */
3046
4020
  getCurrentScrollIndexValue(): object;
3047
4021
  /**
3048
- * Get the origin at a given posittion.
4022
+ * Get the first origin or at a given position.
3049
4023
  *
3050
- * @param {Point} position The input position.
3051
- * @returns {Point} The origin.
4024
+ * @param {Point} [position] Opitonal position.
4025
+ * @returns {Point3D} The origin.
3052
4026
  */
3053
- getOrigin(position: Point): Point;
4027
+ getOrigin(position?: Point): Point3D;
3054
4028
  /**
3055
4029
  * Get the current scroll position value.
3056
4030
  *
@@ -3061,23 +4035,23 @@ export declare class ViewController {
3061
4035
  * Generate display image data to be given to a canvas.
3062
4036
  *
3063
4037
  * @param {ImageData} array The array to fill in.
3064
- * @param {Index} index Optional index at which to generate,
4038
+ * @param {Index} [index] Optional index at which to generate,
3065
4039
  * otherwise generates at current index.
3066
4040
  */
3067
- generateImageData(array: ImageData, index: Index): void;
4041
+ generateImageData(array: ImageData, index?: Index): void;
3068
4042
  /**
3069
4043
  * Set the associated image.
3070
4044
  *
3071
4045
  * @param {Image} img The associated image.
3072
- * @param {number} index The data index of the image.
4046
+ * @param {string} dataId The data id of the image.
3073
4047
  */
3074
- setImage(img: Image_2, index: number): void;
4048
+ setImage(img: Image_2, dataId: string): void;
3075
4049
  /**
3076
- * Get the current spacing.
4050
+ * Get the current view (2D) spacing.
3077
4051
  *
3078
- * @returns {Array} The 2D spacing.
4052
+ * @returns {number[]} The spacing as a 2D array.
3079
4053
  */
3080
- get2DSpacing(): any[];
4054
+ get2DSpacing(): number[];
3081
4055
  /**
3082
4056
  * Get the image rescaled value at the input position.
3083
4057
  *
@@ -3117,8 +4091,15 @@ export declare class ViewController {
3117
4091
  * Can window and level be applied to the data?
3118
4092
  *
3119
4093
  * @returns {boolean} True if possible.
4094
+ * @deprecated Please use isMonochrome instead.
3120
4095
  */
3121
4096
  canWindowLevel(): boolean;
4097
+ /**
4098
+ * Is the data monochrome.
4099
+ *
4100
+ * @returns {boolean} True if the data is monochrome.
4101
+ */
4102
+ isMonochrome(): boolean;
3122
4103
  /**
3123
4104
  * Can the data be scrolled?
3124
4105
  *
@@ -3168,20 +4149,19 @@ export declare class ViewController {
3168
4149
  */
3169
4150
  setCurrentPosition(pos: Point, silent?: boolean): boolean;
3170
4151
  /**
3171
- * Get a position from a 2D (x,y) position.
4152
+ * Get a world position from a 2D plane position.
3172
4153
  *
3173
- * @param {number} x The column position.
3174
- * @param {number} y The row position.
4154
+ * @param {Point2D} point2D The input point.
3175
4155
  * @returns {Point} The associated position.
3176
4156
  */
3177
- getPositionFromPlanePoint(x: number, y: number): Point;
4157
+ getPositionFromPlanePoint(point2D: Point2D): Point;
3178
4158
  /**
3179
- * Get a 2D (x,y) position from a position.
4159
+ * Get a 2D plane position from a world position.
3180
4160
  *
3181
4161
  * @param {Point} point The 3D position.
3182
- * @returns {object} The 2D position.
4162
+ * @returns {Point2D} The 2D position.
3183
4163
  */
3184
- getPlanePositionFromPosition(point: Point): object;
4164
+ getPlanePositionFromPosition(point: Point): Point2D;
3185
4165
  /**
3186
4166
  * Set the current index.
3187
4167
  *
@@ -3194,10 +4174,10 @@ export declare class ViewController {
3194
4174
  * Get a plane 3D position from a plane 2D position: does not compensate
3195
4175
  * for the image origin. Needed for setting the scale center...
3196
4176
  *
3197
- * @param {object} point2D The 2D position as {x,y}.
4177
+ * @param {Point2D} point2D The 2D position.
3198
4178
  * @returns {Point3D} The 3D point.
3199
4179
  */
3200
- getPlanePositionFromPlanePoint(point2D: object): Point3D;
4180
+ getPlanePositionFromPlanePoint(point2D: Point2D): Point3D;
3201
4181
  /**
3202
4182
  * Get a 3D offset from a plane one.
3203
4183
  *
@@ -3246,9 +4226,9 @@ export declare class ViewController {
3246
4226
  /**
3247
4227
  * Get the window/level.
3248
4228
  *
3249
- * @returns {object} The window center and width.
4229
+ * @returns {WindowLevel} The window and level.
3250
4230
  */
3251
- getWindowLevel(): object;
4231
+ getWindowLevel(): WindowLevel;
3252
4232
  /**
3253
4233
  * Get the current window level preset name.
3254
4234
  *
@@ -3256,58 +4236,51 @@ export declare class ViewController {
3256
4236
  */
3257
4237
  getCurrentWindowPresetName(): string;
3258
4238
  /**
3259
- * Set the window/level.
4239
+ * Set the window and level.
3260
4240
  *
3261
- * @param {number} wc The window center.
3262
- * @param {number} ww The window width.
4241
+ * @param {WindowLevel} wl The window and level.
3263
4242
  */
3264
- setWindowLevel(wc: number, ww: number): void;
4243
+ setWindowLevel(wl: WindowLevel): void;
3265
4244
  /**
3266
4245
  * Get the colour map.
3267
4246
  *
3268
- * @returns {object} The colour map.
4247
+ * @returns {string} The colour map name.
3269
4248
  */
3270
- getColourMap(): object;
4249
+ getColourMap(): string;
3271
4250
  /**
3272
4251
  * Set the colour map.
3273
4252
  *
3274
- * @param {object} colourMap The colour map.
4253
+ * @param {string} name The colour map name.
3275
4254
  */
3276
- setColourMap(colourMap: object): void;
4255
+ setColourMap(name: string): void;
3277
4256
  /**
3278
4257
  * @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.
4258
+ * @param {number[]|number} value The pixel value.
4259
+ * @param {number} index The values' index.
4260
+ * @returns {number} The opacity of the input value.
3282
4261
  */
3283
4262
  /**
3284
4263
  * Set the view per value alpha function.
3285
4264
  *
3286
4265
  * @param {alphaFn} func The function.
3287
4266
  */
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;
4267
+ setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
3295
4268
  /**
3296
4269
  * Add an event listener to this class.
3297
4270
  *
3298
4271
  * @param {string} type The event type.
3299
- * @param {object} callback The method associated with the provided
4272
+ * @param {Function} callback The function associated with the provided
3300
4273
  * event type, will be called with the fired event.
3301
4274
  */
3302
- addEventListener(type: string, callback: object): void;
4275
+ addEventListener(type: string, callback: Function): void;
3303
4276
  /**
3304
4277
  * Remove an event listener from this class.
3305
4278
  *
3306
4279
  * @param {string} type The event type.
3307
- * @param {object} callback The method associated with the provided
4280
+ * @param {Function} callback The function associated with the provided
3308
4281
  * event type.
3309
4282
  */
3310
- removeEventListener(type: string, callback: object): void;
4283
+ removeEventListener(type: string, callback: Function): void;
3311
4284
  #private;
3312
4285
  }
3313
4286
 
@@ -3321,24 +4294,24 @@ export declare class ViewLayer {
3321
4294
  */
3322
4295
  constructor(containerDiv: HTMLElement);
3323
4296
  /**
3324
- * Get the associated data index.
4297
+ * Get the associated data id.
3325
4298
  *
3326
- * @returns {number} The index.
4299
+ * @returns {string} The data id.
3327
4300
  */
3328
- getDataIndex(): number;
4301
+ getDataId(): string;
3329
4302
  /**
3330
- * Set the imageSmoothingEnabled flag value.
4303
+ * Set the imageSmoothing flag value.
3331
4304
  *
3332
4305
  * @param {boolean} flag True to enable smoothing.
3333
4306
  */
3334
- enableImageSmoothing(flag: boolean): void;
4307
+ setImageSmoothing(flag: boolean): void;
3335
4308
  /**
3336
4309
  * Set the associated view.
3337
4310
  *
3338
4311
  * @param {object} view The view.
3339
- * @param {number} index The associated data index.
4312
+ * @param {string} dataId The associated data id.
3340
4313
  */
3341
- setView(view: object, index: number): void;
4314
+ setView(view: object, dataId: string): void;
3342
4315
  /**
3343
4316
  * Get the view controller.
3344
4317
  *
@@ -3355,12 +4328,14 @@ export declare class ViewLayer {
3355
4328
  * Handle an image set event.
3356
4329
  *
3357
4330
  * @param {object} event The event.
4331
+ * @function
3358
4332
  */
3359
4333
  onimageset: (event: object) => void;
3360
4334
  /**
3361
4335
  * Handle an image change event.
3362
4336
  *
3363
4337
  * @param {object} event The event.
4338
+ * @function
3364
4339
  */
3365
4340
  onimagechange: (event: object) => void;
3366
4341
  /**
@@ -3401,13 +4376,25 @@ export declare class ViewLayer {
3401
4376
  * Add a flip offset along the layer Y axis.
3402
4377
  */
3403
4378
  addFlipOffsetY(): void;
4379
+ /**
4380
+ * Flip the scale along the layer X axis.
4381
+ */
4382
+ flipScaleX(): void;
4383
+ /**
4384
+ * Flip the scale along the layer Y axis.
4385
+ */
4386
+ flipScaleY(): void;
4387
+ /**
4388
+ * Flip the scale along the layer Z axis.
4389
+ */
4390
+ flipScaleZ(): void;
3404
4391
  /**
3405
4392
  * Set the layer scale.
3406
4393
  *
3407
4394
  * @param {object} newScale The scale as {x,y}.
3408
- * @param {Point3D} center The scale center.
4395
+ * @param {Point3D} [center] The scale center.
3409
4396
  */
3410
- setScale(newScale: object, center: Point3D): void;
4397
+ setScale(newScale: object, center?: Point3D): void;
3411
4398
  /**
3412
4399
  * Set the base layer offset. Updates the layer offset.
3413
4400
  *
@@ -3423,45 +4410,41 @@ export declare class ViewLayer {
3423
4410
  */
3424
4411
  setOffset(newOffset: object): void;
3425
4412
  /**
3426
- * Transform a display position to an index.
4413
+ * Transform a display position to a 2D index.
3427
4414
  *
3428
- * @param {number} x The X position.
3429
- * @param {number} y The Y position.
3430
- * @returns {Index} The equivalent index.
4415
+ * @param {Point2D} point2D The input point.
4416
+ * @returns {Index} The equivalent 2D index.
3431
4417
  */
3432
- displayToPlaneIndex(x: number, y: number): Index;
4418
+ displayToPlaneIndex(point2D: Point2D): Index;
3433
4419
  /**
3434
4420
  * Remove scale from a display position.
3435
4421
  *
3436
- * @param {number} x The X position.
3437
- * @param {number} y The Y position.
3438
- * @returns {object} The de-scaled position as {x,y}.
4422
+ * @param {Point2D} point2D The input point.
4423
+ * @returns {Point2D} The de-scaled point.
3439
4424
  */
3440
- displayToPlaneScale(x: number, y: number): object;
4425
+ displayToPlaneScale(point2D: Point2D): Point2D;
3441
4426
  /**
3442
4427
  * Get a plane position from a display position.
3443
4428
  *
3444
- * @param {number} x The X position.
3445
- * @param {number} y The Y position.
3446
- * @returns {object} The plane position as {x,y}.
4429
+ * @param {Point2D} point2D The input point.
4430
+ * @returns {Point2D} The plane position.
3447
4431
  */
3448
- displayToPlanePos(x: number, y: number): object;
4432
+ displayToPlanePos(point2D: Point2D): Point2D;
3449
4433
  /**
3450
4434
  * Get a display position from a plane position.
3451
4435
  *
3452
- * @param {number} x The X position.
3453
- * @param {number} y The Y position.
3454
- * @returns {object} The display position as {x,y}.
4436
+ * @param {Point2D} point2D The input point.
4437
+ * @returns {Point2D} The display position, can be individually
4438
+ * undefined if out of bounds.
3455
4439
  */
3456
- planePosToDisplay(x: number, y: number): object;
4440
+ planePosToDisplay(point2D: Point2D): Point2D;
3457
4441
  /**
3458
4442
  * Get a main plane position from a display position.
3459
4443
  *
3460
- * @param {number} x The X position.
3461
- * @param {number} y The Y position.
3462
- * @returns {object} The main plane position as {x,y}.
4444
+ * @param {Point2D} point2D The input point.
4445
+ * @returns {Point2D} The main plane position.
3463
4446
  */
3464
- displayToMainPlanePos(x: number, y: number): object;
4447
+ displayToMainPlanePos(point2D: Point2D): Point2D;
3465
4448
  /**
3466
4449
  * Display the layer.
3467
4450
  *
@@ -3510,18 +4493,18 @@ export declare class ViewLayer {
3510
4493
  * Add an event listener to this class.
3511
4494
  *
3512
4495
  * @param {string} type The event type.
3513
- * @param {object} callback The method associated with the provided
4496
+ * @param {Function} callback The function associated with the provided
3514
4497
  * event type, will be called with the fired event.
3515
4498
  */
3516
- addEventListener(type: string, callback: object): void;
4499
+ addEventListener(type: string, callback: Function): void;
3517
4500
  /**
3518
4501
  * Remove an event listener from this class.
3519
4502
  *
3520
4503
  * @param {string} type The event type.
3521
- * @param {object} callback The method associated with the provided
4504
+ * @param {Function} callback The function associated with the provided
3522
4505
  * event type.
3523
4506
  */
3524
- removeEventListener(type: string, callback: object): void;
4507
+ removeEventListener(type: string, callback: Function): void;
3525
4508
  /**
3526
4509
  * Set the current position.
3527
4510
  *
@@ -3538,101 +4521,55 @@ export declare class ViewLayer {
3538
4521
  }
3539
4522
 
3540
4523
  /**
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}
4524
+ * Window and Level also known as window width and center.
3550
4525
  */
3551
- export declare class WindowCenterAndWidth {
4526
+ export declare class WindowLevel {
3552
4527
  /**
3553
4528
  * @param {number} center The window center.
3554
4529
  * @param {number} width The window width.
3555
4530
  */
3556
4531
  constructor(center: number, width: number);
3557
4532
  /**
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.
4533
+ * The window center.
3571
4534
  *
3572
- * @param {number} offset The signed data offset,
3573
- * typically: slope * ( size / 2).
4535
+ * @type {number}
3574
4536
  */
3575
- setSignedOffset(offset: number): void;
4537
+ center: number;
3576
4538
  /**
3577
- * Apply the window level on an input value.
4539
+ * The window width.
3578
4540
  *
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]).
4541
+ * @type {number}
3582
4542
  */
3583
- apply(value: number): number;
4543
+ width: number;
3584
4544
  /**
3585
- * Check for window level equality.
4545
+ * Check for equality.
3586
4546
  *
3587
- * @param {WindowCenterAndWidth} rhs The other window level to compare to.
3588
- * @returns {boolean} True if both window level are equal.
4547
+ * @param {WindowLevel} rhs The other object to compare to.
4548
+ * @returns {boolean} True if both objects are equal.
3589
4549
  */
3590
- equals(rhs: WindowCenterAndWidth): boolean;
3591
- #private;
4550
+ equals(rhs: WindowLevel): boolean;
3592
4551
  }
3593
4552
 
3594
4553
  /**
3595
- * Window LUT class.
3596
- * Typically converts from float to integer.
4554
+ * Writer rule.
3597
4555
  */
3598
- export declare class WindowLut {
4556
+ export declare class WriterRule {
3599
4557
  /**
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.
4558
+ * @param {string} action The rule action.
3612
4559
  */
3613
- getWindowLevel(): WindowCenterAndWidth;
4560
+ constructor(action: string);
3614
4561
  /**
3615
- * Get the rescale lut.
4562
+ * Rule action: `copy`, `remove`, `clear` or `replace`.
3616
4563
  *
3617
- * @returns {RescaleLut} The rescale lut.
4564
+ * @type {string}
3618
4565
  */
3619
- getRescaleLut(): RescaleLut;
4566
+ action: string;
3620
4567
  /**
3621
- * Set the window center and width.
4568
+ * Optional value to use for replace action.
3622
4569
  *
3623
- * @param {WindowCenterAndWidth} wl The window level.
4570
+ * @type {any|undefined}
3624
4571
  */
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;
4572
+ value: any | undefined;
3636
4573
  }
3637
4574
 
3638
4575
  export { }