dwv 0.33.1 → 0.34.0-beta.1

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
@@ -12,6 +12,229 @@ export declare function addTagsToDictionary(group: string, tags: {
12
12
  [x: string]: string[];
13
13
  }): void;
14
14
 
15
+ /**
16
+ * Image annotation.
17
+ */
18
+ export declare class Annotation {
19
+ /**
20
+ * @param {ViewController} viewController The associated view controller.
21
+ */
22
+ constructor(viewController: ViewController);
23
+ /**
24
+ * The ID.
25
+ *
26
+ * 'Tracking Unique Identifier', 112040, DCM.
27
+ *
28
+ * @type {string}
29
+ */
30
+ id: string;
31
+ /**
32
+ * The reference image SOP UID.
33
+ *
34
+ * @type {string}
35
+ */
36
+ referenceSopUID: string;
37
+ /**
38
+ * The position: an Index converted to string.
39
+ *
40
+ * @type {string}
41
+ */
42
+ position: string;
43
+ /**
44
+ * The mathematical shape.
45
+ *
46
+ * @type {object}
47
+ */
48
+ mathShape: object;
49
+ /**
50
+ * The color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
51
+ *
52
+ * 'RGB R Component', 110834, DCM...
53
+ *
54
+ * @type {string}
55
+ */
56
+ colour: string;
57
+ /**
58
+ * Annotation quantification.
59
+ *
60
+ * @type {object}
61
+ */
62
+ quantification: object;
63
+ /**
64
+ * Text expression. Can contain variables surrounded with '{}' that will
65
+ * be extracted from the quantification object.
66
+ *
67
+ * 'Short label', 125309, DCM.
68
+ *
69
+ * @type {string}
70
+ */
71
+ textExpr: string;
72
+ /**
73
+ * Get the image origin for a image UID.
74
+ *
75
+ * @returns {Index|undefined} The origin index.
76
+ */
77
+ getOriginIndex(): Index | undefined;
78
+ /**
79
+ * Set the annotation text expression.
80
+ *
81
+ * @param {Object.<string, string>} labelText The list of label
82
+ * texts indexed by modality.
83
+ */
84
+ setTextExpr(labelText: {
85
+ [x: string]: string;
86
+ }): void;
87
+ /**
88
+ * Get the annotation label text by applying the
89
+ * text expression on the current quantification.
90
+ *
91
+ * @returns {string} The resulting text.
92
+ */
93
+ getText(): string;
94
+ /**
95
+ * Update the annotation quantification.
96
+ */
97
+ updateQuantification(): void;
98
+ /**
99
+ * Get the math shape associated factory.
100
+ *
101
+ * @returns {object} The factory.
102
+ */
103
+ getFactory(): object;
104
+ #private;
105
+ }
106
+
107
+ /**
108
+ * {@link Annotation} factory.
109
+ */
110
+ export declare class AnnotationFactory {
111
+ /**
112
+ * Get a warning string if elements are not as expected.
113
+ * Created by checkElements.
114
+ *
115
+ * @returns {string|undefined} The warning.
116
+ */
117
+ getWarning(): string | undefined;
118
+ /**
119
+ * Check dicom elements. Throws an error if not suitable.
120
+ *
121
+ * @param {Object<string, DataElement>} dataElements The DICOM data elements.
122
+ * @returns {string|undefined} A possible warning.
123
+ */
124
+ checkElements(dataElements: {
125
+ [x: string]: DataElement;
126
+ }): string | undefined;
127
+ /**
128
+ * Get an {@link Annotation} object from the read DICOM file.
129
+ *
130
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
131
+ * @param {ViewController} viewController The associated view controller.
132
+ * @returns {AnnotationList} A new annotation list.
133
+ */
134
+ create(dataElements: {
135
+ [x: string]: DataElement;
136
+ }, viewController: ViewController): AnnotationList;
137
+ /**
138
+ * Convert an annotation list into a DICOM SR object.
139
+ *
140
+ * @param {AnnotationList} annotationList The annotation list.
141
+ * @param {Object<string, any>} [extraTags] Optional list of extra tags.
142
+ * @returns {Object<string, DataElement>} A list of dicom elements.
143
+ */
144
+ toDicom(annotationList: AnnotationList, extraTags?: {
145
+ [x: string]: any;
146
+ }): {
147
+ [x: string]: DataElement;
148
+ };
149
+ #private;
150
+ }
151
+
152
+ /**
153
+ * Annotation list.
154
+ */
155
+ export declare class AnnotationList {
156
+ /**
157
+ * @param {Annotation[]} [list] Optional list, will
158
+ * create new if not provided.
159
+ */
160
+ constructor(list?: Annotation[]);
161
+ /**
162
+ * Get the annotation list as an array.
163
+ *
164
+ * @returns {Annotation[]} The array.
165
+ */
166
+ getList(): Annotation[];
167
+ /**
168
+ * Get the number of annotations of this list.
169
+ *
170
+ * @returns {number} The number of annotations.
171
+ */
172
+ getLength(): number;
173
+ /**
174
+ * Add a new annotation.
175
+ *
176
+ * @param {Annotation} annotation The annotation to add.
177
+ */
178
+ add(annotation: Annotation): void;
179
+ /**
180
+ * Update an existing annotation.
181
+ *
182
+ * @param {Annotation} annotation The annotation to update.
183
+ */
184
+ update(annotation: Annotation): void;
185
+ /**
186
+ * Remoave an annotation.
187
+ *
188
+ * @param {string} id The id of the annotation to remove.
189
+ */
190
+ remove(id: string): void;
191
+ /**
192
+ * Find an annotation.
193
+ *
194
+ * @param {string} id The id of the annotation to find.
195
+ * @returns {Annotation|undefined} The found annotation.
196
+ */
197
+ find(id: string): Annotation | undefined;
198
+ /**
199
+ * Check if this list contains a meta data value.
200
+ *
201
+ * @param {string} key The key to check.
202
+ * @returns {boolean} True if the meta data is present.
203
+ */
204
+ hasMeta(key: string): boolean;
205
+ /**
206
+ * Get a meta data value.
207
+ *
208
+ * @param {string} key The meta data key.
209
+ * @returns {string} The meta data value.
210
+ */
211
+ getMeta(key: string): string;
212
+ /**
213
+ * Set a meta data.
214
+ *
215
+ * @param {string} key The meta data key.
216
+ * @param {string} value The value of the meta data.
217
+ */
218
+ setMeta(key: string, value: string): void;
219
+ /**
220
+ * Add an event listener to this class.
221
+ *
222
+ * @param {string} type The event type.
223
+ * @param {Function} callback The function associated with the provided
224
+ * event type, will be called with the fired event.
225
+ */
226
+ addEventListener(type: string, callback: Function): void;
227
+ /**
228
+ * Remove an event listener from this class.
229
+ *
230
+ * @param {string} type The event type.
231
+ * @param {Function} callback The function associated with the provided
232
+ * event type.
233
+ */
234
+ removeEventListener(type: string, callback: Function): void;
235
+ #private;
236
+ }
237
+
15
238
  /**
16
239
  * List of ViewConfigs indexed by dataIds.
17
240
  *
@@ -412,19 +635,22 @@ export declare class App {
412
635
  /**
413
636
  * Set the drawings of the active layer group.
414
637
  *
415
- * @param {Array} drawings An array of drawings.
416
- * @param {Array} drawingsDetails An array of drawings details.
638
+ * @deprecated
639
+ * @param {Array} _drawings An array of drawings.
640
+ * @param {Array} _drawingsDetails An array of drawings details.
417
641
  */
