dwv 0.33.0-beta.8 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dwv.d.ts CHANGED
@@ -4,9 +4,13 @@ import Konva from 'konva';
4
4
  * Add tags to the dictionary.
5
5
  *
6
6
  * @param {string} group The group key.
7
- * @param {object} tags The tags to add.
7
+ * @param {Object<string, string[]>} tags The tags to add as an
8
+ * object indexed by element key with values as:
9
+ * [VR, multiplicity, TagName] (all strings).
8
10
  */
9
- export declare function addTagsToDictionary(group: string, tags: object): void;
11
+ export declare function addTagsToDictionary(group: string, tags: {
12
+ [x: string]: string[];
13
+ }): void;
10
14
 
11
15
  /**
12
16
  * List of ViewConfigs indexed by dataIds.
@@ -34,15 +38,9 @@ export declare class App {
34
38
  * Get the image.
35
39
  *
36
40
  * @param {string} dataId The data id.
37
- * @returns {Image} The associated image.
38
- */
39
- getImage(dataId: string): Image_2;
40
- /**
41
- * Get the last loaded image.
42
- *
43
- * @returns {Image} The image.
41
+ * @returns {Image|undefined} The associated image.
44
42
  */
45
- getLastImage(): Image_2;
43
+ getImage(dataId: string): Image_2 | undefined;
46
44
  /**
47
45
  * Set the image at the given id.
48
46
  *
@@ -50,63 +48,71 @@ export declare class App {
50
48
  * @param {Image} img The associated image.
51
49
  */
52
50
  setImage(dataId: string, img: Image_2): void;
53
- /**
54
- * Set the last image.
55
- *
56
- * @param {Image} img The associated image.
57
- */
58
- setLastImage(img: Image_2): void;
59
51
  /**
60
52
  * Add a new image.
61
53
  *
62
54
  * @param {Image} image The new image.
63
55
  * @param {object} meta The image meta.
56
+ * @param {string} source The source of the new image,
57
+ * will be passed with load events.
64
58
  * @returns {string} The new image data id.
65
59
  */
66
- addNewImage(image: Image_2, meta: object): string;
60
+ addNewImage(image: Image_2, meta: object, source: string): string;
67
61
  /**
68
62
  * Get the meta data.
69
63
  *
70
64
  * @param {string} dataId The data id.
71
- * @returns {object} The list of meta data.
65
+ * @returns {Object<string, DataElement>|undefined} The list of meta data.
72
66
  */
73
- getMetaData(dataId: string): object;
67
+ getMetaData(dataId: string): {
68
+ [x: string]: DataElement;
69
+ } | undefined;
74
70
  /**
75
71
  * Get the list of ids in the data storage.
76
72
  *
77
- * @returns {Array} The list of data ids.
73
+ * @returns {string[]} The list of data ids.
78
74
  */
79
- getDataIds(): any[];
75
+ getDataIds(): string[];
80
76
  /**
81
- * Can the data be scrolled?
77
+ * Get the list of dataIds that contain the input UIDs.
78
+ *
79
+ * @param {string[]} uids A list of UIDs.
80
+ * @returns {string[]} The list of dataIds that contain the UIDs.
81
+ */
82
+ getDataIdsFromSopUids(uids: string[]): string[];
83
+ /**
84
+ * Can the data (of the active view of the active layer) be scrolled?
82
85
  *
83
86
  * @returns {boolean} True if the data has a third dimension greater than one.
87
+ * @deprecated Please use the ViewController equivalent directly instead.
84
88
  */
85
89
  canScroll(): boolean;
86
90
  /**
87
- * Can window and level be applied to the data?
91
+ * Can window and level be applied to the data
92
+ * (of the active view of the active layer)?
88
93
  *
89
94
  * @returns {boolean} True if the data is monochrome.
95
+ * @deprecated Please use the ViewController equivalent directly instead.
90
96
  */
91
97
  canWindowLevel(): boolean;
92
98
  /**
93
- * Get the layer scale on top of the base scale.
99
+ * Get the active layer group scale on top of the base scale.
94
100
  *
95
- * @returns {object} The scale as {x,y}.
101
+ * @returns {Scalar3D} The scale as {x,y,z}.
96
102
  */
97
- getAddedScale(): object;
103
+ getAddedScale(): Scalar3D;
98
104
  /**
99
- * Get the base scale.
105
+ * Get the base scale of the active layer group.
100
106
  *
101
- * @returns {object} The scale as {x,y}.
107
+ * @returns {Scalar3D} The scale as {x,y,z}.
102
108
  */
103
- getBaseScale(): object;
109
+ getBaseScale(): Scalar3D;
104
110
  /**
105
- * Get the layer offset.
111
+ * Get the layer offset of the active layer group.
106
112
  *
107
- * @returns {object} The offset.
113
+ * @returns {Scalar3D} The offset as {x,y,z}.
108
114
  */
109
- getOffset(): object;
115
+ getOffset(): Scalar3D;
110
116
  /**
111
117
  * Get the toolbox controller.
112
118
  *
@@ -117,9 +123,15 @@ export declare class App {
117
123
  * Get the active layer group.
118
124
  * The layer is available after the first loaded item.
119
125
  *
120
- * @returns {LayerGroup} The layer group.
126
+ * @returns {LayerGroup|undefined} The layer group.
127
+ */
128
+ getActiveLayerGroup(): LayerGroup | undefined;
129
+ /**
130
+ * Set the active layer group.
131
+ *
132
+ * @param {number} index The layer group index.
121
133
  */
122
- getActiveLayerGroup(): LayerGroup;
134
+ setActiveLayerGroup(index: number): void;
123
135
  /**
124
136
  * Get the view layers associated to a data id.
125
137
  * The layer are available after the first loaded item.
@@ -167,7 +179,7 @@ export declare class App {
167
179
  /**
168
180
  * Initialise the application.
169
181
  *
170
- * @param {AppOptions} opt The application options
182
+ * @param {AppOptions} opt The application options.
171
183
  * @example
172
184
  * // create the dwv app
173
185
  * const app = new dwv.App();
@@ -229,8 +241,8 @@ export declare class App {
229
241
  * @fires App#loadprogress
230
242
  * @fires App#loaditem
231
243
  * @fires App#loadend
232
- * @fires App#loaderror
233
- * @fires App#loadabort
244
+ * @fires App#error
245
+ * @fires App#abort
234
246
  * @function
235
247
  */
236
248
  loadFiles: (files: File[]) => void;
