dwv 0.33.0-beta.15 → 0.33.0-beta.17

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
@@ -34,15 +34,15 @@ export declare class App {
34
34
  * Get the image.
35
35
  *
36
36
  * @param {string} dataId The data id.
37
- * @returns {Image} The associated image.
37
+ * @returns {Image|undefined} The associated image.
38
38
  */
39
- getImage(dataId: string): Image_2;
39
+ getImage(dataId: string): Image_2 | undefined;
40
40
  /**
41
41
  * Get the last loaded image.
42
42
  *
43
- * @returns {Image} The image.
43
+ * @returns {Image|undefined} The image.
44
44
  */
45
- getLastImage(): Image_2;
45
+ getLastImage(): Image_2 | undefined;
46
46
  /**
47
47
  * Set the image at the given id.
48
48
  *
@@ -70,41 +70,53 @@ export declare class App {
70
70
  * Get the meta data.
71
71
  *
72
72
  * @param {string} dataId The data id.
73
- * @returns {object} The list of meta data.
73
+ * @returns {Object<string, DataElement>|undefined} The list of meta data.
74
74
  */
75
- getMetaData(dataId: string): object;
75
+ getMetaData(dataId: string): {
76
+ [x: string]: DataElement;
77
+ } | undefined;
76
78
  /**
77
79
  * Get the list of ids in the data storage.
78
80
  *
79
- * @returns {Array} The list of data ids.
81
+ * @returns {string[]} The list of data ids.
80
82
  */
81
- getDataIds(): any[];
83
+ getDataIds(): string[];
82
84
  /**
83
- * Can the data be scrolled?
85
+ * Get the list of dataIds that contain the input UIDs.
86
+ *
87
+ * @param {string[]} uids A list of UIDs.
88
+ * @returns {string[]} The list of dataIds that contain the UIDs.
89
+ */
90
+ getDataIdsFromSopUids(uids: string[]): string[];
91
+ /**
92
+ * Can the data (of the active view of the active layer) be scrolled?
84
93
  *
85
94
  * @returns {boolean} True if the data has a third dimension greater than one.
95
+ * @deprecated Please use the ViewController equivalent directly instead.
86
96
  */
87
97
  canScroll(): boolean;
88
98
  /**
89
- * Can window and level be applied to the data?
99
+ * Can window and level be applied to the data
100
+ * (of the active view of the active layer)?
90
101
  *
91
102
  * @returns {boolean} True if the data is monochrome.
103
+ * @deprecated Please use the ViewController equivalent directly instead.
92
104
  */
93
105
  canWindowLevel(): boolean;
94
106
  /**
95
- * Get the layer scale on top of the base scale.
107
+ * Get the active layer group scale on top of the base scale.
96
108
  *
97
109
  * @returns {object} The scale as {x,y}.
98
110
  */
99
111
  getAddedScale(): object;
100
112
  /**
101
- * Get the base scale.
113
+ * Get the base scale of the active layer group.
102
114
  *
103
115
  * @returns {object} The scale as {x,y}.
104
116
  */
105
117
  getBaseScale(): object;
106
118
  /**
107
- * Get the layer offset.
119
+ * Get the layer offset of the active layer group.
108
120
  *
109
121
  * @returns {object} The offset.
110
122
  */
@@ -292,6 +304,9 @@ export declare class App {
292
304
  fitToContainer(): void;
293
305
  /**
294
306
  * Init the Window/Level display
307
+ * (of the active layer of the active layer group).
308
+ *
309
+ * @deprecated Please set the opacity of the desired view layer directly.
295
310
  */
296
311
  initWLDisplay(): void;
297
312
  /**
@@ -375,7 +390,7 @@ export declare class App {
375
390
  */
376
391
  render(dataId: string, viewConfigs?: ViewConfig[]): void;
377
392
  /**
378
- * Zoom to the layers.
393
+ * Zoom the layers of the active layer group.
379
394
  *
380
395
  * @param {number} step The step to add to the current zoom.
381
396
  * @param {number} cx The zoom center X coordinate.
@@ -383,20 +398,21 @@ export declare class App {
383
398
  */
384
399
  zoom(step: number, cx: number, cy: number): void;
385
400
  /**
386
- * Apply a translation to the layers.
401
+ * Apply a translation to the layers of the active layer group.
387
402
  *
388
403
  * @param {number} tx The translation along X.
389
404
  * @param {number} ty The translation along Y.
390
405
  */
391
406
  translate(tx: number, ty: number): void;
392
407
  /**
393
- * Set the image layer opacity.
408
+ * Set the active view layer (of the active layer group) opacity.
394
409
  *
395
410
  * @param {number} alpha The opacity ([0:1] range).
411
+ * @deprecated Please set the opacity of the desired view layer directly.
396
412
  */
397
413
  setOpacity(alpha: number): void;
398
414
  /**
399
- * Set the drawings on the current stage.
415
+ * Set the drawings of the active layer group.
400
416
  *
401
417
  * @param {Array} drawings An array of drawings.
402
418
  * @param {Array} drawingsDetails An array of drawings details.
@@ -438,6 +454,7 @@ export declare class App {
438
454
  * - CRTL-ARROW_UP: next element on third dim
439
455
  * - CRTL-ARROW_RIGHT: previous element on fourth dim
440
456
  * - CRTL-ARROW_DOWN: previous element on third dim
457
+ * (applies to the active view of the active layer group)
441
458
  *
442
459
  * @param {KeyboardEvent} event The key down event.
443
460
  * @fires UndoStack#undo
@@ -454,17 +471,19 @@ export declare class App {
454
471
  */
455
472
  resetZoom(): void;
456
473
  /**
457
- * Set the colour map.
474
+ * Set the colour map of the active view of the active layer group.
458
475
  *
459
476
  * @param {string} name The colour map name.
477
+ * @deprecated Please use the ViewController equivalent directly instead.
460
478
  */
461
479
  setColourMap(name: string): void;
462
480
  /**
463
- * Set the window/level preset.
481
+ * Set the window/level preset of the active view of the active layer group.
464
482
  *
465
- * @param {object} preset The window/level preset.
483
+ * @param {string} preset The window/level preset.
484
+ * @deprecated Please use the ViewController equivalent directly instead.
466
485
  */
467
- setWindowLevelPreset(preset: object): void;
486
+ setWindowLevelPreset(preset: string): void;
468
487
  /**
469
488
  * Set the tool
470
489
  *
@@ -619,27 +638,33 @@ export declare class ColourMap {
619
638
  /**
620
639
  * Create an Image from DICOM elements.
621
640
  *
622
- * @param {object} elements The DICOM elements.
641
+ * @param {Object<string, DataElement>} elements The DICOM elements.
623
642
  * @returns {Image} The Image object.
624
643
  */
625
- export declare function createImage(elements: object): Image_2;
644
+ export declare function createImage(elements: {
645
+ [x: string]: DataElement;
646
+ }): Image_2;
626
647
 
627
648
  /**
628
649
  * Create a mask Image from DICOM elements.
629
650
  *
630
- * @param {object} elements The DICOM elements.
651
+ * @param {Object<string, DataElement>} elements The DICOM elements.
631
652
  * @returns {Image} The mask Image object.
632
653
  */
633
- export declare function createMaskImage(elements: object): Image_2;
654
+ export declare function createMaskImage(elements: {
655
+ [x: string]: DataElement;
656
+ }): Image_2;
634
657
 
635
658
  /**
636
659
  * Create a View from DICOM elements and image.
637
660
  *
638
- * @param {object} elements The DICOM elements.
661
+ * @param {Object<string, DataElement>} elements The DICOM elements.
639
662
  * @param {Image} image The associated image.
640
663
  * @returns {View} The View object.
641
664
  */
642
- export declare function createView(elements: object, image: Image_2): View;
665
+ export declare function createView(elements: {
666
+ [x: string]: DataElement;
667
+ }, image: Image_2): View;
643
668
 
644
669
  export declare namespace customUI {
645
670
  /**
@@ -709,10 +734,6 @@ export declare class DataElement {
709
734
  items: any[];
710
735
  }
711
736
 
712
- declare type DataElements = {
713
- [x: string]: DataElement;
714
- };
715
-
716
737
  /**
717
738
  * Decoder scripts to be passed to web workers for image decoding.
718
739
  */
@@ -726,14 +747,11 @@ export declare const decoderScripts: {
726
747
  /**
727
748
  * List of default window level presets.
728
749
  *
729
- * @type {Object.<string, Object.<string, {center: number, width: number}>>}
750
+ * @type {Object.<string, Object.<string, WindowLevel>>}
730
751
  */
731
752
  export declare const defaultPresets: {
732
753
  [x: string]: {
733
- [x: string]: {
734
- center: number;
735
- width: number;
736
- };
754
+ [x: string]: WindowLevel;
737
755
  };
738
756
  };
739
757
 
@@ -745,6 +763,46 @@ export declare namespace defaults {
745
763
  };
746
764
  }
747
765
 
766
+ /**
767
+ * DICOM code.
768
+ */
769
+ export declare class DicomCode {
770
+ /**
771
+ * @param {string} meaning The code meaning.
772
+ */
773
+ constructor(meaning: string);
774
+ /**
775
+ * Code meaning (0008,0104).
776
+ *
777
+ * @type {string}
778
+ */
779
+ meaning: string;
780
+ /**
781
+ * Code value (0008,0100).
782
+ *
783
+ * @type {string|undefined}
784
+ */
785
+ value: string | undefined;
786
+ /**
787
+ * Long code value (0008,0119).
788
+ *
789
+ * @type {string|undefined}
790
+ */
791
+ longValue: string | undefined;
792
+ /**
793
+ * URN code value (0008,0120).
794
+ *
795
+ * @type {string|undefined}
796
+ */
797
+ urnValue: string | undefined;
798
+ /**
799
+ * Coding scheme designator (0008,0102).
800
+ *
801
+ * @type {string|undefined}
802
+ */
803
+ schemeDesignator: string | undefined;
804
+ }
805
+
748
806
  /**
749
807
  * DicomParser class.
750
808
  *
@@ -1613,6 +1671,13 @@ declare class Image_2 {
1613
1671
  * @returns {string} The UID.
1614
1672
  */
1615
1673
  getImageUid(index?: Index): string;
1674
+ /**
1675
+ * Check if this image includes the input uids.
1676
+ *
1677
+ * @param {string[]} uids UIDs to test for presence.
1678
+ * @returns {boolean} True if all uids are in this image uids.
1679
+ */
1680
+ containsImageUids(uids: string[]): boolean;
1616
1681
  /**
1617
1682
  * Get the geometry of the image.
1618
1683
  *
@@ -1636,8 +1701,15 @@ declare class Image_2 {
1636
1701
  * Can window and level be applied to the data?
1637
1702
  *
1638
1703
  * @returns {boolean} True if the data is monochrome.
1704
+ * @deprecated Please use isMonochrome instead.
1639
1705
  */
1640
1706
  canWindowLevel(): boolean;
1707
+ /**
1708
+ * Is the data monochrome.
1709
+ *
1710
+ * @returns {boolean} True if the data is monochrome.
1711
+ */
1712
+ isMonochrome(): boolean;
1641
1713
  /**
1642
1714
  * Can the data be scrolled?
1643
1715
  *
@@ -2323,13 +2395,184 @@ export declare class MaskFactory {
2323
2395
  /**
2324
2396
  * Get an {@link Image} object from the read DICOM file.
2325
2397
  *
2326
- * @param {DataElements} dataElements The DICOM tags.
2398
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
2327
2399
  * @param {Uint8Array | Int8Array |
2328
2400
  * Uint16Array | Int16Array |
2329
2401
  * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
2330
2402
  * @returns {Image} A new Image.
2331
2403
  */
2332
- create(dataElements: DataElements, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
2404
+ create(dataElements: {
2405
+ [x: string]: DataElement;
2406
+ }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
2407
+ }
2408
+
2409
+ /**
2410
+ * DICOM (mask) segment.
2411
+ */
2412
+ export declare class MaskSegment {
2413
+ /**
2414
+ * @param {number} number The segment number.
2415
+ * @param {string} label The segment label.
2416
+ * @param {string} algorithmType The segment number.
2417
+ */
2418
+ constructor(number: number, label: string, algorithmType: string);
2419
+ /**
2420
+ * Segment number (0062,0004).
2421
+ *
2422
+ * @type {number}
2423
+ */
2424
+ number: number;
2425
+ /**
2426
+ * Segment label (0062,0005).
2427
+ *
2428
+ * @type {string}
2429
+ */
2430
+ label: string;
2431
+ /**
2432
+ * Segment algorithm type (0062,0008).
2433
+ *
2434
+ * @type {string}
2435
+ */
2436
+ algorithmType: string;
2437
+ /**
2438
+ * Segment algorithm name (0062,0009).
2439
+ *
2440
+ * @type {string|undefined}
2441
+ */
2442
+ algorithmName: string | undefined;
2443
+ /**
2444
+ * Segment display value as simple value.
2445
+ *
2446
+ * @type {number|undefined}
2447
+ */
2448
+ displayValue: number | undefined;
2449
+ /**
2450
+ * Segment display value as RGB colour ({r,g,b}).
2451
+ *
2452
+ * @type {RGB|undefined}
2453
+ */
2454
+ displayRGBValue: RGB | undefined;
2455
+ /**
2456
+ * Segment property code: specific property
2457
+ * the segment represents (0062,000F).
2458
+ *
2459
+ * @type {DicomCode|undefined}
2460
+ */
2461
+ propertyTypeCode: DicomCode | undefined;
2462
+ /**
2463
+ * Segment property category code: general category
2464
+ * of the property the segment represents (0062,0003).
2465
+ *
2466
+ * @type {DicomCode|undefined}
2467
+ */
2468
+ propertyCategoryCode: DicomCode | undefined;
2469
+ /**
2470
+ * Segment tracking UID (0062,0021).
2471
+ *
2472
+ * @type {string|undefined}
2473
+ */
2474
+ trackingUid: string | undefined;
2475
+ /**
2476
+ * Segment tracking id: text label for the UID (0062,0020).
2477
+ *
2478
+ * @type {string|undefined}
2479
+ */
2480
+ trackingId: string | undefined;
2481
+ }
2482
+
2483
+ /**
2484
+ * Mask segment helper.
2485
+ */
2486
+ export declare class MaskSegmentHelper {
2487
+ /**
2488
+ * @param {Image} mask The associated mask image.
2489
+ */
2490
+ constructor(mask: Image_2);
2491
+ /**
2492
+ * Check if a segment is part of the inner segment list.
2493
+ *
2494
+ * @param {number} segmentNumber The segment number.
2495
+ * @returns {boolean} True if the segment is included.
2496
+ */
2497
+ hasSegment(segmentNumber: number): boolean;
2498
+ /**
2499
+ * Check if a segment is present in a mask image.
2500
+ *
2501
+ * @param {number[]} numbers Array of segment numbers.
2502
+ * @returns {boolean[]} Array of boolean set to true
2503
+ * if the segment is present in the mask.
2504
+ */
2505
+ maskHasSegments(numbers: number[]): boolean[];
2506
+ /**
2507
+ * Get a segment from the inner segment list.
2508
+ *
2509
+ * @param {number} segmentNumber The segment number.
2510
+ * @returns {MaskSegment|undefined} The segment.
2511
+ */
2512
+ getSegment(segmentNumber: number): MaskSegment | undefined;
2513
+ /**
2514
+ * Get the inner segment list.
2515
+ *
2516
+ * @returns {MaskSegment[]} The list of segments.
2517
+ */
2518
+ getSegments(): MaskSegment[];
2519
+ /**
2520
+ * Set the inner segment list.
2521
+ *
2522
+ * @param {MaskSegment[]} list The segment list.
2523
+ */
2524
+ setSegments(list: MaskSegment[]): void;
2525
+ /**
2526
+ * Set the hidden segment list.
2527
+ * TODO: not sure if needed...
2528
+ *
2529
+ * @param {number[]} list The list of hidden segment numbers.
2530
+ */
2531
+ setHiddenSegments(list: number[]): void;
2532
+ /**
2533
+ * Check if a segment is in the hidden list.
2534
+ *
2535
+ * @param {number} segmentNumber The segment number.
2536
+ * @returns {boolean} True if the segment is in the list.
2537
+ */
2538
+ isHidden(segmentNumber: number): boolean;
2539
+ /**
2540
+ * Add a segment to the hidden list.
2541
+ *
2542
+ * @param {number} segmentNumber The segment number.
2543
+ */
2544
+ addToHidden(segmentNumber: number): void;
2545
+ /**
2546
+ * Remove a segment from the hidden list.
2547
+ *
2548
+ * @param {number} segmentNumber The segment number.
2549
+ */
2550
+ removeFromHidden(segmentNumber: number): void;
2551
+ /**
2552
+ * @callback alphaFn@callback alphaFn
2553
+ * @param {object} value The pixel value.
2554
+ * @param {object} index The values' index.
2555
+ * @returns {number} The value to display.
2556
+ */
2557
+ /**
2558
+ * Get the alpha function to apply hidden colors.
2559
+ *
2560
+ * @returns {alphaFn} The corresponding alpha function.
2561
+ */
2562
+ getAlphaFunc(): (value: object, index: object) => number;
2563
+ /**
2564
+ * @callback eventFn@callback eventFn
2565
+ * @param {object} event The event.
2566
+ */
2567
+ /**
2568
+ * Delete a segment.
2569
+ *
2570
+ * @param {number} segmentNumber The segment number.
2571
+ * @param {eventFn} cmdCallback The command event callback.
2572
+ * @param {Function} exeCallback The post execution callback.
2573
+ */
2574
+ deleteSegment(segmentNumber: number, cmdCallback: (event: object) => any, exeCallback: Function): void;
2575
+ #private;
2333
2576
  }
2334
2577
 
2335
2578
  /**
@@ -2493,6 +2736,101 @@ export declare class OverlayData {
2493
2736
  #private;
2494
2737
  }
2495
2738
 
2739
+ /**
2740
+ * Plane geometry helper.
2741
+ */
2742
+ export declare class PlaneHelper {
2743
+ /**
2744
+ * @param {Spacing} spacing The spacing.
2745
+ * @param {Matrix33} imageOrientation The image oientation.
2746
+ * @param {Matrix33} viewOrientation The view orientation.
2747
+ */
2748
+ constructor(spacing: Spacing, imageOrientation: Matrix33, viewOrientation: Matrix33);
2749
+ /**
2750
+ * Get a 3D offset from a plane one.
2751
+ *
2752
+ * @param {object} offset2D The plane offset as {x,y}.
2753
+ * @returns {Vector3D} The 3D world offset.
2754
+ */
2755
+ getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
2756
+ /**
2757
+ * Get a plane offset from a 3D one.
2758
+ *
2759
+ * @param {object} offset3D The 3D offset as {x,y,z}.
2760
+ * @returns {object} The plane offset as {x,y}.
2761
+ */
2762
+ getPlaneOffsetFromOffset3D(offset3D: object): object;
2763
+ /**
2764
+ * Orient an input vector from real to target space.
2765
+ *
2766
+ * @param {Vector3D} vector The input vector.
2767
+ * @returns {Vector3D} The oriented vector.
2768
+ */
2769
+ getTargetOrientedVector3D(vector: Vector3D): Vector3D;
2770
+ /**
2771
+ * De-orient an input vector from target to real space.
2772
+ *
2773
+ * @param {Vector3D} planeVector The input vector.
2774
+ * @returns {Vector3D} The de-orienteded vector.
2775
+ */
2776
+ getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D;
2777
+ /**
2778
+ * De-orient an input point from target to real space.
2779
+ *
2780
+ * @param {Point3D} planePoint The input point.
2781
+ * @returns {Point3D} The de-orienteded point.
2782
+ */
2783
+ getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D;
2784
+ /**
2785
+ * Orient an input vector from target to image space.
2786
+ *
2787
+ * @param {Vector3D} planeVector The input vector.
2788
+ * @returns {Vector3D} The orienteded vector.
2789
+ */
2790
+ getImageOrientedVector3D(planeVector: Vector3D): Vector3D;
2791
+ /**
2792
+ * Orient an input point from target to image space.
2793
+ *
2794
+ * @param {Point3D} planePoint The input vector.
2795
+ * @returns {Point3D} The orienteded vector.
2796
+ */
2797
+ getImageOrientedPoint3D(planePoint: Point3D): Point3D;
2798
+ /**
2799
+ * De-orient an input vector from image to target space.
2800
+ *
2801
+ * @param {Vector3D} vector The input vector.
2802
+ * @returns {Vector3D} The de-orienteded vector.
2803
+ */
2804
+ getImageDeOrientedVector3D(vector: Vector3D): Vector3D;
2805
+ /**
2806
+ * De-orient an input point from image to target space.
2807
+ *
2808
+ * @param {Point3D} point The input point.
2809
+ * @returns {Point3D} The de-orienteded point.
2810
+ */
2811
+ getImageDeOrientedPoint3D(point: Point3D): Point3D;
2812
+ /**
2813
+ * Reorder values to follow target orientation.
2814
+ *
2815
+ * @param {object} values Values as {x,y,z}.
2816
+ * @returns {object} Reoriented values as {x,y,z}.
2817
+ */
2818
+ getTargetOrientedPositiveXYZ(values: object): object;
2819
+ /**
2820
+ * Get the (view) scroll dimension index.
2821
+ *
2822
+ * @returns {number} The index.
2823
+ */
2824
+ getScrollIndex(): number;
2825
+ /**
2826
+ * Get the native (image) scroll dimension index.
2827
+ *
2828
+ * @returns {number} The index.
2829
+ */
2830
+ getNativeScrollIndex(): number;
2831
+ #private;
2832
+ }
2833
+
2496
2834
  /**
2497
2835
  * Immutable point.
2498
2836
  * Warning: the input array is NOT cloned, modifying it will
@@ -2702,39 +3040,6 @@ export declare class Point3D {
2702
3040
  */
2703
3041
  export declare function precisionRound(number: number, precision: number): number;
2704
3042
 
2705
- /**
2706
- * Rescale LUT class.
2707
- * Typically converts from integer to float.
2708
- */
2709
- export declare class RescaleLut {
2710
- /**
2711
- * @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
2712
- * @param {number} bitsStored The number of bits used to store the data.
2713
- */
2714
- constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
2715
- /**
2716
- * Get the Rescale Slope and Intercept (RSI).
2717
- *
2718
- * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
2719
- */
2720
- getRSI(): RescaleSlopeAndIntercept;
2721
- /**
2722
- * Get the length of the LUT array.
2723
- *
2724
- * @returns {number} The length of the LUT array.
2725
- */
2726
- getLength(): number;
2727
- /**
2728
- * Get the value of the LUT at the given offset.
2729
- *
2730
- * @param {number} offset The input offset in [0,2^bitsStored] range
2731
- * or full range for ID rescale.
2732
- * @returns {number} The float32 value of the LUT at the given offset.
2733
- */
2734
- getValue(offset: number): number;
2735
- #private;
2736
- }
2737
-
2738
3043
  /**
2739
3044
  * Rescale Slope and Intercept
2740
3045
  */
@@ -2779,6 +3084,36 @@ export declare class RescaleSlopeAndIntercept {
2779
3084
  #private;
2780
3085
  }
2781
3086
 
3087
+ /**
3088
+ * RGB colour class.
3089
+ */
3090
+ export declare class RGB {
3091
+ /**
3092
+ * @param {number} r Red component.
3093
+ * @param {number} g Green component.
3094
+ * @param {number} b Blue component.
3095
+ */
3096
+ constructor(r: number, g: number, b: number);
3097
+ /**
3098
+ * Red component.
3099
+ *
3100
+ * @type {number}
3101
+ */
3102
+ r: number;
3103
+ /**
3104
+ * Green component.
3105
+ *
3106
+ * @type {number}
3107
+ */
3108
+ g: number;
3109
+ /**
3110
+ * Blue component.
3111
+ *
3112
+ * @type {number}
3113
+ */
3114
+ b: number;
3115
+ }
3116
+
2782
3117
  /**
2783
3118
  * Immutable Size class.
2784
3119
  * Warning: the input array is NOT cloned, modifying it will
@@ -2944,10 +3279,10 @@ export declare class Spacing {
2944
3279
  /**
2945
3280
  * Convert sRGB to CIE LAB (standard illuminant D65).
2946
3281
  *
2947
- * @param {object} triplet sRGB triplet as {r,g,b}.
3282
+ * @param {RGB} triplet sRGB triplet as {r,g,b}.
2948
3283
  * @returns {object} CIE LAB triplet as {l,a,b}.
2949
3284
  */
2950
- export declare function srgbToCielab(triplet: object): object;
3285
+ export declare function srgbToCielab(triplet: RGB): object;
2951
3286
 
2952
3287
  /**
2953
3288
  * Immutable tag.
@@ -3306,14 +3641,6 @@ export declare class View {
3306
3641
  * @fires View#alphafuncchange
3307
3642
  */
3308
3643
  setAlphaFunction(func: (value: object, index: object) => number): void;
3309
- /**
3310
- * Get the window LUT of the image.
3311
- * Warning: can be undefined in no window/level was set.
3312
- *
3313
- * @returns {WindowLut} The window LUT of the image.
3314
- * @fires View#wlchange
3315
- */
3316
- getCurrentWindowLut(): WindowLut;
3317
3644
  /**
3318
3645
  * Get the window presets.
3319
3646
  *
@@ -3323,9 +3650,9 @@ export declare class View {
3323
3650
  /**
3324
3651
  * Get the window presets names.
3325
3652
  *
3326
- * @returns {object} The list of window presets names.
3653
+ * @returns {string[]} The list of window presets names.
3327
3654
  */
3328
- getWindowPresetsNames(): object;
3655
+ getWindowPresetsNames(): string[];
3329
3656
  /**
3330
3657
  * Set the window presets.
3331
3658
  *
@@ -3404,14 +3731,19 @@ export declare class View {
3404
3731
  /**
3405
3732
  * Set the view window/level.
3406
3733
  *
3407
- * @param {number} center The window center.
3408
- * @param {number} width The window width.
3734
+ * @param {WindowLevel} wl The window and level.
3409
3735
  * @param {string} [name] Associated preset name, defaults to 'manual'.
3410
3736
  * Warning: uses the latest set rescale LUT or the default linear one.
3411
3737
  * @param {boolean} [silent] Flag to launch events with skipGenerate.
3412
3738
  * @fires View#wlchange
3413
3739
  */
3414
- setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void;
3740
+ setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
3741
+ /**
3742
+ * Get the window/level.
3743
+ *
3744
+ * @returns {WindowLevel} The window and level.
3745
+ */
3746
+ getWindowLevel(): WindowLevel;
3415
3747
  /**
3416
3748
  * Set the window level to the preset with the input name.
3417
3749
  *
@@ -3446,9 +3778,9 @@ export declare class View {
3446
3778
  * Get the image window/level that covers the full data range.
3447
3779
  * Warning: uses the latest set rescale LUT or the default linear one.
3448
3780
  *
3449
- * @returns {WindowCenterAndWidth} A min/max window level.
3781
+ * @returns {WindowLevel} A min/max window level.
3450
3782
  */
3451
- getWindowLevelMinMax(): WindowCenterAndWidth;
3783
+ getWindowLevelMinMax(): WindowLevel;
3452
3784
  /**
3453
3785
  * Set the image window/level to cover the full data range.
3454
3786
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -3561,9 +3893,9 @@ export declare class ViewController {
3561
3893
  /**
3562
3894
  * Get the plane helper.
3563
3895
  *
3564
- * @returns {object} The helper.
3896
+ * @returns {PlaneHelper} The helper.
3565
3897
  */
3566
- getPlaneHelper(): object;
3898
+ getPlaneHelper(): PlaneHelper;
3567
3899
  /**
3568
3900
  * Check is the associated image is a mask.
3569
3901
  *
@@ -3573,9 +3905,9 @@ export declare class ViewController {
3573
3905
  /**
3574
3906
  * Get the mask segment helper.
3575
3907
  *
3576
- * @returns {object} The helper.
3908
+ * @returns {MaskSegmentHelper} The helper.
3577
3909
  */
3578
- getMaskSegmentHelper(): object;
3910
+ getMaskSegmentHelper(): MaskSegmentHelper;
3579
3911
  /**
3580
3912
  * Apply the hidden segments list by setting
3581
3913
  * the corresponding alpha function.
@@ -3601,9 +3933,9 @@ export declare class ViewController {
3601
3933
  /**
3602
3934
  * Get the window/level presets names.
3603
3935
  *
3604
- * @returns {Array} The presets names.
3936
+ * @returns {string[]} The presets names.
3605
3937
  */
3606
- getWindowLevelPresetsNames(): any[];
3938
+ getWindowLevelPresetsNames(): string[];
3607
3939
  /**
3608
3940
  * Add window/level presets to the view.
3609
3941
  *
@@ -3732,8 +4064,15 @@ export declare class ViewController {
3732
4064
  * Can window and level be applied to the data?
3733
4065
  *
3734
4066
  * @returns {boolean} True if possible.
4067
+ * @deprecated Please use isMonochrome instead.
3735
4068
  */
3736
4069
  canWindowLevel(): boolean;
4070
+ /**
4071
+ * Is the data monochrome.
4072
+ *
4073
+ * @returns {boolean} True if the data is monochrome.
4074
+ */
4075
+ isMonochrome(): boolean;
3737
4076
  /**
3738
4077
  * Can the data be scrolled?
3739
4078
  *
@@ -3861,9 +4200,9 @@ export declare class ViewController {
3861
4200
  /**
3862
4201
  * Get the window/level.
3863
4202
  *
3864
- * @returns {object} The window center and width.
4203
+ * @returns {WindowLevel} The window and level.
3865
4204
  */
3866
- getWindowLevel(): object;
4205
+ getWindowLevel(): WindowLevel;
3867
4206
  /**
3868
4207
  * Get the current window level preset name.
3869
4208
  *
@@ -3871,12 +4210,11 @@ export declare class ViewController {
3871
4210
  */
3872
4211
  getCurrentWindowPresetName(): string;
3873
4212
  /**
3874
- * Set the window/level.
4213
+ * Set the window and level.
3875
4214
  *
3876
- * @param {number} wc The window center.
3877
- * @param {number} ww The window width.
4215
+ * @param {WindowLevel} wl The window and level.
3878
4216
  */
3879
- setWindowLevel(wc: number, ww: number): void;
4217
+ setWindowLevel(wl: WindowLevel): void;
3880
4218
  /**
3881
4219
  * Get the colour map.
3882
4220
  *
@@ -4162,101 +4500,33 @@ export declare class ViewLayer {
4162
4500
  }
4163
4501
 
4164
4502
  /**
4165
- * WindowCenterAndWidth class.
4166
- * <br>Pseudo-code:
4167
- * <pre>
4168
- * if (x &lt;= c - 0.5 - (w-1)/2), then y = ymin
4169
- * else if (x > c - 0.5 + (w-1)/2), then y = ymax,
4170
- * else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
4171
- * </pre>
4172
- *
4173
- * @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}
4503
+ * Window and Level also known as window width and center.
4174
4504
  */
4175
- export declare class WindowCenterAndWidth {
4505
+ export declare class WindowLevel {
4176
4506
  /**
4177
4507
  * @param {number} center The window center.
4178
4508
  * @param {number} width The window width.
4179
4509
  */
4180
4510
  constructor(center: number, width: number);
4181
4511
  /**
4182
- * Get the window center.
4183
- *
4184
- * @returns {number} The window center.
4185
- */
4186
- getCenter(): number;
4187
- /**
4188
- * Get the window width.
4189
- *
4190
- * @returns {number} The window width.
4191
- */
4192
- getWidth(): number;
4193
- /**
4194
- * Set the signed offset.
4512
+ * The window center.
4195
4513
  *
4196
- * @param {number} offset The signed data offset,
4197
- * typically: slope * ( size / 2).
4198
- */
4199
- setSignedOffset(offset: number): void;
4200
- /**
4201
- * Apply the window level on an input value.
4202
- *
4203
- * @param {number} value The value to rescale as an integer.
4204
- * @returns {number} The leveled value, in the
4205
- * [ymin, ymax] range (default [0,255]).
4206
- */
4207
- apply(value: number): number;
4208
- /**
4209
- * Check for window level equality.
4210
- *
4211
- * @param {WindowCenterAndWidth} rhs The other window level to compare to.
4212
- * @returns {boolean} True if both window level are equal.
4213
- */
4214
- equals(rhs: WindowCenterAndWidth): boolean;
4215
- #private;
4216
- }
4217
-
4218
- /**
4219
- * Window LUT class.
4220
- * Typically converts from float to integer.
4221
- */
4222
- export declare class WindowLut {
4223
- /**
4224
- * Construct a window LUT object, window level is set with
4225
- * the 'setWindowLevel' method.
4226
- *
4227
- * @param {RescaleLut} rescaleLut The associated rescale LUT.
4228
- * @param {boolean} isSigned Flag to know if the data is signed or not.
4229
- * @param {boolean} isDiscrete Flag to know if the input data is discrete.
4230
- */
4231
- constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
4232
- /**
4233
- * Get the window / level.
4234
- *
4235
- * @returns {WindowCenterAndWidth} The window / level.
4236
- */
4237
- getWindowLevel(): WindowCenterAndWidth;
4238
- /**
4239
- * Get the rescale lut.
4240
- *
4241
- * @returns {RescaleLut} The rescale lut.
4514
+ * @type {number}
4242
4515
  */
4243
- getRescaleLut(): RescaleLut;
4516
+ center: number;
4244
4517
  /**
4245
- * Set the window center and width.
4518
+ * The window width.
4246
4519
  *
4247
- * @param {WindowCenterAndWidth} wl The window level.
4520
+ * @type {number}
4248
4521
  */
4249
- setWindowLevel(wl: WindowCenterAndWidth): void;
4522
+ width: number;
4250
4523
  /**
4251
- * Get the value of the LUT at the given offset.
4524
+ * Check for equality.
4252
4525
  *
4253
- * @param {number} offset The input offset in [0,2^bitsStored] range
4254
- * for discrete data or full range for non discrete.
4255
- * @returns {number} The integer value (default [0,255]) of the LUT
4256
- * at the given offset.
4526
+ * @param {WindowLevel} rhs The other object to compare to.
4527
+ * @returns {boolean} True if both objects are equal.
4257
4528
  */
4258
- getValue(offset: number): number;
4259
- #private;
4529
+ equals(rhs: WindowLevel): boolean;
4260
4530
  }
4261
4531
 
4262
4532
  /**