418
- setDrawings(drawings: any[], drawingsDetails: any[]): void;
642
+ setDrawings(_drawings: any[], _drawingsDetails: any[]): void;
419
643
  /**
420
644
  * Get the JSON state of the app.
421
645
  *
646
+ * @deprecated
422
647
  * @returns {string} The state of the app as a JSON string.
423
648
  */
424
649
  getJsonState(): string;
425
650
  /**
426
651
  * Apply a JSON state to this app.
427
652
  *
653
+ * @deprecated
428
654
  * @param {string} jsonState The state of the app as a JSON string.
429
655
  */
430
656
  applyJsonState(jsonState: string): void;
@@ -532,6 +758,13 @@ export declare class App {
532
758
  * @param {string} dataId The data id.
533
759
  */
534
760
  toggleOverlayListeners(dataId: string): void;
761
+ /**
762
+ * Add a draw layer.
763
+ *
764
+ * @param {string} dataId The data id.
765
+ * @param {ViewConfig} viewConfig The data view config.
766
+ */
767
+ addDrawLayer(dataId: string, viewConfig: ViewConfig): void;
535
768
  #private;
536
769
  }
537
770
 
@@ -734,10 +967,10 @@ export declare namespace customUI {
734
967
  /**
735
968
  * Open a dialogue to edit roi data. Defaults to window.prompt.
736
969
  *
737
- * @param {object} data The roi data.
970
+ * @param {Annotation} annotation The roi data.
738
971
  * @param {Function} callback The callback to launch on dialogue exit.
739
972
  */
740
- export function openRoiDialog(data: any, callback: Function): void;
973
+ export function openRoiDialog(annotation: Annotation, callback: Function): void;
741
974
  }
