dwv 0.34.0-beta.7 → 0.34.0-beta.9

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
@@ -19,8 +19,6 @@ export declare class Annotation {
19
19
  /**
20
20
  * The ID.
21
21
  *
22
- * 'Tracking Unique Identifier', 112040, DCM.
23
- *
24
22
  * @type {string}
25
23
  */
26
24
  id: string;
@@ -30,12 +28,6 @@ export declare class Annotation {
30
28
  * @type {string}
31
29
  */
32
30
  referenceSopUID: string;
33
- /**
34
- * The position: an Index converted to string.
35
- *
36
- * @type {string}
37
- */
38
- position: string;
39
31
  /**
40
32
  * The mathematical shape.
41
33
  *
@@ -45,38 +37,35 @@ export declare class Annotation {
45
37
  /**
46
38
  * Additional points used to define the annotation.
47
39
  *
48
- * @type {Point2D[]}
40
+ * @type {Point2D[]|undefined}
49
41
  */
50
- referencePoints: Point2D[];
42
+ referencePoints: Point2D[] | undefined;
51
43
  /**
52
44
  * The color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
53
45
  *
54
- * 'RGB R Component', 110834, DCM...
55
- *
56
- * @type {string}
46
+ * @type {string|undefined}
57
47
  */
58
- colour: string;
48
+ colour: string | undefined;
59
49
  /**
60
50
  * Annotation quantification.
61
51
  *
62
- * @type {object}
52
+ * @type {object|undefined}
63
53
  */
64
- quantification: object;
54
+ quantification: object | undefined;
65
55
  /**
66
56
  * Text expression. Can contain variables surrounded with '{}' that will
67
57
  * be extracted from the quantification object.
68
58
  *
69
- * 'Short label', 125309, DCM.
70
- *
71
- * @type {string}
59
+ * @type {string|undefined}
72
60
  */
73
- textExpr: string;
61
+ textExpr: string | undefined;
74
62
  /**
75
- * Label position.
63
+ * Label position. If undefined, the default shape
64
+ * label position will be used.
76
65
  *
77
- * @type {Point2D}
66
+ * @type {Point2D|undefined}
78
67
  */
79
- labelPosition: Point2D;
68
+ labelPosition: Point2D | undefined;
80
69
  /**
81
70
  * Set the associated view controller.
82
71
  *
@@ -124,50 +113,6 @@ export declare class Annotation {
124
113
  #private;
125
114
  }
126
115
 
127
- /**
128
- * {@link Annotation} factory.
129
- */
130
- export declare class AnnotationFactory {
131
- /**
132
- * Get a warning string if elements are not as expected.
133
- * Created by checkElements.
134
- *
135
- * @returns {string|undefined} The warning.
136
- */
137
- getWarning(): string | undefined;
138
- /**
139
- * Check dicom elements. Throws an error if not suitable.
140
- *
141
- * @param {Object<string, DataElement>} dataElements The DICOM data elements.
142
- * @returns {string|undefined} A possible warning.
143
- */
144
- checkElements(dataElements: {
145
- [x: string]: DataElement;
146
- }): string | undefined;
147
- /**
148
- * Get an {@link Annotation} object from the read DICOM file.
149
- *
150
- * @param {Object<string, DataElement>} dataElements The DICOM tags.
151
- * @returns {AnnotationGroup} A new annotation group.
152
- */
153
- create(dataElements: {
154
- [x: string]: DataElement;
155
- }): AnnotationGroup;
156
- /**
157
- * Convert an annotation group into a DICOM SR object.
158
- *
159
- * @param {AnnotationGroup} annotationGroup The annotation group.
160
- * @param {Object<string, any>} [extraTags] Optional list of extra tags.
161
- * @returns {Object<string, DataElement>} A list of dicom elements.
162
- */
163
- toDicom(annotationGroup: AnnotationGroup, extraTags?: {
164
- [x: string]: any;
165
- }): {
166
- [x: string]: DataElement;
167
- };
168
- #private;
169
- }
170
-
171
116
  /**
172
117
  * Annotation group.
173
118
  */
@@ -189,6 +134,18 @@ export declare class AnnotationGroup {
189
134
  * @returns {number} The number of annotations.
190
135
  */
191
136
  getLength(): number;
137
+ /**
138
+ * Check if the annotation group is editable.
139
+ *
140
+ * @returns {boolean} True if editable.
141
+ */
142
+ isEditable(): boolean;
143
+ /**
144
+ * Set the annotation group editability.
145
+ *
146
+ * @param {boolean} flag True to make the annotation group editable.
147
+ */
148
+ setEditable(flag: boolean): void;
192
149
  /**
193
150
  * Add a new annotation.
194
151
  *
@@ -199,8 +156,9 @@ export declare class AnnotationGroup {
199
156
  * Update an existing annotation.
200
157
  *
201
158
  * @param {Annotation} annotation The annotation to update.
159
+ * @param {string[]} [propKeys] Optional properties that got updated.
202
160
  */
203
- update(annotation: Annotation): void;
161
+ update(annotation: Annotation, propKeys?: string[]): void;
204
162
  /**
205
163
  * Remove an annotation.
206
164
  *
@@ -268,6 +226,50 @@ export declare class AnnotationGroup {
268
226
  #private;
269
227
  }
270
228
 
229
+ /**
230
+ * {@link AnnotationGroup} factory.
231
+ */
232
+ export declare class AnnotationGroupFactory {
233
+ /**
234
+ * Get a warning string if elements are not as expected.
235
+ * Created by checkElements.
236
+ *
237
+ * @returns {string|undefined} The warning.
238
+ */
239
+ getWarning(): string | undefined;
240
+ /**
241
+ * Check dicom elements. Throws an error if not suitable.
242
+ *
243
+ * @param {Object<string, DataElement>} dataElements The DICOM data elements.
244
+ * @returns {string|undefined} A possible warning.
245
+ */
246
+ checkElements(dataElements: {
247
+ [x: string]: DataElement;
248
+ }): string | undefined;
249
+ /**
250
+ * Get an {@link Annotation} object from the read DICOM file.
251
+ *
252
+ * @param {Object<string, DataElement>} dataElements The DICOM tags.
253
+ * @returns {AnnotationGroup} A new annotation group.
254
+ */
255
+ create(dataElements: {
256
+ [x: string]: DataElement;
257
+ }): AnnotationGroup;
258
+ /**
259
+ * Convert an annotation group into a DICOM SR object.
260
+ *
261
+ * @param {AnnotationGroup} annotationGroup The annotation group.
262
+ * @param {Object<string, any>} [extraTags] Optional list of extra tags.
263
+ * @returns {Object<string, DataElement>} A list of dicom elements.
264
+ */
265
+ toDicom(annotationGroup: AnnotationGroup, extraTags?: {
266
+ [x: string]: any;
267
+ }): {
268
+ [x: string]: DataElement;
269
+ };
270
+ #private;
271
+ }
272
+
271
273
  /**
272
274
  * List of ViewConfigs indexed by dataIds.
273
275
  *
@@ -1448,6 +1450,18 @@ export declare class DrawController {
1448
1450
  * @returns {AnnotationGroup} The list.
1449
1451
  */
1450
1452
  getAnnotationGroup(): AnnotationGroup;
1453
+ /**
1454
+ * Check if the annotation group is editable.
1455
+ *
1456
+ * @returns {boolean} True if editable.
1457
+ */
1458
+ isAnnotationGroupEditable(): boolean;
1459
+ /**
1460
+ * Set the annotation group editability.
1461
+ *
1462
+ * @param {boolean} flag True to make the annotation group editable.
1463
+ */
1464
+ setAnnotationGroupEditable(flag: boolean): void;
1451
1465
  /**
1452
1466
  * Add an annotation.
1453
1467
  *
@@ -1458,8 +1472,9 @@ export declare class DrawController {
1458
1472
  * Update an anotation from the list.
1459
1473
  *
1460
1474
  * @param {Annotation} annotation The annotation to update.
1475
+ * @param {string[]} [propKeys] Optional properties that got updated.
1461
1476
  */
1462
- updateAnnotation(annotation: Annotation): void;
1477
+ updateAnnotation(annotation: Annotation, propKeys?: string[]): void;
1463
1478
  /**
1464
1479
  * Remove an anotation for the list.
1465
1480
  *
@@ -1473,6 +1488,17 @@ export declare class DrawController {
1473
1488
  * @param {Function} exeCallback The undo stack callback.
1474
1489
  */
1475
1490
  removeAnnotationWithCommand(id: string, exeCallback: Function): void;
1491
+ /**
1492
+ * Update an annotation via an update command (triggers draw actions).
1493
+ *
1494
+ * @param {string} id The annotation id.
1495
+ * @param {object} originalProps The original annotation properties
1496
+ * that will be updated.
1497
+ * @param {object} newProps The new annotation properties
1498
+ * that will replace the original ones.
1499
+ * @param {Function} exeCallback The undo stack callback.
1500
+ */
1501
+ updateAnnotationWithCommand(id: string, originalProps: object, newProps: object, exeCallback: Function): void;
1476
1502
  /**
1477
1503
  * Remove all annotations via remove commands (triggers draw actions).
1478
1504
  *
@@ -1664,19 +1690,28 @@ export declare class DrawLayer {
1664
1690
  */
1665
1691
  fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void;
1666
1692
  /**
1667
- * Check the visibility of a given group.
1693
+ * Check the visibility of an annotation.
1694
+ *
1695
+ * @param {string} id The id of the annotation.
1696
+ * @returns {boolean} True if the annotation is visible.
1697
+ */
1698
+ isAnnotationVisible(id: string): boolean;
1699
+ /**
1700
+ * Set the visibility of an annotation.
1668
1701
  *
1669
- * @param {string} id The id of the group.
1670
- * @returns {boolean} True if the group is visible.
1702
+ * @param {string} id The id of the annotation.
1703
+ * @param {boolean} [visible] True to set to visible,
1704
+ * will toggle visibility if not defined.
1705
+ * @returns {boolean} False if the annotation shape cannot be found.
1671
1706
  */
1672
- isGroupVisible(id: string): boolean;
1707
+ setAnnotationVisibility(id: string, visible?: boolean): boolean;
1673
1708
  /**
1674
- * Toggle the visibility of a given group.
1709
+ * Set the visibility of all labels.
1675
1710
  *
1676
- * @param {string} id The id of the group.
1677
- * @returns {boolean} False if the group cannot be found.
1711
+ * @param {boolean} [visible] True to set to visible,
1712
+ * will toggle visibility if not defined.
1678
1713
  */
1679
- toggleGroupVisibility(id: string): boolean;
1714
+ setLabelsVisibility(visible?: boolean): void;
1680
1715
  /**
1681
1716
  * Delete a Draw from the stage.
1682
1717
  *