dwv 0.36.0-beta.8 → 0.36.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
@@ -67,9 +67,11 @@ export declare class Annotation {
67
67
  /**
68
68
  * Annotation quantification.
69
69
  *
70
- * @type {object|undefined}
70
+ * @type {Object<string, Value>|undefined}
71
71
  */
72
- quantification: object | undefined;
72
+ quantification: {
73
+ [x: string]: Value;
74
+ } | undefined;
73
75
  /**
74
76
  * Text expression. Can contain variables surrounded with '{}' that will
75
77
  * be extracted from the quantification object.
@@ -338,7 +340,6 @@ export declare class AnnotationGroupFactory {
338
340
  *
339
341
  * @param {Object<string, DataElement>} dataElements The DICOM data elements.
340
342
  * @returns {string|undefined} A possible warning.
341
- * @throws Error for missing or wrong data.
342
343
  */
343
344
  checkElements(dataElements: {
344
345
  [x: string]: DataElement;
@@ -348,7 +349,7 @@ export declare class AnnotationGroupFactory {
348
349
  *
349
350
  * @param {Object<string, DataElement>} dataElements The DICOM tags.
350
351
  * @returns {AnnotationGroup} A new annotation group.
351
- * @throws Error for missing or wrong data.
352
+ * @throws {Error} Error for missing or wrong data.
352
353
  */
353
354
  create(dataElements: {
354
355
  [x: string]: DataElement;
@@ -592,11 +593,11 @@ export declare class App {
592
593
  /**
593
594
  * Add a command to the undo stack.
594
595
  *
595
- * @param {object} cmd The command to add.
596
+ * @param {Command} cmd The command to add.
596
597
  * @fires UndoStack#undoadd
597
598
  * @function
598
599
  */
599
- addToUndoStack: (cmd: object) => void;
600
+ addToUndoStack: (cmd: Command) => void;
600
601
  /**
601
602
  * Remove a command from the undo stack.
602
603
  *
@@ -994,18 +995,18 @@ export declare class App {
994
995
  */
995
996
  getCurrentStackIndex(): number;
996
997
  /**
997
- * Get the overlay data for a data id.
998
+ * Get the info data for a data id.
998
999
  *
999
1000
  * @param {string} dataId The data id.
1000
- * @returns {OverlayData|undefined} The overlay data.
1001
+ * @returns {InfoData|undefined} The info data.
1001
1002
  */
1002
- getOverlayData(dataId: string): OverlayData | undefined;
1003
+ getInfoData(dataId: string): InfoData | undefined;
1003
1004
  /**
1004
- * Toggle overlay listeners.
1005
+ * Toggle info data listeners.
1005
1006
  *
1006
1007
  * @param {string} dataId The data id.
1007
1008
  */
1008
- toggleOverlayListeners(dataId: string): void;
1009
+ toggleInfoDataListeners(dataId: string): void;
1009
1010
  /**
1010
1011
  * Create new annotation data based on the data of
1011
1012
  * the active view layer.
@@ -1082,7 +1083,7 @@ export declare class AppOptions {
1082
1083
  */
1083
1084
  defaultCharacterSet: string | undefined;
1084
1085
  /**
1085
- * Optional overlay config.
1086
+ * Optional overlay layer config.
1086
1087
  *
1087
1088
  * @type {object|undefined}
1088
1089
  */
@@ -1148,7 +1149,7 @@ export declare class CADReport {
1148
1149
  /**
1149
1150
  * Change segment colour command.
1150
1151
  */
1151
- export declare class ChangeSegmentColourCommand {
1152
+ export declare class ChangeSegmentColourCommand extends Command {
1152
1153
  /**
1153
1154
  * @param {Image} mask The mask image.
1154
1155
  * @param {MaskSegment} segment The segment to modify.
@@ -1156,30 +1157,12 @@ export declare class ChangeSegmentColourCommand {
1156
1157
  * @param {boolean} [silent] Whether to send a creation event or not.
1157
1158
  */
1158
1159
  constructor(mask: Image_2, segment: MaskSegment, newColour: RGB | number, silent?: boolean);
1159
- /**
1160
- * Get the command name.
1161
- *
1162
- * @returns {string} The command name.
1163
- */
1164
- getName(): string;
1165
1160
  /**
1166
1161
  * Check if a command is valid and can be executed.
1167
1162
  *
1168
1163
  * @returns {boolean} True if the command is valid.
1169
1164
  */
1170
1165
  isValid(): boolean;
1171
- /**
1172
- * Execute the command.
1173
- *
1174
- * @fires ChangeSegmentColourCommand#changemasksegmentcolour
1175
- */
1176
- execute(): void;
1177
- /**
1178
- * Undo the command.
1179
- *
1180
- * @fires ChangeSegmentColourCommand#changemasksegmentcolour
1181
- */
1182
- undo(): void;
1183
1166
  /**
1184
1167
  * Handle an execute event.
1185
1168
  *
@@ -1264,9 +1247,11 @@ export declare class Circle {
1264
1247
  * @param {Index} index The index at which to get the
1265
1248
  * image values.
1266
1249
  * @param {string[]} flags A list of stat values to calculate.
1267
- * @returns {object} A quantification object.
1250
+ * @returns {Object<string, Value>} A quantification object.
1268
1251
  */
1269
- quantify(viewController: ViewController, index: Index, flags: string[]): object;
1252
+ quantify(viewController: ViewController, index: Index, flags: string[]): {
1253
+ [x: string]: Value;
1254
+ };
1270
1255
  #private;
1271
1256
  }
1272
1257
 
@@ -1301,6 +1286,26 @@ export declare class ColourMap {
1301
1286
  blue: number[];
1302
1287
  }
1303
1288
 
1289
+ /**
1290
+ * Command interface.
1291
+ */
1292
+ export declare class Command {
1293
+ /**
1294
+ * Get the command name.
1295
+ *
1296
+ * @returns {string} The command name.
1297
+ */
1298
+ getName(): string;
1299
+ /**
1300
+ * Execute the command.
1301
+ */
1302
+ execute(): void;
1303
+ /**
1304
+ * Undo the command.
1305
+ */
1306
+ undo(): void;
1307
+ }
1308
+
1304
1309
  /**
1305
1310
  * Create an Image from DICOM elements.
1306
1311
  *
@@ -1343,6 +1348,7 @@ export declare namespace custom {
1343
1348
  [x: string]: string;
1344
1349
  };
1345
1350
  };
1351
+ let privateBValueRules: object[];
1346
1352
  let openRoiDialog: any;
1347
1353
  let getVolumeIdTagValue: any;
1348
1354
  let getPostLoadVolumeIdTagValue: any;
@@ -1407,40 +1413,42 @@ export declare class DataElement {
1407
1413
  items: any[];
1408
1414
  }
1409
1415
 
1416
+ /**
1417
+ * Default tool list.
1418
+ *
1419
+ * @type {Object<string, any>}
1420
+ */
1421
+ export declare const defaultToolList: {
1422
+ [x: string]: any;
1423
+ };
1424
+
1425
+ /**
1426
+ * Default tool options.
1427
+ *
1428
+ * @type {Object<string, Object<string, any>>}
1429
+ */
1430
+ export declare const defaultToolOptions: {
1431
+ [x: string]: {
1432
+ [x: string]: any;
1433
+ };
1434
+ };
1435
+
1410
1436
  /**
1411
1437
  * Delete segment command.
1412
1438
  */
1413
- export declare class DeleteSegmentCommand {
1439
+ export declare class DeleteSegmentCommand extends Command {
1414
1440
  /**
1415
1441
  * @param {Image} mask The mask image.
1416
1442
  * @param {MaskSegment} segment The segment to remove.
1417
1443
  * @param {boolean} [silent] Whether to send a creation event or not.
1418
1444
  */
1419
1445
  constructor(mask: Image_2, segment: MaskSegment, silent?: boolean);
1420
- /**
1421
- * Get the command name.
1422
- *
1423
- * @returns {string} The command name.
1424
- */
1425
- getName(): string;
1426
1446
  /**
1427
1447
  * Check if a command is valid and can be executed.
1428
1448
  *
1429
1449
  * @returns {boolean} True if the command is valid.
1430
1450
  */
1431
1451
  isValid(): boolean;
1432
- /**
1433
- * Execute the command.
1434
- *
1435
- * @fires DeleteSegmentCommand#masksegmentdelete
1436
- */
1437
- execute(): void;
1438
- /**
1439
- * Undo the command.
1440
- *
1441
- * @fires DeleteSegmentCommand#masksegmentredraw
1442
- */
1443
- undo(): void;
1444
1452
  /**
1445
1453
  * Handle an execute event.
1446
1454
  *
@@ -1456,6 +1464,50 @@ export declare class DeleteSegmentCommand {
1456
1464
  #private;
1457
1465
  }
1458
1466
 
1467
+ /**
1468
+ * Diameter type.
1469
+ */
1470
+ export declare class Diameter {
1471
+ /**
1472
+ * The scaled diameter value.
1473
+ *
1474
+ * @type {Value}
1475
+ */
1476
+ diameter: Value;
1477
+ /**
1478
+ * The offset of the pixel at the start
1479
+ * of the line used to calculate this diameter.
1480
+ *
1481
+ * @type {number}
1482
+ */
1483
+ offset1: number;
1484
+ /**
1485
+ * The offset of the pixel at the end
1486
+ * of the line used to calculate this diameter.
1487
+ *
1488
+ * @type {number}
1489
+ */
1490
+ offset2: number;
1491
+ }
1492
+
1493
+ /**
1494
+ * Diameters type.
1495
+ */
1496
+ export declare class Diameters {
1497
+ /**
1498
+ * The major (longest) diameter of the segment.
1499
+ *
1500
+ * @type {Diameter}
1501
+ */
1502
+ major: Diameter;
1503
+ /**
1504
+ * The minor (longest perpendicular to the major) diameter of the segment.
1505
+ *
1506
+ * @type {Diameter}
1507
+ */
1508
+ minor: Diameter;
1509
+ }
1510
+
1459
1511
  /**
1460
1512
  * DICOM code: item of a basic code sequence.
1461
1513
  *
@@ -2299,9 +2351,11 @@ export declare class Ellipse {
2299
2351
  * @param {Index} index The index at which to get the
2300
2352
  * image values.
2301
2353
  * @param {string[]} flags A list of stat values to calculate.
2302
- * @returns {object} A quantification object.
2354
+ * @returns {Object<string, Value>} A quantification object.
2303
2355
  */
2304
- quantify(viewController: ViewController, index: Index, flags: string[]): object;
2356
+ quantify(viewController: ViewController, index: Index, flags: string[]): {
2357
+ [x: string]: Value;
2358
+ };
2305
2359
  #private;
2306
2360
  }
2307
2361
 
@@ -2619,6 +2673,16 @@ export declare function getEllipseIndices(center: Index, radius: number[], dir:
2619
2673
  */
2620
2674
  export declare function getLayerDetailsFromEvent(event: object): object;
2621
2675
 
2676
+ /**
2677
+ * Get the manufacturer.
2678
+ *
2679
+ * @param {Object<string, DataElement>} elements The DICOM tags.
2680
+ * @returns {string|undefined} The manufacturer.
2681
+ */
2682
+ export declare function getManufacturer(elements: {
2683
+ [x: string]: DataElement;
2684
+ }): string | undefined;
2685
+
2622
2686
  /**
2623
2687
  * Get the offset of an input mouse event.
2624
2688
  *
@@ -2627,6 +2691,17 @@ export declare function getLayerDetailsFromEvent(event: object): object;
2627
2691
  */
2628
2692
  export declare function getMousePoint(event: object): Point2D;
2629
2693
 
2694
+ /**
2695
+ * Get the normalised manufacturer.
2696
+ *
2697
+ * @param {Object<string, DataElement>} elements The DICOM tags.
2698
+ * @returns {string|undefined} The manufacturer as a unique
2699
+ * all lower case string.
2700
+ */
2701
+ export declare function getNormalisedManufacturer(elements: {
2702
+ [x: string]: DataElement;
2703
+ }): string | undefined;
2704
+
2630
2705
  /**
2631
2706
  * Get the name of an image orientation patient.
2632
2707
  *
@@ -3134,11 +3209,11 @@ declare class Image_2 {
3134
3209
  * @param {number} i The X index.
3135
3210
  * @param {number} j The Y index.
3136
3211
  * @param {number} k The Z index.
3137
- * @param {number} f The frame number.
3212
+ * @param {number} [f] Optional frame number.
3138
3213
  * @returns {number} The value at the desired position.
3139
3214
  * Warning: No size check...
3140
3215
  */
3141
- getValue(i: number, j: number, k: number, f: number): number;
3216
+ getValue(i: number, j: number, k: number, f?: number): number;
3142
3217
  /**
3143
3218
  * Get the value of the image at a specific index.
3144
3219
  *
@@ -3153,11 +3228,11 @@ declare class Image_2 {
3153
3228
  * @param {number} i The X index.
3154
3229
  * @param {number} j The Y index.
3155
3230
  * @param {number} k The Z index.
3156
- * @param {number} f The frame number.
3231
+ * @param {number} [f] Optional frame number.
3157
3232
  * @returns {number} The rescaled value at the desired position.
3158
3233
  * Warning: No size check...
3159
3234
  */
3160
- getRescaledValue(i: number, j: number, k: number, f: number): number;
3235
+ getRescaledValue(i: number, j: number, k: number, f?: number): number;
3161
3236
  /**
3162
3237
  * Get the rescaled value of the image at a specific index.
3163
3238
  *
@@ -3372,6 +3447,101 @@ export declare class Index {
3372
3447
  #private;
3373
3448
  }
3374
3449
 
3450
+ /**
3451
+ * DICOM Header info data.
3452
+ */
3453
+ export declare class InfoData {
3454
+ /**
3455
+ * @param {App} app The associated application.
3456
+ * @param {string} dataId The associated data id.
3457
+ * @param {Object<string, InfoDataItem[]>} configs The info data config.
3458
+ */
3459
+ constructor(app: App, dataId: string, configs: {
3460
+ [x: string]: InfoDataItem[];
3461
+ });
3462
+ /**
3463
+ * Reset the data.
3464
+ */
3465
+ reset(): void;
3466
+ /**
3467
+ * Handle a new loaded item event.
3468
+ *
3469
+ * @param {Object<string, DataElement>} data The item meta data.
3470
+ */
3471
+ addItemMeta(data: {
3472
+ [x: string]: DataElement;
3473
+ }): void;
3474
+ /**
3475
+ * Handle a changed slice event.
3476
+ *
3477
+ * @param {object} event The slicechange event.
3478
+ */
3479
+ onSliceChange: (event: object) => void;
3480
+ /**
3481
+ * Is this class listening to app events.
3482
+ *
3483
+ * @returns {boolean} True is listening to app events.
3484
+ */
3485
+ isListening(): boolean;
3486
+ /**
3487
+ * Toggle info listeners.
3488
+ */
3489
+ addAppListeners(): void;
3490
+ /**
3491
+ * Toggle info listeners.
3492
+ */
3493
+ removeAppListeners(): void;
3494
+ /**
3495
+ * Add an event listener to this class.
3496
+ *
3497
+ * @param {string} type The event type.
3498
+ * @param {object} callback The method associated with the provided
3499
+ * event type, will be called with the fired event.
3500
+ */
3501
+ addEventListener(type: string, callback: object): void;
3502
+ /**
3503
+ * Remove an event listener from this class.
3504
+ *
3505
+ * @param {string} type The event type.
3506
+ * @param {object} callback The method associated with the provided
3507
+ * event type.
3508
+ */
3509
+ removeEventListener(type: string, callback: object): void;
3510
+ #private;
3511
+ }
3512
+
3513
+ /**
3514
+ * Info data item class.
3515
+ */
3516
+ export declare class InfoDataItem {
3517
+ /**
3518
+ * List of tag keys.
3519
+ *
3520
+ * @type {string[]|undefined}
3521
+ */
3522
+ tags: string[] | undefined;
3523
+ /**
3524
+ * @type {string|undefined}
3525
+ */
3526
+ event: string | undefined;
3527
+ /**
3528
+ * @type {string}
3529
+ */
3530
+ pos: string;
3531
+ /**
3532
+ * @type {string}
3533
+ */
3534
+ format: string;
3535
+ /**
3536
+ * @type {string|undefined}
3537
+ */
3538
+ precision: string | undefined;
3539
+ /**
3540
+ * @type {string}
3541
+ */
3542
+ value: string;
3543
+ }
3544
+
3375
3545
  /**
3376
3546
  * Check if two rgb objects are equal.
3377
3547
  *
@@ -3381,6 +3551,60 @@ export declare class Index {
3381
3551
  */
3382
3552
  export declare function isEqualRgb(c1: RGB, c2: RGB): boolean;
3383
3553
 
3554
+ /**
3555
+ * Label type.
3556
+ */
3557
+ export declare class Label {
3558
+ /**
3559
+ * The world coordinates of the centroid.
3560
+ *
3561
+ * @type {Point}
3562
+ */
3563
+ centroid: Point;
3564
+ /**
3565
+ * The closest voxel Index to the centroid.
3566
+ *
3567
+ * @type {number[]}
3568
+ */
3569
+ centroidIndex: number[];
3570
+ /**
3571
+ * The volume of the labeled segment.
3572
+ *
3573
+ * @type {Value}
3574
+ */
3575
+ volume: Value;
3576
+ /**
3577
+ * The voxel count of the labeled segment.
3578
+ *
3579
+ * @type {number}
3580
+ */
3581
+ count: number;
3582
+ /**
3583
+ * The diameters of the segment.
3584
+ *
3585
+ * @type {Diameters}
3586
+ */
3587
+ diameters: Diameters;
3588
+ /**
3589
+ * The scaled height of the segment.
3590
+ *
3591
+ * @type {Value}
3592
+ */
3593
+ height: Value;
3594
+ /**
3595
+ * The segment label id.
3596
+ *
3597
+ * @type {number}
3598
+ */
3599
+ id: number;
3600
+ /**
3601
+ * The Z index of the largest slice of the segment.
3602
+ *
3603
+ * @type {number}
3604
+ */
3605
+ largestSliceZ: number;
3606
+ }
3607
+
3384
3608
  /**
3385
3609
  * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
3386
3610
  * unsigned int CIE LAB ([0, 65535]).
@@ -3409,14 +3633,17 @@ export declare function labToUintLab(triplet: object): object;
3409
3633
  export declare class LayerGroup {
3410
3634
  /**
3411
3635
  * @param {HTMLElement} containerDiv The associated HTML div.
3636
+ * @param {boolean} [withInfoLayer] Optional with info layer flag,
3637
+ * default to false.
3412
3638
  */
3413
- constructor(containerDiv: HTMLElement);
3639
+ constructor(containerDiv: HTMLElement, withInfoLayer?: boolean);
3414
3640
  /**
3415
3641
  * Get the position helper.
3416
3642
  *
3417
- * @returns {PositionHelper} The position helper.
3643
+ * @returns {PositionHelper|undefined} The position helper or
3644
+ * undefined if no layers.
3418
3645
  */
3419
- getPositionHelper(): PositionHelper;
3646
+ getPositionHelper(): PositionHelper | undefined;
3420
3647
  /**
3421
3648
  * Get the showCrosshair flag.
3422
3649
  *
@@ -3624,6 +3851,23 @@ export declare class LayerGroup {
3624
3851
  * @returns {DrawLayer} The created layer.
3625
3852
  */
3626
3853
  addDrawLayer(): DrawLayer;
3854
+ /**
3855
+ * Add info data.
3856
+ *
3857
+ * @param {InfoData} data The data to add.
3858
+ * @param {string} dataId The associated data ID.
3859
+ */
3860
+ addInfoData(data: InfoData, dataId: string): void;
3861
+ /**
3862
+ * Bind info data.
3863
+ *
3864
+ * @param {string} dataId The associated data ID.
3865
+ */
3866
+ bindInfoData(dataId: string): void;
3867
+ /**
3868
+ * Unbind info data.
3869
+ */
3870
+ unbindInfoData(): void;
3627
3871
  /**
3628
3872
  * Empty the layer list.
3629
3873
  */
@@ -3684,6 +3928,12 @@ export declare class LayerGroup {
3684
3928
  * @returns {boolean} True if one view layer has more than one slice.
3685
3929
  */
3686
3930
  moreThanOne(dim: number): boolean;
3931
+ /**
3932
+ * Check if any layer has a valid position.
3933
+ *
3934
+ * @returns {boolean} True if any layer has a valid position.
3935
+ */
3936
+ hasAnyLayerWithValidPosition(): boolean;
3687
3937
  /**
3688
3938
  * Update layers (but not the event source layer) to a position change.
3689
3939
  *
@@ -3826,7 +4076,6 @@ export declare class MaskFactory {
3826
4076
  *
3827
4077
  * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
3828
4078
  * @returns {string|undefined} A possible warning.
3829
- * @throws Error for missing or wrong data.
3830
4079
  */
3831
4080
  checkElements(_dicomElements: {
3832
4081
  [x: string]: DataElement;
@@ -3841,7 +4090,7 @@ export declare class MaskFactory {
3841
4090
  * @param {Image} [refImage] Reference image, code will use its
3842
4091
  * origins if present (best) or try to calculate them.
3843
4092
  * @returns {Image} A new Image.
3844
- * @throws Error for missing or wrong data.
4093
+ * @throws {Error} Error for missing or wrong data.
3845
4094
  */
3846
4095
  create(dataElements: {
3847
4096
  [x: string]: DataElement;
@@ -3949,6 +4198,12 @@ export declare class MaskSegmentHelper {
3949
4198
  * @param {Image} mask The associated mask image.
3950
4199
  */
3951
4200
  constructor(mask: Image_2);
4201
+ /**
4202
+ * Get the associated mask image.
4203
+ *
4204
+ * @returns {Image} The mask image.
4205
+ */
4206
+ getMask(): Image_2;
3952
4207
  /**
3953
4208
  * Check if a segment is part of the segments list.
3954
4209
  *
@@ -3996,17 +4251,19 @@ export declare class MaskSegmentHelper {
3996
4251
  */
3997
4252
  updateSegment(segment: MaskSegment): void;
3998
4253
  /**
3999
- * The overlap count of a signle segment with another segment.
4254
+ * The overlap count of a single segment with another segment.
4000
4255
  *
4001
4256
  * @typedef OverlapCount@typedef OverlapCount
4257
+ * @property {string} label The segment label.
4002
4258
  * @property {number} count The number of overlapping voxels.
4003
- * @property {number} percentage The overlap percentage between 0 and 1.
4259
+ * @property {number} percentage The overlap percentage between 0 and 100.
4004
4260
  */
4005
4261
  /**
4006
4262
  * The count of overlapping voxels of a single segment with a set of
4007
4263
  * different segments.
4008
4264
  *
4009
4265
  * @typedef Overlap@typedef Overlap
4266
+ * @property {string} label The segment label.
4010
4267
  * @property {Object.<number, OverlapCount>} overlap A Dictionary
4011
4268
  * containing the counts. The key is the segment number of the overlapping
4012
4269
  * segment.
@@ -4025,12 +4282,17 @@ export declare class MaskSegmentHelper {
4025
4282
  * Find the overlap for each segment between two segmentation masks.
4026
4283
  * It is assumed these images have the same orientation.
4027
4284
  *
4028
- * @param {Image} compare The segmentation image to find overlap with.
4285
+ * @param {MaskSegmentHelper} rhs The helper of the
4286
+ * segmentation image to find overlap with.
4029
4287
  * @returns {OverlapMap} The overlapping voxel counts. First level is the
4030
4288
  * segments from this image, second level is the compare image segments.
4031
4289
  */
4032
- findOverlap(compare: Image_2): {
4290
+ findOverlap(rhs: MaskSegmentHelper): {
4033
4291
  [x: number]: {
4292
+ /**
4293
+ * The segment label.
4294
+ */
4295
+ label: string;
4034
4296
  /**
4035
4297
  * A Dictionary
4036
4298
  * containing the counts. The key is the segment number of the overlapping
@@ -4038,12 +4300,16 @@ export declare class MaskSegmentHelper {
4038
4300
  */
4039
4301
  overlap: {
4040
4302
  [x: number]: {
4303
+ /**
4304
+ * The segment label.
4305
+ */
4306
+ label: string;
4041
4307
  /**
4042
4308
  * The number of overlapping voxels.
4043
4309
  */
4044
4310
  count: number;
4045
4311
  /**
4046
- * The overlap percentage between 0 and 1.
4312
+ * The overlap percentage between 0 and 100.
4047
4313
  */
4048
4314
  percentage: number;
4049
4315
  };
@@ -4080,18 +4346,6 @@ export declare class MaskSegmentViewHelper {
4080
4346
  * @param {number} segmentNumber The segment number.
4081
4347
  */
4082
4348
  removeFromHidden(segmentNumber: number): void;
4083
- /**
4084
- * @callback alphaFn@callback alphaFn
4085
- * @param {number|number[]} value The pixel value.
4086
- * @param {number} index The values' index.
4087
- * @returns {number} The opacity of the input value.
4088
- */
4089
- /**
4090
- * Get the alpha function to apply hidden colors.
4091
- *
4092
- * @returns {alphaFn} The corresponding alpha function.
4093
- */
4094
- getAlphaFunc(): (value: number | number[], index: number) => number;
4095
4349
  #private;
4096
4350
  }
4097
4351
 
@@ -4229,6 +4483,13 @@ export declare class Matrix33 {
4229
4483
  #private;
4230
4484
  }
4231
4485
 
4486
+ export declare namespace NormalisedManufacturers {
4487
+ let GE: string;
4488
+ let SIEMENS: string;
4489
+ let PHILIPS: string;
4490
+ let HITASHI: string;
4491
+ }
4492
+
4232
4493
  /**
4233
4494
  * Number range.
4234
4495
  */
@@ -4254,59 +4515,6 @@ export declare namespace Orientation {
4254
4515
  let Sagittal: string;
4255
4516
  }
4256
4517
 
4257
- /**
4258
- * DICOM Header overlay info.
4259
- */
4260
- export declare class OverlayData {
4261
- /**
4262
- * @param {App} app The associated application.
4263
- * @param {string} dataId The associated data id.
4264
- * @param {object} configs The overlay config.
4265
- */
4266
- constructor(app: App, dataId: string, configs: object);
4267
- /**
4268
- * Reset the data.
4269
- */
4270
- reset(): void;
4271
- /**
4272
- * Handle a new loaded item event.
4273
- *
4274
- * @param {object} data The item meta data.
4275
- */
4276
- addItemMeta(data: object): void;
4277
- /**
4278
- * Is this class listening to app events.
4279
- *
4280
- * @returns {boolean} True is listening to app events.
4281
- */
4282
- isListening(): boolean;
4283
- /**
4284
- * Toggle info listeners.
4285
- */
4286
- addAppListeners(): void;
4287
- /**
4288
- * Toggle info listeners.
4289
- */
4290
- removeAppListeners(): void;
4291
- /**
4292
- * Add an event listener to this class.
4293
- *
4294
- * @param {string} type The event type.
4295
- * @param {object} callback The method associated with the provided
4296
- * event type, will be called with the fired event.
4297
- */
4298
- addEventListener(type: string, callback: object): void;
4299
- /**
4300
- * Remove an event listener from this class.
4301
- *
4302
- * @param {string} type The event type.
4303
- * @param {object} callback The method associated with the provided
4304
- * event type.
4305
- */
4306
- removeEventListener(type: string, callback: object): void;
4307
- #private;
4308
- }
4309
-
4310
4518
  /**
4311
4519
  * Plane geometry helper.
4312
4520
  */
@@ -4734,7 +4942,7 @@ export declare class PositionHelper {
4734
4942
  * with the input value.
4735
4943
  *
4736
4944
  * @param {number} dim The dimension.
4737
- * @param {number} value The value to used at dimension index.
4945
+ * @param {number} value The value to use at dimension index.
4738
4946
  * @returns {Point} The position.
4739
4947
  */
4740
4948
  getCurrentPositionAtDimValue(dim: number, value: number): Point;
@@ -4881,9 +5089,11 @@ export declare class Protractor {
4881
5089
  *
4882
5090
  * @param {ViewController} _viewController The associated view controller.
4883
5091
  * @param {string[]} _flags A list of stat values to calculate.
4884
- * @returns {object} A quantification object.
5092
+ * @returns {Object<string, Value>} A quantification object.
4885
5093
  */
4886
- quantify(_viewController: ViewController, _flags: string[]): object;
5094
+ quantify(_viewController: ViewController, _flags: string[]): {
5095
+ [x: string]: Value;
5096
+ };
4887
5097
  #private;
4888
5098
  }
4889
5099
 
@@ -4974,9 +5184,11 @@ export declare class Rectangle {
4974
5184
  * @param {Index} index The index at which to get the
4975
5185
  * image values.
4976
5186
  * @param {string[]} flags A list of stat values to calculate.
4977
- * @returns {object} A quantification object.
5187
+ * @returns {Object<string, Value>} A quantification object.
4978
5188
  */
4979
- quantify(viewController: ViewController, index: Index, flags: string[]): object;
5189
+ quantify(viewController: ViewController, index: Index, flags: string[]): {
5190
+ [x: string]: Value;
5191
+ };
4980
5192
  #private;
4981
5193
  }
4982
5194
 
@@ -5284,7 +5496,7 @@ export declare class Size {
5284
5496
  *
5285
5497
  * @param {Index} index The index to convert.
5286
5498
  * @param {number} [start] Optional start dimension to base the offset on.
5287
- * @returns {number} The offset.
5499
+ * @returns {number} The offset or -1 if out of bounds.
5288
5500
  */
5289
5501
  indexToOffset(index: Index, start?: number): number;
5290
5502
  /**
@@ -5300,6 +5512,22 @@ export declare class Size {
5300
5512
  * @returns {Scalar2D} The 2D base [0,1] as {x,y}.
5301
5513
  */
5302
5514
  get2D(): Scalar2D;
5515
+ /**
5516
+ * Normalise a point to this size.
5517
+ *
5518
+ * @param {Point} point The input point.
5519
+ * @param {Point} [extra] Optional point used to fill extra dimensions.
5520
+ * @returns {Point} The result point.
5521
+ */
5522
+ normalisePoint(point: Point, extra?: Point): Point;
5523
+ /**
5524
+ * Normalise an index to this size.
5525
+ *
5526
+ * @param {Index} index The input index.
5527
+ * @param {Index} [extra] Optional index used to fill extra dimensions.
5528
+ * @returns {Index} The result point.
5529
+ */
5530
+ normaliseIndex(index: Index, extra?: Index): Index;
5303
5531
  #private;
5304
5532
  }
5305
5533
 
@@ -5642,6 +5870,20 @@ export declare const toolOptions: {
5642
5870
  };
5643
5871
  };
5644
5872
 
5873
+ /**
5874
+ * Class to store a value and a unit.
5875
+ */
5876
+ export declare class Value {
5877
+ /**
5878
+ * @type {number}
5879
+ */
5880
+ value: number;
5881
+ /**
5882
+ * @type {string|undefined}
5883
+ */
5884
+ unit: string | undefined;
5885
+ }
5886
+
5645
5887
  /**
5646
5888
  * Immutable 3D vector.
5647
5889
  */
@@ -5771,9 +6013,22 @@ export declare class View {
5771
6013
  /**
5772
6014
  * Set the associated image.
5773
6015
  *
5774
- * @param {Image} inImage The associated image.
6016
+ * @param {Image} image The associated image.
6017
+ */
6018
+ setImage(image: Image_2): void;
6019
+ /**
6020
+ * Check is the associated image is a mask.
6021
+ *
6022
+ * @returns {boolean} True if the associated image is a mask.
6023
+ */
6024
+ isMask(): boolean;
6025
+ /**
6026
+ * Set the mask segment view helper to handle
6027
+ * hidden segments.
6028
+ *
6029
+ * @param {MaskSegmentViewHelper} helper The helper.
5775
6030
  */
5776
- setImage(inImage: Image_2): void;
6031
+ setMaskViewHelper(helper: MaskSegmentViewHelper): void;
5777
6032
  /**
5778
6033
  * Get the view orientation.
5779
6034
  *
@@ -5815,14 +6070,6 @@ export declare class View {
5815
6070
  * (0 <= integer <= MAX_CONTOUR_SIZE).
5816
6071
  */
5817
6072
  setContourThickness(thickness: number): void;
5818
- /**
5819
- * Initialise the view: set initial index.
5820
- */
5821
- init(): void;
5822
- /**
5823
- * Set the initial index to the middle position.
5824
- */
5825
- setInitialIndex(): void;
5826
6073
  /**
5827
6074
  * Get the milliseconds per frame from frame rate.
5828
6075
  *
@@ -5830,12 +6077,6 @@ export declare class View {
5830
6077
  * @returns {number} The milliseconds per frame.
5831
6078
  */
5832
6079
  getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
5833
- /**
5834
- * @callback alphaFn@callback alphaFn
5835
- * @param {number[]|number} value The pixel value.
5836
- * @param {number} index The values' index.
5837
- * @returns {number} The opacity of the input value.
5838
- */
5839
6080
  /**
5840
6081
  * Get the alpha function.
5841
6082
  *
@@ -5876,9 +6117,9 @@ export declare class View {
5876
6117
  /**
5877
6118
  * Get the current window level preset name.
5878
6119
  *
5879
- * @returns {string} The preset name.
6120
+ * @returns {string|undefined} The preset name.
5880
6121
  */
5881
- getCurrentWindowPresetName(): string;
6122
+ getCurrentWindowPresetName(): string | undefined;
5882
6123
  /**
5883
6124
  * Get the colour map of the image.
5884
6125
  *
@@ -5895,15 +6136,15 @@ export declare class View {
5895
6136
  /**
5896
6137
  * Get the current position.
5897
6138
  *
5898
- * @returns {Point} The current position.
6139
+ * @returns {Point|undefined} The current position.
5899
6140
  */
5900
- getCurrentPosition(): Point;
6141
+ getCurrentPosition(): Point | undefined;
5901
6142
  /**
5902
6143
  * Get the current index.
5903
6144
  *
5904
- * @returns {Index} The current index.
6145
+ * @returns {Index|undefined} The current index.
5905
6146
  */
5906
- getCurrentIndex(): Index;
6147
+ getCurrentIndex(): Index | undefined;
5907
6148
  /**
5908
6149
  * Get the SOP image UID of the current image.
5909
6150
  *
@@ -5951,12 +6192,12 @@ export declare class View {
5951
6192
  /**
5952
6193
  * Set current position.
5953
6194
  *
5954
- * @param {Point} position The new position.
6195
+ * @param {Point} inPosition The new position.
5955
6196
  * @param {boolean} [silent] Flag to fire event or not.
5956
6197
  * @returns {boolean} False if not in bounds.
5957
6198
  * @fires View#positionchange
5958
6199
  */
5959
- setCurrentPosition(position: Point, silent?: boolean): boolean;
6200
+ setCurrentPosition(inPosition: Point, silent?: boolean): boolean;
5960
6201
  /**
5961
6202
  * Set the view window/level.
5962
6203
  *
@@ -6072,6 +6313,18 @@ export declare class ViewConfig {
6072
6313
  * @type {number|undefined}
6073
6314
  */
6074
6315
  opacity: number | undefined;
6316
+ /**
6317
+ * Optional segmentation layer fill opacity; in [0, 1] range.
6318
+ *
6319
+ * @type {number|undefined}
6320
+ */
6321
+ fillOpacity: number | undefined;
6322
+ /**
6323
+ * Optional segmentation contour thickness; in [0, 10] range.
6324
+ *
6325
+ * @type {number|undefined}
6326
+ */
6327
+ contourThickness: number | undefined;
6075
6328
  /**
6076
6329
  * Optional layer window level preset name.
6077
6330
  * If present, the preset name will be used and
@@ -6174,17 +6427,12 @@ export declare class ViewController {
6174
6427
  */
6175
6428
  isPlaying(): boolean;
6176
6429
  /**
6177
- * Get the position helper.
6430
+ * Get a position helper: returns a new helper
6431
+ * based on the current view.
6178
6432
  *
6179
6433
  * @returns {PositionHelper} The helper.
6180
6434
  */
6181
6435
  getPositionHelper(): PositionHelper;
6182
- /**
6183
- * Get a clone of the position helper.
6184
- *
6185
- * @returns {PositionHelper} The helper clone.
6186
- */
6187
- getPositionHelperClone(): PositionHelper;
6188
6436
  /**
6189
6437
  * Get the current position.
6190
6438
  *
@@ -6499,6 +6747,13 @@ export declare class ViewController {
6499
6747
  * @param {alphaFn} func The function.
6500
6748
  */
6501
6749
  setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
6750
+ /**
6751
+ * Set the mask segment view helper to handle
6752
+ * hidden segments.
6753
+ *
6754
+ * @param {MaskSegmentViewHelper} helper The helper.
6755
+ */
6756
+ setMaskViewHelper(helper: MaskSegmentViewHelper): void;
6502
6757
  /**
6503
6758
  * Get the fill opacity relative to the global opacity.
6504
6759
  *
@@ -6839,6 +7094,12 @@ export declare class ViewLayer {
6839
7094
  * event type.
6840
7095
  */
6841
7096
  removeEventListener(type: string, callback: Function): void;
7097
+ /**
7098
+ * Check if the position is valid.
7099
+ *
7100
+ * @returns {boolean} True if the position is valid.
7101
+ */
7102
+ isValidPosition(): boolean;
6842
7103
  /**
6843
7104
  * Set the current position.
6844
7105
  *