742
975
 
743
976
  /**
@@ -880,6 +1113,7 @@ export declare class DeleteSegmentCommand {
880
1113
  * DICOM code: item of a basic code sequence.
881
1114
  *
882
1115
  * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_8.8.html}.
1116
+ * List: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part16/chapter_d.html}.
883
1117
  */
884
1118
  export declare class DicomCode {
885
1119
  /**
@@ -887,35 +1121,41 @@ export declare class DicomCode {
887
1121
  */
888
1122
  constructor(meaning: string);
889
1123
  /**
890
- * Code meaning (0008,0104).
1124
+ * Code meaning.
891
1125
  *
892
1126
  * @type {string}
893
1127
  */
894
1128
  meaning: string;
895
1129
  /**
896
- * Code value (0008,0100).
1130
+ * Code value.
897
1131
  *
898
1132
  * @type {string|undefined}
899
1133
  */
900
1134
  value: string | undefined;
901
1135
  /**
902
- * Long code value (0008,0119).
1136
+ * Long code value.
903
1137
  *
904
1138
  * @type {string|undefined}
905
1139
  */
906
1140
  longValue: string | undefined;
907
1141
  /**
908
- * URN code value (0008,0120).
1142
+ * URN code value.
909
1143
  *
910
1144
  * @type {string|undefined}
911
1145
  */
912
1146
  urnValue: string | undefined;
913
1147
  /**
914
- * Coding scheme designator (0008,0102).
1148
+ * Coding scheme designator.
915
1149
  *
916
1150
  * @type {string|undefined}
917
1151
  */
918
1152
  schemeDesignator: string | undefined;
1153
+ /**
1154
+ * Get a string representation of this object.
1155
+ *
1156
+ * @returns {string} The code as string.
1157
+ */
1158
+ toString(): string;
919
1159
  }
920
1160
 
921
1161
  /**
@@ -981,6 +1221,55 @@ export declare class DicomParser {
981
1221
  #private;
982
1222
  }
983
1223
 
1224
+ /**
1225
+ * DICOM SR content: item of a SR content sequence.
1226
+ *
1227
+ * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.17.3.html}.
1228
+ */
1229
+ export declare class DicomSRContent {
1230
+ /**
1231
+ * @param {string} valueType The content item value type.
1232
+ */
1233
+ constructor(valueType: string);
1234
+ /**
1235
+ * Value type.
1236
+ *
1237
+ * @type {string}
1238
+ */
1239
+ valueType: string;
1240
+ /**
1241
+ * Concept name code.
1242
+ *
1243
+ * @type {DicomCode|undefined}
1244
+ */
1245
+ conceptNameCode: DicomCode | undefined;
1246
+ /**
1247
+ * Relationship Type.
1248
+ *
1249
+ * @type {string}
1250
+ */
1251
+ relationshipType: string;
1252
+ /**
1253
+ * Content sequence (0040,A730).
1254
+ *
1255
+ * @type {DicomSRContent[]|undefined}
1256
+ */
1257
+ contentSequence: DicomSRContent[] | undefined;
1258
+ /**
1259
+ * Value.
1260
+ *
1261
+ * @type {object}
1262
+ */
1263
+ value: object;
1264
+ /**
1265
+ * Get a string representation of this object.
1266
+ *
1267
+ * @param {string} [prefix] An optional prefix for recursive content.
1268
+ * @returns {string} The object as string.
1269
+ */
1270
+ toString(prefix?: string): string;
1271
+ }
1272
+
984
1273
  /**
985
1274
  * DICOM writer.
986
1275
  *
@@ -1070,135 +1359,70 @@ export declare class DicomWriter {
1070
1359
  */