@@ -239,15 +251,15 @@ export declare class App {
239
251
  *
240
252
  * @param {string[]} urls The list of urls to load.
241
253
  * @param {object} [options] The options object, can contain:
242
- * - requestHeaders: an array of {name, value} to use as request headers
243
- * - withCredentials: boolean xhr.withCredentials flag to pass to the request
244
- * - batchSize: the size of the request url batch
254
+ * - requestHeaders: an array of {name, value} to use as request headers,
255
+ * - withCredentials: boolean xhr.withCredentials flag to pass to the request,
256
+ * - batchSize: the size of the request url batch.
245
257
  * @fires App#loadstart
246
258
  * @fires App#loadprogress
247
259
  * @fires App#loaditem
248
260
  * @fires App#loadend
249
- * @fires App#loaderror
250
- * @fires App#loadabort
261
+ * @fires App#error
262
+ * @fires App#abort
251
263
  * @function
252
264
  */
253
265
  loadURLs: (urls: string[], options?: object) => void;
@@ -268,15 +280,21 @@ export declare class App {
268
280
  * @fires App#loadprogress
269
281
  * @fires App#loaditem
270
282
  * @fires App#loadend
271
- * @fires App#loaderror
272
- * @fires App#loadabort
283
+ * @fires App#error
284
+ * @fires App#abort
273
285
  * @function
274
286
  */
275
287
  loadImageObject: (data: any[]) => void;
276
288
  /**
277
- * Abort the current load.
289
+ * Abort all the current loads.
290
+ */
291
+ abortAllLoads(): void;
292
+ /**
293
+ * Abort an individual data load.
294
+ *
295
+ * @param {string} dataId The data to stop loading.
278
296
  */
279
- abortLoad(): void;
297
+ abortLoad(dataId: string): void;
280
298
  /**
281
299
  * Fit the display to the data of each layer group.
282
300
  * To be called once the image is loaded.
@@ -284,6 +302,9 @@ export declare class App {
284
302
  fitToContainer(): void;
285
303
  /**
286
304
  * Init the Window/Level display
305
+ * (of the active layer of the active layer group).
306
+ *
307
+ * @deprecated Please set the opacity of the desired view layer directly.
287
308
  */
288
309
  initWLDisplay(): void;
289
310
  /**
@@ -292,6 +313,26 @@ export declare class App {
292
313
  * @param {boolean} flag True to enable smoothing.
293
314
  */
294
315
  setImageSmoothing(flag: boolean): void;
316
+ /**
317
+ * Get the layer group configuration from a data id.
318
+ *
319
+ * @param {string} dataId The data id.
320
+ * @param {boolean} [excludeStarConfig] Exclude the star config
321
+ * (default to false).
322
+ * @returns {ViewConfig[]} The list of associated configs.
323
+ */
324
+ getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
325
+ /**
326
+ * Get the layer group configuration for a data id and group
327
+ * div id.
328
+ *
329
+ * @param {string} dataId The data id.
330
+ * @param {string} groupDivId The layer group div id.
331
+ * @param {boolean} [excludeStarConfig] Exclude the star config
332
+ * (default to false).
333
+ * @returns {ViewConfig|undefined} The associated config.
334
+ */
335
+ getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
295
336
  /**
296
337
  * Get the data view config.
297
338
  * Carefull, returns a reference, do not modify without resetting.
@@ -321,11 +362,11 @@ export declare class App {
321
362
  * Remove a data view config.
322
363
  *
323
364
  * @param {string} dataId The data id.
324
- * @param {ViewConfig} config The view configuration.
365
+ * @param {string} divId The div id.
325
366
  */
326
- removeDataViewConfig(dataId: string, config: ViewConfig): void;
367
+ removeDataViewConfig(dataId: string, divId: string): void;
327
368
  /**
328
- * Update a data view config.
369
+ * Update an existing data view config.
329
370
  * Removes and re-creates the layer if found.
330
371
  *
331
372
  * @param {string} dataId The data id.
@@ -336,9 +377,9 @@ export declare class App {
336
377
  /**
337
378
  * Set the layer groups binders.
338
379
  *
339
- * @param {Array} list The list of binder names.
380
+ * @param {string[]} list The list of binder names.
340
381
  */
341
- setLayerGroupsBinders(list: any[]): void;
382
+ setLayerGroupsBinders(list: string[]): void;
342
383
  /**
343
384
  * Render the current data.
344
385
  *
@@ -347,7 +388,7 @@ export declare class App {
347
388
  */
348
389
  render(dataId: string, viewConfigs?: ViewConfig[]): void;
349
390
  /**
350
- * Zoom to the layers.
391
+ * Zoom the layers of the active layer group.
351
392
  *
352
393
  * @param {number} step The step to add to the current zoom.
353
394
  * @param {number} cx The zoom center X coordinate.
@@ -355,20 +396,21 @@ export declare class App {
355
396
  */
356
397
  zoom(step: number, cx: number, cy: number): void;
357
398
  /**
358
- * Apply a translation to the layers.
399
+ * Apply a translation to the layers of the active layer group.
359
400
  *
360
401
  * @param {number} tx The translation along X.
361
402
  * @param {number} ty The translation along Y.
362
403
  */
363
404
  translate(tx: number, ty: number): void;
364
405
  /**
365
- * Set the image layer opacity.
406
+ * Set the active view layer (of the active layer group) opacity.
366
407
  *
367
408
  * @param {number} alpha The opacity ([0:1] range).
409
+ * @deprecated Please set the opacity of the desired view layer directly.
368
410
  */
369
411
  setOpacity(alpha: number): void;
370
412
  /**
371
- * Set the drawings on the current stage.
413
+ * Set the drawings of the active layer group.
372
414
  *
373
415
  * @param {Array} drawings An array of drawings.
374
416
  * @param {Array} drawingsDetails An array of drawings details.
@@ -404,12 +446,14 @@ export declare class App {
404
446
  onKeydown: (event: KeyboardEvent) => void;
405
447
  /**
406
448
  * Key down event handler example.
407
- * - CRTL-Z: undo
408
- * - CRTL-Y: redo
409
- * - CRTL-ARROW_LEFT: next element on fourth dim
410
- * - CRTL-ARROW_UP: next element on third dim
411
- * - CRTL-ARROW_RIGHT: previous element on fourth dim
412
- * - CRTL-ARROW_DOWN: previous element on third dim
449
+ * - CRTL-Z: undo,
450
+ * - CRTL-Y: redo,
451
+ * - CRTL-ARROW_LEFT: next element on fourth dim,
452
+ * - CRTL-ARROW_UP: next element on third dim,
453
+ * - CRTL-ARROW_RIGHT: previous element on fourth dim,
454
+ * - CRTL-ARROW_DOWN: previous element on third dim.
455
+ *
456
+ * Applies to the active view of the active layer group.
413
457
  *
414
458
  * @param {KeyboardEvent} event The key down event.
415
459
  * @fires UndoStack#undo
@@ -418,27 +462,29 @@ export declare class App {
418
462
  */
419
463
  defaultOnKeydown: (event: KeyboardEvent) => void;
420
464
  /**
421
- * Reset the display
465
+ * Reset the display.
422
466
  */
423
467
  resetDisplay(): void;
424
468
  /**
425
- * Reset the app zoom.s
469
+ * Reset the app zoom.
426
470
  */
427
471
  resetZoom(): void;
428
472
  /**
429
- * Set the colour map.
473
+ * Set the colour map of the active view of the active layer group.
430
474
  *
431
475
  * @param {string} name The colour map name.
476
+ * @deprecated Please use the ViewController equivalent directly instead.
432
477
  */
433
478
  setColourMap(name: string): void;
434
479
  /**
435
- * Set the window/level preset.
480
+ * Set the window/level preset of the active view of the active layer group.
436
481
  *
437
- * @param {object} preset The window/level preset.
482
+ * @param {string} preset The window/level preset.
483
+ * @deprecated Please use the ViewController equivalent directly instead.
438
484
  */
439
- setWindowLevelPreset(preset: object): void;
485
+ setWindowLevelPreset(preset: string): void;
440
486
  /**
441
- * Set the tool
487
+ * Set the tool.
442
488
  *
443
489
  * @param {string} tool The tool.
444
490
  */
@@ -450,13 +496,13 @@ export declare class App {
450
496
  */
451
497
  setToolFeatures(list: object): void;
452
498
  /**
453
- * Undo the last action
499
+ * Undo the last action.
454
500
  *
455
501
  * @fires UndoStack#undo
456
502
  */
457
503
  undo(): void;
458
504
  /**
459
- * Redo the last action
505
+ * Redo the last action.
460
506
  *
461
507
  * @fires UndoStack#redo
462
508
  */
@@ -524,15 +570,16 @@ export declare class AppOptions {
524
570
  binders: string[] | undefined;
525
571
  /**
526
572
  * Optional boolean flag to trigger the first data render
527
- * after the first loaded data or not. Defaults to true;
573
+ * after the first loaded data or not. Defaults to true.
528
574
  *
529
575
  * @type {boolean|undefined}
530
576
  */
531
577
  viewOnFirstLoadItem: boolean | undefined;
532
578
  /**
533
- * Optional default chraracter set string used for DICOM parsing if
534
- * not passed in DICOM file.
535
- * Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings
579
+ * Optional default chraracterset string used for DICOM parsing if
580
+ * not passed in DICOM file.
581
+ *
582
+ * Valid values: {@link https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings}.
536
583
  *
537
584
  * @type {string|undefined}
538
585
  */
@@ -543,12 +590,26 @@ export declare class AppOptions {
543
590
  * @type {object|undefined}
544
591
  */
545
592
  overlayConfig: object | undefined;
593
+ /**
594
+ * DOM root document.
595
+ *
596
+ * @type {DocumentFragment}
597
+ */
598
+ rootDocument: DocumentFragment;
599
+ }
600
+
601
+ export declare namespace BLACK {
602
+ let r: number;
603
+ let g: number;
604
+ let b: number;
546
605
  }
547
606
 
548
607
  /**
549
608
  * Build a multipart message.
550
- * See: https://en.wikipedia.org/wiki/MIME#Multipart_messages
551
- * See: https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/Samples/JavaScript/stow-rs.js
609
+ *
610
+ * Ref:
611
+ * - {@link https://en.wikipedia.org/wiki/MIME#Multipart_messages},
612
+ * - {@link https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/Samples/JavaScript/stow-rs.js}.
552
613
  *
553
614
  * @param {Array} parts The message parts as an array of object containing
554
615
  * content headers and messages as the data property (as returned by parse).
@@ -557,9 +618,59 @@ export declare class AppOptions {
557
618
  */
558
619
  export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
559
620
 
621
+ /**
622
+ * Change segment colour command.
623
+ */
624
+ export declare class ChangeSegmentColourCommand {
625
+ /**
626
+ * @param {Image} mask The mask image.
627
+ * @param {MaskSegment} segment The segment to modify.
628
+ * @param {RGB|number} newColour The new segment colour.
629
+ * @param {boolean} [silent] Whether to send a creation event or not.
630
+ */
631
+ constructor(mask: Image_2, segment: MaskSegment, newColour: RGB | number, silent?: boolean);
632
+ /**
633
+ * Get the command name.
634
+ *
635
+ * @returns {string} The command name.
636
+ */
637
+ getName(): string;
638
+ /**
639
+ * Check if a command is valid and can be executed.
640
+ *
641
+ * @returns {boolean} True if the command is valid.
642
+ */
643
+ isValid(): boolean;
644
+ /**
645
+ * Execute the command.
646
+ *
647
+ * @fires ChangeSegmentColourCommand#changemasksegmentcolour
648
+ */
649
+ execute(): void;
650
+ /**
651
+ * Undo the command.
652
+ *
653
+ * @fires ChangeSegmentColourCommand#changemasksegmentcolour
654
+ */
655
+ undo(): void;
656
+ /**
657
+ * Handle an execute event.
658
+ *
659
+ * @param {object} _event The execute event with type and id.
660
+ */
661
+ onExecute(_event: object): void;
662
+ /**
663
+ * Handle an undo event.
664
+ *
665
+ * @param {object} _event The undo event with type and id.
666
+ */
667
+ onUndo(_event: object): void;
668
+ #private;
669
+ }
670
+
560
671
  /**
561
672
  * Colour map: red, green and blue components
562
- * to associate with intensity values.
673
+ * to associate with intensity values.
563
674
  */
564
675
  export declare class ColourMap {
565
676
  /**
@@ -591,27 +702,33 @@ export declare class ColourMap {
591
702
  /**
592
703
  * Create an Image from DICOM elements.
593
704
  *
594
- * @param {object} elements The DICOM elements.
705
+ * @param {Object<string, DataElement>} elements The DICOM elements.
595
706
  * @returns {Image} The Image object.
596
707
  */
597
- export declare function createImage(elements: object): Image_2;
708
+ export declare function createImage(elements: {
709
+ [x: string]: DataElement;
710
+ }): Image_2;
598
711
 
599
712
  /**
600
713
  * Create a mask Image from DICOM elements.
601
714
  *
602
- * @param {object} elements The DICOM elements.
715
+ * @param {Object<string, DataElement>} elements The DICOM elements.
603
716
  * @returns {Image} The mask Image object.
604
717
  */
605
- export declare function createMaskImage(elements: object): Image_2;
718
+ export declare function createMaskImage(elements: {
719
+ [x: string]: DataElement;
720
+ }): Image_2;
606
721
 
607
722
  /**
608
723
  * Create a View from DICOM elements and image.
609
724
  *
610
- * @param {object} elements The DICOM elements.
725
+ * @param {Object<string, DataElement>} elements The DICOM elements.
611
726
  * @param {Image} image The associated image.
612
727
  * @returns {View} The View object.
613
728
  */
614
- export declare function createView(elements: object, image: Image_2): View;
729
+ export declare function createView(elements: {
730
+ [x: string]: DataElement;
731
+ }, image: Image_2): View;
615
732
 
616
733
  export declare namespace customUI {
617
734
  /**
@@ -694,14 +811,11 @@ export declare const decoderScripts: {
694
811
  /**
695
812
  * List of default window level presets.
696
813
  *
697
- * @type {Object.<string, Object.<string, {center: number, width: number}>>}
814
+ * @type {Object.<string, Object.<string, WindowLevel>>}
698
815
  */
699
816
  export declare const defaultPresets: {
700
817
  [x: string]: {
701
- [x: string]: {
702
- center: number;
703
- width: number;
704
- };
818
+ [x: string]: WindowLevel;
705
819
  };
706
820
  };
707
821
 
@@ -713,6 +827,97 @@ export declare namespace defaults {
713
827
  };
714
828
  }
715
829
 
830
+ /**
831
+ * Delete segment command.
832
+ */
833
+ export declare class DeleteSegmentCommand {
834
+ /**
835
+ * @param {Image} mask The mask image.
836
+ * @param {MaskSegment} segment The segment to remove.
837
+ * @param {boolean} [silent] Whether to send a creation event or not.
838
+ */
839
+ constructor(mask: Image_2, segment: MaskSegment, silent?: boolean);
840
+ /**
841
+ * Get the command name.
842
+ *
843
+ * @returns {string} The command name.
844
+ */
845
+ getName(): string;
846
+ /**
847
+ * Check if a command is valid and can be executed.
848
+ *
849
+ * @returns {boolean} True if the command is valid.
850
+ */
851
+ isValid(): boolean;
852
+ /**
853
+ * Execute the command.
854
+ *
855
+ * @fires DeleteSegmentCommand#masksegmentdelete
856
+ */
857
+ execute(): void;
858
+ /**
859
+ * Undo the command.
860
+ *
861
+ * @fires DeleteSegmentCommand#masksegmentredraw
862
+ */
863
+ undo(): void;
864
+ /**
865
+ * Handle an execute event.
866
+ *
867
+ * @param {object} _event The execute event with type and id.
868
+ */
869
+ onExecute(_event: object): void;
870
+ /**
871
+ * Handle an undo event.
872
+ *
873
+ * @param {object} _event The undo event with type and id.
874
+ */
875
+ onUndo(_event: object): void;
876
+ #private;
877
+ }
878
+
879
+ /**
880
+ * DICOM code: item of a basic code sequence.
881
+ *
882
+ * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_8.8.html}.
883
+ */
884
+ export declare class DicomCode {
885
+ /**
886
+ * @param {string} meaning The code meaning.
887
+ */
888
+ constructor(meaning: string);
889
+ /**
890
+ * Code meaning (0008,0104).
891
+ *
892
+ * @type {string}
893
+ */
894
+ meaning: string;
895
+ /**
896
+ * Code value (0008,0100).
897
+ *
898
+ * @type {string|undefined}
899
+ */
900
+ value: string | undefined;
901
+ /**
902
+ * Long code value (0008,0119).
903
+ *
904
+ * @type {string|undefined}
905
+ */
906
+ longValue: string | undefined;
907
+ /**
908
+ * URN code value (0008,0120).
909
+ *
910
+ * @type {string|undefined}
911
+ */
912
+ urnValue: string | undefined;
913
+ /**
914
+ * Coding scheme designator (0008,0102).
915
+ *
916
+ * @type {string|undefined}
917
+ */
918
+ schemeDesignator: string | undefined;
919
+ }
920
+
716
921
  /**
717
922
  * DicomParser class.
718
923
  *
@@ -814,31 +1019,37 @@ export declare class DicomWriter {
814
1019
  * @param {boolean} flag True to use UN VR.
815
1020
  */
816
1021
  setUseUnVrForPrivateSq(flag: boolean): void;
1022
+ /**
1023
+ * Set the vr=UN check and fix flag.
1024
+ *
1025
+ * @param {boolean} flag True to activate the check and fix.
1026
+ */
1027
+ setFixUnknownVR(flag: boolean): void;
817
1028
  /**
818
1029
  * Set the writing rules.
819
- * List of writer rules indexed by either `default`, tagName or groupName.
1030
+ * List of writer rules indexed by either `default`,
1031
+ * tagKey, tagName or groupName.
820
1032
  * Each DICOM element will be checked to see if a rule is applicable.
821
- * First checked by tagName and then by groupName,
1033
+ * First checked by tagKey, tagName and then by groupName,
822
1034
  * if nothing is found the default rule is applied.
823
1035
  *
824
1036
  * @param {Object<string, WriterRule>} rules The input rules.
1037
+ * @param {boolean} [addMissingTags] If true, explicit tags that
1038
+ * have replace rule and a value will be
1039
+ * added if missing. Defaults to false.
825
1040
  */
826
1041
  setRules(rules: {
827
1042
  [x: string]: WriterRule;
828
- }): void;
1043
+ }, addMissingTags?: boolean): void;
829
1044
  /**
830
1045
  * Use a TextEncoder instead of the default text decoder.
831
1046
  */
832
1047
  useSpecialTextEncoder(): void;
833
- /**
834
- * Use default anonymisation rules.
835
- */
836
- useDefaultAnonymisationRules(): void;
837
1048
  /**
838
1049
  * Get the element to write according to the class rules.
839
1050
  * Priority order: tagName, groupName, default.
840
1051
  *
841
- * @param {DataElement} element The element to check
1052
+ * @param {DataElement} element The element to check.
842
1053
  * @returns {DataElement|null} The element to write, can be null.
843
1054
  */
844
1055
  getElementToWrite(element: DataElement): DataElement | null;
@@ -942,6 +1153,13 @@ export declare class DrawController {
942
1153
  * DeleteCommand has been executed.
943
1154
  */
944
1155
  deleteDraws(cmdCallback: Function, exeCallback: Function): void;
1156
+ /**
1157
+ * Get the total number of draws
1158
+ * (at all positions).
1159
+ *
1160
+ * @returns {number} The total number of draws.
1161
+ */
1162
+ getNumberOfDraws(): number;
945
1163
  #private;
946
1164
  }
947
1165
 
@@ -1017,21 +1235,25 @@ export declare class DrawLayer {
1017
1235
  /**
1018
1236
  * Set the plane helper.
1019
1237
  *
1020
- * @param {object} helper The helper.
1238
+ * @param {PlaneHelper} helper The helper.
1021
1239
  */
1022
- setPlaneHelper(helper: object): void;
1240
+ setPlaneHelper(helper: PlaneHelper): void;
1023
1241
  /**
1024
1242
  * Get the id of the layer.
1025
1243
  *
1026
1244
  * @returns {string} The string id.
1027
1245
  */
1028
1246
  getId(): string;
1247
+ /**
1248
+ * Remove the HTML element from the DOM.
1249
+ */
1250
+ removeFromDOM(): void;
1029
1251
  /**
1030
1252
  * Get the layer base size (without scale).
1031
1253
  *
1032
- * @returns {object} The size as {x,y}.
1254
+ * @returns {Scalar2D} The size as {x,y}.
1033
1255
  */
1034
- getBaseSize(): object;
1256
+ getBaseSize(): Scalar2D;
1035
1257
  /**
1036
1258
  * Get the layer opacity.
1037
1259
  *
@@ -1052,6 +1274,14 @@ export declare class DrawLayer {
1052
1274
  * Add a flip offset along the layer Y axis.
1053
1275
  */
1054
1276
  addFlipOffsetY(): void;
1277
+ /**
1278
+ * Flip the scale along the layer X axis.
1279
+ */
1280
+ flipScaleX(): void;
1281
+ /**
1282
+ * Flip the scale along the layer Y axis.
1283
+ */
1284
+ flipScaleY(): void;
1055
1285
  /**
1056
1286
  * Flip the scale along the layer Z axis.
1057
1287
  */
@@ -1059,16 +1289,16 @@ export declare class DrawLayer {
1059
1289
  /**
1060
1290
  * Set the layer scale.
1061
1291
  *
1062
- * @param {object} newScale The scale as {x,y}.
1292
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
1063
1293
  * @param {Point3D} [center] The scale center.
1064
1294
  */
1065
- setScale(newScale: object, center?: Point3D): void;
1295
+ setScale(newScale: Scalar3D, center?: Point3D): void;
1066
1296
  /**
1067
1297
  * Set the layer offset.
1068
1298
  *
1069
- * @param {object} newOffset The offset as {x,y}.
1299
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
1070
1300
  */
1071
- setOffset(newOffset: object): void;
1301
+ setOffset(newOffset: Scalar3D): void;
1072
1302
  /**
1073
1303
  * Set the base layer offset. Updates the layer offset.
1074
1304
  *
@@ -1091,25 +1321,25 @@ export declare class DrawLayer {
1091
1321
  isVisible(): boolean;
1092
1322
  /**
1093
1323
  * Draw the content (imageData) of the layer.
1094
- * The imageData variable needs to be set
1324
+ * The imageData variable needs to be set.
1095
1325
  */
1096
1326
  draw(): void;
1097
1327
  /**
1098
- * Initialise the layer: set the canvas and context
1328
+ * Initialise the layer: set the canvas and context.
1099
1329
  *
1100
- * @param {object} size The image size as {x,y}.
1101
- * @param {object} spacing The image spacing as {x,y}.
1330
+ * @param {Scalar2D} size The image size as {x,y}.
1331
+ * @param {Scalar2D} spacing The image spacing as {x,y}.
1102
1332
  * @param {string} dataId The associated data id.
1103
1333
  */
1104
- initialise(size: object, spacing: object, dataId: string): void;
1334
+ initialise(size: Scalar2D, spacing: Scalar2D, dataId: string): void;
1105
1335
  /**
1106
1336
  * Fit the layer to its parent container.
1107
1337
  *
1108
- * @param {number} fitScale1D The 1D fit scale.
1109
- * @param {object} fitSize The fit size as {x,y}.
1110
- * @param {object} fitOffset The fit offset as {x,y}.
1338
+ * @param {Scalar2D} containerSize The container size as {x,y}.
1339
+ * @param {number} divToWorldSizeRatio The div to world size ratio.
1340
+ * @param {Scalar2D} fitOffset The fit offset as {x,y}.
1111
1341
  */
1112
- fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void;
1342
+ fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void;
1113
1343
  /**
1114
1344
  * Check the visibility of a given group.
1115
1345
  *
@@ -1139,6 +1369,13 @@ export declare class DrawLayer {
1139
1369
  * DeleteCommand has been executed.
1140
1370
  */
1141
1371
  deleteDraws(exeCallback: object): void;
1372
+ /**
1373
+ * Get the total number of draws of this layer
1374
+ * (at all positions).
1375
+ *
1376
+ * @returns {number|undefined} The total number of draws.
1377
+ */
1378
+ getNumberOfDraws(): number | undefined;
1142
1379
  /**
1143
1380
  * Enable and listen to container interaction events.
1144
1381
  */
@@ -1262,7 +1499,7 @@ export declare class Geometry {
1262
1499
  * Warning: the size comes as stored in DICOM, meaning that it could
1263
1500
  * be oriented.
1264
1501
  *
1265
- * @param {Matrix33} [viewOrientation] The view orientation (optional)
1502
+ * @param {Matrix33} [viewOrientation] The view orientation (optional).
1266
1503
  * @returns {Size} The object size.
1267
1504
  */
1268
1505
  getSize(viewOrientation?: Matrix33): Size;
@@ -1271,7 +1508,7 @@ export declare class Geometry {
1271
1508
  * Warning: the spacing comes as stored in DICOM, meaning that it could
1272
1509
  * be oriented.
1273
1510
  *
1274
- * @param {Matrix33} [viewOrientation] The view orientation (optional)
1511
+ * @param {Matrix33} [viewOrientation] The view orientation (optional).
1275
1512
  * @returns {Spacing} The object spacing.
1276
1513
  */
1277
1514
  getSpacing(viewOrientation?: Matrix33): Spacing;
@@ -1375,6 +1612,13 @@ export declare class Geometry {
1375
1612
  #private;
1376
1613
  }
1377
1614
 
1615
+ /**
1616
+ * Get the default DICOM seg tags as an object.
1617
+ *
1618
+ * @returns {object} The default tags.
1619
+ */
1620
+ export declare function getDefaultDicomSegJson(): object;
1621
+
1378
1622
  /**
1379
1623
  * List of DICOM data elements indexed via a 8 character string formed from
1380
1624
  * the group and element numbers.
@@ -1389,28 +1633,57 @@ export declare class Geometry {
1389
1633
  export declare function getDwvVersion(): string;
1390
1634
 
1391
1635
  /**
1392
- * Get the DICOM elements from a 'simple' DICOM json tags object.
1393
- * The json is a simplified version of the oficial DICOM json with
1636
+ * Get the DICOM elements from a 'simple' DICOM tags object.
1637
+ * The input object is a simplified version of the oficial DICOM json with
1394
1638
  * tag names instead of keys and direct values (no value property) for
1395
1639
  * simple tags. See synthetic test data (in tests/dicom) for examples.
1396
1640
  *
1397
- * @param {Object<string, any>} jsonTags The DICOM
1398
- * json tags object.
1641
+ * @param {Object<string, any>} simpleTags The 'simple' DICOM
1642
+ * tags object.
1399
1643
  * @returns {Object<string, DataElement>} The DICOM elements.
1400
1644
  */
1401
- export declare function getElementsFromJSONTags(jsonTags: {
1645
+ export declare function getElementsFromJSONTags(simpleTags: {
1402
1646
  [x: string]: any;
1403
1647
  }): {
1404
1648
  [x: string]: DataElement;
1405
1649
  };
1406
1650
 
1651
+ /**
1652
+ * Get the indices that form a ellpise.
1653
+ *
1654
+ * @param {Index} center The ellipse center.
1655
+ * @param {number[]} radius The 2 ellipse radiuses.
1656
+ * @param {number[]} dir The 2 ellipse directions.
1657
+ * @returns {Index[]} The indices of the ellipse.
1658
+ */
1659
+ export declare function getEllipseIndices(center: Index, radius: number[], dir: number[]): Index[];
1660
+
1661
+ /**
1662
+ * Get the layer details from a mouse event.
1663
+ *
1664
+ * @param {object} event The event to get the layer div id from. Expecting
1665
+ * an event origininating from a canvas inside a layer HTML div
1666
+ * with the 'layer' class and id generated with `getLayerDivId`.
1667
+ * @returns {object} The layer details as {groupDivId, layerId}.
1668
+ */
1669
+ export declare function getLayerDetailsFromEvent(event: object): object;
1670
+
1671
+ /**
1672
+ * Get the offset of an input mouse event.
1673
+ *
1674
+ * @param {object} event The event to get the offset from.
1675
+ * @returns {Point2D} The 2D point.
1676
+ */
1677
+ export declare function getMousePoint(event: object): Point2D;
1678
+
1407
1679
  /**
1408
1680
  * Get the name of an image orientation patient.
1409
1681
  *
1410
- * @param {Array} orientation The image orientation patient.
1411
- * @returns {string} The orientation name: axial, coronal or sagittal.
1682
+ * @param {number[]} orientation The image orientation patient.
1683
+ * @returns {string|undefined} The orientation
1684
+ * name: axial, coronal or sagittal.
1412
1685
  */
1413
- export declare function getOrientationName(orientation: any[]): string;
1686
+ export declare function getOrientationName(orientation: number[]): string | undefined;
1414
1687
 
1415
1688
  /**
1416
1689
  * Get the PixelData Tag.
@@ -1435,6 +1708,14 @@ export declare function getReverseOrientation(ori: string): string;
1435
1708
  */
1436
1709
  export declare function getTagFromKey(key: string): Tag;
1437
1710
 
1711
+ /**
1712
+ * Get the offsets of an input touch event.
1713
+ *
1714
+ * @param {object} event The event to get the offset from.
1715
+ * @returns {Point2D[]} The array of points.
1716
+ */
1717
+ export declare function getTouchPoints(event: object): Point2D[];
1718
+
1438
1719
  /**
1439
1720
  * Get the appropriate TypedArray in function of arguments.
1440
1721
  *
@@ -1450,11 +1731,14 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
1450
1731
 
1451
1732
  /**
1452
1733
  * Get a UID for a DICOM tag.
1453
- * Note: Use https://github.com/uuidjs/uuid?
1454
1734
  *
1455
- * @see http://dicom.nema.org/dicom/2013/output/chtml/part05/chapter_9.html
1456
- * @see http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html
1457
- * @see https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid
1735
+ * Note: Use {@link https://github.com/uuidjs/uuid}?
1736
+ *
1737
+ * Ref:
1738
+ * - {@link http://dicom.nema.org/medical/dicom/2022a/output/chtml/part05/chapter_9.html},
1739
+ * - {@link http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html},
1740
+ * - {@link https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid}.
1741
+ *
1458
1742
  * @param {string} tagName The input tag.
1459
1743
  * @returns {string} The corresponding UID.
1460
1744
  */
@@ -1462,8 +1746,9 @@ export declare function getUID(tagName: string): string;
1462
1746
 
1463
1747
  /**
1464
1748
  * Check that an input buffer includes the DICOM prefix 'DICM'
1465
- * after the 128 bytes preamble.
1466
- * Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}
1749
+ * after the 128 bytes preamble.
1750
+ *
1751
+ * Ref: [DICOM File Meta]{@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part10/chapter_7.html#sect_7.1}.
1467
1752
  *
1468
1753
  * @param {ArrayBuffer} buffer The buffer to check.
1469
1754
  * @returns {boolean} True if the buffer includes the prefix.
@@ -1522,9 +1807,9 @@ declare class Image_2 {
1522
1807
  /**
1523
1808
  * @param {Geometry} geometry The geometry of the image.
1524
1809
  * @param {TypedArray} buffer The image data as a one dimensional buffer.
1525
- * @param {Array} [imageUids] An array of Uids indexed to slice number.
1810
+ * @param {string[]} [imageUids] An array of Uids indexed to slice number.
1526
1811
  */
1527
- constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: any[]);
1812
+ constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]);
1528
1813
  /**
1529
1814
  * Get the image UID at a given index.
1530
1815
  *
@@ -1532,6 +1817,13 @@ declare class Image_2 {
1532
1817
  * @returns {string} The UID.
1533
1818
  */
1534
1819
  getImageUid(index?: Index): string;
1820
+ /**
1821
+ * Check if this image includes the input uids.
1822
+ *
1823
+ * @param {string[]} uids UIDs to test for presence.
1824
+ * @returns {boolean} True if all uids are in this image uids.
1825
+ */
1826
+ containsImageUids(uids: string[]): boolean;
1535
1827
  /**
1536
1828
  * Get the geometry of the image.
1537
1829
  *
@@ -1541,7 +1833,7 @@ declare class Image_2 {
1541
1833
  /**
1542
1834
  * Get the data buffer of the image.
1543
1835
  *
1544
- * @todo dangerous...
1836
+ * @todo Dangerous...
1545
1837
  * @returns {TypedArray} The data buffer of the image.
1546
1838
  */
1547
1839
  getBuffer(): Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array;
@@ -1555,8 +1847,15 @@ declare class Image_2 {
1555
1847
  * Can window and level be applied to the data?
1556
1848
  *
1557
1849
  * @returns {boolean} True if the data is monochrome.
1850
+ * @deprecated Please use isMonochrome instead.
1558
1851
  */
1559
1852
  canWindowLevel(): boolean;
1853
+ /**
1854
+ * Is the data monochrome.
1855
+ *
1856
+ * @returns {boolean} True if the data is monochrome.
1857
+ */
1858
+ isMonochrome(): boolean;
1560
1859
  /**
1561
1860
  * Can the data be scrolled?
1562
1861
  *
@@ -1633,15 +1932,19 @@ declare class Image_2 {
1633
1932
  /**
1634
1933
  * Get the meta information of the image.
1635
1934
  *
1636
- * @returns {object} The meta information of the image.
1935
+ * @returns {Object<string, any>} The meta information of the image.
1637
1936
  */
1638
- getMeta(): object;
1937
+ getMeta(): {
1938
+ [x: string]: any;
1939
+ };
1639
1940
  /**
1640
1941
  * Set the meta information of the image.
1641
1942
  *
1642
- * @param {object} rhs The meta information of the image.
1943
+ * @param {Object<string, any>} rhs The meta information of the image.
1643
1944
  */
1644
- setMeta(rhs: object): void;
1945
+ setMeta(rhs: {
1946
+ [x: string]: any;
1947
+ }): void;
1645
1948
  /**
1646
1949
  * Get value at offset. Warning: No size check...
1647
1950
  *
@@ -1653,19 +1956,19 @@ declare class Image_2 {
1653
1956
  * Get the offsets where the buffer equals the input value.
1654
1957
  * Loops through the whole volume, can get long for big data...
1655
1958
  *
1656
- * @param {number|object} value The value to check.
1657
- * @returns {Array} The list of offsets.
1959
+ * @param {number|RGB} value The value to check.
1960
+ * @returns {number[]} The list of offsets.
1658
1961
  */
1659
- getOffsets(value: number | object): any[];
1962
+ getOffsets(value: number | RGB): number[];
1660
1963
  /**
1661
1964
  * Check if the input values are in the buffer.
1662
1965
  * Could loop through the whole volume, can get long for big data...
1663
1966
  *
1664
1967
  * @param {Array} values The values to check.
1665
- * @returns {Array} A list of booleans for each input value,
1968
+ * @returns {boolean[]} A list of booleans for each input value,
1666
1969
  * set to true if the value is present in the buffer.
1667
1970
  */
1668
- hasValues(values: any[]): any[];
1971
+ hasValues(values: any[]): boolean[];
1669
1972
  /**
1670
1973
  * Clone the image.
1671
1974
  *
@@ -1676,6 +1979,7 @@ declare class Image_2 {
1676
1979
  * Append a slice to the image.
1677
1980
  *
1678
1981
  * @param {Image} rhs The slice to append.
1982
+ * @fires Image#imagegeometrychange
1679
1983
  */
1680
1984
  appendSlice(rhs: Image_2): void;
1681
1985
  /**
@@ -1695,15 +1999,15 @@ declare class Image_2 {
1695
1999
  /**
1696
2000
  * Get the data range.
1697
2001
  *
1698
- * @returns {object} The data range.
2002
+ * @returns {NumberRange} The data range.
1699
2003
  */
1700
- getDataRange(): object;
2004
+ getDataRange(): NumberRange;
1701
2005
  /**
1702
2006
  * Get the rescaled data range.
1703
2007
  *
1704
- * @returns {object} The rescaled data range.
2008
+ * @returns {NumberRange} The rescaled data range.
1705
2009
  */
1706
- getRescaledDataRange(): object;
2010
+ getRescaledDataRange(): NumberRange;
1707
2011
  /**
1708
2012
  * Get the histogram.
1709
2013
  *
@@ -1729,29 +2033,31 @@ declare class Image_2 {
1729
2033
  /**
1730
2034
  * Set the inner buffer values at given offsets.
1731
2035
  *
1732
- * @param {Array} offsets List of offsets where to set the data.
1733
- * @param {object} value The value to set at the given offsets.
1734
- * @fires Image#imagechange
2036
+ * @param {number[]} offsets List of offsets where to set the data.
2037
+ * @param {number|RGB} value The value to set at the given offsets.
2038
+ * @fires Image#imagecontentchange
1735
2039
  */
1736
- setAtOffsets(offsets: any[], value: object): void;
2040
+ setAtOffsets(offsets: number[], value: number | RGB): void;
1737
2041
  /**
1738
2042
  * Set the inner buffer values at given offsets.
1739
2043
  *
1740
- * @param {Array} offsetsLists List of offset lists where to set the data.
1741
- * @param {object} value The value to set at the given offsets.
2044
+ * @param {number[][]} offsetsLists List of offset lists where
2045
+ * to set the data.
2046
+ * @param {RGB} value The value to set at the given offsets.
1742
2047
  * @returns {Array} A list of objects representing the original values before
1743
2048
  * replacing them.
1744
- * @fires Image#imagechange
2049
+ * @fires Image#imagecontentchange
1745
2050
  */
1746
- setAtOffsetsAndGetOriginals(offsetsLists: any[], value: object): any[];
2051
+ setAtOffsetsAndGetOriginals(offsetsLists: number[][], value: RGB): any[];
1747
2052
  /**
1748
2053
  * Set the inner buffer values at given offsets.
1749
2054
  *
1750
- * @param {Array} offsetsLists List of offset lists where to set the data.
1751
- * @param {object|Array} value The value to set at the given offsets.
1752
- * @fires Image#imagechange
2055
+ * @param {number[][]} offsetsLists List of offset lists
2056
+ * where to set the data.
2057
+ * @param {RGB|Array} value The value to set at the given offsets.
2058
+ * @fires Image#imagecontentchange
1753
2059
  */
1754
- setAtOffsetsWithIterator(offsetsLists: any[], value: object | any[]): void;
2060
+ setAtOffsetsWithIterator(offsetsLists: number[][], value: RGB | any[]): void;
1755
2061
  /**
1756
2062
  * Get the value of the image at a specific coordinate.
1757
2063
  *
@@ -1823,20 +2129,20 @@ declare class Image_2 {
1823
2129
  *
1824
2130
  * Note: Uses raw buffer values.
1825
2131
  *
1826
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2132
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1827
2133
  * @returns {Image} The convoluted image.
1828
2134
  */
1829
- convolute2D(weights: any[]): Image_2;
2135
+ convolute2D(weights: number[]): Image_2;
1830
2136
  /**
1831
2137
  * Convolute an image buffer with a given 2D kernel.
1832
2138
  *
1833
2139
  * Note: Uses raw buffer values.
1834
2140
  *
1835
- * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix.
2141
+ * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix.
1836
2142
  * @param {TypedArray} buffer The buffer to convolute.
1837
2143
  * @param {number} startOffset The index to start at.
1838
2144
  */
1839
- convoluteBuffer(weights: any[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
2145
+ convoluteBuffer(weights: number[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void;
1840
2146
  /**
1841
2147
  * Transform an image using a specific operator.
1842
2148
  * WARNING: no size check!
@@ -1941,21 +2247,39 @@ export declare class Index {
1941
2247
  #private;
1942
2248
  }
1943
2249
 
2250
+ /**
2251
+ * Check if two rgb objects are equal.
2252
+ *
2253
+ * @param {RGB} c1 The first colour.
2254
+ * @param {RGB} c2 The second colour.
2255
+ * @returns {boolean} True if both colour are equal.
2256
+ */
2257
+ export declare function isEqualRgb(c1: RGB, c2: RGB): boolean;
2258
+
2259
+ /**
2260
+ * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
2261
+ * unsigned int CIE LAB ([0, 65535]).
2262
+ *
2263
+ * @param {object} triplet CIE XYZ triplet as {l,a,b} with CIE LAB range.
2264
+ * @returns {object} CIE LAB triplet as {l,a,b} with unsigned range.
2265
+ */
2266
+ export declare function labToUintLab(triplet: object): object;
2267
+
1944
2268
  /**
1945
2269
  * Layer group.
1946
2270
  *
1947
- * Display position: {x,y}
1948
- * Plane position: Index (access: get(i))
1949
- * (world) Position: Point3D (access: getX, getY, getZ)
2271
+ * - Display position: {x,y},
2272
+ * - Plane position: Index (access: get(i)),
2273
+ * - (world) Position: Point3D (access: getX, getY, getZ).
1950
2274
  *
1951
2275
  * Display -> World:
1952
- * planePos = viewLayer.displayToPlanePos(displayPos)
1953
- * -> compensate for layer scale and offset
1954
- * pos = viewController.getPositionFromPlanePoint(planePos)
2276
+ * - planePos = viewLayer.displayToPlanePos(displayPos)
2277
+ * -> compensate for layer scale and offset,
2278
+ * - pos = viewController.getPositionFromPlanePoint(planePos).
1955
2279
  *
1956
- * World -> display
1957
- * planePos = viewController.getOffset3DFromPlaneOffset(pos)
1958
- * no need yet for a planePos to displayPos...
2280
+ * World -> Display:
2281
+ * - planePos = viewController.getOffset3DFromPlaneOffset(pos)
2282
+ * no need yet for a planePos to displayPos...
1959
2283
  */
1960
2284
  export declare class LayerGroup {
1961
2285
  /**
@@ -1989,33 +2313,41 @@ export declare class LayerGroup {
1989
2313
  /**
1990
2314
  * Get the layer scale.
1991
2315
  *
1992
- * @returns {object} The scale as {x,y,z}.
2316
+ * @returns {Scalar3D} The scale as {x,y,z}.
1993
2317
  */
1994
- getScale(): object;
2318
+ getScale(): Scalar3D;
1995
2319
  /**
1996
2320
  * Get the base scale.
1997
2321
  *
1998
- * @returns {object} The scale as {x,y,z}.
2322
+ * @returns {Scalar3D} The scale as {x,y,z}.
1999
2323
  */
2000
- getBaseScale(): object;
2324
+ getBaseScale(): Scalar3D;
2001
2325
  /**
2002
- * Get the added scale: the scale added to the base scale
2326
+ * Get the added scale: the scale added to the base scale.
2003
2327
  *
2004
- * @returns {object} The scale as {x,y,z}.
2328
+ * @returns {Scalar3D} The scale as {x,y,z}.
2005
2329
  */
2006
- getAddedScale(): object;
2330
+ getAddedScale(): Scalar3D;
2007
2331
  /**
2008
2332
  * Get the layer offset.
2009
2333
  *
2010
- * @returns {object} The offset as {x,y,z}.
2334
+ * @returns {Scalar3D} The offset as {x,y,z}.
2011
2335
  */
2012
- getOffset(): object;
2336
+ getOffset(): Scalar3D;
2013
2337
  /**
2014
2338
  * Get the number of layers handled by this class.
2015
2339
  *
2016
2340
  * @returns {number} The number of layers.
2017
2341
  */
2018
2342
  getNumberOfLayers(): number;
2343
+ /**
2344
+ * Check if this layerGroup contains a layer with the input id.
2345
+ *
2346
+ * @param {string} id The layer id to look for.
2347
+ * @returns {boolean} True if this group contains
2348
+ * a layer with the input id.
2349
+ */
2350
+ includes(id: string): boolean;
2019
2351
  /**
2020
2352
  * Get the number of view layers handled by this class.
2021
2353
  *
@@ -2028,6 +2360,12 @@ export declare class LayerGroup {
2028
2360
  * @returns {ViewLayer|undefined} The layer.
2029
2361
  */
2030
2362
  getActiveViewLayer(): ViewLayer | undefined;
2363
+ /**
2364
+ * Get the base view layer.
2365
+ *
2366
+ * @returns {ViewLayer|undefined} The layer.
2367
+ */
2368
+ getBaseViewLayer(): ViewLayer | undefined;
2031
2369
  /**
2032
2370
  * Get the view layers associated to a data id.
2033
2371
  *
@@ -2045,9 +2383,9 @@ export declare class LayerGroup {
2045
2383
  /**
2046
2384
  * Get the view layers data indices.
2047
2385
  *
2048
- * @returns {Array} The list of indices.
2386
+ * @returns {string[]} The list of indices.
2049
2387
  */
2050
- getViewDataIndices(): any[];
2388
+ getViewDataIndices(): string[];
2051
2389
  /**
2052
2390
  * Get the active draw layer.
2053
2391
  *
@@ -2088,12 +2426,16 @@ export declare class LayerGroup {
2088
2426
  /**
2089
2427
  * Add a view layer.
2090
2428
  *
2429
+ * The new layer will be marked as the active view layer.
2430
+ *
2091
2431
  * @returns {ViewLayer} The created layer.
2092
2432
  */
2093
2433
  addViewLayer(): ViewLayer;
2094
2434
  /**
2095
2435
  * Add a draw layer.
2096
2436
  *
2437
+ * The new layer will be marked as the active draw layer.
2438
+ *
2097
2439
  * @returns {DrawLayer} The created layer.
2098
2440
  */
2099
2441
  addDrawLayer(): DrawLayer;
@@ -2101,6 +2443,12 @@ export declare class LayerGroup {
2101
2443
  * Empty the layer list.
2102
2444
  */
2103
2445
  empty(): void;
2446
+ /**
2447
+ * Remove all layers for a specific data.
2448
+ *
2449
+ * @param {string} dataId The data to remove its layers.
2450
+ */
2451
+ removeLayersByDataId(dataId: string): void;
2104
2452
  /**
2105
2453
  * Remove a layer from this layer group.
2106
2454
  * Warning: if current active layer, the index will
@@ -2110,6 +2458,46 @@ export declare class LayerGroup {
2110
2458
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
2111
2459
  */
2112
2460
  removeLayer(layer: ViewLayer | DrawLayer): void;
2461
+ /**
2462
+ * Displays a tooltip in a temporary `span`.
2463
+ * Works with css to hide/show the span only on mouse hover.
2464
+ *
2465
+ * @param {Point2D} point The update point.
2466
+ */
2467
+ showTooltip(point: Point2D): void;
2468
+ /**
2469
+ * Remove the tooltip html div.
2470
+ */
2471
+ removeTooltipDiv(): void;
2472
+ /**
2473
+ * Test if one of the view layers satisfies an input callbackFn.
2474
+ *
2475
+ * @param {Function} callbackFn A function that takes a ViewLayer as input
2476
+ * and returns a boolean.
2477
+ * @returns {boolean} True if one of the ViewLayers satisfies the callbackFn.
2478
+ */
2479
+ someViewLayer(callbackFn: Function): boolean;
2480
+ /**
2481
+ * Can the input position be set on one of the view layers.
2482
+ *
2483
+ * @param {Point} position The input position.
2484
+ * @returns {boolean} True if one view layer accepts the input position.
2485
+ */
2486
+ isPositionInBounds(position: Point): boolean;
2487
+ /**
2488
+ * Can one of the view layers be scrolled.
2489
+ *
2490
+ * @returns {boolean} True if one view layer can be scrolled.
2491
+ */
2492
+ canScroll(): boolean;
2493
+ /**
2494
+ * Does one of the view layer have more than one slice in the
2495
+ * given dimension.
2496
+ *
2497
+ * @param {number} dim The input dimension.
2498
+ * @returns {boolean} True if one view layer has more than one slice.
2499
+ */
2500
+ moreThanOne(dim: number): boolean;
2113
2501
  /**
2114
2502
  * Update layers (but not the active view layer) to a position change.
2115
2503
  *
@@ -2118,23 +2506,24 @@ export declare class LayerGroup {
2118
2506
  */
2119
2507
  updateLayersToPositionChange: (event: object) => void;
2120
2508
  /**
2121
- * Calculate the fit scale: the scale that fits the largest data.
2509
+ * Calculate the div to world size ratio needed to fit
2510
+ * the largest data.
2122
2511
  *
2123
- * @returns {number|undefined} The fit scale.
2512
+ * @returns {number|undefined} The ratio.
2124
2513
  */
2125
- calculateFitScale(): number | undefined;
2514
+ getDivToWorldSizeRatio(): number | undefined;
2126
2515
  /**
2127
- * Set the layer group fit scale.
2516
+ * Fit to container: set the layers div to world size ratio.
2128
2517
  *
2129
- * @param {number} scaleIn The fit scale.
2518
+ * @param {number} divToWorldSizeRatio The ratio.
2130
2519
  */
2131
- setFitScale(scaleIn: number): void;
2520
+ fitToContainer(divToWorldSizeRatio: number): void;
2132
2521
  /**
2133
- * Get the largest data size.
2522
+ * Get the largest data world (mm) size.
2134
2523
  *
2135
- * @returns {object|undefined} The largest size as {x,y}.
2524
+ * @returns {Scalar2D|undefined} The largest size as {x,y}.
2136
2525
  */
2137
- getMaxSize(): object | undefined;
2526
+ getMaxWorldSize(): Scalar2D | undefined;
2138
2527
  /**
2139
2528
  * Flip all layers along the Z axis without offset compensation.
2140
2529
  */
@@ -2149,24 +2538,24 @@ export declare class LayerGroup {
2149
2538
  /**
2150
2539
  * Set the layers' scale.
2151
2540
  *
2152
- * @param {object} newScale The scale to apply as {x,y,z}.
2541
+ * @param {Scalar3D} newScale The scale to apply as {x,y,z}.
2153
2542
  * @param {Point3D} [center] The scale center Point3D.
2154
2543
  * @fires LayerGroup#zoomchange
2155
2544
  */
2156
- setScale(newScale: object, center?: Point3D): void;
2545
+ setScale(newScale: Scalar3D, center?: Point3D): void;
2157
2546
  /**
2158
2547
  * Add translation to the layers.
2159
2548
  *
2160
- * @param {object} translation The translation as {x,y,z}.
2549
+ * @param {Scalar3D} translation The translation as {x,y,z}.
2161
2550
  */
2162
- addTranslation(translation: object): void;
2551
+ addTranslation(translation: Scalar3D): void;
2163
2552
  /**
2164
2553
  * Set the layers' offset.
2165
2554
  *
2166
- * @param {object} newOffset The offset as {x,y,z}.
2555
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
2167
2556
  * @fires LayerGroup#offsetchange
2168
2557
  */
2169
- setOffset(newOffset: object): void;
2558
+ setOffset(newOffset: Scalar3D): void;
2170
2559
  /**
2171
2560
  * Reset the stage to its initial scale and no offset.
2172
2561
  */
@@ -2226,52 +2615,268 @@ export declare const luts: {
2226
2615
  };
2227
2616
 
2228
2617
  /**
2229
- * Immutable 3x3 Matrix.
2618
+ * Mask {@link Image} factory.
2230
2619
  */
2231
- export declare class Matrix33 {
2620
+ export declare class MaskFactory {
2232
2621
  /**
2233
- * @param {number[]} values row-major ordered 9 values.
2622
+ * Get a warning string if elements are not as expected.
2623
+ * Created by checkElements.
2624
+ *
2625
+ * @returns {string|undefined} The warning.
2234
2626
  */
2235
- constructor(values: number[]);
2627
+ getWarning(): string | undefined;
2236
2628
  /**
2237
- * Get a value of the matrix.
2629
+ * Check dicom elements. Throws an error if not suitable.
2238
2630
  *
2239
- * @param {number} row The row at wich to get the value.
2240
- * @param {number} col The column at wich to get the value.
2241
- * @returns {number|undefined} The value at the position.
2631
+ * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
2632
+ * @returns {string|undefined} A possible warning.
2242
2633
  */
2243
- get(row: number, col: number): number | undefined;
2634
+ checkElements(_dicomElements: {
2635
+ [x: string]: DataElement;
2636
+ }): string | undefined;
2244
2637
  /**
2245
- * Get the inverse of this matrix.
2638
+ * Get an {@link Image} object from the read DICOM file.
2246
2639
  *
2247
- * @returns {Matrix33|undefined} The inverse matrix or undefined
2248
- * if the determinant is zero.
2640
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
2641
+ * @param {Uint8Array | Int8Array |
2642
+ * Uint16Array | Int16Array |
2643
+ * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
2644
+ * @returns {Image} A new Image.
2249
2645
  */
2250
- getInverse(): Matrix33 | undefined;
2646
+ create(dataElements: {
2647
+ [x: string]: DataElement;
2648
+ }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
2251
2649
  /**
2252
- * Check for Matrix33 equality.
2650
+ * Convert a mask image into a DICOM segmentation object.
2253
2651
  *
2254
- * @param {Matrix33} rhs The other matrix to compare to.
2255
- * @param {number} [p] A numeric expression for the precision to use in check
2256
- * (ex: 0.001). Defaults to Number.EPSILON if not provided.
2257
- * @returns {boolean} True if both matrices are equal.
2652
+ * @param {Image} image The mask image.
2653
+ * @param {MaskSegment[]} segments The mask segments.
2654
+ * @param {Image} sourceImage The source image.
2655
+ * @param {Object<string, any>} [extraTags] Optional list of extra tags.
2656
+ * @returns {Object<string, DataElement>} A list of dicom elements.
2258
2657
  */
2259
- equals(rhs: Matrix33, p?: number): boolean;
2658
+ toDicom(image: Image_2, segments: MaskSegment[], sourceImage: Image_2, extraTags?: {
2659
+ [x: string]: any;
2660
+ }): {
2661
+ [x: string]: DataElement;
2662
+ };
2663
+ #private;
2664
+ }
2665
+
2666
+ /**
2667
+ * DICOM (mask) segment: item of a SegmentSequence (0062,0002).
2668
+ *
2669
+ * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.8.20.4.html}.
2670
+ */
2671
+ export declare class MaskSegment {
2260
2672
  /**
2261
- * Get a string representation of the Matrix33.
2262
- *
2263
- * @returns {string} The matrix as a string.
2673
+ * @param {number} number The segment number.
2674
+ * @param {string} label The segment label.
2675
+ * @param {string} algorithmType The segment number.
2264
2676
  */
2265
- toString(): string;
2677
+ constructor(number: number, label: string, algorithmType: string);
2266
2678
  /**
2267
- * Multiply this matrix by another.
2679
+ * Segment number (0062,0004).
2268
2680
  *
2269
- * @param {Matrix33} rhs The matrix to multiply by.
2270
- * @returns {Matrix33} The product matrix.
2681
+ * @type {number}
2271
2682
  */
2272
- multiply(rhs: Matrix33): Matrix33;
2683
+ number: number;
2273
2684
  /**
2274
- * Get the absolute value of this matrix.
2685
+ * Segment label (0062,0005).
2686
+ *
2687
+ * @type {string}
2688
+ */
2689
+ label: string;
2690
+ /**
2691
+ * Segment algorithm type (0062,0008).
2692
+ *
2693
+ * @type {string}
2694
+ */
2695
+ algorithmType: string;
2696
+ /**
2697
+ * Segment algorithm name (0062,0009).
2698
+ *
2699
+ * @type {string|undefined}
2700
+ */
2701
+ algorithmName: string | undefined;
2702
+ /**
2703
+ * Segment display value as simple value.
2704
+ *
2705
+ * @type {number|undefined}
2706
+ */
2707
+ displayValue: number | undefined;
2708
+ /**
2709
+ * Segment display value as RGB colour ({r,g,b}).
2710
+ *
2711
+ * @type {RGB|undefined}
2712
+ */
2713
+ displayRGBValue: RGB | undefined;
2714
+ /**
2715
+ * Segment property code: specific property
2716
+ * the segment represents (0062,000F).
2717
+ *
2718
+ * @type {DicomCode|undefined}
2719
+ */
2720
+ propertyTypeCode: DicomCode | undefined;
2721
+ /**
2722
+ * Segment property category code: general category
2723
+ * of the property the segment represents (0062,0003).
2724
+ *
2725
+ * @type {DicomCode|undefined}
2726
+ */
2727
+ propertyCategoryCode: DicomCode | undefined;
2728
+ /**
2729
+ * Segment tracking UID (0062,0021).
2730
+ *
2731
+ * @type {string|undefined}
2732
+ */
2733
+ trackingUid: string | undefined;
2734
+ /**
2735
+ * Segment tracking id: text label for the UID (0062,0020).
2736
+ *
2737
+ * @type {string|undefined}
2738
+ */
2739
+ trackingId: string | undefined;
2740
+ }
2741
+
2742
+ /**
2743
+ * Mask segment helper: helps handling the segments list,
2744
+ * but does *NOT* update the associated mask (use special commands
2745
+ * for that such as DeleteSegmentCommand, ChangeSegmentColourCommand...).
2746
+ */
2747
+ export declare class MaskSegmentHelper {
2748
+ /**
2749
+ * @param {Image} mask The associated mask image.
2750
+ */
2751
+ constructor(mask: Image_2);
2752
+ /**
2753
+ * Check if a segment is part of the segments list.
2754
+ *
2755
+ * @param {number} segmentNumber The segment number.
2756
+ * @returns {boolean} True if the segment is included.
2757
+ */
2758
+ hasSegment(segmentNumber: number): boolean;
2759
+ /**
2760
+ * Check if a segment is present in a mask image.
2761
+ *
2762
+ * @param {number[]} numbers Array of segment numbers.
2763
+ * @returns {boolean[]} Array of boolean set to true
2764
+ * if the segment is present in the mask.
2765
+ */
2766
+ maskHasSegments(numbers: number[]): boolean[];
2767
+ /**
2768
+ * Get a segment from the inner segment list.
2769
+ *
2770
+ * @param {number} segmentNumber The segment number.
2771
+ * @returns {MaskSegment|undefined} The segment or undefined if not found.
2772
+ */
2773
+ getSegment(segmentNumber: number): MaskSegment | undefined;
2774
+ /**
2775
+ * Add a segment to the segments list.
2776
+ *
2777
+ * @param {MaskSegment} segment The segment to add.
2778
+ */
2779
+ addSegment(segment: MaskSegment): void;
2780
+ /**
2781
+ * Remove a segment from the segments list.
2782
+ *
2783
+ * @param {number} segmentNumber The segment number.
2784
+ */
2785
+ removeSegment(segmentNumber: number): void;
2786
+ /**
2787
+ * Update a segment of the segments list.
2788
+ *
2789
+ * @param {MaskSegment} segment The segment to update.
2790
+ */
2791
+ updateSegment(segment: MaskSegment): void;
2792
+ #private;
2793
+ }
2794
+
2795
+ /**
2796
+ * Mask segment view helper: handles hidden segments.
2797
+ */
2798
+ export declare class MaskSegmentViewHelper {
2799
+ /**
2800
+ * Check if a segment is in the hidden list.
2801
+ *
2802
+ * @param {number} segmentNumber The segment number.
2803
+ * @returns {boolean} True if the segment is in the list.
2804
+ */
2805
+ isHidden(segmentNumber: number): boolean;
2806
+ /**
2807
+ * Add a segment to the hidden list.
2808
+ *
2809
+ * @param {MaskSegment} segment The segment to add.
2810
+ */
2811
+ addToHidden(segment: MaskSegment): void;
2812
+ /**
2813
+ * Remove a segment from the hidden list.
2814
+ *
2815
+ * @param {number} segmentNumber The segment number.
2816
+ */
2817
+ removeFromHidden(segmentNumber: number): void;
2818
+ /**
2819
+ * @callback alphaFn@callback alphaFn
2820
+ * @param {number[]|number} value The pixel value.
2821
+ * @param {number} index The values' index.
2822
+ * @returns {number} The opacity of the input value.
2823
+ */
2824
+ /**
2825
+ * Get the alpha function to apply hidden colors.
2826
+ *
2827
+ * @returns {alphaFn} The corresponding alpha function.
2828
+ */
2829
+ getAlphaFunc(): (value: number[] | number, index: number) => number;
2830
+ #private;
2831
+ }
2832
+
2833
+ /**
2834
+ * Immutable 3x3 Matrix.
2835
+ */
2836
+ export declare class Matrix33 {
2837
+ /**
2838
+ * @param {number[]} values Row-major ordered 9 values.
2839
+ */
2840
+ constructor(values: number[]);
2841
+ /**
2842
+ * Get a value of the matrix.
2843
+ *
2844
+ * @param {number} row The row at wich to get the value.
2845
+ * @param {number} col The column at wich to get the value.
2846
+ * @returns {number|undefined} The value at the position.
2847
+ */
2848
+ get(row: number, col: number): number | undefined;
2849
+ /**
2850
+ * Get the inverse of this matrix.
2851
+ *
2852
+ * @returns {Matrix33|undefined} The inverse matrix or undefined
2853
+ * if the determinant is zero.
2854
+ */
2855
+ getInverse(): Matrix33 | undefined;
2856
+ /**
2857
+ * Check for Matrix33 equality.
2858
+ *
2859
+ * @param {Matrix33} rhs The other matrix to compare to.
2860
+ * @param {number} [p] A numeric expression for the precision to use in check
2861
+ * (ex: 0.001). Defaults to Number.EPSILON if not provided.
2862
+ * @returns {boolean} True if both matrices are equal.
2863
+ */
2864
+ equals(rhs: Matrix33, p?: number): boolean;
2865
+ /**
2866
+ * Get a string representation of the Matrix33.
2867
+ *
2868
+ * @returns {string} The matrix as a string.
2869
+ */
2870
+ toString(): string;
2871
+ /**
2872
+ * Multiply this matrix by another.
2873
+ *
2874
+ * @param {Matrix33} rhs The matrix to multiply by.
2875
+ * @returns {Matrix33} The product matrix.
2876
+ */
2877
+ multiply(rhs: Matrix33): Matrix33;
2878
+ /**
2879
+ * Get the absolute value of this matrix.
2275
2880
  *
2276
2881
  * @returns {Matrix33} The result matrix.
2277
2882
  */
@@ -2319,7 +2924,7 @@ export declare class Matrix33 {
2319
2924
  */
2320
2925
  getColAbsMax(col: number): object;
2321
2926
  /**
2322
- * Get this matrix with only zero and +/- ones instead of the maximum,
2927
+ * Get this matrix with only zero and +/- ones instead of the maximum.
2323
2928
  *
2324
2929
  * @returns {Matrix33} The simplified matrix.
2325
2930
  */
@@ -2333,6 +2938,31 @@ export declare class Matrix33 {
2333
2938
  #private;
2334
2939
  }
2335
2940
 
2941
+ /**
2942
+ * Number range.
2943
+ */
2944
+ export declare class NumberRange {
2945
+ /**
2946
+ * @param {number} min The minimum.
2947
+ * @param {number} max The maximum.
2948
+ */
2949
+ constructor(min: number, max: number);
2950
+ /**
2951
+ * @type {number}
2952
+ */
2953
+ min: number;
2954
+ /**
2955
+ * @type {number}
2956
+ */
2957
+ max: number;
2958
+ }
2959
+
2960
+ export declare namespace Orientation {
2961
+ let Axial: string;
2962
+ let Coronal: string;
2963
+ let Sagittal: string;
2964
+ }
2965
+
2336
2966
  /**
2337
2967
  * DICOM Header overlay info.
2338
2968
  */
@@ -2386,6 +3016,101 @@ export declare class OverlayData {
2386
3016
  #private;
2387
3017
  }
2388
3018
 
3019
+ /**
3020
+ * Plane geometry helper.
3021
+ */
3022
+ export declare class PlaneHelper {
3023
+ /**
3024
+ * @param {Spacing} spacing The spacing.
3025
+ * @param {Matrix33} imageOrientation The image oientation.
3026
+ * @param {Matrix33} viewOrientation The view orientation.
3027
+ */
3028
+ constructor(spacing: Spacing, imageOrientation: Matrix33, viewOrientation: Matrix33);
3029
+ /**
3030
+ * Get a 3D offset from a plane one.
3031
+ *
3032
+ * @param {Scalar2D} offset2D The plane offset as {x,y}.
3033
+ * @returns {Vector3D} The 3D world offset.
3034
+ */
3035
+ getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
3036
+ /**
3037
+ * Get a plane offset from a 3D one.
3038
+ *
3039
+ * @param {Scalar3D} offset3D The 3D offset as {x,y,z}.
3040
+ * @returns {Scalar2D} The plane offset as {x,y}.
3041
+ */
3042
+ getPlaneOffsetFromOffset3D(offset3D: Scalar3D): Scalar2D;
3043
+ /**
3044
+ * Orient an input vector from real to target space.
3045
+ *
3046
+ * @param {Vector3D} vector The input vector.
3047
+ * @returns {Vector3D} The oriented vector.
3048
+ */
3049
+ getTargetOrientedVector3D(vector: Vector3D): Vector3D;
3050
+ /**
3051
+ * De-orient an input vector from target to real space.
3052
+ *
3053
+ * @param {Vector3D} planeVector The input vector.
3054
+ * @returns {Vector3D} The de-orienteded vector.
3055
+ */
3056
+ getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D;
3057
+ /**
3058
+ * De-orient an input point from target to real space.
3059
+ *
3060
+ * @param {Point3D} planePoint The input point.
3061
+ * @returns {Point3D} The de-orienteded point.
3062
+ */
3063
+ getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D;
3064
+ /**
3065
+ * Orient an input vector from target to image space.
3066
+ *
3067
+ * @param {Vector3D} planeVector The input vector.
3068
+ * @returns {Vector3D} The orienteded vector.
3069
+ */
3070
+ getImageOrientedVector3D(planeVector: Vector3D): Vector3D;
3071
+ /**
3072
+ * Orient an input point from target to image space.
3073
+ *
3074
+ * @param {Point3D} planePoint The input vector.
3075
+ * @returns {Point3D} The orienteded vector.
3076
+ */
3077
+ getImageOrientedPoint3D(planePoint: Point3D): Point3D;
3078
+ /**
3079
+ * De-orient an input vector from image to target space.
3080
+ *
3081
+ * @param {Vector3D} vector The input vector.
3082
+ * @returns {Vector3D} The de-orienteded vector.
3083
+ */
3084
+ getImageDeOrientedVector3D(vector: Vector3D): Vector3D;
3085
+ /**
3086
+ * De-orient an input point from image to target space.
3087
+ *
3088
+ * @param {Point3D} point The input point.
3089
+ * @returns {Point3D} The de-orienteded point.
3090
+ */
3091
+ getImageDeOrientedPoint3D(point: Point3D): Point3D;
3092
+ /**
3093
+ * Reorder values to follow target orientation.
3094
+ *
3095
+ * @param {Scalar3D} values Values as {x,y,z}.
3096
+ * @returns {Scalar3D} Reoriented values as {x,y,z}.
3097
+ */
3098
+ getTargetOrientedPositiveXYZ(values: Scalar3D): Scalar3D;
3099
+ /**
3100
+ * Get the (view) scroll dimension index.
3101
+ *
3102
+ * @returns {number} The index.
3103
+ */
3104
+ getScrollIndex(): number;
3105
+ /**
3106
+ * Get the native (image) scroll dimension index.
3107
+ *
3108
+ * @returns {number} The index.
3109
+ */
3110
+ getNativeScrollIndex(): number;
3111
+ #private;
3112
+ }
3113
+
2389
3114
  /**
2390
3115
  * Immutable point.
2391
3116
  * Warning: the input array is NOT cloned, modifying it will
@@ -2499,19 +3224,6 @@ export declare class Point2D {
2499
3224
  * @returns {string} The point as a string.
2500
3225
  */
2501
3226
  toString(): string;
2502
- /**
2503
- * Get the distance to another Point2D.
2504
- *
2505
- * @param {Point2D} point2D The input point.
2506
- * @returns {number} The distance to the input point.
2507
- */
2508
- getDistance(point2D: Point2D): number;
2509
- /**
2510
- * Round a Point2D.
2511
- *
2512
- * @returns {Point2D} The rounded point.
2513
- */
2514
- getRound(): Point2D;
2515
3227
  #private;
2516
3228
  }
2517
3229
 
@@ -2572,6 +3284,13 @@ export declare class Point3D {
2572
3284
  * @returns {number} Ths distance to the input point.
2573
3285
  */
2574
3286
  getDistance(point3D: Point3D): number;
3287
+ /**
3288
+ * Get the closest point to this in a Point3D list.
3289
+ *
3290
+ * @param {Point3D[]} pointList The list to check.
3291
+ * @returns {number} The index of the closest point in the input list.
3292
+ */
3293
+ getClosest(pointList: Point3D[]): number;
2575
3294
  /**
2576
3295
  * Get the difference to another Point3D.
2577
3296
  *
@@ -2584,9 +3303,11 @@ export declare class Point3D {
2584
3303
 
2585
3304
  /**
2586
3305
  * Round a float number to a given precision.
2587
- * Inspired from https://stackoverflow.com/a/49729715/3639892.
3306
+ *
3307
+ * Inspired from {@link https://stackoverflow.com/a/49729715/3639892}.
3308
+ *
2588
3309
  * Can be a solution to not have trailing zero as when
2589
- * using toFixed or toPrecision.
3310
+ * using toFixed or toPrecision.
2590
3311
  * '+number.toFixed(precision)' does not pass all the tests...
2591
3312
  *
2592
3313
  * @param {number} number The number to round.
@@ -2596,40 +3317,7 @@ export declare class Point3D {
2596
3317
  export declare function precisionRound(number: number, precision: number): number;
2597
3318
 
2598
3319
  /**
2599
- * Rescale LUT class.
2600
- * Typically converts from integer to float.
2601
- */
2602
- export declare class RescaleLut {
2603
- /**
2604
- * @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
2605
- * @param {number} bitsStored The number of bits used to store the data.
2606
- */
2607
- constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
2608
- /**
2609
- * Get the Rescale Slope and Intercept (RSI).
2610
- *
2611
- * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
2612
- */
2613
- getRSI(): RescaleSlopeAndIntercept;
2614
- /**
2615
- * Get the length of the LUT array.
2616
- *
2617
- * @returns {number} The length of the LUT array.
2618
- */
2619
- getLength(): number;
2620
- /**
2621
- * Get the value of the LUT at the given offset.
2622
- *
2623
- * @param {number} offset The input offset in [0,2^bitsStored] range
2624
- * or full range for ID rescale.
2625
- * @returns {number} The float32 value of the LUT at the given offset.
2626
- */
2627
- getValue(offset: number): number;
2628
- #private;
2629
- }
2630
-
2631
- /**
2632
- * Rescale Slope and Intercept
3320
+ * Rescale Slope and Intercept.
2633
3321
  */
2634
3322
  export declare class RescaleSlopeAndIntercept {
2635
3323
  /**
@@ -2672,6 +3360,96 @@ export declare class RescaleSlopeAndIntercept {
2672
3360
  #private;
2673
3361
  }
2674
3362
 
3363
+ /**
3364
+ * RGB colour class.
3365
+ */
3366
+ export declare class RGB {
3367
+ /**
3368
+ * @param {number} r Red component.
3369
+ * @param {number} g Green component.
3370
+ * @param {number} b Blue component.
3371
+ */
3372
+ constructor(r: number, g: number, b: number);
3373
+ /**
3374
+ * Red component.
3375
+ *
3376
+ * @type {number}
3377
+ */
3378
+ r: number;
3379
+ /**
3380
+ * Green component.
3381
+ *
3382
+ * @type {number}
3383
+ */
3384
+ g: number;
3385
+ /**
3386
+ * Blue component.
3387
+ *
3388
+ * @type {number}
3389
+ */
3390
+ b: number;
3391
+ }
3392
+
3393
+ /**
3394
+ * Mutable 2D scalar ({x,y}).
3395
+ */
3396
+ export declare class Scalar2D {
3397
+ /**
3398
+ * X value.
3399
+ *
3400
+ * @type {number}
3401
+ */
3402
+ x: number;
3403
+ /**
3404
+ * Y value.
3405
+ *
3406
+ * @type {number}
3407
+ */
3408
+ y: number;
3409
+ }
3410
+
3411
+ /**
3412
+ * Mutable 3D scalar ({x,y,z}).
3413
+ */
3414
+ export declare class Scalar3D {
3415
+ /**
3416
+ * X value.
3417
+ *
3418
+ * @type {number}
3419
+ */
3420
+ x: number;
3421
+ /**
3422
+ * Y value.
3423
+ *
3424
+ * @type {number}
3425
+ */
3426
+ y: number;
3427
+ /**
3428
+ * Z value.
3429
+ *
3430
+ * @type {number}
3431
+ */
3432
+ z: number;
3433
+ }
3434
+
3435
+ /**
3436
+ * Scroll wheel class: provides a wheel event handler
3437
+ * that scroll the corresponding data.
3438
+ */
3439
+ export declare class ScrollWheel {
3440
+ /**
3441
+ * @param {App} app The associated application.
3442
+ */
3443
+ constructor(app: App);
3444
+ /**
3445
+ * Handle mouse wheel event.
3446
+ *
3447
+ * @param {WheelEvent} event The mouse wheel event.
3448
+ */
3449
+ wheel(event: WheelEvent): void;
3450
+ #private;
3451
+ }
3452
+
2675
3453
  /**
2676
3454
  * Immutable Size class.
2677
3455
  * Warning: the input array is NOT cloned, modifying it will
@@ -2679,9 +3457,9 @@ export declare class RescaleSlopeAndIntercept {
2679
3457
  */
2680
3458
  export declare class Size {
2681
3459
  /**
2682
- * @param {Array} values The size values.
3460
+ * @param {number[]} values The size values.
2683
3461
  */
2684
- constructor(values: any[]);
3462
+ constructor(values: number[]);
2685
3463
  /**
2686
3464
  * Get the size value at the given array index.
2687
3465
  *
@@ -2704,9 +3482,9 @@ export declare class Size {
2704
3482
  /**
2705
3483
  * Get the values of this index.
2706
3484
  *
2707
- * @returns {Array} The array of values.
3485
+ * @returns {number[]} The array of values.
2708
3486
  */
2709
- getValues(): any[];
3487
+ getValues(): number[];
2710
3488
  /**
2711
3489
  * Check if a dimension exists and has more than one element.
2712
3490
  *
@@ -2755,10 +3533,10 @@ export declare class Size {
2755
3533
  * Check that an index is within bounds.
2756
3534
  *
2757
3535
  * @param {Index} index The index to check.
2758
- * @param {Array} dirs Optional list of directions to check.
3536
+ * @param {number[]} dirs Optional list of directions to check.
2759
3537
  * @returns {boolean} True if the given coordinates are within bounds.
2760
3538
  */
2761
- isInBounds(index: Index, dirs: any[]): boolean;
3539
+ isInBounds(index: Index, dirs: number[]): boolean;
2762
3540
  /**
2763
3541
  * Convert an index to an offset in memory.
2764
3542
  *
@@ -2777,9 +3555,9 @@ export declare class Size {
2777
3555
  /**
2778
3556
  * Get the 2D base of this size.
2779
3557
  *
2780
- * @returns {object} The 2D base [0,1] as {x,y}.
3558
+ * @returns {Scalar2D} The 2D base [0,1] as {x,y}.
2781
3559
  */
2782
- get2D(): object;
3560
+ get2D(): Scalar2D;
2783
3561
  #private;
2784
3562
  }
2785
3563
 
@@ -2790,9 +3568,9 @@ export declare class Size {
2790
3568
  */
2791
3569
  export declare class Spacing {
2792
3570
  /**
2793
- * @param {Array} values The spacing values.
3571
+ * @param {number[]} values The spacing values.
2794
3572
  */
2795
- constructor(values: any[]);
3573
+ constructor(values: number[]);
2796
3574
  /**
2797
3575
  * Get the spacing value at the given array index.
2798
3576
  *
@@ -2815,9 +3593,9 @@ export declare class Spacing {
2815
3593
  /**
2816
3594
  * Get the values of this spacing.
2817
3595
  *
2818
- * @returns {Array} The array of values.
3596
+ * @returns {number[]} The array of values.
2819
3597
  */
2820
- getValues(): any[];
3598
+ getValues(): number[];
2821
3599
  /**
2822
3600
  * Check for equality.
2823
3601
  *
@@ -2828,12 +3606,20 @@ export declare class Spacing {
2828
3606
  /**
2829
3607
  * Get the 2D base of this size.
2830
3608
  *
2831
- * @returns {object} The 2D base [col,row] as {x,y}.
3609
+ * @returns {Scalar2D} The 2D base [col,row] as {x,y}.
2832
3610
  */
2833
- get2D(): object;
3611
+ get2D(): Scalar2D;
2834
3612
  #private;
2835
3613
  }
2836
3614
 
3615
+ /**
3616
+ * Convert sRGB to CIE LAB (standard illuminant D65).
3617
+ *
3618
+ * @param {RGB} triplet 'sRGB' triplet as {r,g,b}.
3619
+ * @returns {object} CIE LAB triplet as {l,a,b}.
3620
+ */
3621
+ export declare function srgbToCielab(triplet: RGB): object;
3622
+
2837
3623
  /**
2838
3624
  * Immutable tag.
2839
3625
  */
@@ -2890,18 +3676,13 @@ export declare class Tag {
2890
3676
  isWithVR(): boolean;
2891
3677
  /**
2892
3678
  * Is the tag group a private tag group ?
2893
- * see: http://dicom.nema.org/medical/dicom/2015a/output/html/part05.html#sect_7.8
3679
+ *
3680
+ * See: {@link http://dicom.nema.org/medical/dicom/2022a/output/html/part05.html#sect_7.8}.
2894
3681
  *
2895
3682
  * @returns {boolean} True if the tag group is private,
2896
3683
  * ie if its group is an odd number.
2897
3684
  */
2898
3685
  isPrivate(): boolean;
2899
- /**
2900
- * Get the tag info from the dicom dictionary.
2901
- *
2902
- * @returns {Array|undefined} The info as [vr, multiplicity, name].
2903
- */
2904
- getInfoFromDictionary(): any[] | undefined;
2905
3686
  /**
2906
3687
  * Get the tag Value Representation (VR) from the dicom dictionary.
2907
3688
  *
@@ -2946,6 +3727,13 @@ export declare class ToolboxController {
2946
3727
  * Initialise.
2947
3728
  */
2948
3729
  init(): void;
3730
+ /**
3731
+ * Enable or disable shortcuts. The 'init' methods enables shortcuts
3732
+ * by default. Call this method after init to disable shortcuts.
3733
+ *
3734
+ * @param {boolean} flag True to enable shortcuts.
3735
+ */
3736
+ enableShortcuts(flag: boolean): void;
2949
3737
  /**
2950
3738
  * Get the tool list.
2951
3739
  *
@@ -3013,6 +3801,16 @@ export declare class ToolConfig {
3013
3801
  options: string[] | undefined;
3014
3802
  }
3015
3803
 
3804
+ /**
3805
+ * List of client provided tools to be added to
3806
+ * the default ones.
3807
+ *
3808
+ * @type {Object<string, any>}
3809
+ */
3810
+ export declare const toolList: {
3811
+ [x: string]: any;
3812
+ };
3813
+
3016
3814
  /**
3017
3815
  * Immutable 3D vector.
3018
3816
  */
@@ -3065,7 +3863,8 @@ export declare class Vector3D {
3065
3863
  * vector that is perpendicular to both a and b.
3066
3864
  * If both vectors are parallel, the cross product is a zero vector.
3067
3865
  *
3068
- * @see https://en.wikipedia.org/wiki/Cross_product
3866
+ * Ref: {@link https://en.wikipedia.org/wiki/Cross_product}.
3867
+ *
3069
3868
  * @param {Vector3D} vector3D The input vector.
3070
3869
  * @returns {Vector3D} The result vector.
3071
3870
  */
@@ -3073,11 +3872,19 @@ export declare class Vector3D {
3073
3872
  /**
3074
3873
  * Get the dot product with another Vector3D.
3075
3874
  *
3076
- * @see https://en.wikipedia.org/wiki/Dot_product
3875
+ * Ref: {@link https://en.wikipedia.org/wiki/Dot_product}.
3876
+ *
3077
3877
  * @param {Vector3D} vector3D The input vector.
3078
3878
  * @returns {number} The dot product.
3079
3879
  */
3080
3880
  dotProduct(vector3D: Vector3D): number;
3881
+ /**
3882
+ * Is this vector codirectional to an input one.
3883
+ *
3884
+ * @param {Vector3D} vector3D The vector to test.
3885
+ * @returns {boolean} True if codirectional, false is opposite.
3886
+ */
3887
+ isCodirectional(vector3D: Vector3D): boolean;
3081
3888
  #private;
3082
3889
  }
3083
3890
 
@@ -3152,7 +3959,7 @@ export declare class View {
3152
3959
  */
3153
3960
  init(): void;
3154
3961
  /**
3155
- * Set the initial index to 0.
3962
+ * Set the initial index to the middle position.
3156
3963
  */
3157
3964
  setInitialIndex(): void;
3158
3965
  /**
@@ -3164,31 +3971,23 @@ export declare class View {
3164
3971
  getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
3165
3972
  /**
3166
3973
  * @callback alphaFn@callback alphaFn
3167
- * @param {object} value The pixel value.
3168
- * @param {object} index The values' index.
3169
- * @returns {number} The value to display.
3974
+ * @param {number[]|number} value The pixel value.
3975
+ * @param {number} index The values' index.
3976
+ * @returns {number} The opacity of the input value.
3170
3977
  */
3171
3978
  /**
3172
3979
  * Get the alpha function.
3173
3980
  *
3174
3981
  * @returns {alphaFn} The function.
3175
3982
  */
3176
- getAlphaFunction(): (value: object, index: object) => number;
3983
+ getAlphaFunction(): (value: number[] | number, index: number) => number;
3177
3984
  /**
3178
3985
  * Set alpha function.
3179
3986
  *
3180
3987
  * @param {alphaFn} func The function.
3181
3988
  * @fires View#alphafuncchange
3182
3989
  */
3183
- setAlphaFunction(func: (value: object, index: object) => number): void;
3184
- /**
3185
- * Get the window LUT of the image.
3186
- * Warning: can be undefined in no window/level was set.
3187
- *
3188
- * @returns {WindowLut} The window LUT of the image.
3189
- * @fires View#wlchange
3190
- */
3191
- getCurrentWindowLut(): WindowLut;
3990
+ setAlphaFunction(func: (value: number[] | number, index: number) => number): void;
3192
3991
  /**
3193
3992
  * Get the window presets.
3194
3993
  *
@@ -3198,9 +3997,9 @@ export declare class View {
3198
3997
  /**
3199
3998
  * Get the window presets names.
3200
3999
  *
3201
- * @returns {object} The list of window presets names.
4000
+ * @returns {string[]} The list of window presets names.
3202
4001
  */
3203
- getWindowPresetsNames(): object;
4002
+ getWindowPresetsNames(): string[];
3204
4003
  /**
3205
4004
  * Set the window presets.
3206
4005
  *
@@ -3245,12 +4044,13 @@ export declare class View {
3245
4044
  */
3246
4045
  getCurrentIndex(): Index;
3247
4046
  /**
3248
- * Check is the provided position can be set.
4047
+ * Check if the current position (default) or
4048
+ * the provided position is in bounds.
3249
4049
  *
3250
- * @param {Point} position The position.
4050
+ * @param {Point} [position] Optional position.
3251
4051
  * @returns {boolean} True is the position is in bounds.
3252
4052
  */
3253
- canSetPosition(position: Point): boolean;
4053
+ isPositionInBounds(position?: Point): boolean;
3254
4054
  /**
3255
4055
  * Get the first origin or at a given position.
3256
4056
  *
@@ -3263,7 +4063,7 @@ export declare class View {
3263
4063
  *
3264
4064
  * @param {Point} position The new position.
3265
4065
  * @param {boolean} silent Flag to fire event or not.
3266
- * @returns {boolean} False if not in bounds
4066
+ * @returns {boolean} False if not in bounds.
3267
4067
  * @fires View#positionchange
3268
4068
  */
3269
4069
  setCurrentPosition(position: Point, silent: boolean): boolean;
@@ -3279,14 +4079,19 @@ export declare class View {
3279
4079
  /**
3280
4080
  * Set the view window/level.
3281
4081
  *
3282
- * @param {number} center The window center.
3283
- * @param {number} width The window width.
4082
+ * @param {WindowLevel} wl The window and level.
3284
4083
  * @param {string} [name] Associated preset name, defaults to 'manual'.
3285
4084
  * Warning: uses the latest set rescale LUT or the default linear one.
3286
4085
  * @param {boolean} [silent] Flag to launch events with skipGenerate.
3287
4086
  * @fires View#wlchange
3288
4087
  */
3289
- setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void;
4088
+ setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
4089
+ /**
4090
+ * Get the window/level.
4091
+ *
4092
+ * @returns {WindowLevel} The window and level.
4093
+ */
4094
+ getWindowLevel(): WindowLevel;
3290
4095
  /**
3291
4096
  * Set the window level to the preset with the input name.
3292
4097
  *
@@ -3321,9 +4126,9 @@ export declare class View {
3321
4126
  * Get the image window/level that covers the full data range.
3322
4127
  * Warning: uses the latest set rescale LUT or the default linear one.
3323
4128
  *
3324
- * @returns {WindowCenterAndWidth} A min/max window level.
4129
+ * @returns {WindowLevel} A min/max window level.
3325
4130
  */
3326
- getWindowLevelMinMax(): WindowCenterAndWidth;
4131
+ getWindowLevelMinMax(): WindowLevel;
3327
4132
  /**
3328
4133
  * Set the image window/level to cover the full data range.
3329
4134
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -3337,42 +4142,12 @@ export declare class View {
3337
4142
  * otherwise generates at current index.
3338
4143
  */
3339
4144
  generateImageData(data: ImageData, index: Index): void;
3340
- /**
3341
- * Increment the provided dimension.
3342
- *
3343
- * @param {number} dim The dimension to increment.
3344
- * @param {boolean} silent Do not send event.
3345
- * @returns {boolean} False if not in bounds.
3346
- */
3347
- incrementIndex(dim: number, silent: boolean): boolean;
3348
- /**
3349
- * Decrement the provided dimension.
3350
- *
3351
- * @param {number} dim The dimension to increment.
3352
- * @param {boolean} silent Do not send event.
3353
- * @returns {boolean} False if not in bounds.
3354
- */
3355
- decrementIndex(dim: number, silent: boolean): boolean;
3356
4145
  /**
3357
4146
  * Get the scroll dimension index.
3358
4147
  *
3359
4148
  * @returns {number} The index.
3360
4149
  */
3361
4150
  getScrollIndex(): number;
3362
- /**
3363
- * Decrement the scroll dimension index.
3364
- *
3365
- * @param {boolean} silent Do not send event.
3366
- * @returns {boolean} False if not in bounds.
3367
- */
3368
- decrementScrollIndex(silent: boolean): boolean;
3369
- /**
3370
- * Increment the scroll dimension index.
3371
- *
3372
- * @param {boolean} silent Do not send event.
3373
- * @returns {boolean} False if not in bounds.
3374
- */
3375
- incrementScrollIndex(silent: boolean): boolean;
3376
4151
  #private;
3377
4152
  }
3378
4153
 
@@ -3410,6 +4185,26 @@ export declare class ViewConfig {
3410
4185
  * @type {number|undefined}
3411
4186
  */
3412
4187
  opacity: number | undefined;
4188
+ /**
4189
+ * Optional layer window level preset name.
4190
+ * If present, the preset name will be used and
4191
+ * the window centre and width ignored.
4192
+ *
4193
+ * @type {string|undefined}
4194
+ */
4195
+ wlPresetName: string | undefined;
4196
+ /**
4197
+ * Optional layer window center.
4198
+ *
4199
+ * @type {number|undefined}
4200
+ */
4201
+ windowCenter: number | undefined;
4202
+ /**
4203
+ * Optional layer window width.
4204
+ *
4205
+ * @type {number|undefined}
4206
+ */
4207
+ windowWidth: number | undefined;
3413
4208
  }
3414
4209
 
3415
4210
  /**
@@ -3424,33 +4219,15 @@ export declare class ViewController {
3424
4219
  /**
3425
4220
  * Get the plane helper.
3426
4221
  *
3427
- * @returns {object} The helper.
4222
+ * @returns {PlaneHelper} The helper.
3428
4223
  */
3429
- getPlaneHelper(): object;
4224
+ getPlaneHelper(): PlaneHelper;
3430
4225
  /**
3431
4226
  * Check is the associated image is a mask.
3432
4227
  *
3433
4228
  * @returns {boolean} True if the associated image is a mask.
3434
4229
  */
3435
4230
  isMask(): boolean;
3436
- /**
3437
- * Get the mask segment helper.
3438
- *
3439
- * @returns {object} The helper.
3440
- */
3441
- getMaskSegmentHelper(): object;
3442
- /**
3443
- * Apply the hidden segments list by setting
3444
- * the corresponding alpha function.
3445
- */
3446
- applyHiddenSegments(): void;
3447
- /**
3448
- * Delete a segment.
3449
- *
3450
- * @param {number} segmentNumber The segment number.
3451
- * @param {Function} exeCallback The post execution callback.
3452
- */
3453
- deleteSegment(segmentNumber: number, exeCallback: Function): void;
3454
4231
  /**
3455
4232
  * Initialise the controller.
3456
4233
  */
@@ -3464,9 +4241,9 @@ export declare class ViewController {
3464
4241
  /**
3465
4242
  * Get the window/level presets names.
3466
4243
  *
3467
- * @returns {Array} The presets names.
4244
+ * @returns {string[]} The presets names.
3468
4245
  */
3469
- getWindowLevelPresetsNames(): any[];
4246
+ getWindowLevelPresetsNames(): string[];
3470
4247
  /**
3471
4248
  * Add window/level presets to the view.
3472
4249
  *
@@ -3539,10 +4316,10 @@ export declare class ViewController {
3539
4316
  * Generate display image data to be given to a canvas.
3540
4317
  *
3541
4318
  * @param {ImageData} array The array to fill in.
3542
- * @param {Index} index Optional index at which to generate,
4319
+ * @param {Index} [index] Optional index at which to generate,
3543
4320
  * otherwise generates at current index.
3544
4321
  */
3545
- generateImageData(array: ImageData, index: Index): void;
4322
+ generateImageData(array: ImageData, index?: Index): void;
3546
4323
  /**
3547
4324
  * Set the associated image.
3548
4325
  *
@@ -3553,13 +4330,13 @@ export declare class ViewController {
3553
4330
  /**
3554
4331
  * Get the current view (2D) spacing.
3555
4332
  *
3556
- * @returns {Array} The spacing as a 2D array.
4333
+ * @returns {Scalar2D} The spacing as a 2D array.
3557
4334
  */
3558
- get2DSpacing(): any[];
4335
+ get2DSpacing(): Scalar2D;
3559
4336
  /**
3560
4337
  * Get the image rescaled value at the input position.
3561
4338
  *
3562
- * @param {Point} position the input position.
4339
+ * @param {Point} position The input position.
3563
4340
  * @returns {number|undefined} The image value or undefined if out of bounds
3564
4341
  * or no quantifiable (for ex RGB).
3565
4342
  */
@@ -3567,7 +4344,7 @@ export declare class ViewController {
3567
4344
  /**
3568
4345
  * Get the image pixel unit.
3569
4346
  *
3570
- * @returns {string} The unit
4347
+ * @returns {string} The unit.
3571
4348
  */
3572
4349
  getPixelUnit(): string;
3573
4350
  /**
@@ -3581,10 +4358,10 @@ export declare class ViewController {
3581
4358
  /**
3582
4359
  * Get some values from the associated image in variable regions.
3583
4360
  *
3584
- * @param {Array} regions A list of regions.
4361
+ * @param {number[][][]} regions A list of [x, y] pairs (min, max).
3585
4362
  * @returns {Array} A list of values.
3586
4363
  */
3587
- getImageVariableRegionValues(regions: any[]): any[];
4364
+ getImageVariableRegionValues(regions: number[][][]): any[];
3588
4365
  /**
3589
4366
  * Can the image values be quantified?
3590
4367
  *
@@ -3595,8 +4372,15 @@ export declare class ViewController {
3595
4372
  * Can window and level be applied to the data?
3596
4373
  *
3597
4374
  * @returns {boolean} True if possible.
4375
+ * @deprecated Please use isMonochrome instead.
3598
4376
  */
3599
4377
  canWindowLevel(): boolean;
4378
+ /**
4379
+ * Is the data monochrome.
4380
+ *
4381
+ * @returns {boolean} True if the data is monochrome.
4382
+ */
4383
+ isMonochrome(): boolean;
3600
4384
  /**
3601
4385
  * Can the data be scrolled?
3602
4386
  *
@@ -3605,17 +4389,25 @@ export declare class ViewController {
3605
4389
  */
3606
4390
  canScroll(): boolean;
3607
4391
  /**
3608
- * Get the image size.
4392
+ * Get the oriented image size.
3609
4393
  *
3610
4394
  * @returns {Size} The size.
3611
4395
  */
3612
4396
  getImageSize(): Size;
4397
+ /**
4398
+ * Is the data size larger than one in the given dimension?
4399
+ *
4400
+ * @param {number} dim The dimension.
4401
+ * @returns {boolean} True if the image size is larger than one
4402
+ * in the given dimension.
4403
+ */
4404
+ moreThanOne(dim: number): boolean;
3613
4405
  /**
3614
4406
  * Get the image world (mm) 2D size.
3615
4407
  *
3616
- * @returns {object} The 2D size as {x,y}.
4408
+ * @returns {Scalar2D} The 2D size as {x,y}.
3617
4409
  */
3618
- getImageWorldSize(): object;
4410
+ getImageWorldSize(): Scalar2D;
3619
4411
  /**
3620
4412
  * Get the image rescaled data range.
3621
4413
  *
@@ -3630,12 +4422,13 @@ export declare class ViewController {
3630
4422
  */
3631
4423
  equalImageMeta(meta: object): boolean;
3632
4424
  /**
3633
- * Check is the provided position can be set.
4425
+ * Check if the current position (default) or
4426
+ * the provided position is in bounds.
3634
4427
  *
3635
- * @param {Point} position The position.
4428
+ * @param {Point} [position] Optional position.
3636
4429
  * @returns {boolean} True is the position is in bounds.
3637
4430
  */
3638
- canSetPosition(position: Point): boolean;
4431
+ isPositionInBounds(position?: Point): boolean;
3639
4432
  /**
3640
4433
  * Set the current position.
3641
4434
  *
@@ -3646,20 +4439,19 @@ export declare class ViewController {
3646
4439
  */
3647
4440
  setCurrentPosition(pos: Point, silent?: boolean): boolean;
3648
4441
  /**
3649
- * Get a position from a 2D (x,y) position.
4442
+ * Get a world position from a 2D plane position.
3650
4443
  *
3651
- * @param {number} x The column position.
3652
- * @param {number} y The row position.
4444
+ * @param {Point2D} point2D The input point.
3653
4445
  * @returns {Point} The associated position.
3654
4446
  */
3655
- getPositionFromPlanePoint(x: number, y: number): Point;
4447
+ getPositionFromPlanePoint(point2D: Point2D): Point;
3656
4448
  /**
3657
- * Get a 2D (x,y) position from a position.
4449
+ * Get a 2D plane position from a world position.
3658
4450
  *
3659
4451
  * @param {Point} point The 3D position.
3660
- * @returns {object} The 2D position.
4452
+ * @returns {Point2D} The 2D position.
3661
4453
  */
3662
- getPlanePositionFromPosition(point: Point): object;
4454
+ getPlanePositionFromPosition(point: Point): Point2D;
3663
4455
  /**
3664
4456
  * Set the current index.
3665
4457
  *
@@ -3672,17 +4464,43 @@ export declare class ViewController {
3672
4464
  * Get a plane 3D position from a plane 2D position: does not compensate
3673
4465
  * for the image origin. Needed for setting the scale center...
3674
4466
  *
3675
- * @param {object} point2D The 2D position as {x,y}.
4467
+ * @param {Point2D} point2D The 2D position.
3676
4468
  * @returns {Point3D} The 3D point.
3677
4469
  */
3678
- getPlanePositionFromPlanePoint(point2D: object): Point3D;
4470
+ getPlanePositionFromPlanePoint(point2D: Point2D): Point3D;
3679
4471
  /**
3680
4472
  * Get a 3D offset from a plane one.
3681
4473
  *
3682
- * @param {object} offset2D The plane offset as {x,y}.
4474
+ * @param {Scalar2D} offset2D The plane offset as {x,y}.
3683
4475
  * @returns {Vector3D} The 3D world offset.
3684
4476
  */
3685
- getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
4477
+ getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
4478
+ /**
4479
+ * Get the current position incremented in the input direction.
4480
+ *
4481
+ * @param {number} dim The direction in which to increment.
4482
+ * @returns {Point} The resulting point.
4483
+ */
4484
+ getIncrementPosition(dim: number): Point;
4485
+ /**
4486
+ * Get the current position decremented in the input direction.
4487
+ *
4488
+ * @param {number} dim The direction in which to decrement.
4489
+ * @returns {Point} The resulting point.
4490
+ */
4491
+ getDecrementPosition(dim: number): Point;
4492
+ /**
4493
+ * Get the current position decremented in the scroll direction.
4494
+ *
4495
+ * @returns {Point} The resulting point.
4496
+ */
4497
+ getIncrementScrollPosition(): Point;
4498
+ /**
4499
+ * Get the current position decremented in the scroll direction.
4500
+ *
4501
+ * @returns {Point} The resulting point.
4502
+ */
4503
+ getDecrementScrollPosition(): Point;
3686
4504
  /**
3687
4505
  * Increment the provided dimension.
3688
4506
  *
@@ -3724,9 +4542,9 @@ export declare class ViewController {
3724
4542
  /**
3725
4543
  * Get the window/level.
3726
4544
  *
3727
- * @returns {object} The window center and width.
4545
+ * @returns {WindowLevel} The window and level.
3728
4546
  */
3729
- getWindowLevel(): object;
4547
+ getWindowLevel(): WindowLevel;
3730
4548
  /**
3731
4549
  * Get the current window level preset name.
3732
4550
  *
@@ -3734,12 +4552,11 @@ export declare class ViewController {
3734
4552
  */
3735
4553
  getCurrentWindowPresetName(): string;
3736
4554
  /**
3737
- * Set the window/level.
4555
+ * Set the window and level.
3738
4556
  *
3739
- * @param {number} wc The window center.
3740
- * @param {number} ww The window width.
4557
+ * @param {WindowLevel} wl The window and level.
3741
4558
  */
3742
- setWindowLevel(wc: number, ww: number): void;
4559
+ setWindowLevel(wl: WindowLevel): void;
3743
4560
  /**
3744
4561
  * Get the colour map.
3745
4562
  *
@@ -3754,16 +4571,28 @@ export declare class ViewController {
3754
4571
  setColourMap(name: string): void;
3755
4572
  /**
3756
4573
  * @callback alphaFn@callback alphaFn
3757
- * @param {object} value The pixel value.
3758
- * @param {object} index The values' index.
3759
- * @returns {number} The value to display.
4574
+ * @param {number[]|number} value The pixel value.
4575
+ * @param {number} index The values' index.
4576
+ * @returns {number} The opacity of the input value.
3760
4577
  */
3761
4578
  /**
3762
4579
  * Set the view per value alpha function.
3763
4580
  *
3764
4581
  * @param {alphaFn} func The function.
3765
4582
  */
3766
- setViewAlphaFunction(func: (value: object, index: object) => number): void;
4583
+ setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
4584
+ /**
4585
+ * Bind the view image to the provided layer.
4586
+ *
4587
+ * @param {ViewLayer} viewLayer The layer to bind.
4588
+ */
4589
+ bindImageAndLayer(viewLayer: ViewLayer): void;
4590
+ /**
4591
+ * Unbind the view image to the provided layer.
4592
+ *
4593
+ * @param {ViewLayer} viewLayer The layer to bind.
4594
+ */
4595
+ unbindImageAndLayer(viewLayer: ViewLayer): void;
3767
4596
  /**
3768
4597
  * Add an event listener to this class.
3769
4598
  *
@@ -3798,6 +4627,18 @@ export declare class ViewLayer {
3798
4627
  * @returns {string} The data id.
3799
4628
  */
3800
4629
  getDataId(): string;
4630
+ /**
4631
+ * Get the layer scale.
4632
+ *
4633
+ * @returns {Scalar2D} The scale as {x,y}.
4634
+ */
4635
+ getScale(): Scalar2D;
4636
+ /**
4637
+ * Get the layer zoom offset without the fit scale.
4638
+ *
4639
+ * @returns {Scalar2D} The offset as {x,y}.
4640
+ */
4641
+ getAbsoluteZoomOffset(): Scalar2D;
3801
4642
  /**
3802
4643
  * Set the imageSmoothing flag value.
3803
4644
  *
@@ -3830,31 +4671,50 @@ export declare class ViewLayer {
3830
4671
  * @function
3831
4672
  */
3832
4673
  onimageset: (event: object) => void;
4674
+ /**
4675
+ * Bind this layer to the view image.
4676
+ */
4677
+ bindImage(): void;
4678
+ /**
4679
+ * Unbind this layer to the view image.
4680
+ */
4681
+ unbindImage(): void;
4682
+ /**
4683
+ * Handle an image content change event.
4684
+ *
4685
+ * @param {object} event The event.
4686
+ * @function
4687
+ */
4688
+ onimagecontentchange: (event: object) => void;
3833
4689
  /**
3834
4690
  * Handle an image change event.
3835
4691
  *
3836
4692
  * @param {object} event The event.
3837
4693
  * @function
3838
4694
  */
3839
- onimagechange: (event: object) => void;
4695
+ onimagegeometrychange: (event: object) => void;
3840
4696
  /**
3841
4697
  * Get the id of the layer.
3842
4698
  *
3843
4699
  * @returns {string} The string id.
3844
4700
  */
3845
4701
  getId(): string;
4702
+ /**
4703
+ * Remove the HTML element from the DOM.
4704
+ */
4705
+ removeFromDOM(): void;
3846
4706
  /**
3847
4707
  * Get the layer base size (without scale).
3848
4708
  *
3849
- * @returns {object} The size as {x,y}.
4709
+ * @returns {Scalar2D} The size as {x,y}.
3850
4710
  */
3851
- getBaseSize(): object;
4711
+ getBaseSize(): Scalar2D;
3852
4712
  /**
3853
4713
  * Get the image world (mm) 2D size.
3854
4714
  *
3855
- * @returns {object} The 2D size as {x,y}.
4715
+ * @returns {Scalar2D} The 2D size as {x,y}.
3856
4716
  */
3857
- getImageWorldSize(): object;
4717
+ getImageWorldSize(): Scalar2D;
3858
4718
  /**
3859
4719
  * Get the layer opacity.
3860
4720
  *
@@ -3875,6 +4735,14 @@ export declare class ViewLayer {
3875
4735
  * Add a flip offset along the layer Y axis.
3876
4736
  */
3877
4737
  addFlipOffsetY(): void;
4738
+ /**
4739
+ * Flip the scale along the layer X axis.
4740
+ */
4741
+ flipScaleX(): void;
4742
+ /**
4743
+ * Flip the scale along the layer Y axis.
4744
+ */
4745
+ flipScaleY(): void;
3878
4746
  /**
3879
4747
  * Flip the scale along the layer Z axis.
3880
4748
  */
@@ -3882,65 +4750,70 @@ export declare class ViewLayer {
3882
4750
  /**
3883
4751
  * Set the layer scale.
3884
4752
  *
3885
- * @param {object} newScale The scale as {x,y}.
4753
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
3886
4754
  * @param {Point3D} [center] The scale center.
3887
4755
  */
3888
- setScale(newScale: object, center?: Point3D): void;
4756
+ setScale(newScale: Scalar3D, center?: Point3D): void;
4757
+ /**
4758
+ * Initialise the layer scale.
4759
+ *
4760
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
4761
+ * @param {Scalar2D} absoluteZoomOffset The zoom offset as {x,y}
4762
+ * without the fit scale (as provided by getAbsoluteZoomOffset).
4763
+ */
4764
+ initScale(newScale: Scalar3D, absoluteZoomOffset: Scalar2D): void;
3889
4765
  /**
3890
4766
  * Set the base layer offset. Updates the layer offset.
3891
4767
  *
3892
4768
  * @param {Vector3D} scrollOffset The scroll offset vector.
3893
4769
  * @param {Vector3D} planeOffset The plane offset vector.
4770
+ * @param {Point3D} [layerGroupOrigin] The layer group origin.
4771
+ * @param {Point3D} [layerGroupOrigin0] The layer group first origin.
3894
4772
  * @returns {boolean} True if the offset was updated.
3895
4773
  */
3896
- setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D): boolean;
4774
+ setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D, layerGroupOrigin?: Point3D, layerGroupOrigin0?: Point3D): boolean;
3897
4775
  /**
3898
4776
  * Set the layer offset.
3899
4777
  *
3900
- * @param {object} newOffset The offset as {x,y}.
4778
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
3901
4779
  */
3902
- setOffset(newOffset: object): void;
4780
+ setOffset(newOffset: Scalar3D): void;
3903
4781
  /**
3904
- * Transform a display position to an index.
4782
+ * Transform a display position to a 2D index.
3905
4783
  *
3906
- * @param {number} x The X position.
3907
- * @param {number} y The Y position.
3908
- * @returns {Index} The equivalent index.
4784
+ * @param {Point2D} point2D The input point.
4785
+ * @returns {Index} The equivalent 2D index.
3909
4786
  */
3910
- displayToPlaneIndex(x: number, y: number): Index;
4787
+ displayToPlaneIndex(point2D: Point2D): Index;
3911
4788
  /**
3912
4789
  * Remove scale from a display position.
3913
4790
  *
3914
- * @param {number} x The X position.
3915
- * @param {number} y The Y position.
3916
- * @returns {object} The de-scaled position as {x,y}.
4791
+ * @param {Point2D} point2D The input point.
4792
+ * @returns {Point2D} The de-scaled point.
3917
4793
  */
3918
- displayToPlaneScale(x: number, y: number): object;
4794
+ displayToPlaneScale(point2D: Point2D): Point2D;
3919
4795
  /**
3920
4796
  * Get a plane position from a display position.
3921
4797
  *
3922
- * @param {number} x The X position.
3923
- * @param {number} y The Y position.
3924
- * @returns {object} The plane position as {x,y}.
4798
+ * @param {Point2D} point2D The input point.
4799
+ * @returns {Point2D} The plane position.
3925
4800
  */
3926
- displayToPlanePos(x: number, y: number): object;
4801
+ displayToPlanePos(point2D: Point2D): Point2D;
3927
4802
  /**
3928
4803
  * Get a display position from a plane position.
3929
4804
  *
3930
- * @param {number} x The X position.
3931
- * @param {number} y The Y position.
3932
- * @returns {object} The display position as {x,y}, can be individually
4805
+ * @param {Point2D} point2D The input point.
4806
+ * @returns {Point2D} The display position, can be individually
3933
4807
  * undefined if out of bounds.
3934
4808
  */
3935
- planePosToDisplay(x: number, y: number): object;
4809
+ planePosToDisplay(point2D: Point2D): Point2D;
3936
4810
  /**
3937
4811
  * Get a main plane position from a display position.
3938
4812
  *
3939
- * @param {number} x The X position.
3940
- * @param {number} y The Y position.
3941
- * @returns {object} The main plane position as {x,y}.
4813
+ * @param {Point2D} point2D The input point.
4814
+ * @returns {Point2D} The main plane position.
3942
4815
  */
3943
- displayToMainPlanePos(x: number, y: number): object;
4816
+ displayToMainPlanePos(point2D: Point2D): Point2D;
3944
4817
  /**
3945
4818
  * Display the layer.
3946
4819
  *
@@ -3955,28 +4828,28 @@ export declare class ViewLayer {
3955
4828
  isVisible(): boolean;
3956
4829
  /**
3957
4830
  * Draw the content (imageData) of the layer.
3958
- * The imageData variable needs to be set
4831
+ * The imageData variable needs to be set.
3959
4832
  *
3960
4833
  * @fires App#renderstart
3961
4834
  * @fires App#renderend
3962
4835
  */
3963
4836
  draw(): void;
3964
4837
  /**
3965
- * Initialise the layer: set the canvas and context
4838
+ * Initialise the layer: set the canvas and context.
3966
4839
  *
3967
- * @param {object} size The image size as {x,y}.
3968
- * @param {object} spacing The image spacing as {x,y}.
4840
+ * @param {Scalar2D} size The image size as {x,y}.
4841
+ * @param {Scalar2D} spacing The image spacing as {x,y}.
3969
4842
  * @param {number} alpha The initial data opacity.
3970
4843
  */
3971
- initialise(size: object, spacing: object, alpha: number): void;
4844
+ initialise(size: Scalar2D, spacing: Scalar2D, alpha: number): void;
3972
4845
  /**
3973
4846
  * Fit the layer to its parent container.
3974
4847
  *
3975
- * @param {number} fitScale1D The 1D fit scale.
3976
- * @param {object} fitSize The fit size as {x,y}.
3977
- * @param {object} fitOffset The fit offset as {x,y}.
4848
+ * @param {Scalar2D} containerSize The fit size as {x,y}.
4849
+ * @param {number} divToWorldSizeRatio The div to world size ratio.
4850
+ * @param {Scalar2D} fitOffset The fit offset as {x,y}.
3978
4851
  */
3979
- fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void;
4852
+ fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void;
3980
4853
  /**
3981
4854
  * Enable and listen to container interaction events.
3982
4855
  */
@@ -4017,101 +4890,33 @@ export declare class ViewLayer {
4017
4890
  }
4018
4891
 
4019
4892
  /**
4020
- * WindowCenterAndWidth class.
4021
- * <br>Pseudo-code:
4022
- * <pre>
4023
- * if (x &lt;= c - 0.5 - (w-1)/2), then y = ymin
4024
- * else if (x > c - 0.5 + (w-1)/2), then y = ymax,
4025
- * else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
4026
- * </pre>
4027
- *
4028
- * @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}
4893
+ * Window and Level also known as window width and center.
4029
4894
  */
4030
- export declare class WindowCenterAndWidth {
4895
+ export declare class WindowLevel {
4031
4896
  /**
4032
4897
  * @param {number} center The window center.
4033
4898
  * @param {number} width The window width.
4034
4899
  */
4035
4900
  constructor(center: number, width: number);
4036
4901
  /**
4037
- * Get the window center.
4038
- *
4039
- * @returns {number} The window center.
4040
- */
4041
- getCenter(): number;
4042
- /**
4043
- * Get the window width.
4044
- *
4045
- * @returns {number} The window width.
4046
- */
4047
- getWidth(): number;
4048
- /**
4049
- * Set the signed offset.
4050
- *
4051
- * @param {number} offset The signed data offset,
4052
- * typically: slope * ( size / 2).
4053
- */
4054
- setSignedOffset(offset: number): void;
4055
- /**
4056
- * Apply the window level on an input value.
4057
- *
4058
- * @param {number} value The value to rescale as an integer.
4059
- * @returns {number} The leveled value, in the
4060
- * [ymin, ymax] range (default [0,255]).
4061
- */
4062
- apply(value: number): number;
4063
- /**
4064
- * Check for window level equality.
4065
- *
4066
- * @param {WindowCenterAndWidth} rhs The other window level to compare to.
4067
- * @returns {boolean} True if both window level are equal.
4068
- */
4069
- equals(rhs: WindowCenterAndWidth): boolean;
4070
- #private;
4071
- }
4072
-
4073
- /**
4074
- * Window LUT class.
4075
- * Typically converts from float to integer.
4076
- */
4077
- export declare class WindowLut {
4078
- /**
4079
- * Construct a window LUT object, window level is set with
4080
- * the 'setWindowLevel' method.
4081
- *
4082
- * @param {RescaleLut} rescaleLut The associated rescale LUT.
4083
- * @param {boolean} isSigned Flag to know if the data is signed or not.
4084
- * @param {boolean} isDiscrete Flag to know if the input data is discrete.
4085
- */
4086
- constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
4087
- /**
4088
- * Get the window / level.
4089
- *
4090
- * @returns {WindowCenterAndWidth} The window / level.
4091
- */
4092
- getWindowLevel(): WindowCenterAndWidth;
4093
- /**
4094
- * Get the rescale lut.
4902
+ * The window center.
4095
4903
  *
4096
- * @returns {RescaleLut} The rescale lut.
4904
+ * @type {number}
4097
4905
  */
4098
- getRescaleLut(): RescaleLut;
4906
+ center: number;
4099
4907
  /**
4100
- * Set the window center and width.
4908
+ * The window width.
4101
4909
  *
4102
- * @param {WindowCenterAndWidth} wl The window level.
4910
+ * @type {number}
4103
4911
  */
4104
- setWindowLevel(wl: WindowCenterAndWidth): void;
4912
+ width: number;
4105
4913
  /**
4106
- * Get the value of the LUT at the given offset.
4914
+ * Check for equality.
4107
4915
  *
4108
- * @param {number} offset The input offset in [0,2^bitsStored] range
4109
- * for discrete data or full range for non discrete.
4110
- * @returns {number} The integer value (default [0,255]) of the LUT
4111
- * at the given offset.
4916
+ * @param {WindowLevel} rhs The other object to compare to.
4917
+ * @returns {boolean} True if both objects are equal.
4112
4918
  */
4113
- getValue(offset: number): number;
4114
- #private;
4919
+ equals(rhs: WindowLevel): boolean;
4115
4920
  }
4116
4921
 
4117
4922
  /**