dwv 0.35.0-beta.3 → 0.35.0-beta.30

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
@@ -17,19 +17,37 @@ export declare function addTagsToDictionary(group: string, tags: {
17
17
  */
18
18
  export declare class Annotation {
19
19
  /**
20
- * The ID.
20
+ * Tracking id, unique within domain.
21
21
  *
22
22
  * @type {string}
23
23
  */
24
- id: string;
24
+ trackingId: string;
25
25
  /**
26
- * The reference image SOP UID.
26
+ * Tracking Unique id.
27
27
  *
28
28
  * @type {string}
29
29
  */
30
- referenceSopUID: string;
30
+ trackingUid: string;
31
31
  /**
32
- * The mathematical shape.
32
+ * Referenced image SOP isntance UID.
33
+ *
34
+ * @type {string}
35
+ */
36
+ referencedSopInstanceUID: string;
37
+ /**
38
+ * Referenced image SOP class UID.
39
+ *
40
+ * @type {string}
41
+ */
42
+ referencedSopClassUID: string;
43
+ /**
44
+ * Referenced frame number.
45
+ *
46
+ * @type {number|undefined}
47
+ */
48
+ referencedFrameNumber: number | undefined;
49
+ /**
50
+ * Mathematical shape.
33
51
  *
34
52
  * @type {object}
35
53
  */
@@ -41,11 +59,11 @@ export declare class Annotation {
41
59
  */
42
60
  referencePoints: Point2D[] | undefined;
43
61
  /**
44
- * The color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
62
+ * Colour: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
45
63
  *
46
- * @type {string|undefined}
64
+ * @type {string}
47
65
  */
48
- colour: string | undefined;
66
+ colour: string;
49
67
  /**
50
68
  * Annotation quantification.
51
69
  *
@@ -54,11 +72,11 @@ export declare class Annotation {
54
72
  quantification: object | undefined;
55
73
  /**
56
74
  * Text expression. Can contain variables surrounded with '{}' that will
57
- * be extracted from the quantification object.
75
+ * be extracted from the quantification object.
58
76
  *
59
- * @type {string|undefined}
77
+ * @type {string}
60
78
  */
61
- textExpr: string | undefined;
79
+ textExpr: string;
62
80
  /**
63
81
  * Label position. If undefined, the default shape
64
82
  * label position will be used.
@@ -67,7 +85,7 @@ export declare class Annotation {
67
85
  */
68
86
  labelPosition: Point2D | undefined;
69
87
  /**
70
- * The plane origin, the 3D position of index [0, 0, k].
88
+ * Plane origin: 3D position of index [0, 0, k].
71
89
  *
72
90
  * @type {Point3D|undefined}
73
91
  */
@@ -78,6 +96,33 @@ export declare class Annotation {
78
96
  * @type {Point3D[]|undefined}
79
97
  */
80
98
  planePoints: Point3D[] | undefined;
99
+ /**
100
+ * Get the concepts ids of the annotation meta data.
101
+ *
102
+ * @returns {string[]} The ids.
103
+ */
104
+ getMetaConceptIds(): string[];
105
+ /**
106
+ * Get an annotation meta data.
107
+ *
108
+ * @param {string} conceptId The value of the concept dicom code.
109
+ * @returns {object|undefined} The corresponding meta data item
110
+ * as {concept, value} or undefined.
111
+ */
112
+ getMetaItem(conceptId: string): object | undefined;
113
+ /**
114
+ * Add annotation meta data.
115
+ *
116
+ * @param {DicomCode} concept The concept code.
117
+ * @param {DicomCode|string} value The value code.
118
+ */
119
+ addMetaItem(concept: DicomCode, value: DicomCode | string): void;
120
+ /**
121
+ * Remove an annotation meta data.
122
+ *
123
+ * @param {string} conceptId The value of the concept dicom code.
124
+ */
125
+ removeMetaItem(conceptId: string): void;
81
126
  /**
82
127
  * Get the orientation name for this annotation.
83
128
  *
@@ -91,6 +136,13 @@ export declare class Annotation {
91
136
  * @param {ViewController} viewController The associated view controller.
92
137
  */
93
138
  init(viewController: ViewController): void;
139
+ /**
140
+ * Check if the annotation can be displayed: true if it has
141
+ * an associated view controller.
142
+ *
143
+ * @returns {boolean} True if the annotation can be displayed.
144
+ */
145
+ canView(): boolean;
94
146
  /**
95
147
  * Check if an input view is compatible with the annotation.
96
148
  *
@@ -133,9 +185,9 @@ export declare class Annotation {
133
185
  /**
134
186
  * Get the math shape associated draw factory.
135
187
  *
136
- * @returns {object} The factory.
188
+ * @returns {object|undefined} The factory.
137
189
  */
138
- getFactory(): object;
190
+ getFactory(): object | undefined;
139
191
  #private;
140
192
  }
141
193
 
@@ -195,14 +247,16 @@ export declare class AnnotationGroup {
195
247
  *
196
248
  * @param {Annotation} annotation The annotation to update.
197
249
  * @param {string[]} [propKeys] Optional properties that got updated.
250
+ * @param {boolean} [propagate] Whether the update event propagates
251
+ * outside of dwv or not, defaults to true.
198
252
  */
199
- update(annotation: Annotation, propKeys?: string[]): void;
253
+ update(annotation: Annotation, propKeys?: string[], propagate?: boolean): void;
200
254
  /**
201
255
  * Remove an annotation.
202
256
  *
203
- * @param {string} id The id of the annotation to remove.
257
+ * @param {string} uid The UID of the annotation to remove.
204
258
  */
205
- remove(id: string): void;
259
+ remove(uid: string): void;
206
260
  /**
207
261
  * Set the associated view controller.
208
262
  *
@@ -212,10 +266,10 @@ export declare class AnnotationGroup {
212
266
  /**
213
267
  * Find an annotation.
214
268
  *
215
- * @param {string} id The id of the annotation to find.
269
+ * @param {string} uid The UID of the annotation to find.
216
270
  * @returns {Annotation|undefined} The found annotation.
217
271
  */
218
- find(id: string): Annotation | undefined;
272
+ find(uid: string): Annotation | undefined;
219
273
  /**
220
274
  * Get the meta data.
221
275
  *
@@ -235,9 +289,9 @@ export declare class AnnotationGroup {
235
289
  * Get a meta data value.
236
290
  *
237
291
  * @param {string} key The meta data key.
238
- * @returns {string|object} The meta data value.
292
+ * @returns {string|object|undefined} The meta data value.
239
293
  */
240
- getMetaValue(key: string): string | object;
294
+ getMetaValue(key: string): string | object | undefined;
241
295
  /**
242
296
  * Set a meta data.
243
297
  *
@@ -276,25 +330,37 @@ export declare class AnnotationGroupFactory {
276
330
  */
277
331
  getWarning(): string | undefined;
278
332
  /**
279
- * Check dicom elements. Throws an error if not suitable.
333
+ * Check dicom elements.
280
334
  *
281
335
  * @param {Object<string, DataElement>} dataElements The DICOM data elements.
282
336
  * @returns {string|undefined} A possible warning.
337
+ * @throws Error for missing or wrong data.
283
338
  */
284
339
  checkElements(dataElements: {
285
340
  [x: string]: DataElement;
286
341
  }): string | undefined;
287
342
  /**
288
- * Get an {@link Annotation} object from the read DICOM file.
343
+ * Get an {@link AnnotationGroup} object from the read DICOM file.
289
344
  *
290
345
  * @param {Object<string, DataElement>} dataElements The DICOM tags.
291
346
  * @returns {AnnotationGroup} A new annotation group.
347
+ * @throws Error for missing or wrong data.
292
348
  */
293
349
  create(dataElements: {
294
350
  [x: string]: DataElement;
295
351
  }): AnnotationGroup;
296
352
  /**
297
- * Convert an annotation group into a DICOM SR object.
353
+ * Get an {@link CADReport} object from the read DICOM file.
354
+ *
355
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
356
+ * @returns {CADReport|undefined} A new CAD report.
357
+ */
358
+ createCADReport(dataElements: {
359
+ [x: string]: DataElement;
360
+ }): CADReport | undefined;
361
+ /**
362
+ * Convert an annotation group into a DICOM SR object using the
363
+ * TID 1500 template.
298
364
  *
299
365
  * @param {AnnotationGroup} annotationGroup The annotation group.
300
366
  * @param {Object<string, any>} [extraTags] Optional list of extra tags.
@@ -305,6 +371,19 @@ export declare class AnnotationGroupFactory {
305
371
  }): {
306
372
  [x: string]: DataElement;
307
373
  };
374
+ /**
375
+ * Convert a CAD report into a DICOM CAD report SR object using
376
+ * the TID 4100 template.
377
+ *
378
+ * @param {CADReport} report The CAD report.
379
+ * @param {Object<string, any>} [extraTags] Optional list of extra tags.
380
+ * @returns {Object<string, DataElement>} A list of dicom elements.
381
+ */
382
+ toDicomCADReport(report: CADReport, extraTags?: {
383
+ [x: string]: any;
384
+ }): {
385
+ [x: string]: DataElement;
386
+ };
308
387
  #private;
309
388
  }
310
389
 
@@ -476,9 +555,9 @@ export declare class App {
476
555
  * The layer is available after the first loaded item.
477
556
  *
478
557
  * @param {string} divId The div id.
479
- * @returns {LayerGroup} The layer group.
558
+ * @returns {LayerGroup|undefined} The layer group.
480
559
  */
481
- getLayerGroupByDivId(divId: string): LayerGroup;
560
+ getLayerGroupByDivId(divId: string): LayerGroup | undefined;
482
561
  /**
483
562
  * Get the number of layer groups.
484
563
  *
@@ -569,6 +648,7 @@ export declare class App {
569
648
  * Load a list of files. Can be image files or a state file.
570
649
  *
571
650
  * @param {File[]} files The list of files to load.
651
+ * @returns {string} The data ID, '-1' if problem.
572
652
  * @fires App#loadstart
573
653
  * @fires App#loadprogress
574
654
  * @fires App#loaditem
@@ -577,7 +657,7 @@ export declare class App {
577
657
  * @fires App#abort
578
658
  * @function
579
659
  */
580
- loadFiles: (files: File[]) => void;
660
+ loadFiles: (files: File[]) => string;
581
661
  /**
582
662
  * Load a list of URLs. Can be image files or a state file.
583
663
  *
@@ -586,6 +666,7 @@ export declare class App {
586
666
  * - requestHeaders: an array of {name, value} to use as request headers,
587
667
  * - withCredentials: boolean xhr.withCredentials flag to pass to the request,
588
668
  * - batchSize: the size of the request url batch.
669
+ * @returns {string} The data ID, '-1' if problem.
589
670
  * @fires App#loadstart
590
671
  * @fires App#loadprogress
591
672
  * @fires App#loaditem
@@ -594,7 +675,7 @@ export declare class App {
594
675
  * @fires App#abort
595
676
  * @function
596
677
  */
597
- loadURLs: (urls: string[], options?: object) => void;
678
+ loadURLs: (urls: string[], options?: object) => string;
598
679
  /**
599
680
  * Load from an input uri.
600
681
  *
@@ -608,6 +689,7 @@ export declare class App {
608
689
  *
609
690
  * @param {Array} data The list of ArrayBuffers to load
610
691
  * in the form of [{name: "", filename: "", data: data}].
692
+ * @returns {string} The data ID.
611
693
  * @fires App#loadstart
612
694
  * @fires App#loadprogress
613
695
  * @fires App#loaditem
@@ -616,7 +698,7 @@ export declare class App {
616
698
  * @fires App#abort
617
699
  * @function
618
700
  */
619
- loadImageObject: (data: any[]) => void;
701
+ loadImageObject: (data: any[]) => string;
620
702
  /**
621
703
  * Abort all the current loads.
622
704
  */
@@ -693,6 +775,8 @@ export declare class App {
693
775
  addDataViewConfig(dataId: string, config: ViewConfig): void;
694
776
  /**
695
777
  * Remove a data view config.
778
+ * Removes the associated layer if found, removes
779
+ * the layer group if empty.
696
780
  *
697
781
  * @param {string} dataId The data id.
698
782
  * @param {string} divId The div id.
@@ -970,6 +1054,24 @@ export declare class AppOptions {
970
1054
  */
971
1055
  export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
972
1056
 
1057
+ /**
1058
+ * CAD report class.
1059
+ */
1060
+ export declare class CADReport {
1061
+ /**
1062
+ * @type {AnnotationGroup[]}
1063
+ */
1064
+ annotationGroups: AnnotationGroup[];
1065
+ /**
1066
+ * @type {ResponseEvaluation[]}
1067
+ */
1068
+ responseEvaluations: ResponseEvaluation[];
1069
+ /**
1070
+ * @type {string}
1071
+ */
1072
+ comment: string;
1073
+ }
1074
+
973
1075
  /**
974
1076
  * Change segment colour command.
975
1077
  */
@@ -1086,10 +1188,12 @@ export declare class Circle {
1086
1188
  * Quantify an circle according to view information.
1087
1189
  *
1088
1190
  * @param {ViewController} viewController The associated view controller.
1191
+ * @param {Index} index The index at which to get the
1192
+ * image values.
1089
1193
  * @param {string[]} flags A list of stat values to calculate.
1090
1194
  * @returns {object} A quantification object.
1091
1195
  */
1092
- quantify(viewController: ViewController, flags: string[]): object;
1196
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
1093
1197
  #private;
1094
1198
  }
1095
1199
 
@@ -1155,14 +1259,20 @@ export declare function createView(elements: {
1155
1259
  [x: string]: DataElement;
1156
1260
  }, image: Image_2): View;
1157
1261
 
1158
- export declare namespace customUI {
1159
- /**
1160
- * Open a dialogue to edit roi data. Defaults to window.prompt.
1161
- *
1162
- * @param {Annotation} annotation The roi data.
1163
- * @param {Function} callback The callback to launch on dialogue exit.
1164
- */
1165
- export function openRoiDialog(annotation: Annotation, callback: Function): void;
1262
+ export declare namespace custom {
1263
+ let wlPresets: {
1264
+ [x: string]: {
1265
+ [x: string]: WindowLevel;
1266
+ };
1267
+ };
1268
+ let labelTexts: {
1269
+ [x: string]: {
1270
+ [x: string]: string;
1271
+ };
1272
+ };
1273
+ let openRoiDialog: any;
1274
+ let getTagTime: any;
1275
+ let getTagPixelUnit: any;
1166
1276
  }
1167
1277
 
1168
1278
  /**
@@ -1223,35 +1333,6 @@ export declare class DataElement {
1223
1333
  items: any[];
1224
1334
  }
1225
1335
 
1226
- /**
1227
- * Decoder scripts to be passed to web workers for image decoding.
1228
- */
1229
- export declare const decoderScripts: {
1230
- jpeg2000: string;
1231
- 'jpeg-lossless': string;
1232
- 'jpeg-baseline': string;
1233
- rle: string;
1234
- };
1235
-
1236
- /**
1237
- * List of default window level presets.
1238
- *
1239
- * @type {Object.<string, Object.<string, WindowLevel>>}
1240
- */
1241
- export declare const defaultPresets: {
1242
- [x: string]: {
1243
- [x: string]: WindowLevel;
1244
- };
1245
- };
1246
-
1247
- export declare namespace defaults {
1248
- let labelText: {
1249
- [x: string]: {
1250
- [x: string]: string;
1251
- };
1252
- };
1253
- }
1254
-
1255
1336
  /**
1256
1337
  * Delete segment command.
1257
1338
  */
@@ -1354,15 +1435,19 @@ export declare class DicomCode {
1354
1435
  */
1355
1436
  export declare class DicomData {
1356
1437
  /**
1357
- * @param {object} meta The DICOM meta data.
1438
+ * @param {Object<string, DataElement>} meta The DICOM meta data.
1358
1439
  */
1359
- constructor(meta: object);
1440
+ constructor(meta: {
1441
+ [x: string]: DataElement;
1442
+ });
1360
1443
  /**
1361
1444
  * DICOM meta data.
1362
1445
  *
1363
- * @type {object}
1446
+ * @type {Object<string, DataElement>}
1364
1447
  */
1365
- meta: object;
1448
+ meta: {
1449
+ [x: string]: DataElement;
1450
+ };
1366
1451
  /**
1367
1452
  * Image extracted from meta data.
1368
1453
  *
@@ -1375,6 +1460,12 @@ export declare class DicomData {
1375
1460
  * @type {AnnotationGroup|undefined}
1376
1461
  */
1377
1462
  annotationGroup: AnnotationGroup | undefined;
1463
+ /**
1464
+ * Image buffer used to build image.
1465
+ *
1466
+ * @type {any|undefined}
1467
+ */
1468
+ buffer: any | undefined;
1378
1469
  }
1379
1470
 
1380
1471
  /**
@@ -1431,12 +1522,20 @@ export declare class DicomParser {
1431
1522
  [x: string]: DataElement;
1432
1523
  };
1433
1524
  /**
1434
- * Parse the complete DICOM file (given as input to the class).
1525
+ * Safely get an elements' first value from the parsed elements.
1526
+ *
1527
+ * @param {string} key The tag key as for example '00100020'.
1528
+ * @returns {any|undefined} The elements' value or undefined.
1529
+ */
1530
+ safeGet(key: string): any | undefined;
1531
+ /**
1532
+ * Parse a DICOM buffer.
1435
1533
  * Fills in the member object 'dataElements'.
1436
1534
  *
1437
1535
  * @param {ArrayBuffer} buffer The input array buffer.
1536
+ * @param {Tag} [untilTag] Optional tag to stop the parsing once reached.
1438
1537
  */
1439
- parse(buffer: ArrayBuffer): void;
1538
+ parse(buffer: ArrayBuffer, untilTag?: Tag): void;
1440
1539
  #private;
1441
1540
  }
1442
1541
 
@@ -1469,11 +1568,11 @@ export declare class DicomSRContent {
1469
1568
  */
1470
1569
  relationshipType: string;
1471
1570
  /**
1472
- * Content sequence (0040,A730).
1571
+ * Content sequence.
1473
1572
  *
1474
- * @type {DicomSRContent[]|undefined}
1573
+ * @type {DicomSRContent[]}
1475
1574
  */
1476
- contentSequence: DicomSRContent[] | undefined;
1575
+ contentSequence: DicomSRContent[];
1477
1576
  /**
1478
1577
  * Value.
1479
1578
  *
@@ -1487,6 +1586,15 @@ export declare class DicomSRContent {
1487
1586
  * @returns {string} The object as string.
1488
1587
  */
1489
1588
  toString(prefix?: string): string;
1589
+ /**
1590
+ * Check if this content has input header values.
1591
+ *
1592
+ * @param {string} valueType The value type.
1593
+ * @param {DicomCode} conceptNameCode The concept name code.
1594
+ * @param {string} relationshipType The relationship type.
1595
+ * @returns {boolean} True if equal.
1596
+ */
1597
+ hasHeader(valueType: string, conceptNameCode: DicomCode, relationshipType: string): boolean;
1490
1598
  }
1491
1599
 
1492
1600
  /**
@@ -1584,10 +1692,10 @@ export declare class DrawController {
1584
1692
  /**
1585
1693
  * Get an annotation.
1586
1694
  *
1587
- * @param {string} id The annotation id.
1695
+ * @param {string} uid The annotation UID.
1588
1696
  * @returns {Annotation|undefined} The annotation.
1589
1697
  */
1590
- getAnnotation(id: string): Annotation | undefined;
1698
+ getAnnotation(uid: string): Annotation | undefined;
1591
1699
  /**
1592
1700
  * Get the annotation group.
1593
1701
  *
@@ -1617,32 +1725,33 @@ export declare class DrawController {
1617
1725
  *
1618
1726
  * @param {Annotation} annotation The annotation to update.
1619
1727
  * @param {string[]} [propKeys] Optional properties that got updated.
1728
+ * @param {boolean} [silent] Whether to send a update event or not.
1620
1729
  */
1621
- updateAnnotation(annotation: Annotation, propKeys?: string[]): void;
1730
+ updateAnnotation(annotation: Annotation, propKeys?: string[], silent?: boolean): void;
1622
1731
  /**
1623
1732
  * Remove an anotation for the list.
1624
1733
  *
1625
- * @param {string} id The id of the annotation to remove.
1734
+ * @param {string} uid The UID of the annotation to remove.
1626
1735
  */
1627
- removeAnnotation(id: string): void;
1736
+ removeAnnotation(uid: string): void;
1628
1737
  /**
1629
1738
  * Remove an annotation via a remove command (triggers draw actions).
1630
1739
  *
1631
- * @param {string} id The annotation id.
1740
+ * @param {string} uid The annotation UID.
1632
1741
  * @param {Function} exeCallback The undo stack callback.
1633
1742
  */
1634
- removeAnnotationWithCommand(id: string, exeCallback: Function): void;
1743
+ removeAnnotationWithCommand(uid: string, exeCallback: Function): void;
1635
1744
  /**
1636
1745
  * Update an annotation via an update command (triggers draw actions).
1637
1746
  *
1638
- * @param {string} id The annotation id.
1747
+ * @param {string} uid The annotation UID.
1639
1748
  * @param {object} originalProps The original annotation properties
1640
1749
  * that will be updated.
1641
1750
  * @param {object} newProps The new annotation properties
1642
1751
  * that will replace the original ones.
1643
1752
  * @param {Function} exeCallback The undo stack callback.
1644
1753
  */
1645
- updateAnnotationWithCommand(id: string, originalProps: object, newProps: object, exeCallback: Function): void;
1754
+ updateAnnotationWithCommand(uid: string, originalProps: object, newProps: object, exeCallback: Function): void;
1646
1755
  /**
1647
1756
  * Remove all annotations via remove commands (triggers draw actions).
1648
1757
  *
@@ -1695,7 +1804,7 @@ export declare class DrawLayer {
1695
1804
  */
1696
1805
  getDataId(): string;
1697
1806
  /**
1698
- * Get the reference data id.
1807
+ * Get the reference layer id.
1699
1808
  *
1700
1809
  * @returns {string} The id.
1701
1810
  */
@@ -2073,10 +2182,12 @@ export declare class Ellipse {
2073
2182
  * Quantify an ellipse according to view information.
2074
2183
  *
2075
2184
  * @param {ViewController} viewController The associated view controller.
2185
+ * @param {Index} index The index at which to get the
2186
+ * image values.
2076
2187
  * @param {string[]} flags A list of stat values to calculate.
2077
2188
  * @returns {object} A quantification object.
2078
2189
  */
2079
- quantify(viewController: ViewController, flags: string[]): object;
2190
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
2080
2191
  #private;
2081
2192
  }
2082
2193
 
@@ -2085,14 +2196,14 @@ export declare class Ellipse {
2085
2196
  */
2086
2197
  export declare class Geometry {
2087
2198
  /**
2088
- * @param {Point3D} origin The object origin (a 3D point).
2199
+ * @param {Point3D[]} origins The object origins.
2089
2200
  * @param {Size} size The object size.
2090
2201
  * @param {Spacing} spacing The object spacing.
2091
2202
  * @param {Matrix33} [orientation] The object orientation (3*3 matrix,
2092
2203
  * default to 3*3 identity).
2093
2204
  * @param {number} [time] Optional time index.
2094
2205
  */
2095
- constructor(origin: Point3D, size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2206
+ constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2096
2207
  /**
2097
2208
  * Get the time value that was passed at construction.
2098
2209
  *
@@ -2139,11 +2250,11 @@ export declare class Geometry {
2139
2250
  * Check if a point is in the origin list.
2140
2251
  *
2141
2252
  * @param {Point3D} point3D The point to check.
2142
- * @param {number} tol The comparison tolerance
2143
- * default to Number.EPSILON.
2253
+ * @param {number} [tol] Optional number comparison tolerance
2254
+ * defaults to Number.EPSILON.
2144
2255
  * @returns {boolean} True if in list.
2145
2256
  */
2146
- includesOrigin(point3D: Point3D, tol: number): boolean;
2257
+ includesOrigin(point3D: Point3D, tol?: number): boolean;
2147
2258
  /**
2148
2259
  * Get the object size.
2149
2260
  * Warning: the size comes as stored in DICOM, meaning that it could
@@ -2231,6 +2342,13 @@ export declare class Geometry {
2231
2342
  * @returns {boolean} True if the given coordinates are within bounds.
2232
2343
  */
2233
2344
  isIndexInBounds(index: Index, dirs?: number[]): boolean;
2345
+ /**
2346
+ * Get the geometrical range, ie the minimum and maximum
2347
+ * positions.
2348
+ *
2349
+ * @returns {Point[]} The min and max positions.
2350
+ */
2351
+ getRange(): Point[];
2234
2352
  /**
2235
2353
  * Convert an index into world coordinates.
2236
2354
  *
@@ -2262,6 +2380,21 @@ export declare class Geometry {
2262
2380
  #private;
2263
2381
  }
2264
2382
 
2383
+ /**
2384
+ * Get the meta data as simple elements:
2385
+ * - indexed by tag names instead of tag keys,
2386
+ * - no element object, just value if not sequence nor merged item.
2387
+ *
2388
+ * @param {Object<string, DataElement>} metaData The meta data
2389
+ * index by tag keys.
2390
+ * @returns {Object<string, any>} The simple elements.
2391
+ */
2392
+ export declare function getAsSimpleElements(metaData: {
2393
+ [x: string]: DataElement;
2394
+ }): {
2395
+ [x: string]: any;
2396
+ };
2397
+
2265
2398
  /**
2266
2399
  * Get the default DICOM seg tags as an object.
2267
2400
  *
@@ -2371,6 +2504,13 @@ export declare function getRectangleIndices(center: Index, size: number[], dir:
2371
2504
  */
2372
2505
  export declare function getReverseOrientation(ori: string): string;
2373
2506
 
2507
+ /**
2508
+ * Get a segmentation DICOM code.
2509
+ *
2510
+ * @returns {DicomCode} The code.
2511
+ */
2512
+ export declare function getSegmentationCode(): DicomCode;
2513
+
2374
2514
  /**
2375
2515
  * Get a content item object from a dicom element.
2376
2516
  *
@@ -2436,6 +2576,14 @@ export declare function getUID(tagName: string): string;
2436
2576
  */
2437
2577
  export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
2438
2578
 
2579
+ /**
2580
+ * Convert a hex color into RGB.
2581
+ *
2582
+ * @param {string} hexStr The hex color as '#ab01ef'.
2583
+ * @returns {RGB} The RGB values as {r,g,b}.
2584
+ */
2585
+ export declare function hexToRgb(hexStr: string): RGB;
2586
+
2439
2587
  export declare namespace i18n {
2440
2588
  /**
2441
2589
  * Get the translated text.
@@ -2443,7 +2591,7 @@ export declare namespace i18n {
2443
2591
  * @param {string} key The key to the text entry.
2444
2592
  * @returns {string|undefined} The translated text.
2445
2593
  */
2446
- export function t(key: string): string;
2594
+ export function t(key: string): string | undefined;
2447
2595
  }
2448
2596
 
2449
2597
  /**
@@ -2876,6 +3024,10 @@ declare class Image_2 {
2876
3024
  * Note: Uses the raw buffer values.
2877
3025
  */
2878
3026
  compose(rhs: Image_2, operator: Function): Image_2;
3027
+ /**
3028
+ * Recalculate labels.
3029
+ */
3030
+ recalculateLabels(): void;
2879
3031
  #private;
2880
3032
  }
2881
3033
  export { Image_2 as Image }
@@ -2937,14 +3089,32 @@ export declare class Index {
2937
3089
  */
2938
3090
  compare(rhs: Index): number[];
2939
3091
  /**
2940
- * Add another index to this one.
3092
+ * Add another index to this one and return
3093
+ * the result as a new index.
2941
3094
  *
2942
3095
  * @param {Index} rhs The index to add.
2943
3096
  * @returns {Index} The index representing the sum of both indices.
2944
3097
  */
2945
3098
  add(rhs: Index): Index;
2946
3099
  /**
2947
- * Get the current index with a new 2D base.
3100
+ * Increment this index by 1 at the given dimension
3101
+ * and return the result as a new index.
3102
+ *
3103
+ * @param {number} dim The dimension number.
3104
+ * @returns {Index} The result index.
3105
+ */
3106
+ next(dim: number): Index;
3107
+ /**
3108
+ * Decrement this index by 1 at the given dimension
3109
+ * and return the result as a new index.
3110
+ *
3111
+ * @param {number} dim The dimension number.
3112
+ * @returns {Index} The result index.
3113
+ */
3114
+ previous(dim: number): Index;
3115
+ /**
3116
+ * Get the current index with a new 2D base
3117
+ * and return the result as a new index.
2948
3118
  *
2949
3119
  * @param {number} i The new 0 index.
2950
3120
  * @param {number} j The new 1 index.
@@ -2993,6 +3163,12 @@ export declare class LayerGroup {
2993
3163
  * @param {HTMLElement} containerDiv The associated HTML div.
2994
3164
  */
2995
3165
  constructor(containerDiv: HTMLElement);
3166
+ /**
3167
+ * Get the position helper.
3168
+ *
3169
+ * @returns {PositionHelper} The position helper.
3170
+ */
3171
+ getPositionHelper(): PositionHelper;
2996
3172
  /**
2997
3173
  * Get the showCrosshair flag.
2998
3174
  *
@@ -3014,9 +3190,9 @@ export declare class LayerGroup {
3014
3190
  /**
3015
3191
  * Get the Id of the container div.
3016
3192
  *
3017
- * @returns {string} The id of the div.
3193
+ * @returns {string|undefined} The id of the div.
3018
3194
  */
3019
- getDivId(): string;
3195
+ getDivId(): string | undefined;
3020
3196
  /**
3021
3197
  * Get the layer scale.
3022
3198
  *
@@ -3090,6 +3266,12 @@ export declare class LayerGroup {
3090
3266
  * @returns {number} The number of layers.
3091
3267
  */
3092
3268
  getNumberOfViewLayers(): number;
3269
+ /**
3270
+ * Get the active image layer.
3271
+ *
3272
+ * @returns {ViewLayer|DrawLayer|undefined} The layer.
3273
+ */
3274
+ getActiveLayer(): ViewLayer | DrawLayer | undefined;
3093
3275
  /**
3094
3276
  * Get the active image layer.
3095
3277
  *
@@ -3102,6 +3284,13 @@ export declare class LayerGroup {
3102
3284
  * @returns {ViewLayer|undefined} The layer.
3103
3285
  */
3104
3286
  getBaseViewLayer(): ViewLayer | undefined;
3287
+ /**
3288
+ * Get a view layer associated to a data id.
3289
+ *
3290
+ * @param {string} id The layer id.
3291
+ * @returns {ViewLayer|undefined} The layer.
3292
+ */
3293
+ getViewLayerById(id: string): ViewLayer | undefined;
3105
3294
  /**
3106
3295
  * Get the view layers associated to a data id.
3107
3296
  *
@@ -3128,6 +3317,13 @@ export declare class LayerGroup {
3128
3317
  * @returns {DrawLayer|undefined} The layer.
3129
3318
  */
3130
3319
  getActiveDrawLayer(): DrawLayer | undefined;
3320
+ /**
3321
+ * Get a draw layer associated to a data id.
3322
+ *
3323
+ * @param {string} id The layer id.
3324
+ * @returns {DrawLayer|undefined} The layer.
3325
+ */
3326
+ getDrawLayerById(id: string): DrawLayer | undefined;
3131
3327
  /**
3132
3328
  * Get the draw layers associated to a data id.
3133
3329
  *
@@ -3136,30 +3332,17 @@ export declare class LayerGroup {
3136
3332
  */
3137
3333
  getDrawLayersByDataId(dataId: string): DrawLayer[];
3138
3334
  /**
3139
- * Set the active view layer.
3335
+ * Set the active layer.
3140
3336
  *
3141
3337
  * @param {number} index The index of the layer to set as active.
3142
3338
  */
3143
- setActiveViewLayer(index: number): void;
3144
- /**
3145
- * Set the active view layer with a data id.
3146
- *
3147
- * @param {string} dataId The data id.
3148
- */
3149
- setActiveViewLayerByDataId(dataId: string): void;
3150
- /**
3151
- * Set the active draw layer.
3152
- *
3153
- * @param {number|undefined} index The index of the layer to set as active
3154
- * or undefined to not set any.
3155
- */
3156
- setActiveDrawLayer(index: number | undefined): void;
3339
+ setActiveLayer(index: number): void;
3157
3340
  /**
3158
- * Set the active draw layer with a data id.
3341
+ * Set the active layer with a data id.
3159
3342
  *
3160
3343
  * @param {string} dataId The data id.
3161
3344
  */
3162
- setActiveDrawLayerByDataId(dataId: string): void;
3345
+ setActiveLayerByDataId(dataId: string): void;
3163
3346
  /**
3164
3347
  * Add a view layer.
3165
3348
  *
@@ -3193,6 +3376,7 @@ export declare class LayerGroup {
3193
3376
  * methods to define the active index.
3194
3377
  *
3195
3378
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
3379
+ * @fires LayerGroup#removelayer
3196
3380
  */
3197
3381
  removeLayer(layer: ViewLayer | DrawLayer): void;
3198
3382
  /**
@@ -3228,7 +3412,7 @@ export declare class LayerGroup {
3228
3412
  */
3229
3413
  moreThanOne(dim: number): boolean;
3230
3414
  /**
3231
- * Update layers (but not the active view layer) to a position change.
3415
+ * Update layers (but not the event source layer) to a position change.
3232
3416
  *
3233
3417
  * @param {object} event The position change event.
3234
3418
  * @function
@@ -3355,10 +3539,11 @@ export declare class MaskFactory {
3355
3539
  */
3356
3540
  getWarning(): string | undefined;
3357
3541
  /**
3358
- * Check dicom elements. Throws an error if not suitable.
3542
+ * Check dicom elements.
3359
3543
  *
3360
3544
  * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
3361
3545
  * @returns {string|undefined} A possible warning.
3546
+ * @throws Error for missing or wrong data.
3362
3547
  */
3363
3548
  checkElements(_dicomElements: {
3364
3549
  [x: string]: DataElement;
@@ -3370,11 +3555,14 @@ export declare class MaskFactory {
3370
3555
  * @param {Uint8Array | Int8Array |
3371
3556
  * Uint16Array | Int16Array |
3372
3557
  * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
3558
+ * @param {Image} [refImage] Reference image, code will use its
3559
+ * origins if present (best) or try to calculate them.
3373
3560
  * @returns {Image} A new Image.
3561
+ * @throws Error for missing or wrong data.
3374
3562
  */
3375
3563
  create(dataElements: {
3376
3564
  [x: string]: DataElement;
3377
- }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2;
3565
+ }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array, refImage?: Image_2): Image_2;
3378
3566
  /**
3379
3567
  * Convert a mask image into a DICOM segmentation object.
3380
3568
  *
@@ -3592,11 +3780,18 @@ export declare class Matrix33 {
3592
3780
  * Check for Matrix33 equality.
3593
3781
  *
3594
3782
  * @param {Matrix33} rhs The other matrix to compare to.
3595
- * @param {number} [p] A numeric expression for the precision to use in check
3596
- * (ex: 0.001). Defaults to Number.EPSILON if not provided.
3597
3783
  * @returns {boolean} True if both matrices are equal.
3598
3784
  */
3599
- equals(rhs: Matrix33, p?: number): boolean;
3785
+ equals(rhs: Matrix33): boolean;
3786
+ /**
3787
+ * Check for Matrix33 similarity.
3788
+ *
3789
+ * @param {Matrix33} rhs The other matrix to compare to.
3790
+ * @param {number} [tol] Optional number comparison tolerance,
3791
+ * defaults to Number.EPSILON.
3792
+ * @returns {boolean} True if both matrices are similar.
3793
+ */
3794
+ isSimilar(rhs: Matrix33, tol?: number): boolean;
3600
3795
  /**
3601
3796
  * Get a string representation of the Matrix33.
3602
3797
  *
@@ -3871,6 +4066,13 @@ export declare class PlaneHelper {
3871
4066
  * @returns {Index} The corresponding index.
3872
4067
  */
3873
4068
  worldToIndex(point: Point): Index;
4069
+ /**
4070
+ * Image index to world.
4071
+ *
4072
+ * @param {Index} index The input index.
4073
+ * @returns {Point} The corresponding point.
4074
+ */
4075
+ indexToWorld(index: Index): Point;
3874
4076
  /**
3875
4077
  * Is this view in the same orientation as the image aquisition.
3876
4078
  *
@@ -3889,13 +4091,13 @@ export declare class PlaneHelper {
3889
4091
  *
3890
4092
  * @returns {number} The index.
3891
4093
  */
3892
- getScrollIndex(): number;
4094
+ getScrollDimIndex(): number;
3893
4095
  /**
3894
4096
  * Get the native (image) scroll dimension index.
3895
4097
  *
3896
4098
  * @returns {number} The index.
3897
4099
  */
3898
- getNativeScrollIndex(): number;
4100
+ getNativeScrollDimIndex(): number;
3899
4101
  #private;
3900
4102
  }
3901
4103
 
@@ -4079,11 +4281,11 @@ export declare class Point3D {
4079
4281
  * Check for Point3D similarity.
4080
4282
  *
4081
4283
  * @param {Point3D} rhs The other point to compare to.
4082
- * @param {number} tol Optional comparison tolerance,
4083
- * default to Number.EPSILON.
4084
- * @returns {boolean} True if both points are equal.
4284
+ * @param {number} [tol] Optional number comparison tolerance,
4285
+ * defaults to Number.EPSILON.
4286
+ * @returns {boolean} True if both points are similar.
4085
4287
  */
4086
- isSimilar(rhs: Point3D, tol: number): boolean;
4288
+ isSimilar(rhs: Point3D, tol?: number): boolean;
4087
4289
  /**
4088
4290
  * Get a string representation of the Point3D.
4089
4291
  *
@@ -4114,17 +4316,172 @@ export declare class Point3D {
4114
4316
  #private;
4115
4317
  }
4116
4318
 
4319
+ /**
4320
+ * Position helper.
4321
+ */
4322
+ export declare class PositionHelper {
4323
+ /**
4324
+ * @param {View} view The associated view.
4325
+ */
4326
+ constructor(view: View);
4327
+ /**
4328
+ * Get the geometry.
4329
+ *
4330
+ * @returns {Geometry} The geometry.
4331
+ */
4332
+ getGeometry(): Geometry;
4333
+ /**
4334
+ * Get the scroll index.
4335
+ *
4336
+ * @returns {number} The scroll index.
4337
+ */
4338
+ getScrollDimIndex(): number;
4339
+ /**
4340
+ * Get the maximum dimension value.
4341
+ *
4342
+ * @param {number} dim The dimension.
4343
+ * @returns {number} The maximum value.
4344
+ */
4345
+ getMaximumDimValue(dim: number): number;
4346
+ /**
4347
+ * Get the maximum scroll value.
4348
+ *
4349
+ * @returns {number} The maximum value.
4350
+ */
4351
+ getMaximumScrollValue(): number;
4352
+ /**
4353
+ * Get the current position.
4354
+ *
4355
+ * @returns {Point} The current position.
4356
+ */
4357
+ getCurrentPosition(): Point;
4358
+ /**
4359
+ * Get the value at dimension index for the current position.
4360
+ *
4361
+ * @param {number} dim The dimension.
4362
+ * @returns {number} The value.
4363
+ */
4364
+ getCurrentPositionDimValue(dim: number): number;
4365
+ /**
4366
+ * Get the value at scroll index for the current position.
4367
+ *
4368
+ * @returns {number} The value.
4369
+ */
4370
+ getCurrentPositionScrollValue(): number;
4371
+ /**
4372
+ * Get the current position updated at the provided dimension index
4373
+ * with the input value.
4374
+ *
4375
+ * @param {number} dim The dimension.
4376
+ * @param {number} value The value to used at dimension index.
4377
+ * @returns {Point} The position.
4378
+ */
4379
+ getCurrentPositionAtDimValue(dim: number, value: number): Point;
4380
+ /**
4381
+ * Get the current position updated at scroll index with the input value.
4382
+ *
4383
+ * @param {number} value The value to use at scroll index.
4384
+ * @returns {Point} The position.
4385
+ */
4386
+ getCurrentPositionAtScrollValue(value: number): Point;
4387
+ /**
4388
+ * Get the current index.
4389
+ *
4390
+ * @returns {Index} The current index.
4391
+ */
4392
+ getCurrentIndex(): Index;
4393
+ /**
4394
+ * Set the current position.
4395
+ *
4396
+ * @param {Point} position The position.
4397
+ * @param {boolean} [silent] Flag to fire event or not.
4398
+ * @returns {boolean} True if possible and in bounds.
4399
+ */
4400
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
4401
+ /**
4402
+ * Set the current position only if it is in the geometry bounds.
4403
+ *
4404
+ * @param {Point} position The position.
4405
+ * @param {boolean} [silent] Flag to fire event or not.
4406
+ * @returns {boolean} True if possible and in bounds.
4407
+ */
4408
+ setCurrentPositionSafe(position: Point, silent?: boolean): boolean;
4409
+ /**
4410
+ * Merge with another helper.
4411
+ *
4412
+ * @param {PositionHelper} rhs The helper to merge with this one.
4413
+ */
4414
+ merge(rhs: PositionHelper): void;
4415
+ /**
4416
+ * Check if the current position (default) or
4417
+ * the provided position is in bounds.
4418
+ *
4419
+ * @param {Point} position Optional position.
4420
+ * @returns {boolean} True is the position is in bounds.
4421
+ */
4422
+ isPositionInBounds(position: Point): boolean;
4423
+ /**
4424
+ * Get the current position incremented in the input direction.
4425
+ *
4426
+ * @param {number} dim The direction in which to increment.
4427
+ * @returns {Point} The resulting point.
4428
+ */
4429
+ getIncrementPosition(dim: number): Point;
4430
+ /**
4431
+ * Get the current position decremented in the input direction.
4432
+ *
4433
+ * @param {number} dim The direction in which to decrement.
4434
+ * @returns {Point} The resulting point.
4435
+ */
4436
+ getDecrementPosition(dim: number): Point;
4437
+ /**
4438
+ * Increment the current position along the provided dim.
4439
+ *
4440
+ * @param {number} dim The direction in which to increment.
4441
+ * @returns {boolean} True if possible and in bounds.
4442
+ */
4443
+ incrementPosition(dim: number): boolean;
4444
+ /**
4445
+ * Decrement the current position along the provided dim.
4446
+ *
4447
+ * @param {number} dim The direction in which to decrement.
4448
+ * @returns {boolean} True if possible and in bounds.
4449
+ */
4450
+ decrementPosition(dim: number): boolean;
4451
+ /**
4452
+ * Increment the current position along the scroll dimension.
4453
+ *
4454
+ * @returns {boolean} True if possible and in bounds.
4455
+ */
4456
+ incrementPositionAlongScroll(): boolean;
4457
+ /**
4458
+ * Decrement the current position along the scroll dimension.
4459
+ *
4460
+ * @returns {boolean} True if possible and in bounds.
4461
+ */
4462
+ decrementPositionAlongScroll(): boolean;
4463
+ #private;
4464
+ }
4465
+
4117
4466
  /**
4118
4467
  * Round a float number to a given precision.
4119
4468
  *
4120
4469
  * Inspired from {@link https://stackoverflow.com/a/49729715/3639892}.
4121
4470
  *
4122
- * Can be a solution to not have trailing zero as when
4123
- * using toFixed or toPrecision.
4124
- * '+number.toFixed(precision)' does not pass all the tests...
4471
+ * `toPrecision` uses all non zero digits of the number:
4472
+ * (123.009).toPrecision(4) = "123.0";
4473
+ * (0.09).toPrecision(4) = "0.09000".
4474
+ *
4475
+ * `toFixed` does not always behave as expected:
4476
+ * (123.009).toFixed(2) = "123.01";
4477
+ * (0.009).toFixed(2) = "0.01";
4478
+ * but
4479
+ * (-0.005).toFixed(2) = "-0.01" (expecting 0);
4480
+ * (1.005).toFixed(2) = "1" (expecting 1.01).
4125
4481
  *
4126
4482
  * @param {number} number The number to round.
4127
- * @param {number} precision The rounding precision.
4483
+ * @param {number} precision The rounding precision, ie the result number
4484
+ * of digits after the comma.
4128
4485
  * @returns {number} The rounded number.
4129
4486
  */
4130
4487
  export declare function precisionRound(number: number, precision: number): number;
@@ -4253,10 +4610,12 @@ export declare class Rectangle {
4253
4610
  * Quantify a rectangle according to view information.
4254
4611
  *
4255
4612
  * @param {ViewController} viewController The associated view controller.
4613
+ * @param {Index} index The index at which to get the
4614
+ * image values.
4256
4615
  * @param {string[]} flags A list of stat values to calculate.
4257
4616
  * @returns {object} A quantification object.
4258
4617
  */
4259
- quantify(viewController: ViewController, flags: string[]): object;
4618
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
4260
4619
  #private;
4261
4620
  }
4262
4621
 
@@ -4304,6 +4663,24 @@ export declare class RescaleSlopeAndIntercept {
4304
4663
  #private;
4305
4664
  }
4306
4665
 
4666
+ /**
4667
+ * Response evaluation class.
4668
+ */
4669
+ export declare class ResponseEvaluation {
4670
+ /**
4671
+ * Current response.
4672
+ *
4673
+ * @type {DicomCode}
4674
+ */
4675
+ current: DicomCode;
4676
+ /**
4677
+ * Measurement of response (mm).
4678
+ *
4679
+ * @type {number}
4680
+ */
4681
+ measure: number;
4682
+ }
4683
+
4307
4684
  /**
4308
4685
  * RGB colour class.
4309
4686
  */
@@ -4334,6 +4711,14 @@ export declare class RGB {
4334
4711
  b: number;
4335
4712
  }
4336
4713
 
4714
+ /**
4715
+ * Convert RGB to its hex equivalent.
4716
+ *
4717
+ * @param {RGB} rgb The RGB object as {r,g,b}.
4718
+ * @returns {string} A string representing the hex color as '#ab01ef'.
4719
+ */
4720
+ export declare function rgbToHex(rgb: RGB): string;
4721
+
4337
4722
  /**
4338
4723
  * Region Of Interest shape.
4339
4724
  * Note: should be a closed path.
@@ -4380,9 +4765,9 @@ export declare class ROI {
4380
4765
  * a non-self-intersecting closed polygon.
4381
4766
  * Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}.
4382
4767
  *
4383
- * @returns {Point2D} The centroid point.
4768
+ * @returns {Point2D|undefined} The centroid point.
4384
4769
  */
4385
- getCentroid(): Point2D;
4770
+ getCentroid(): Point2D | undefined;
4386
4771
  #private;
4387
4772
  }
4388
4773
 
@@ -4685,6 +5070,12 @@ export declare class Tag {
4685
5070
  * @returns {string|undefined} The VR.
4686
5071
  */
4687
5072
  getVrFromDictionary(): string | undefined;
5073
+ /**
5074
+ * Get the multiplicity from the dicom dictionary.
5075
+ *
5076
+ * @returns {number|undefined} The multiplicity.
5077
+ */
5078
+ getMultiplicityFromDictionary(): number | undefined;
4688
5079
  /**
4689
5080
  * Get the tag name from the dicom dictionary.
4690
5081
  *
@@ -4694,23 +5085,6 @@ export declare class Tag {
4694
5085
  #private;
4695
5086
  }
4696
5087
 
4697
- /**
4698
- * Methods used to extract values from DICOM elements.
4699
- *
4700
- * Implemented as class and method to allow for override via its prototype.
4701
- */
4702
- export declare class TagValueExtractor {
4703
- /**
4704
- * Get the time.
4705
- *
4706
- * @param {Object<string, DataElement>} _elements The DICOM elements.
4707
- * @returns {number|undefined} The time value if available.
4708
- */
4709
- getTime(_elements: {
4710
- [x: string]: DataElement;
4711
- }): number | undefined;
4712
- }
4713
-
4714
5088
  /**
4715
5089
  * Toolbox controller.
4716
5090
  */
@@ -4871,7 +5245,7 @@ export declare const toolList: {
4871
5245
  * const group = new Konva.Group();
4872
5246
  * group.name('love-group');
4873
5247
  * group.visible(true);
4874
- * group.id(annotation.id);
5248
+ * group.id(annotation.trackingUid);
4875
5249
  * group.add(shape);
4876
5250
  * return group;
4877
5251
  * }
@@ -5172,23 +5546,23 @@ export declare class View {
5172
5546
  */
5173
5547
  getOrigin(position?: Point): Point3D;
5174
5548
  /**
5175
- * Set the current position.
5549
+ * Set the current position via an index.
5176
5550
  *
5177
- * @param {Point} position The new position.
5551
+ * @param {Index} index The new index.
5178
5552
  * @param {boolean} [silent] Flag to fire event or not.
5179
5553
  * @returns {boolean} False if not in bounds.
5180
5554
  * @fires View#positionchange
5181
5555
  */
5182
- setCurrentPosition(position: Point, silent?: boolean): boolean;
5556
+ setCurrentIndex(index: Index, silent?: boolean): boolean;
5183
5557
  /**
5184
- * Set the current index.
5558
+ * Set current position.
5185
5559
  *
5186
- * @param {Index} index The new index.
5560
+ * @param {Point} position The new position.
5187
5561
  * @param {boolean} [silent] Flag to fire event or not.
5188
5562
  * @returns {boolean} False if not in bounds.
5189
5563
  * @fires View#positionchange
5190
5564
  */
5191
- setCurrentIndex(index: Index, silent?: boolean): boolean;
5565
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
5192
5566
  /**
5193
5567
  * Set the view window/level.
5194
5568
  *
@@ -5260,7 +5634,7 @@ export declare class View {
5260
5634
  *
5261
5635
  * @returns {number} The index.
5262
5636
  */
5263
- getScrollIndex(): number;
5637
+ getScrollDimIndex(): number;
5264
5638
  /**
5265
5639
  * Is this view in the same orientation as the image aquisition.
5266
5640
  *
@@ -5356,6 +5730,12 @@ export declare class ViewController {
5356
5730
  * @returns {string} The modality.
5357
5731
  */
5358
5732
  getModality(): string;
5733
+ /**
5734
+ * Get the image SOP class UID.
5735
+ *
5736
+ * @returns {string|undefined} The uid.
5737
+ */
5738
+ getSopClassUid(): string | undefined;
5359
5739
  /**
5360
5740
  * Get the window/level presets names.
5361
5741
  *
@@ -5387,6 +5767,18 @@ export declare class ViewController {
5387
5767
  * @returns {boolean} True if the controler is playing.
5388
5768
  */
5389
5769
  isPlaying(): boolean;
5770
+ /**
5771
+ * Get the position helper.
5772
+ *
5773
+ * @returns {PositionHelper} The helper.
5774
+ */
5775
+ getPositionHelper(): PositionHelper;
5776
+ /**
5777
+ * Get a clone of the position helper.
5778
+ *
5779
+ * @returns {PositionHelper} The helper clone.
5780
+ */
5781
+ getPositionHelperClone(): PositionHelper;
5390
5782
  /**
5391
5783
  * Get the current position.
5392
5784
  *
@@ -5426,17 +5818,17 @@ export declare class ViewController {
5426
5818
  */
5427
5819
  getCurrentOrientedIndex(): Index;
5428
5820
  /**
5429
- * Get the scroll index.
5821
+ * Get the scroll dimension index.
5430
5822
  *
5431
5823
  * @returns {number} The index.
5432
5824
  */
5433
- getScrollIndex(): number;
5825
+ getScrollDimIndex(): number;
5434
5826
  /**
5435
- * Get the current scroll index value.
5827
+ * Get the current index scroll value.
5436
5828
  *
5437
- * @returns {object} The value.
5829
+ * @returns {number} The value.
5438
5830
  */
5439
- getCurrentScrollIndexValue(): object;
5831
+ getCurrentIndexScrollValue(): number;
5440
5832
  /**
5441
5833
  * Get the first origin or at a given position.
5442
5834
  *
@@ -5498,21 +5890,31 @@ export declare class ViewController {
5498
5890
  * @returns {string} The unit.
5499
5891
  */
5500
5892
  getPixelUnit(): string;
5893
+ /**
5894
+ * Get the image length unit.
5895
+ *
5896
+ * @returns {string} The unit.
5897
+ */
5898
+ getLengthUnit(): string;
5501
5899
  /**
5502
5900
  * Get some values from the associated image in a region.
5503
5901
  *
5504
5902
  * @param {Point2D} min Minimum point.
5505
5903
  * @param {Point2D} max Maximum point.
5904
+ * @param {Index} index The index at which to get the
5905
+ * image values (combined with min/max).
5506
5906
  * @returns {Array} A list of values.
5507
5907
  */
5508
- getImageRegionValues(min: Point2D, max: Point2D): any[];
5908
+ getImageRegionValues(min: Point2D, max: Point2D, index: Index): any[];
5509
5909
  /**
5510
5910
  * Get some values from the associated image in variable regions.
5511
5911
  *
5512
5912
  * @param {number[][][]} regions A list of [x, y] pairs (min, max).
5913
+ * @param {Index} index The index at which to get the
5914
+ * image values (combined with regions min/max).
5513
5915
  * @returns {Array} A list of values.
5514
5916
  */
5515
- getImageVariableRegionValues(regions: number[][][]): any[];
5917
+ getImageVariableRegionValues(regions: number[][][], index: Index): any[];
5516
5918
  /**
5517
5919
  * Can the image values be quantified?
5518
5920
  *
@@ -5635,62 +6037,6 @@ export declare class ViewController {
5635
6037
  * @returns {Vector3D} The 3D world offset.
5636
6038
  */
5637
6039
  getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
5638
- /**
5639
- * Get the current position incremented in the input direction.
5640
- *
5641
- * @param {number} dim The direction in which to increment.
5642
- * @returns {Point} The resulting point.
5643
- */
5644
- getIncrementPosition(dim: number): Point;
5645
- /**
5646
- * Get the current position decremented in the input direction.
5647
- *
5648
- * @param {number} dim The direction in which to decrement.
5649
- * @returns {Point} The resulting point.
5650
- */
5651
- getDecrementPosition(dim: number): Point;
5652
- /**
5653
- * Get the current position decremented in the scroll direction.
5654
- *
5655
- * @returns {Point} The resulting point.
5656
- */
5657
- getIncrementScrollPosition(): Point;
5658
- /**
5659
- * Get the current position decremented in the scroll direction.
5660
- *
5661
- * @returns {Point} The resulting point.
5662
- */
5663
- getDecrementScrollPosition(): Point;
5664
- /**
5665
- * Increment the provided dimension.
5666
- *
5667
- * @param {number} dim The dimension to increment.
5668
- * @param {boolean} [silent] Do not send event.
5669
- * @returns {boolean} False if not in bounds.
5670
- */
5671
- incrementIndex(dim: number, silent?: boolean): boolean;
5672
- /**
5673
- * Decrement the provided dimension.
5674
- *
5675
- * @param {number} dim The dimension to increment.
5676
- * @param {boolean} [silent] Do not send event.
5677
- * @returns {boolean} False if not in bounds.
5678
- */
5679
- decrementIndex(dim: number, silent?: boolean): boolean;
5680
- /**
5681
- * Decrement the scroll dimension index.
5682
- *
5683
- * @param {boolean} [silent] Do not send event.
5684
- * @returns {boolean} False if not in bounds.
5685
- */
5686
- decrementScrollIndex(silent?: boolean): boolean;
5687
- /**
5688
- * Increment the scroll dimension index.
5689
- *
5690
- * @param {boolean} [silent] Do not send event.
5691
- * @returns {boolean} False if not in bounds.
5692
- */
5693
- incrementScrollIndex(silent?: boolean): boolean;
5694
6040
  /**
5695
6041
  * Scroll play: loop through all slices.
5696
6042
  */