1071
1360
  export declare class DrawController {
1072
1361
  /**
1073
- * @param {DrawLayer} drawLayer The draw layer.
1074
- */
1075
- constructor(drawLayer: DrawLayer);
1076
- /**
1077
- * Get the current position group.
1078
- *
1079
- * @returns {Konva.Group|undefined} The Konva.Group.
1080
- */
1081
- getCurrentPosGroup(): Konva.Group | undefined;
1082
- /**
1083
- * Reset: clear the layers array.
1084
- */
1085
- reset(): void;
1086
- /**
1087
- * Get a Konva group using its id.
1088
- *
1089
- * @param {string} id The group id.
1090
- * @returns {object|undefined} The Konva group.
1362
+ * @param {AnnotationList} [list] Optional annotation list.
1091
1363
  */
1092
- getGroup(id: string): object | undefined;
1364
+ constructor(list?: AnnotationList);
1093
1365
  /**
1094
- * Activate the current draw layer.
1366
+ * Get an annotation.
1095
1367
  *
1096
- * @param {Index} index The current position.
1097
- * @param {number} scrollIndex The scroll index.
1368
+ * @param {string} id The annotation id.
1369
+ * @returns {Annotation|undefined} The annotation.
1098
1370
  */
1099
- activateDrawLayer(index: Index, scrollIndex: number): void;
1371
+ getAnnotation(id: string): Annotation | undefined;
1100
1372
  /**
1101
- * Get a list of drawing display details.
1373
+ * Get the annotation list.
1102
1374
  *
1103
- * @returns {DrawDetails[]} A list of draw details.
1375
+ * @returns {AnnotationList} The list.
1104
1376
  */
1105
- getDrawDisplayDetails(): DrawDetails[];
1377
+ getAnnotationList(): AnnotationList;
1106
1378
  /**
1107
- * Get a list of drawing store details. Used in state.
1379
+ * Add an annotation.
1108
1380
  *
1109
- * @returns {object} A list of draw details including id, text, quant...
1110
- * TODO Unify with getDrawDisplayDetails?
1381
+ * @param {Annotation} annotation The annotation to add.
1111
1382
  */
1112
- getDrawStoreDetails(): object;
1383
+ addAnnotation(annotation: Annotation): void;
1113
1384
  /**
1114
- * Set the drawings on the current stage.
1385
+ * Update an anotation from the list.
1115
1386
  *
1116
- * @param {Array} drawings An array of drawings.
1117
- * @param {DrawDetails[]} drawingsDetails An array of drawings details.
1118
- * @param {object} cmdCallback The DrawCommand callback.
1119
- * @param {object} exeCallback The callback to call once the
1120
- * DrawCommand has been executed.
1387
+ * @param {Annotation} annotation The annotation to update.
1121
1388
  */
1122
- setDrawings(drawings: any[], drawingsDetails: DrawDetails[], cmdCallback: object, exeCallback: object): void;
1389
+ updateAnnotation(annotation: Annotation): void;
1123
1390
  /**
1124
- * Update a drawing from its details.
1391
+ * Remove an anotation for the list.
1125
1392
  *
1126
- * @param {DrawDetails} drawDetails Details of the drawing to update.
1393
+ * @param {string} id The id of the annotation to remove.
1127
1394
  */
1128
- updateDraw(drawDetails: DrawDetails): void;
1395
+ removeAnnotation(id: string): void;
1129
1396
  /**
1130
- * Delete a Draw from the stage.
1397
+ * Check if the annotation list contains a meta data value.
1131
1398
  *
1132
- * @param {Konva.Group} group The group to delete.
1133
- * @param {object} cmdCallback The DeleteCommand callback.
1134
- * @param {object} exeCallback The callback to call once the
1135
- * DeleteCommand has been executed.
1399
+ * @param {string} key The key to check.
1400
+ * @returns {boolean} True if the meta data is present.
1136
1401
  */
1137
- deleteDrawGroup(group: Konva.Group, cmdCallback: object, exeCallback: object): void;
1402
+ hasAnnotationMeta(key: string): boolean;
1138
1403
  /**
1139
- * Delete a Draw from the stage.
1404
+ * Set an annotation meta data.
1140
1405
  *
1141
- * @param {string} id The id of the group to delete.
1142
- * @param {Function} cmdCallback The DeleteCommand callback.
1143
- * @param {Function} exeCallback The callback to call once the
1144
- * DeleteCommand has been executed.
1145
- * @returns {boolean} False if the group cannot be found.
1406
+ * @param {string} key The meta data to set.
1407
+ * @param {string} value The value of the meta data.
1146
1408
  */
1147
- deleteDraw(id: string, cmdCallback: Function, exeCallback: Function): boolean;
1409
+ setAnnotationMeta(key: string, value: string): void;
1148
1410
  /**
1149
- * Delete all Draws from the stage.
1411
+ * Get draw store details.
1150
1412
  *
1151
- * @param {Function} cmdCallback The DeleteCommand callback.
1152
- * @param {Function} exeCallback The callback to call once the
1153
- * DeleteCommand has been executed.
1413
+ * @deprecated
1154
1414
  */
1155
- deleteDraws(cmdCallback: Function, exeCallback: Function): void;
1156
- /**
1157
- * Get the total number of draws
1158
- * (at all positions).
1159
- *
1160
- * @returns {number} The total number of draws.
1161
- */
1162
- getNumberOfDraws(): number;
1415
+ getDrawStoreDetails(): void;
1163
1416
  #private;
1164
1417
  }
