dwv 0.34.0-beta.6 → 0.34.0-beta.8

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;
@@ -45,38 +43,34 @@ export declare class Annotation {
45
43
  /**
46
44
  * Additional points used to define the annotation.
47
45
  *
48
- * @type {Point2D[]}
46
+ * @type {Point2D[]|undefined}
49
47
  */
50
- referencePoints: Point2D[];
48
+ referencePoints: Point2D[] | undefined;
51
49
  /**
52
50
  * The color: for example 'green', '#00ff00' or 'rgb(0,255,0)'.
53
51
  *
54
- * 'RGB R Component', 110834, DCM...
55
- *
56
- * @type {string}
52
+ * @type {string|undefined}
57
53
  */
58
- colour: string;
54
+ colour: string | undefined;
59
55
  /**
60
56
  * Annotation quantification.
61
57
  *
62
- * @type {object}
58
+ * @type {object|undefined}
63
59
  */
64
- quantification: object;
60
+ quantification: object | undefined;
65
61
  /**
66
62
  * Text expression. Can contain variables surrounded with '{}' that will
67
63
  * be extracted from the quantification object.
68
64
  *
69
- * 'Short label', 125309, DCM.
70
- *
71
- * @type {string}
65
+ * @type {string|undefined}
72
66
  */
73
- textExpr: string;
67
+ textExpr: string | undefined;
74
68
  /**
75
69
  * Label position.
76
70
  *
77
- * @type {Point2D}
71
+ * @type {Point2D|undefined}
78
72
  */
79
- labelPosition: Point2D;
73
+ labelPosition: Point2D | undefined;
80
74
  /**
81
75
  * Set the associated view controller.
82
76
  *
@@ -189,6 +183,18 @@ export declare class AnnotationGroup {
189
183
  * @returns {number} The number of annotations.
190
184
  */
191
185
  getLength(): number;
186
+ /**
187
+ * Check if the annotation group is editable.
188
+ *
189
+ * @returns {boolean} True if editable.
190
+ */
191
+ isEditable(): boolean;
192
+ /**
193
+ * Set the annotation group editability.
194
+ *
195
+ * @param {boolean} flag True to make the annotation group editable.
196
+ */
197
+ setEditable(flag: boolean): void;
192
198
  /**
193
199
  * Add a new annotation.
194
200
  *
@@ -199,8 +205,9 @@ export declare class AnnotationGroup {
199
205
  * Update an existing annotation.
200
206
  *
201
207
  * @param {Annotation} annotation The annotation to update.
208
+ * @param {string[]} [propKeys] Optional properties that got updated.
202
209
  */
203
- update(annotation: Annotation): void;
210
+ update(annotation: Annotation, propKeys?: string[]): void;
204
211
  /**
205
212
  * Remove an annotation.
206
213
  *
@@ -239,16 +246,16 @@ export declare class AnnotationGroup {
239
246
  * Get a meta data value.
240
247
  *
241
248
  * @param {string} key The meta data key.
242
- * @returns {object} The meta data value.
249
+ * @returns {string|object} The meta data value.
243
250
  */
244
- getMetaValue(key: string): object;
251
+ getMetaValue(key: string): string | object;
245
252
  /**
246
253
  * Set a meta data.
247
254
  *
248
255
  * @param {string} key The meta data key.
249
- * @param {object} value The value of the meta data.
256
+ * @param {string|object} value The value of the meta data.
250
257
  */
251
- setMetaValue(key: string, value: object): void;
258
+ setMetaValue(key: string, value: string | object): void;
252
259
  /**
253
260
  * Add an event listener to this class.
254
261
  *
@@ -788,6 +795,22 @@ export declare class App {
788
795
  * @param {string} dataId The data id.
789
796
  */
790
797
  toggleOverlayListeners(dataId: string): void;
798
+ /**
799
+ * Create new annotation data based on the data of
800
+ * the active view layer.
801
+ *
802
+ * @param {LayerGroup} layerGroup The layerGroup with the data to associate
803
+ * to the annotation.
804
+ * @returns {DicomData} The new data.
805
+ */
806
+ createAnnotationData(layerGroup: LayerGroup): DicomData;
807
+ /**
808
+ * Add new data and render it with a simple new data view config.
809
+ *
810
+ * @param {DicomData} data The data to add.
811
+ * @param {string} divId The div where to draw.
812
+ */
813
+ addAndRenderAnnotationData(data: DicomData, divId: string): void;
791
814
  /**
792
815
  * Add a draw layer.
793
816
  *
@@ -1143,7 +1166,6 @@ export declare class DeleteSegmentCommand {
1143
1166
  * DICOM code: item of a basic code sequence.
1144
1167
  *
1145
1168
  * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_8.8.html}.
1146
- * List: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part16/chapter_d.html}.
1147
1169
  */
1148
1170
  export declare class DicomCode {
1149
1171
  /**
@@ -1433,6 +1455,18 @@ export declare class DrawController {
1433
1455
  * @returns {AnnotationGroup} The list.
1434
1456
  */
1435
1457
  getAnnotationGroup(): AnnotationGroup;
1458
+ /**
1459
+ * Check if the annotation group is editable.
1460
+ *
1461
+ * @returns {boolean} True if editable.
1462
+ */
1463
+ isAnnotationGroupEditable(): boolean;
1464
+ /**
1465
+ * Set the annotation group editability.
1466
+ *
1467
+ * @param {boolean} flag True to make the annotation group editable.
1468
+ */
1469
+ setAnnotationGroupEditable(flag: boolean): void;
1436
1470
  /**
1437
1471
  * Add an annotation.
1438
1472
  *
@@ -1443,8 +1477,9 @@ export declare class DrawController {
1443
1477
  * Update an anotation from the list.
1444
1478
  *
1445
1479
  * @param {Annotation} annotation The annotation to update.
1480
+ * @param {string[]} [propKeys] Optional properties that got updated.
1446
1481
  */
1447
- updateAnnotation(annotation: Annotation): void;
1482
+ updateAnnotation(annotation: Annotation, propKeys?: string[]): void;
1448
1483
  /**
1449
1484
  * Remove an anotation for the list.
1450
1485
  *
@@ -1458,6 +1493,17 @@ export declare class DrawController {
1458
1493
  * @param {Function} exeCallback The undo stack callback.
1459
1494
  */
1460
1495
  removeAnnotationWithCommand(id: string, exeCallback: Function): void;
1496
+ /**
1497
+ * Update an annotation via an update command (triggers draw actions).
1498
+ *
1499
+ * @param {string} id The annotation id.
1500
+ * @param {object} originalProps The original annotation properties
1501
+ * that will be updated.
1502
+ * @param {object} newProps The new annotation properties
1503
+ * that will replace the original ones.
1504
+ * @param {Function} exeCallback The undo stack callback.
1505
+ */
1506
+ updateAnnotationWithCommand(id: string, originalProps: object, newProps: object, exeCallback: Function): void;
1461
1507
  /**
1462
1508
  * Remove all annotations via remove commands (triggers draw actions).
1463
1509
  *
@@ -1649,19 +1695,28 @@ export declare class DrawLayer {
1649
1695
  */
1650
1696
  fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void;
1651
1697
  /**
1652
- * Check the visibility of a given group.
1698
+ * Check the visibility of an annotation.
1699
+ *
1700
+ * @param {string} id The id of the annotation.
1701
+ * @returns {boolean} True if the annotation is visible.
1702
+ */
1703
+ isAnnotationVisible(id: string): boolean;
1704
+ /**
1705
+ * Set the visibility of an annotation.
1653
1706
  *
1654
- * @param {string} id The id of the group.
1655
- * @returns {boolean} True if the group is visible.
1707
+ * @param {string} id The id of the annotation.
1708
+ * @param {boolean} [visible] True to set to visible,
1709
+ * will toggle visibility if not defined.
1710
+ * @returns {boolean} False if the annotation shape cannot be found.
1656
1711
  */
1657
- isGroupVisible(id: string): boolean;
1712
+ setAnnotationVisibility(id: string, visible?: boolean): boolean;
1658
1713
  /**
1659
- * Toggle the visibility of a given group.
1714
+ * Set the visibility of all labels.
1660
1715
  *
1661
- * @param {string} id The id of the group.
1662
- * @returns {boolean} False if the group cannot be found.
1716
+ * @param {boolean} [visible] True to set to visible,
1717
+ * will toggle visibility if not defined.
1663
1718
  */
1664
- toggleGroupVisibility(id: string): boolean;
1719
+ setLabelsVisibility(visible?: boolean): void;
1665
1720
  /**
1666
1721
  * Delete a Draw from the stage.
1667
1722
  *