1165
1418
 
1166
1419
  /**
1167
- * Draw details.
1420
+ * Debug function to output the layer hierarchy as text.
1421
+ *
1422
+ * @param {object} layer The Konva layer.
1423
+ * @param {string} prefix A display prefix (used in recursion).
1424
+ * @returns {string} A text representation of the hierarchy.
1168
1425
  */
1169
- export declare class DrawDetails {
1170
- /**
1171
- * The draw ID.
1172
- *
1173
- * @type {number}
1174
- */
1175
- id: number;
1176
- /**
1177
- * The draw position: an Index converted to string.
1178
- *
1179
- * @type {string}
1180
- */
1181
- position: string;
1182
- /**
1183
- * The draw type.
1184
- *
1185
- * @type {string}
1186
- */
1187
- type: string;
1188
- /**
1189
- * The draw color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
1190
- *
1191
- * @type {string}
1192
- */
1193
- color: string;
1194
- /**
1195
- * The draw meta.
1196
- *
1197
- * @type {DrawMeta}
1198
- */
1199
- meta: DrawMeta;
1200
- }
1201
-
1202
1426
  /**
1203
1427
  * Draw layer.
1204
1428
  */
@@ -1329,9 +1553,17 @@ export declare class DrawLayer {
1329
1553
  *
1330
1554
  * @param {Scalar2D} size The image size as {x,y}.
1331
1555
  * @param {Scalar2D} spacing The image spacing as {x,y}.
1556
+ */
1557
+ initialise(size: Scalar2D, spacing: Scalar2D): void;
1558
+ /**
1559
+ * Set the annotation list.
1560
+ *
1561
+ * @param {AnnotationList} list The annotation list.
1332
1562
  * @param {string} dataId The associated data id.
1563
+ * @param {object} cmdCallback The command callback.
1564
+ * @param {object} exeCallback The exe callback.
1333
1565
  */
1334
- initialise(size: Scalar2D, spacing: Scalar2D, dataId: string): void;
1566
+ setAnnotationList(list: AnnotationList, dataId: string, cmdCallback: object, exeCallback: object): void;
1335
1567
  /**
1336
1568
  * Fit the layer to its parent container.
1337
1569
  *
@@ -1358,17 +1590,17 @@ export declare class DrawLayer {
1358
1590
  * Delete a Draw from the stage.
1359
1591
  *
1360
1592
  * @param {string} id The id of the group to delete.
1361
- * @param {object} exeCallback The callback to call once the
1593
+ * @param {Function} exeCallback The callback to call once the
1362
1594
  * DeleteCommand has been executed.
1363
1595
  */
1364
- deleteDraw(id: string, exeCallback: object): void;
1596
+ deleteDraw(id: string, exeCallback: Function): void;
1365
1597
  /**
1366
1598
  * Delete all Draws from the stage.
1367
1599
  *
1368
- * @param {object} exeCallback The callback to call once the
1600
+ * @param {Function} exeCallback The callback to call once the
1369
1601
  * DeleteCommand has been executed.
1370
1602
  */
1371
- deleteDraws(exeCallback: object): void;
1603
+ deleteDraws(exeCallback: Function): void;
1372
1604
  /**
1373
1605
  * Get the total number of draws of this layer
1374
1606
  * (at all positions).
@@ -1392,6 +1624,32 @@ export declare class DrawLayer {
1392
1624
  * @returns {boolean} True if the position was updated.
1393
1625
  */
1394
1626
  setCurrentPosition(position: Point, index: Index): boolean;
1627
+ /**
1628
+ * Activate the current draw layer.
1629
+ *
1630
+ * @param {Index} index The current position.
1631
+ * @param {number} scrollIndex The scroll index.
1632
+ */
1633
+ activateDrawLayer(index: Index, scrollIndex: number): void;
1634
+ /**
1635
+ * Get the current position group.
1636
+ *
1637
+ * @returns {Konva.Group|undefined} The Konva.Group.
1638
+ */
1639
+ getCurrentPosGroup(): Konva.Group | undefined;
1640
+ /**
1641
+ * Get the non current position groups. Used to stop listeners.
1642
+ *
1643
+ * @returns {object[]} The groups that do not have the current position id.
1644
+ */
1645
+ getNonCurrentPosGroup(): object[];
1646
+ /**
1647
+ * Get a Konva group using its id.
1648
+ *
1649
+ * @param {string} id The group id.
1650
+ * @returns {object|undefined} The Konva group.
1651
+ */
1652
+ getGroup(id: string): object | undefined;
1395
1653
  /**
1396
1654
  * Add an event listener to this class.
1397
1655
  *
@@ -1411,25 +1669,6 @@ export declare class DrawLayer {
1411
1669
  #private;
1412
1670
  }
1413
1671
 
1414
- /**
1415
- * Draw meta data.
1416
- */
1417
- export declare class DrawMeta {
1418
- /**
1419
- * Draw quantification.
1420
- *
1421
- * @type {object}
1422
- */
1423
- quantification: object;
1424
- /**
1425
- * Draw text expression. Can contain variables surrounded with '{}' that will
1426
- * be extracted from the quantification object.
1427
- *
1428
- * @type {string}
1429
- */
1430
- textExpr: string;
1431
- }
1432
-
1433
1672
  /**
1434
1673
  * 2D/3D Geometry class.
1435
1674
  */
@@ -1619,6 +1858,16 @@ export declare class Geometry {
1619
1858
  */
1620
1859
  export declare function getDefaultDicomSegJson(): object;
1621
1860
 
1861
+ /**
1862
+ * Get a simple dicom element item from a content item object.
1863
+ *
1864
+ * @param {DicomSRContent} content The content item object.
1865
+ * @returns {Object<string, any>} The item as a list of (key, value) pairs.
1866
+ */
1867
+ export declare function getDicomSRContentItem(content: DicomSRContent): {
1868
+ [x: string]: any;
1869
+ };
1870
+
1622
1871
  /**
1623
1872
  * List of DICOM data elements indexed via a 8 character string formed from
1624
1873
  * the group and element numbers.
@@ -1700,6 +1949,16 @@ export declare function getPixelDataTag(): Tag;
1700
1949
  */
1701
1950
  export declare function getReverseOrientation(ori: string): string;
1702
1951
 
1952
+ /**
1953
+ * Get a content item object from a dicom element.
1954
+ *
1955
+ * @param {Object<string, DataElement>} dataElements The dicom element.
1956
+ * @returns {DicomSRContent} A content item object.
1957
+ */
1958
+ export declare function getSRContent(dataElements: {
1959
+ [x: string]: DataElement;
1960
+ }): DicomSRContent;
1961
+
1703
1962
  /**
1704
1963
  * Split a group-element key used to store DICOM elements.
1705
1964
  *
@@ -1817,6 +2076,13 @@ declare class Image_2 {
1817
2076
  * @returns {string} The UID.
1818
2077
  */
1819
2078
  getImageUid(index?: Index): string;
2079
+ /**
2080
+ * Get the image origin for a image UID.
2081
+ *
2082
+ * @param {string} uid The UID.
2083
+ * @returns {Point3D|undefined} The origin.
2084
+ */
2085
+ getOriginForImageUid(uid: string): Point3D | undefined;
1820
2086
  /**
1821
2087
  * Check if this image includes the input uids.
1822
2088
  *
@@ -3224,6 +3490,13 @@ export declare class Point2D {
3224
3490
  * @returns {string} The point as a string.
3225
3491
  */
3226
3492
  toString(): string;
3493
+ /**
3494
+ * Get the distance to another Point2D.
3495
+ *
3496
+ * @param {Point2D} point2D The input point.
3497
+ * @returns {number} Ths distance to the input point.
3498
+ */
3499
+ getDistance(point2D: Point2D): number;
3227
3500
  #private;
3228
3501
  }
3229
3502
 
@@ -4043,6 +4316,19 @@ export declare class View {
4043
4316
  * @returns {Index} The current index.
4044
4317
  */
4045
4318
  getCurrentIndex(): Index;
4319
+ /**
4320
+ * Get the SOP image UID of the current image.
4321
+ *
4322
+ * @returns {string} The UID.
4323
+ */
4324
+ getCurrentImageUid(): string;
4325
+ /**
4326
+ * Get the image origin for a image UID.
4327
+ *
4328
+ * @param {string} uid The UID.
4329
+ * @returns {Index|undefined} The origin index.
4330
+ */
4331
+ getOriginIndexForImageUid(uid: string): Index | undefined;
4046
4332
  /**
4047
4333
  * Check if the current position (default) or
4048
4334
  * the provided position is in bounds.
@@ -4213,9 +4499,8 @@ export declare class ViewConfig {
4213
4499
  export declare class ViewController {
4214
4500
  /**
4215
4501
  * @param {View} view The associated view.
4216
- * @param {string} dataId The associated data id.
4217
4502
  */
4218
- constructor(view: View, dataId: string);
4503
+ constructor(view: View);
4219
4504
  /**
4220
4505
  * Get the plane helper.
4221
4506
  *
@@ -4281,6 +4566,19 @@ export declare class ViewController {
4281
4566
  * @returns {Index} The current index.
4282
4567
  */
4283
4568
  getCurrentIndex(): Index;
4569
+ /**
4570
+ * Get the SOP image UID of the current image.
4571
+ *
4572
+ * @returns {string} The UID.
4573
+ */
4574
+ getCurrentImageUid(): string;
4575
+ /**
4576
+ * Get the image origin index for a image UID.
4577
+ *
4578
+ * @param {string} uid The UID.
4579
+ * @returns {Index|undefined} The origin index.
4580
+ */
4581
+ getOriginIndexForImageUid(uid: string): Index | undefined;
4284
4582
  /**
4285
4583
  * Get the current oriented index.
4286
4584
  *
@@ -4324,9 +4622,8 @@ export declare class ViewController {
4324
4622
  * Set the associated image.
4325
4623
  *
4326
4624
  * @param {Image} img The associated image.
4327
- * @param {string} dataId The data id of the image.
4328
4625
  */
4329
- setImage(img: Image_2, dataId: string): void;
4626
+ setImage(img: Image_2): void;
4330
4627
  /**
4331
4628
  * Get the current view (2D) spacing.
4332
4629
  *
@@ -4347,6 +4644,12 @@ export declare class ViewController {
4347
4644
  * @returns {string} The unit.
4348
4645
  */
4349
4646
  getPixelUnit(): string;
4647
+ /**
4648
+ * Get the image study instance UID.
4649
+ *
4650
+ * @returns {string} The UID.
4651
+ */
4652
+ getStudyInstanceUID(): string;
4350
4653
  /**
4351
4654
  * Get some values from the associated image in a region.
4352
4655
  *
@@ -4593,22 +4896,6 @@ export declare class ViewController {
4593
4896
  * @param {ViewLayer} viewLayer The layer to bind.
4594
4897
  */
4595
4898
  unbindImageAndLayer(viewLayer: ViewLayer): void;
4596
- /**
4597
- * Add an event listener to this class.
4598
- *
4599
- * @param {string} type The event type.
4600
- * @param {Function} callback The function associated with the provided
4601
- * event type, will be called with the fired event.
4602
- */
4603
- addEventListener(type: string, callback: Function): void;
4604
- /**
4605
- * Remove an event listener from this class.
4606
- *
4607
- * @param {string} type The event type.
4608
- * @param {Function} callback The function associated with the provided
4609
- * event type.
4610
- */
4611
- removeEventListener(type: string, callback: Function): void;
4612
4899
  #private;
4613
4900
  }
4614
4901