dwv 0.34.0-beta.9 → 0.34.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 +773 -101
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +18 -18
package/dist/dwv.d.ts
CHANGED
|
@@ -67,17 +67,49 @@ export declare class Annotation {
|
|
|
67
67
|
*/
|
|
68
68
|
labelPosition: Point2D | undefined;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* The plane origin, the 3D position of index [0, 0, k].
|
|
71
|
+
*
|
|
72
|
+
* @type {Point3D|undefined}
|
|
73
|
+
*/
|
|
74
|
+
planeOrigin: Point3D | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* A couple of points that help define the annotation plane.
|
|
77
|
+
*
|
|
78
|
+
* @type {Point3D[]|undefined}
|
|
79
|
+
*/
|
|
80
|
+
planePoints: Point3D[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Get the orientation name for this annotation.
|
|
83
|
+
*
|
|
84
|
+
* @returns {string|undefined} The orientation name,
|
|
85
|
+
* undefined if same as reference data.
|
|
86
|
+
*/
|
|
87
|
+
getOrientationName(): string | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Initialise the annotation.
|
|
71
90
|
*
|
|
72
91
|
* @param {ViewController} viewController The associated view controller.
|
|
73
92
|
*/
|
|
93
|
+
init(viewController: ViewController): void;
|
|
94
|
+
/**
|
|
95
|
+
* Check if an input view is compatible with the annotation.
|
|
96
|
+
*
|
|
97
|
+
* @param {PlaneHelper} planeHelper The input view to check.
|
|
98
|
+
* @returns {boolean} True if compatible view.
|
|
99
|
+
*/
|
|
100
|
+
isCompatibleView(planeHelper: PlaneHelper): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Set the associated view controller if it is compatible.
|
|
103
|
+
*
|
|
104
|
+
* @param {ViewController} viewController The view controller.
|
|
105
|
+
*/
|
|
74
106
|
setViewController(viewController: ViewController): void;
|
|
75
107
|
/**
|
|
76
|
-
* Get the
|
|
108
|
+
* Get the centroid of the math shape.
|
|
77
109
|
*
|
|
78
|
-
* @returns {
|
|
110
|
+
* @returns {Point|undefined} The 3D centroid point.
|
|
79
111
|
*/
|
|
80
|
-
|
|
112
|
+
getCentroid(): Point | undefined;
|
|
81
113
|
/**
|
|
82
114
|
* Set the annotation text expression.
|
|
83
115
|
*
|
|
@@ -104,12 +136,6 @@ export declare class Annotation {
|
|
|
104
136
|
* @returns {object} The factory.
|
|
105
137
|
*/
|
|
106
138
|
getFactory(): object;
|
|
107
|
-
/**
|
|
108
|
-
* Get the string type of this annotation.
|
|
109
|
-
*
|
|
110
|
-
* @returns {string} The type.
|
|
111
|
-
*/
|
|
112
|
-
getType(): string;
|
|
113
139
|
#private;
|
|
114
140
|
}
|
|
115
141
|
|
|
@@ -146,6 +172,18 @@ export declare class AnnotationGroup {
|
|
|
146
172
|
* @param {boolean} flag True to make the annotation group editable.
|
|
147
173
|
*/
|
|
148
174
|
setEditable(flag: boolean): void;
|
|
175
|
+
/**
|
|
176
|
+
* Get the group colour.
|
|
177
|
+
*
|
|
178
|
+
* @returns {string} The colour as hex string.
|
|
179
|
+
*/
|
|
180
|
+
getColour(): string;
|
|
181
|
+
/**
|
|
182
|
+
* Set the group colour.
|
|
183
|
+
*
|
|
184
|
+
* @param {string} colour The colour as hex string.
|
|
185
|
+
*/
|
|
186
|
+
setColour(colour: string): void;
|
|
149
187
|
/**
|
|
150
188
|
* Add a new annotation.
|
|
151
189
|
*
|
|
@@ -299,6 +337,14 @@ export declare class App {
|
|
|
299
337
|
* @returns {DicomData|undefined} The data.
|
|
300
338
|
*/
|
|
301
339
|
getData(dataId: string): DicomData | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* Get the image.
|
|
342
|
+
*
|
|
343
|
+
* @param {string} dataId The data id.
|
|
344
|
+
* @returns {Image|undefined} The associated image.
|
|
345
|
+
* @deprecated Since v0.34, please use the getData method.
|
|
346
|
+
*/
|
|
347
|
+
getImage(dataId: string): Image_2 | undefined;
|
|
302
348
|
/**
|
|
303
349
|
* Set the image at the given id.
|
|
304
350
|
*
|
|
@@ -339,7 +385,8 @@ export declare class App {
|
|
|
339
385
|
* Can the data (of the active view of the active layer) be scrolled?
|
|
340
386
|
*
|
|
341
387
|
* @returns {boolean} True if the data has a third dimension greater than one.
|
|
342
|
-
* @deprecated
|
|
388
|
+
* @deprecated Since v0.33, please use the ViewController
|
|
389
|
+
* equivalent directly instead.
|
|
343
390
|
*/
|
|
344
391
|
canScroll(): boolean;
|
|
345
392
|
/**
|
|
@@ -347,7 +394,8 @@ export declare class App {
|
|
|
347
394
|
* (of the active view of the active layer)?
|
|
348
395
|
*
|
|
349
396
|
* @returns {boolean} True if the data is monochrome.
|
|
350
|
-
* @deprecated
|
|
397
|
+
* @deprecated Since v0.33, please use the ViewController
|
|
398
|
+
* equivalent directly instead.
|
|
351
399
|
*/
|
|
352
400
|
canWindowLevel(): boolean;
|
|
353
401
|
/**
|
|
@@ -395,6 +443,16 @@ export declare class App {
|
|
|
395
443
|
* @returns {ViewLayer[]} The layers.
|
|
396
444
|
*/
|
|
397
445
|
getViewLayersByDataId(dataId: string): ViewLayer[];
|
|
446
|
+
/**
|
|
447
|
+
* Get a list of view layers according to an input callback function.
|
|
448
|
+
*
|
|
449
|
+
* @param {Function} [callbackFn] A function that takes
|
|
450
|
+
* a ViewLayer as input and returns a boolean. If undefined,
|
|
451
|
+
* returns all view layers.
|
|
452
|
+
* @returns {ViewLayer[]} The layers that
|
|
453
|
+
* satisfy the callbackFn.
|
|
454
|
+
*/
|
|
455
|
+
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
398
456
|
/**
|
|
399
457
|
* Get the draw layers associated to a data id.
|
|
400
458
|
* The layer are available after the first loaded item.
|
|
@@ -403,6 +461,16 @@ export declare class App {
|
|
|
403
461
|
* @returns {DrawLayer[]} The layers.
|
|
404
462
|
*/
|
|
405
463
|
getDrawLayersByDataId(dataId: string): DrawLayer[];
|
|
464
|
+
/**
|
|
465
|
+
* Get a list of draw layers according to an input callback function.
|
|
466
|
+
*
|
|
467
|
+
* @param {Function} [callbackFn] A function that takes
|
|
468
|
+
* a DrawLayer as input and returns a boolean. If undefined,
|
|
469
|
+
* returns all draw layers.
|
|
470
|
+
* @returns {DrawLayer[]} The layers that
|
|
471
|
+
* satisfy the callbackFn.
|
|
472
|
+
*/
|
|
473
|
+
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
406
474
|
/**
|
|
407
475
|
* Get a layer group by div id.
|
|
408
476
|
* The layer is available after the first loaded item.
|
|
@@ -431,6 +499,15 @@ export declare class App {
|
|
|
431
499
|
* @function
|
|
432
500
|
*/
|
|
433
501
|
addToUndoStack: (cmd: object) => void;
|
|
502
|
+
/**
|
|
503
|
+
* Remove a command from the undo stack.
|
|
504
|
+
*
|
|
505
|
+
* @param {string} name The name of the command to remove.
|
|
506
|
+
* @returns {boolean} True if the command was found and removed.
|
|
507
|
+
* @fires UndoStack#undoremove
|
|
508
|
+
* @function
|
|
509
|
+
*/
|
|
510
|
+
removeFromUndoStack: (name: string) => boolean;
|
|
434
511
|
/**
|
|
435
512
|
* Initialise the application.
|
|
436
513
|
*
|
|
@@ -559,7 +636,8 @@ export declare class App {
|
|
|
559
636
|
* Init the Window/Level display
|
|
560
637
|
* (of the active layer of the active layer group).
|
|
561
638
|
*
|
|
562
|
-
* @deprecated
|
|
639
|
+
* @deprecated Since v0.33, please set the opacity
|
|
640
|
+
* of the desired view layer directly.
|
|
563
641
|
*/
|
|
564
642
|
initWLDisplay(): void;
|
|
565
643
|
/**
|
|
@@ -661,31 +739,28 @@ export declare class App {
|
|
|
661
739
|
* Set the active view layer (of the active layer group) opacity.
|
|
662
740
|
*
|
|
663
741
|
* @param {number} alpha The opacity ([0:1] range).
|
|
664
|
-
* @deprecated
|
|
742
|
+
* @deprecated Since v0.33, pplease set the opacity
|
|
743
|
+
* of the desired view layer directly.
|
|
665
744
|
*/
|
|
666
745
|
setOpacity(alpha: number): void;
|
|
667
746
|
/**
|
|
668
747
|
* Set the drawings of the active layer group.
|
|
669
748
|
*
|
|
670
|
-
* @deprecated
|
|
671
|
-
* @param {Array}
|
|
672
|
-
* @param {Array}
|
|
673
|
-
|
|
674
|
-
setDrawings(_drawings: any[], _drawingsDetails: any[]): void;
|
|
675
|
-
/**
|
|
676
|
-
* Get the JSON state of the app.
|
|
677
|
-
*
|
|
678
|
-
* @deprecated
|
|
679
|
-
* @returns {string} The state of the app as a JSON string.
|
|
749
|
+
* @deprecated Since v0.34, please switch to DICOM SR annotations.
|
|
750
|
+
* @param {Array} drawings An array of drawings.
|
|
751
|
+
* @param {Array} drawingsDetails An array of drawings details.
|
|
752
|
+
* @param {string} dataId The converted data id.
|
|
680
753
|
*/
|
|
681
|
-
|
|
754
|
+
setDrawings(drawings: any[], drawingsDetails: any[], dataId: string): void;
|
|
682
755
|
/**
|
|
683
756
|
* Apply a JSON state to this app.
|
|
684
757
|
*
|
|
685
|
-
* @deprecated
|
|
758
|
+
* @deprecated Since v0.34, please switch to DICOM SR
|
|
759
|
+
* for annotations.
|
|
686
760
|
* @param {string} jsonState The state of the app as a JSON string.
|
|
761
|
+
* @param {string} dataId The state data id.
|
|
687
762
|
*/
|
|
688
|
-
applyJsonState(jsonState: string): void;
|
|
763
|
+
applyJsonState(jsonState: string, dataId: string): void;
|
|
689
764
|
/**
|
|
690
765
|
* Handle resize: fit the display to the window.
|
|
691
766
|
* To be called once the image is loaded.
|
|
@@ -731,14 +806,16 @@ export declare class App {
|
|
|
731
806
|
* Set the colour map of the active view of the active layer group.
|
|
732
807
|
*
|
|
733
808
|
* @param {string} name The colour map name.
|
|
734
|
-
* @deprecated
|
|
809
|
+
* @deprecated Since v0.33, please use the ViewController
|
|
810
|
+
* equivalent directly instead.
|
|
735
811
|
*/
|
|
736
812
|
setColourMap(name: string): void;
|
|
737
813
|
/**
|
|
738
814
|
* Set the window/level preset of the active view of the active layer group.
|
|
739
815
|
*
|
|
740
816
|
* @param {string} preset The window/level preset.
|
|
741
|
-
* @deprecated
|
|
817
|
+
* @deprecated Since v0.33, please use the ViewController
|
|
818
|
+
* equivalent directly instead.
|
|
742
819
|
*/
|
|
743
820
|
setWindowLevelPreset(preset: string): void;
|
|
744
821
|
/**
|
|
@@ -794,18 +871,18 @@ export declare class App {
|
|
|
794
871
|
* Create new annotation data based on the data of
|
|
795
872
|
* the active view layer.
|
|
796
873
|
*
|
|
797
|
-
* @param {
|
|
798
|
-
* to the annotation.
|
|
874
|
+
* @param {string} refDataId The reference data id.
|
|
799
875
|
* @returns {DicomData} The new data.
|
|
800
876
|
*/
|
|
801
|
-
createAnnotationData(
|
|
877
|
+
createAnnotationData(refDataId: string): DicomData;
|
|
802
878
|
/**
|
|
803
879
|
* Add new data and render it with a simple new data view config.
|
|
804
880
|
*
|
|
805
881
|
* @param {DicomData} data The data to add.
|
|
806
882
|
* @param {string} divId The div where to draw.
|
|
883
|
+
* @param {string} refDataId The reference data id.
|
|
807
884
|
*/
|
|
808
|
-
addAndRenderAnnotationData(data: DicomData, divId: string): void;
|
|
885
|
+
addAndRenderAnnotationData(data: DicomData, divId: string, refDataId: string): void;
|
|
809
886
|
/**
|
|
810
887
|
* Add a draw layer.
|
|
811
888
|
*
|
|
@@ -949,6 +1026,79 @@ export declare class ChangeSegmentColourCommand {
|
|
|
949
1026
|
#private;
|
|
950
1027
|
}
|
|
951
1028
|
|
|
1029
|
+
/**
|
|
1030
|
+
* Circle shape.
|
|
1031
|
+
*/
|
|
1032
|
+
export declare class Circle {
|
|
1033
|
+
/**
|
|
1034
|
+
* @param {Point2D} centre A Point2D representing the centre
|
|
1035
|
+
* of the circle.
|
|
1036
|
+
* @param {number} radius The radius of the circle.
|
|
1037
|
+
*/
|
|
1038
|
+
constructor(centre: Point2D, radius: number);
|
|
1039
|
+
/**
|
|
1040
|
+
* Get the centre (point) of the circle.
|
|
1041
|
+
*
|
|
1042
|
+
* @returns {Point2D} The center (point) of the circle.
|
|
1043
|
+
*/
|
|
1044
|
+
getCenter(): Point2D;
|
|
1045
|
+
/**
|
|
1046
|
+
* Get the centroid of the circle.
|
|
1047
|
+
*
|
|
1048
|
+
* @returns {Point2D} The centroid point.
|
|
1049
|
+
*/
|
|
1050
|
+
getCentroid(): Point2D;
|
|
1051
|
+
/**
|
|
1052
|
+
* Get the radius of the circle.
|
|
1053
|
+
*
|
|
1054
|
+
* @returns {number} The radius of the circle.
|
|
1055
|
+
*/
|
|
1056
|
+
getRadius(): number;
|
|
1057
|
+
/**
|
|
1058
|
+
* Check for equality.
|
|
1059
|
+
*
|
|
1060
|
+
* @param {Circle} rhs The object to compare to.
|
|
1061
|
+
* @returns {boolean} True if both objects are equal.
|
|
1062
|
+
*/
|
|
1063
|
+
equals(rhs: Circle): boolean;
|
|
1064
|
+
/**
|
|
1065
|
+
* Get the surface of the circle.
|
|
1066
|
+
*
|
|
1067
|
+
* @returns {number} The surface of the circle.
|
|
1068
|
+
*/
|
|
1069
|
+
getSurface(): number;
|
|
1070
|
+
/**
|
|
1071
|
+
* Get the surface of the circle according to a spacing.
|
|
1072
|
+
*
|
|
1073
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
1074
|
+
* @returns {number} The surface of the circle multiplied by the given
|
|
1075
|
+
* spacing or null for null spacings.
|
|
1076
|
+
*/
|
|
1077
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
1078
|
+
/**
|
|
1079
|
+
* Get the rounded limits of the circle.
|
|
1080
|
+
*
|
|
1081
|
+
* See: {@link https://en.wikipedia.org/wiki/Circle#Equations}.
|
|
1082
|
+
*
|
|
1083
|
+
* Circle formula: `x*x + y*y = r*r`.
|
|
1084
|
+
*
|
|
1085
|
+
* Implies: `y = (+-) sqrt(r*r - x*x)`.
|
|
1086
|
+
*
|
|
1087
|
+
* @returns {number[][][]} The rounded limits:
|
|
1088
|
+
* list of [x, y] pairs (min, max).
|
|
1089
|
+
*/
|
|
1090
|
+
getRound(): number[][][];
|
|
1091
|
+
/**
|
|
1092
|
+
* Quantify an circle according to view information.
|
|
1093
|
+
*
|
|
1094
|
+
* @param {ViewController} viewController The associated view controller.
|
|
1095
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
1096
|
+
* @returns {object} A quantification object.
|
|
1097
|
+
*/
|
|
1098
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
1099
|
+
#private;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
952
1102
|
/**
|
|
953
1103
|
* Colour map: red, green and blue components
|
|
954
1104
|
* to associate with intensity values.
|
|
@@ -1519,12 +1669,6 @@ export declare class DrawController {
|
|
|
1519
1669
|
* @param {string} value The value of the meta data.
|
|
1520
1670
|
*/
|
|
1521
1671
|
setAnnotationMeta(key: string, value: string): void;
|
|
1522
|
-
/**
|
|
1523
|
-
* Get draw store details.
|
|
1524
|
-
*
|
|
1525
|
-
* @deprecated
|
|
1526
|
-
*/
|
|
1527
|
-
getDrawStoreDetails(): void;
|
|
1528
1672
|
#private;
|
|
1529
1673
|
}
|
|
1530
1674
|
|
|
@@ -1556,6 +1700,12 @@ export declare class DrawLayer {
|
|
|
1556
1700
|
* @returns {string} The id.
|
|
1557
1701
|
*/
|
|
1558
1702
|
getDataId(): string;
|
|
1703
|
+
/**
|
|
1704
|
+
* Get the reference data id.
|
|
1705
|
+
*
|
|
1706
|
+
* @returns {string} The id.
|
|
1707
|
+
*/
|
|
1708
|
+
getReferenceLayerId(): string;
|
|
1559
1709
|
/**
|
|
1560
1710
|
* Get the Konva stage.
|
|
1561
1711
|
*
|
|
@@ -1635,6 +1785,14 @@ export declare class DrawLayer {
|
|
|
1635
1785
|
* @param {Point3D} [center] The scale center.
|
|
1636
1786
|
*/
|
|
1637
1787
|
setScale(newScale: Scalar3D, center?: Point3D): void;
|
|
1788
|
+
/**
|
|
1789
|
+
* Initialise the layer scale.
|
|
1790
|
+
*
|
|
1791
|
+
* @param {Scalar3D} newScale The scale as {x,y,z}.
|
|
1792
|
+
* @param {Scalar2D} absoluteZoomOffset The zoom offset as {x,y}
|
|
1793
|
+
* without the fit scale (as provided by getAbsoluteZoomOffset).
|
|
1794
|
+
*/
|
|
1795
|
+
initScale(newScale: Scalar3D, absoluteZoomOffset: Scalar2D): void;
|
|
1638
1796
|
/**
|
|
1639
1797
|
* Set the layer offset.
|
|
1640
1798
|
*
|
|
@@ -1671,8 +1829,9 @@ export declare class DrawLayer {
|
|
|
1671
1829
|
*
|
|
1672
1830
|
* @param {Scalar2D} size The image size as {x,y}.
|
|
1673
1831
|
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
1832
|
+
* @param {string} refLayerId The reference image dataId.
|
|
1674
1833
|
*/
|
|
1675
|
-
initialise(size: Scalar2D, spacing: Scalar2D): void;
|
|
1834
|
+
initialise(size: Scalar2D, spacing: Scalar2D, refLayerId: string): void;
|
|
1676
1835
|
/**
|
|
1677
1836
|
* Set the annotation group.
|
|
1678
1837
|
*
|
|
@@ -1681,6 +1840,12 @@ export declare class DrawLayer {
|
|
|
1681
1840
|
* @param {object} exeCallback The undo stack callback.
|
|
1682
1841
|
*/
|
|
1683
1842
|
setAnnotationGroup(annotationGroup: AnnotationGroup, dataId: string, exeCallback: object): void;
|
|
1843
|
+
/**
|
|
1844
|
+
* Activate shapes at current position.
|
|
1845
|
+
*
|
|
1846
|
+
* @param {boolean} flag The flag to activate or not.
|
|
1847
|
+
*/
|
|
1848
|
+
activateCurrentPositionShapes(flag: boolean): void;
|
|
1684
1849
|
/**
|
|
1685
1850
|
* Fit the layer to its parent container.
|
|
1686
1851
|
*
|
|
@@ -1712,10 +1877,17 @@ export declare class DrawLayer {
|
|
|
1712
1877
|
* will toggle visibility if not defined.
|
|
1713
1878
|
*/
|
|
1714
1879
|
setLabelsVisibility(visible?: boolean): void;
|
|
1880
|
+
/**
|
|
1881
|
+
* Set a shape group label visibility according to
|
|
1882
|
+
* this layer setting.
|
|
1883
|
+
*
|
|
1884
|
+
* @param {Konva.Group} shapeGroup The shape group.
|
|
1885
|
+
*/
|
|
1886
|
+
setLabelVisibility(shapeGroup: Konva.Group): void;
|
|
1715
1887
|
/**
|
|
1716
1888
|
* Delete a Draw from the stage.
|
|
1717
1889
|
*
|
|
1718
|
-
* @deprecated
|
|
1890
|
+
* @deprecated Since v0.34, please switch to `annotationGroup.remove`.
|
|
1719
1891
|
* @param {string} _id The id of the group to delete.
|
|
1720
1892
|
* @param {Function} _exeCallback The callback to call once the
|
|
1721
1893
|
* DeleteCommand has been executed.
|
|
@@ -1724,7 +1896,7 @@ export declare class DrawLayer {
|
|
|
1724
1896
|
/**
|
|
1725
1897
|
* Delete all Draws from the stage.
|
|
1726
1898
|
*
|
|
1727
|
-
* @deprecated
|
|
1899
|
+
* @deprecated Since v0.34, please switch to `annotationGroup.remove`.
|
|
1728
1900
|
* @param {Function} _exeCallback The callback to call once the
|
|
1729
1901
|
* DeleteCommand has been executed.
|
|
1730
1902
|
*/
|
|
@@ -1748,29 +1920,16 @@ export declare class DrawLayer {
|
|
|
1748
1920
|
* Set the current position.
|
|
1749
1921
|
*
|
|
1750
1922
|
* @param {Point} position The new position.
|
|
1751
|
-
* @param {Index} index
|
|
1923
|
+
* @param {Index} [index] Optional coresponding index.
|
|
1752
1924
|
* @returns {boolean} True if the position was updated.
|
|
1753
1925
|
*/
|
|
1754
|
-
setCurrentPosition(position: Point, index
|
|
1755
|
-
/**
|
|
1756
|
-
* Activate the current draw layer.
|
|
1757
|
-
*
|
|
1758
|
-
* @param {Index} index The current position.
|
|
1759
|
-
* @param {number} scrollIndex The scroll index.
|
|
1760
|
-
*/
|
|
1761
|
-
activateDrawLayer(index: Index, scrollIndex: number): void;
|
|
1926
|
+
setCurrentPosition(position: Point, index?: Index): boolean;
|
|
1762
1927
|
/**
|
|
1763
1928
|
* Get the current position group.
|
|
1764
1929
|
*
|
|
1765
1930
|
* @returns {Konva.Group|undefined} The Konva.Group.
|
|
1766
1931
|
*/
|
|
1767
1932
|
getCurrentPosGroup(): Konva.Group | undefined;
|
|
1768
|
-
/**
|
|
1769
|
-
* Get the non current position groups. Used to stop listeners.
|
|
1770
|
-
*
|
|
1771
|
-
* @returns {object[]} The groups that do not have the current position id.
|
|
1772
|
-
*/
|
|
1773
|
-
getNonCurrentPosGroup(): object[];
|
|
1774
1933
|
/**
|
|
1775
1934
|
* Get a Konva group using its id.
|
|
1776
1935
|
*
|
|
@@ -1846,11 +2005,11 @@ export declare class DrawShapeHandler {
|
|
|
1846
2005
|
/**
|
|
1847
2006
|
* Add shape group listeners.
|
|
1848
2007
|
*
|
|
1849
|
-
* @param {DrawLayer} drawLayer The origin draw layer.
|
|
1850
2008
|
* @param {Konva.Group} shapeGroup The shape group to set on.
|
|
1851
2009
|
* @param {Annotation} annotation The associated annotation.
|
|
2010
|
+
* @param {DrawLayer} drawLayer The origin draw layer.
|
|
1852
2011
|
*/
|
|
1853
|
-
|
|
2012
|
+
addShapeGroupListeners(shapeGroup: Konva.Group, annotation: Annotation, drawLayer: DrawLayer): void;
|
|
1854
2013
|
/**
|
|
1855
2014
|
* Remove shape group listeners.
|
|
1856
2015
|
*
|
|
@@ -1860,6 +2019,86 @@ export declare class DrawShapeHandler {
|
|
|
1860
2019
|
#private;
|
|
1861
2020
|
}
|
|
1862
2021
|
|
|
2022
|
+
/**
|
|
2023
|
+
* Ellipse shape.
|
|
2024
|
+
*/
|
|
2025
|
+
export declare class Ellipse {
|
|
2026
|
+
/**
|
|
2027
|
+
* @param {Point2D} centre A Point2D representing the centre
|
|
2028
|
+
* of the ellipse.
|
|
2029
|
+
* @param {number} a The radius of the ellipse on the horizontal axe.
|
|
2030
|
+
* @param {number} b The radius of the ellipse on the vertical axe.
|
|
2031
|
+
*/
|
|
2032
|
+
constructor(centre: Point2D, a: number, b: number);
|
|
2033
|
+
/**
|
|
2034
|
+
* Get the centre (point) of the ellipse.
|
|
2035
|
+
*
|
|
2036
|
+
* @returns {Point2D} The center (point) of the ellipse.
|
|
2037
|
+
*/
|
|
2038
|
+
getCenter(): Point2D;
|
|
2039
|
+
/**
|
|
2040
|
+
* Get the centroid of the ellipse.
|
|
2041
|
+
*
|
|
2042
|
+
* @returns {Point2D} The centroid point.
|
|
2043
|
+
*/
|
|
2044
|
+
getCentroid(): Point2D;
|
|
2045
|
+
/**
|
|
2046
|
+
* Get the radius of the ellipse on the horizontal axe.
|
|
2047
|
+
*
|
|
2048
|
+
* @returns {number} The radius of the ellipse on the horizontal axe.
|
|
2049
|
+
*/
|
|
2050
|
+
getA(): number;
|
|
2051
|
+
/**
|
|
2052
|
+
* Get the radius of the ellipse on the vertical axe.
|
|
2053
|
+
*
|
|
2054
|
+
* @returns {number} The radius of the ellipse on the vertical axe.
|
|
2055
|
+
*/
|
|
2056
|
+
getB(): number;
|
|
2057
|
+
/**
|
|
2058
|
+
* Check for equality.
|
|
2059
|
+
*
|
|
2060
|
+
* @param {Ellipse} rhs The object to compare to.
|
|
2061
|
+
* @returns {boolean} True if both objects are equal.
|
|
2062
|
+
*/
|
|
2063
|
+
equals(rhs: Ellipse): boolean;
|
|
2064
|
+
/**
|
|
2065
|
+
* Get the surface of the ellipse.
|
|
2066
|
+
*
|
|
2067
|
+
* @returns {number} The surface of the ellipse.
|
|
2068
|
+
*/
|
|
2069
|
+
getSurface(): number;
|
|
2070
|
+
/**
|
|
2071
|
+
* Get the surface of the ellipse according to a spacing.
|
|
2072
|
+
*
|
|
2073
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
2074
|
+
* @returns {number} The surface of the ellipse multiplied by the given
|
|
2075
|
+
* spacing or null for null spacings.
|
|
2076
|
+
*/
|
|
2077
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
2078
|
+
/**
|
|
2079
|
+
* Get the rounded limits of the ellipse.
|
|
2080
|
+
*
|
|
2081
|
+
* See: {@link https://en.wikipedia.org/wiki/Ellipse#Standard_equation}.
|
|
2082
|
+
*
|
|
2083
|
+
* Ellipse formula: `x*x / a*a + y*y / b*b = 1`.
|
|
2084
|
+
*
|
|
2085
|
+
* Implies: `y = (+-)(b/a) * sqrt(a*a - x*x)`.
|
|
2086
|
+
*
|
|
2087
|
+
* @returns {number[][][]} The rounded limits:
|
|
2088
|
+
* list of [x, y] pairs (min, max).
|
|
2089
|
+
*/
|
|
2090
|
+
getRound(): number[][][];
|
|
2091
|
+
/**
|
|
2092
|
+
* Quantify an ellipse according to view information.
|
|
2093
|
+
*
|
|
2094
|
+
* @param {ViewController} viewController The associated view controller.
|
|
2095
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
2096
|
+
* @returns {object} A quantification object.
|
|
2097
|
+
*/
|
|
2098
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
2099
|
+
#private;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
1863
2102
|
/**
|
|
1864
2103
|
* 2D/3D Geometry class.
|
|
1865
2104
|
*/
|
|
@@ -2104,7 +2343,7 @@ export declare function getEllipseIndices(center: Index, radius: number[], dir:
|
|
|
2104
2343
|
* @param {object} event The event to get the layer div id from. Expecting
|
|
2105
2344
|
* an event origininating from a canvas inside a layer HTML div
|
|
2106
2345
|
* with the 'layer' class and id generated with `getLayerDivId`.
|
|
2107
|
-
* @returns {object} The layer details as {groupDivId, layerId}.
|
|
2346
|
+
* @returns {object} The layer details as {groupDivId, layerIndex, layerId}.
|
|
2108
2347
|
*/
|
|
2109
2348
|
export declare function getLayerDetailsFromEvent(event: object): object;
|
|
2110
2349
|
|
|
@@ -2119,11 +2358,12 @@ export declare function getMousePoint(event: object): Point2D;
|
|
|
2119
2358
|
/**
|
|
2120
2359
|
* Get the name of an image orientation patient.
|
|
2121
2360
|
*
|
|
2122
|
-
* @param {number[]}
|
|
2361
|
+
* @param {number[]} cosines The image orientation
|
|
2362
|
+
* patient cosines (6 values).
|
|
2123
2363
|
* @returns {string|undefined} The orientation
|
|
2124
2364
|
* name: axial, coronal or sagittal.
|
|
2125
2365
|
*/
|
|
2126
|
-
export declare function getOrientationName(
|
|
2366
|
+
export declare function getOrientationName(cosines: number[]): string | undefined;
|
|
2127
2367
|
|
|
2128
2368
|
/**
|
|
2129
2369
|
* Get the PixelData Tag.
|
|
@@ -2132,6 +2372,16 @@ export declare function getOrientationName(orientation: number[]): string | unde
|
|
|
2132
2372
|
*/
|
|
2133
2373
|
export declare function getPixelDataTag(): Tag;
|
|
2134
2374
|
|
|
2375
|
+
/**
|
|
2376
|
+
* Get the indices that form a rectangle.
|
|
2377
|
+
*
|
|
2378
|
+
* @param {Index} center The rectangle center.
|
|
2379
|
+
* @param {number[]} size The 2 rectangle sizes.
|
|
2380
|
+
* @param {number[]} dir The 2 rectangle directions.
|
|
2381
|
+
* @returns {Index[]} The indices of the rectangle.
|
|
2382
|
+
*/
|
|
2383
|
+
export declare function getRectangleIndices(center: Index, size: number[], dir: number[]): Index[];
|
|
2384
|
+
|
|
2135
2385
|
/**
|
|
2136
2386
|
* Get patient orientation label in the reverse direction.
|
|
2137
2387
|
*
|
|
@@ -2274,6 +2524,13 @@ declare class Image_2 {
|
|
|
2274
2524
|
* @returns {Point3D|undefined} The origin.
|
|
2275
2525
|
*/
|
|
2276
2526
|
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
2527
|
+
/**
|
|
2528
|
+
* Check if the image includes an UID.
|
|
2529
|
+
*
|
|
2530
|
+
* @param {string} uid The UID.
|
|
2531
|
+
* @returns {boolean} True if present.
|
|
2532
|
+
*/
|
|
2533
|
+
includesImageUid(uid: string): boolean;
|
|
2277
2534
|
/**
|
|
2278
2535
|
* Check if this image includes the input uids.
|
|
2279
2536
|
*
|
|
@@ -2304,7 +2561,7 @@ declare class Image_2 {
|
|
|
2304
2561
|
* Can window and level be applied to the data?
|
|
2305
2562
|
*
|
|
2306
2563
|
* @returns {boolean} True if the data is monochrome.
|
|
2307
|
-
* @deprecated
|
|
2564
|
+
* @deprecated Since v0.33, please use isMonochrome instead.
|
|
2308
2565
|
*/
|
|
2309
2566
|
canWindowLevel(): boolean;
|
|
2310
2567
|
/**
|
|
@@ -2694,13 +2951,6 @@ export declare class Index {
|
|
|
2694
2951
|
* @returns {Index} The new index.
|
|
2695
2952
|
*/
|
|
2696
2953
|
getWithNew2D(i: number, j: number): Index;
|
|
2697
|
-
/**
|
|
2698
|
-
* Get a string id from the index values in the form of: '#0-1_#1-2'.
|
|
2699
|
-
*
|
|
2700
|
-
* @param {number[]} [dims] Optional list of dimensions to use.
|
|
2701
|
-
* @returns {string} The string id.
|
|
2702
|
-
*/
|
|
2703
|
-
toStringId(dims?: number[]): string;
|
|
2704
2954
|
#private;
|
|
2705
2955
|
}
|
|
2706
2956
|
|
|
@@ -2805,6 +3055,35 @@ export declare class LayerGroup {
|
|
|
2805
3055
|
* a layer with the input id.
|
|
2806
3056
|
*/
|
|
2807
3057
|
includes(id: string): boolean;
|
|
3058
|
+
/**
|
|
3059
|
+
* Get a list of view layers according to an input callback function.
|
|
3060
|
+
*
|
|
3061
|
+
* @param {Function} [callbackFn] A function that takes
|
|
3062
|
+
* a ViewLayer as input and returns a boolean. If undefined,
|
|
3063
|
+
* returns all view layers.
|
|
3064
|
+
* @returns {ViewLayer[]} The layers that
|
|
3065
|
+
* satisfy the callbackFn.
|
|
3066
|
+
*/
|
|
3067
|
+
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
3068
|
+
/**
|
|
3069
|
+
* Test if one of the view layers satisfies an input callbackFn.
|
|
3070
|
+
*
|
|
3071
|
+
* @param {Function} callbackFn A function that takes
|
|
3072
|
+
* a ViewLayer as input and returns a boolean.
|
|
3073
|
+
* @returns {boolean} True if one of the ViewLayers
|
|
3074
|
+
* satisfies the callbackFn.
|
|
3075
|
+
*/
|
|
3076
|
+
someViewLayer(callbackFn: Function): boolean;
|
|
3077
|
+
/**
|
|
3078
|
+
* Get a list of draw layers according to an input callback function.
|
|
3079
|
+
*
|
|
3080
|
+
* @param {Function} [callbackFn] A function that takes
|
|
3081
|
+
* a DrawLayer as input and returns a boolean. If undefined,
|
|
3082
|
+
* returns all draw layers.
|
|
3083
|
+
* @returns {DrawLayer[]} The layers that
|
|
3084
|
+
* satisfy the callbackFn.
|
|
3085
|
+
*/
|
|
3086
|
+
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
2808
3087
|
/**
|
|
2809
3088
|
* Get the number of view layers handled by this class.
|
|
2810
3089
|
*
|
|
@@ -2871,9 +3150,10 @@ export declare class LayerGroup {
|
|
|
2871
3150
|
/**
|
|
2872
3151
|
* Set the active draw layer.
|
|
2873
3152
|
*
|
|
2874
|
-
* @param {number} index The index of the layer to set as active
|
|
3153
|
+
* @param {number|undefined} index The index of the layer to set as active
|
|
3154
|
+
* or undefined to not set any.
|
|
2875
3155
|
*/
|
|
2876
|
-
setActiveDrawLayer(index: number): void;
|
|
3156
|
+
setActiveDrawLayer(index: number | undefined): void;
|
|
2877
3157
|
/**
|
|
2878
3158
|
* Set the active draw layer with a data id.
|
|
2879
3159
|
*
|
|
@@ -2926,14 +3206,6 @@ export declare class LayerGroup {
|
|
|
2926
3206
|
* Remove the tooltip html div.
|
|
2927
3207
|
*/
|
|
2928
3208
|
removeTooltipDiv(): void;
|
|
2929
|
-
/**
|
|
2930
|
-
* Test if one of the view layers satisfies an input callbackFn.
|
|
2931
|
-
*
|
|
2932
|
-
* @param {Function} callbackFn A function that takes a ViewLayer as input
|
|
2933
|
-
* and returns a boolean.
|
|
2934
|
-
* @returns {boolean} True if one of the ViewLayers satisfies the callbackFn.
|
|
2935
|
-
*/
|
|
2936
|
-
someViewLayer(callbackFn: Function): boolean;
|
|
2937
3209
|
/**
|
|
2938
3210
|
* Can the input position be set on one of the view layers.
|
|
2939
3211
|
*
|
|
@@ -3213,6 +3485,12 @@ export declare class MaskSegmentHelper {
|
|
|
3213
3485
|
* @returns {boolean} True if the segment is included.
|
|
3214
3486
|
*/
|
|
3215
3487
|
hasSegment(segmentNumber: number): boolean;
|
|
3488
|
+
/**
|
|
3489
|
+
* Get the number of segments of the segmentation.
|
|
3490
|
+
*
|
|
3491
|
+
* @returns {number} The number of segments.
|
|
3492
|
+
*/
|
|
3493
|
+
getNumberOfSegments(): number;
|
|
3216
3494
|
/**
|
|
3217
3495
|
* Check if a segment is present in a mask image.
|
|
3218
3496
|
*
|
|
@@ -3478,11 +3756,22 @@ export declare class OverlayData {
|
|
|
3478
3756
|
*/
|
|
3479
3757
|
export declare class PlaneHelper {
|
|
3480
3758
|
/**
|
|
3481
|
-
* @param {
|
|
3482
|
-
* @param {Matrix33} imageOrientation The image oientation.
|
|
3759
|
+
* @param {Geometry} imageGeometry The image geometry.
|
|
3483
3760
|
* @param {Matrix33} viewOrientation The view orientation.
|
|
3484
3761
|
*/
|
|
3485
|
-
constructor(
|
|
3762
|
+
constructor(imageGeometry: Geometry, viewOrientation: Matrix33);
|
|
3763
|
+
/**
|
|
3764
|
+
* Get the view orientation.
|
|
3765
|
+
*
|
|
3766
|
+
* @returns {Matrix33} The orientation matrix.
|
|
3767
|
+
*/
|
|
3768
|
+
getViewOrientation(): Matrix33;
|
|
3769
|
+
/**
|
|
3770
|
+
* Get the target orientation.
|
|
3771
|
+
*
|
|
3772
|
+
* @returns {Matrix33} The orientation matrix.
|
|
3773
|
+
*/
|
|
3774
|
+
getTargetOrientation(): Matrix33;
|
|
3486
3775
|
/**
|
|
3487
3776
|
* Get a 3D offset from a plane one.
|
|
3488
3777
|
*
|
|
@@ -3546,6 +3835,48 @@ export declare class PlaneHelper {
|
|
|
3546
3835
|
* @returns {Point3D} The de-orienteded point.
|
|
3547
3836
|
*/
|
|
3548
3837
|
getImageDeOrientedPoint3D(point: Point3D): Point3D;
|
|
3838
|
+
/**
|
|
3839
|
+
* Get a world position from a 2D plane position.
|
|
3840
|
+
*
|
|
3841
|
+
* @param {Point2D} point2D The plane point.
|
|
3842
|
+
* @param {number} k The slice index.
|
|
3843
|
+
* @returns {Point3D} The world position.
|
|
3844
|
+
*/
|
|
3845
|
+
getPositionFromPlanePoint(point2D: Point2D, k: number): Point3D;
|
|
3846
|
+
/**
|
|
3847
|
+
* Get a 2D plane position from a world position.
|
|
3848
|
+
*
|
|
3849
|
+
* @param {Point} point The world position.
|
|
3850
|
+
* @returns {Point3D} The plane point.
|
|
3851
|
+
*/
|
|
3852
|
+
getPlanePointFromPosition(point: Point): Point3D;
|
|
3853
|
+
/**
|
|
3854
|
+
* Get the cosines of this plane.
|
|
3855
|
+
*
|
|
3856
|
+
* @returns {number[]} The 2 cosines vectors (3D).
|
|
3857
|
+
*/
|
|
3858
|
+
getCosines(): number[];
|
|
3859
|
+
/**
|
|
3860
|
+
* Get a list of points that define the plane at input position,
|
|
3861
|
+
* given this classes orientation.
|
|
3862
|
+
*
|
|
3863
|
+
* @param {Point} position The position.
|
|
3864
|
+
* @returns {Point3D[]} An origin and 2 cosines vectors.
|
|
3865
|
+
*/
|
|
3866
|
+
getPlanePoints(position: Point): Point3D[];
|
|
3867
|
+
/**
|
|
3868
|
+
* Image world to index.
|
|
3869
|
+
*
|
|
3870
|
+
* @param {Point} point The input point.
|
|
3871
|
+
* @returns {Index} The corresponding index.
|
|
3872
|
+
*/
|
|
3873
|
+
worldToIndex(point: Point): Index;
|
|
3874
|
+
/**
|
|
3875
|
+
* Is this view in the same orientation as the image aquisition.
|
|
3876
|
+
*
|
|
3877
|
+
* @returns {boolean} True if in aquisition plane.
|
|
3878
|
+
*/
|
|
3879
|
+
isAquisitionOrientation(): boolean;
|
|
3549
3880
|
/**
|
|
3550
3881
|
* Reorder values to follow target orientation.
|
|
3551
3882
|
*
|
|
@@ -3571,7 +3902,7 @@ export declare class PlaneHelper {
|
|
|
3571
3902
|
/**
|
|
3572
3903
|
* Immutable point.
|
|
3573
3904
|
* Warning: the input array is NOT cloned, modifying it will
|
|
3574
|
-
* modify the
|
|
3905
|
+
* modify the point values.
|
|
3575
3906
|
*/
|
|
3576
3907
|
export declare class Point {
|
|
3577
3908
|
/**
|
|
@@ -3579,26 +3910,26 @@ export declare class Point {
|
|
|
3579
3910
|
*/
|
|
3580
3911
|
constructor(values: number[]);
|
|
3581
3912
|
/**
|
|
3582
|
-
* Get the
|
|
3913
|
+
* Get the point value at the given array index.
|
|
3583
3914
|
*
|
|
3584
3915
|
* @param {number} i The index to get.
|
|
3585
3916
|
* @returns {number} The value.
|
|
3586
3917
|
*/
|
|
3587
3918
|
get(i: number): number;
|
|
3588
3919
|
/**
|
|
3589
|
-
* Get the length of the
|
|
3920
|
+
* Get the length of the point.
|
|
3590
3921
|
*
|
|
3591
3922
|
* @returns {number} The length.
|
|
3592
3923
|
*/
|
|
3593
3924
|
length(): number;
|
|
3594
3925
|
/**
|
|
3595
|
-
* Get a string representation of the
|
|
3926
|
+
* Get a string representation of the point.
|
|
3596
3927
|
*
|
|
3597
|
-
* @returns {string} The
|
|
3928
|
+
* @returns {string} The point as a string.
|
|
3598
3929
|
*/
|
|
3599
3930
|
toString(): string;
|
|
3600
3931
|
/**
|
|
3601
|
-
* Get the values of this
|
|
3932
|
+
* Get the values of this point.
|
|
3602
3933
|
*
|
|
3603
3934
|
* @returns {number[]} The array of values.
|
|
3604
3935
|
*/
|
|
@@ -3668,6 +3999,18 @@ export declare class Point2D {
|
|
|
3668
3999
|
* @returns {number} The Y position of the point.
|
|
3669
4000
|
*/
|
|
3670
4001
|
getY(): number;
|
|
4002
|
+
/**
|
|
4003
|
+
* Get the values of this point.
|
|
4004
|
+
*
|
|
4005
|
+
* @returns {number[]} The array of values.
|
|
4006
|
+
*/
|
|
4007
|
+
getValues(): number[];
|
|
4008
|
+
/**
|
|
4009
|
+
* Get the centroid of the point, ie itself.
|
|
4010
|
+
*
|
|
4011
|
+
* @returns {Point2D} The centroid point.
|
|
4012
|
+
*/
|
|
4013
|
+
getCentroid(): Point2D;
|
|
3671
4014
|
/**
|
|
3672
4015
|
* Check for Point2D equality.
|
|
3673
4016
|
*
|
|
@@ -3719,6 +4062,12 @@ export declare class Point3D {
|
|
|
3719
4062
|
* @returns {number} The Z position of the point.
|
|
3720
4063
|
*/
|
|
3721
4064
|
getZ(): number;
|
|
4065
|
+
/**
|
|
4066
|
+
* Get the values of this point.
|
|
4067
|
+
*
|
|
4068
|
+
* @returns {number[]} The array of values.
|
|
4069
|
+
*/
|
|
4070
|
+
getValues(): number[];
|
|
3722
4071
|
/**
|
|
3723
4072
|
* Check for Point3D equality.
|
|
3724
4073
|
*
|
|
@@ -3780,6 +4129,137 @@ export declare class Point3D {
|
|
|
3780
4129
|
*/
|
|
3781
4130
|
export declare function precisionRound(number: number, precision: number): number;
|
|
3782
4131
|
|
|
4132
|
+
/**
|
|
4133
|
+
* Protractor shape: 3 points from which to calculate an angle.
|
|
4134
|
+
*/
|
|
4135
|
+
export declare class Protractor {
|
|
4136
|
+
/**
|
|
4137
|
+
* @param {Point2D[]} points The list of Point2D that make
|
|
4138
|
+
* the protractor.
|
|
4139
|
+
*/
|
|
4140
|
+
constructor(points: Point2D[]);
|
|
4141
|
+
/**
|
|
4142
|
+
* Get a point of the list.
|
|
4143
|
+
*
|
|
4144
|
+
* @param {number} index The index of the point
|
|
4145
|
+
* to get (beware, no size check).
|
|
4146
|
+
* @returns {Point2D|undefined} The Point2D at the given index.
|
|
4147
|
+
*/
|
|
4148
|
+
getPoint(index: number): Point2D | undefined;
|
|
4149
|
+
/**
|
|
4150
|
+
* Get the length of the path (should be 3).
|
|
4151
|
+
*
|
|
4152
|
+
* @returns {number} The length of the path.
|
|
4153
|
+
*/
|
|
4154
|
+
getLength(): number;
|
|
4155
|
+
/**
|
|
4156
|
+
* Get the centroid of the protractor.
|
|
4157
|
+
*
|
|
4158
|
+
* @returns {Point2D} THe centroid point.
|
|
4159
|
+
*/
|
|
4160
|
+
getCentroid(): Point2D;
|
|
4161
|
+
/**
|
|
4162
|
+
* Quantify a path according to view information.
|
|
4163
|
+
*
|
|
4164
|
+
* @param {ViewController} _viewController The associated view controller.
|
|
4165
|
+
* @param {string[]} _flags A list of stat values to calculate.
|
|
4166
|
+
* @returns {object} A quantification object.
|
|
4167
|
+
*/
|
|
4168
|
+
quantify(_viewController: ViewController, _flags: string[]): object;
|
|
4169
|
+
#private;
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
/**
|
|
4173
|
+
* Rectangle shape.
|
|
4174
|
+
*/
|
|
4175
|
+
export declare class Rectangle {
|
|
4176
|
+
/**
|
|
4177
|
+
* @param {Point2D} begin A Point2D representing the beginning
|
|
4178
|
+
* of the rectangle.
|
|
4179
|
+
* @param {Point2D} end A Point2D representing the end
|
|
4180
|
+
* of the rectangle.
|
|
4181
|
+
*/
|
|
4182
|
+
constructor(begin: Point2D, end: Point2D);
|
|
4183
|
+
/**
|
|
4184
|
+
* Get the begin point of the rectangle.
|
|
4185
|
+
*
|
|
4186
|
+
* @returns {Point2D} The begin point of the rectangle.
|
|
4187
|
+
*/
|
|
4188
|
+
getBegin(): Point2D;
|
|
4189
|
+
/**
|
|
4190
|
+
* Get the end point of the rectangle.
|
|
4191
|
+
*
|
|
4192
|
+
* @returns {Point2D} The end point of the rectangle.
|
|
4193
|
+
*/
|
|
4194
|
+
getEnd(): Point2D;
|
|
4195
|
+
/**
|
|
4196
|
+
* Check for equality.
|
|
4197
|
+
*
|
|
4198
|
+
* @param {Rectangle} rhs The object to compare to.
|
|
4199
|
+
* @returns {boolean} True if both objects are equal.
|
|
4200
|
+
*/
|
|
4201
|
+
equals(rhs: Rectangle): boolean;
|
|
4202
|
+
/**
|
|
4203
|
+
* Get the surface of the rectangle.
|
|
4204
|
+
*
|
|
4205
|
+
* @returns {number} The surface of the rectangle.
|
|
4206
|
+
*/
|
|
4207
|
+
getSurface(): number;
|
|
4208
|
+
/**
|
|
4209
|
+
* Get the surface of the rectangle according to a spacing.
|
|
4210
|
+
*
|
|
4211
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
4212
|
+
* @returns {number} The surface of the rectangle multiplied by the given
|
|
4213
|
+
* spacing or null for null spacings.
|
|
4214
|
+
*/
|
|
4215
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
4216
|
+
/**
|
|
4217
|
+
* Get the real width of the rectangle.
|
|
4218
|
+
*
|
|
4219
|
+
* @returns {number} The real width of the rectangle.
|
|
4220
|
+
*/
|
|
4221
|
+
getRealWidth(): number;
|
|
4222
|
+
/**
|
|
4223
|
+
* Get the real height of the rectangle.
|
|
4224
|
+
*
|
|
4225
|
+
* @returns {number} The real height of the rectangle.
|
|
4226
|
+
*/
|
|
4227
|
+
getRealHeight(): number;
|
|
4228
|
+
/**
|
|
4229
|
+
* Get the width of the rectangle.
|
|
4230
|
+
*
|
|
4231
|
+
* @returns {number} The width of the rectangle.
|
|
4232
|
+
*/
|
|
4233
|
+
getWidth(): number;
|
|
4234
|
+
/**
|
|
4235
|
+
* Get the height of the rectangle.
|
|
4236
|
+
*
|
|
4237
|
+
* @returns {number} The height of the rectangle.
|
|
4238
|
+
*/
|
|
4239
|
+
getHeight(): number;
|
|
4240
|
+
/**
|
|
4241
|
+
* Get the rounded limits of the rectangle.
|
|
4242
|
+
*
|
|
4243
|
+
* @returns {object} The rounded limits as {min, max} (Point2D).
|
|
4244
|
+
*/
|
|
4245
|
+
getRound(): object;
|
|
4246
|
+
/**
|
|
4247
|
+
* Get the centroid of the rectangle.
|
|
4248
|
+
*
|
|
4249
|
+
* @returns {Point2D} The centroid point.
|
|
4250
|
+
*/
|
|
4251
|
+
getCentroid(): Point2D;
|
|
4252
|
+
/**
|
|
4253
|
+
* Quantify a rectangle according to view information.
|
|
4254
|
+
*
|
|
4255
|
+
* @param {ViewController} viewController The associated view controller.
|
|
4256
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
4257
|
+
* @returns {object} A quantification object.
|
|
4258
|
+
*/
|
|
4259
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
4260
|
+
#private;
|
|
4261
|
+
}
|
|
4262
|
+
|
|
3783
4263
|
/**
|
|
3784
4264
|
* Rescale Slope and Intercept.
|
|
3785
4265
|
*/
|
|
@@ -3854,6 +4334,58 @@ export declare class RGB {
|
|
|
3854
4334
|
b: number;
|
|
3855
4335
|
}
|
|
3856
4336
|
|
|
4337
|
+
/**
|
|
4338
|
+
* Region Of Interest shape.
|
|
4339
|
+
* Note: should be a closed path.
|
|
4340
|
+
*/
|
|
4341
|
+
export declare class ROI {
|
|
4342
|
+
/**
|
|
4343
|
+
* @param {Point2D[]} [points] Optional initial point list.
|
|
4344
|
+
*/
|
|
4345
|
+
constructor(points?: Point2D[]);
|
|
4346
|
+
/**
|
|
4347
|
+
* Get a point of the list at a given index.
|
|
4348
|
+
*
|
|
4349
|
+
* @param {number} index The index of the point to get
|
|
4350
|
+
* (beware, no size check).
|
|
4351
|
+
* @returns {Point2D|undefined} The Point2D at the given index.
|
|
4352
|
+
*/
|
|
4353
|
+
getPoint(index: number): Point2D | undefined;
|
|
4354
|
+
/**
|
|
4355
|
+
* Get the point list.
|
|
4356
|
+
*
|
|
4357
|
+
* @returns {Point2D[]} The list.
|
|
4358
|
+
*/
|
|
4359
|
+
getPoints(): Point2D[];
|
|
4360
|
+
/**
|
|
4361
|
+
* Get the length of the point list.
|
|
4362
|
+
*
|
|
4363
|
+
* @returns {number} The length of the point list.
|
|
4364
|
+
*/
|
|
4365
|
+
getLength(): number;
|
|
4366
|
+
/**
|
|
4367
|
+
* Add a point to the ROI.
|
|
4368
|
+
*
|
|
4369
|
+
* @param {Point2D} point The Point2D to add.
|
|
4370
|
+
*/
|
|
4371
|
+
addPoint(point: Point2D): void;
|
|
4372
|
+
/**
|
|
4373
|
+
* Add points to the ROI.
|
|
4374
|
+
*
|
|
4375
|
+
* @param {Point2D[]} rhs The array of POints2D to add.
|
|
4376
|
+
*/
|
|
4377
|
+
addPoints(rhs: Point2D[]): void;
|
|
4378
|
+
/**
|
|
4379
|
+
* Get the centroid of the roi. Only valid for
|
|
4380
|
+
* a non-self-intersecting closed polygon.
|
|
4381
|
+
* Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}.
|
|
4382
|
+
*
|
|
4383
|
+
* @returns {Point2D} The centroid point.
|
|
4384
|
+
*/
|
|
4385
|
+
getCentroid(): Point2D;
|
|
4386
|
+
#private;
|
|
4387
|
+
}
|
|
4388
|
+
|
|
3857
4389
|
/**
|
|
3858
4390
|
* Mutable 2D scalar ({x,y}).
|
|
3859
4391
|
*/
|
|
@@ -4269,12 +4801,109 @@ export declare class ToolConfig {
|
|
|
4269
4801
|
* List of client provided tools to be added to
|
|
4270
4802
|
* the default ones.
|
|
4271
4803
|
*
|
|
4804
|
+
* @example
|
|
4805
|
+
* // custom tool
|
|
4806
|
+
* class AlertTool {
|
|
4807
|
+
* mousedown() {alert('AlertTool mousedown');}
|
|
4808
|
+
* init() {}
|
|
4809
|
+
* activate() {}
|
|
4810
|
+
* }
|
|
4811
|
+
* // pass it to dwv tool list
|
|
4812
|
+
* dwv.toolList['Alert'] = AlertTool;
|
|
4813
|
+
* // create the dwv app
|
|
4814
|
+
* const app = new dwv.App();
|
|
4815
|
+
* // initialise
|
|
4816
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
4817
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
4818
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
4819
|
+
* options.tools = {Alert: {}};
|
|
4820
|
+
* app.init(options);
|
|
4821
|
+
* // activate tool
|
|
4822
|
+
* app.addEventListener('load', function () {
|
|
4823
|
+
* app.setTool('Alert');
|
|
4824
|
+
* });
|
|
4825
|
+
* // load dicom data
|
|
4826
|
+
* app.loadURLs([
|
|
4827
|
+
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
4828
|
+
* ]);
|
|
4829
|
+
*
|
|
4272
4830
|
* @type {Object<string, any>}
|
|
4273
4831
|
*/
|
|
4274
4832
|
export declare const toolList: {
|
|
4275
4833
|
[x: string]: any;
|
|
4276
4834
|
};
|
|
4277
4835
|
|
|
4836
|
+
/**
|
|
4837
|
+
* List of client provided tool options to be added to
|
|
4838
|
+
* the default ones.
|
|
4839
|
+
*
|
|
4840
|
+
* @example
|
|
4841
|
+
* // custom factory
|
|
4842
|
+
* class LoveFactory {
|
|
4843
|
+
* getName() {return 'love';}
|
|
4844
|
+
* static supports(mathShape) {return mathShape instanceof ROI;}
|
|
4845
|
+
* getNPoints() {return 1;}
|
|
4846
|
+
* getTimeout() {return 0;}
|
|
4847
|
+
* setAnnotationMathShape(annotation, points) {
|
|
4848
|
+
* const px = points[0].getX();
|
|
4849
|
+
* const py = points[0].getY();
|
|
4850
|
+
* annotation.mathShape = new dwv.ROI([
|
|
4851
|
+
* new dwv.Point2D(px+15,py), new dwv.Point2D(px+10,py-10),
|
|
4852
|
+
* new dwv.Point2D(px,py), new dwv.Point2D(px-10,py-10),
|
|
4853
|
+
* new dwv.Point2D(px-15,py), new dwv.Point2D(px,py+20)
|
|
4854
|
+
* ]);
|
|
4855
|
+
* annotation.getFactory = function () {return new LoveFactory();}
|
|
4856
|
+
* }
|
|
4857
|
+
* createShapeGroup(annotation, style) {
|
|
4858
|
+
* const roi = annotation.mathShape;
|
|
4859
|
+
* // konva line
|
|
4860
|
+
* const arr = [];
|
|
4861
|
+
* for (let i = 0; i < roi.getLength(); ++i) {
|
|
4862
|
+
* arr.push(roi.getPoint(i).getX());
|
|
4863
|
+
* arr.push(roi.getPoint(i).getY());
|
|
4864
|
+
* }
|
|
4865
|
+
* const shape = new Konva.Line({
|
|
4866
|
+
* name: 'shape', points: arr,
|
|
4867
|
+
* stroke: 'red', strokeWidth: 2,
|
|
4868
|
+
* closed: true
|
|
4869
|
+
* });
|
|
4870
|
+
* // konva group
|
|
4871
|
+
* const group = new Konva.Group();
|
|
4872
|
+
* group.name('love-group');
|
|
4873
|
+
* group.visible(true);
|
|
4874
|
+
* group.id(annotation.id);
|
|
4875
|
+
* group.add(shape);
|
|
4876
|
+
* return group;
|
|
4877
|
+
* }
|
|
4878
|
+
* }
|
|
4879
|
+
* // pass it to dwv option list
|
|
4880
|
+
* dwv.toolOptions['draw'] = {LoveFactory};
|
|
4881
|
+
* // create the dwv app
|
|
4882
|
+
* const app = new dwv.App();
|
|
4883
|
+
* // initialise
|
|
4884
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
4885
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
4886
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
4887
|
+
* options.tools = {Draw: {options: ['Love']}};
|
|
4888
|
+
* app.init(options);
|
|
4889
|
+
* // activate tool
|
|
4890
|
+
* app.addEventListener('load', function () {
|
|
4891
|
+
* app.setTool('Draw');
|
|
4892
|
+
* app.setToolFeatures({shapeName: 'Love'});
|
|
4893
|
+
* });
|
|
4894
|
+
* // load dicom data
|
|
4895
|
+
* app.loadURLs([
|
|
4896
|
+
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
4897
|
+
* ]);
|
|
4898
|
+
*
|
|
4899
|
+
* @type {Object<string, Object<string, any>>}
|
|
4900
|
+
*/
|
|
4901
|
+
export declare const toolOptions: {
|
|
4902
|
+
[x: string]: {
|
|
4903
|
+
[x: string]: any;
|
|
4904
|
+
};
|
|
4905
|
+
};
|
|
4906
|
+
|
|
4278
4907
|
/**
|
|
4279
4908
|
* Immutable 3D vector.
|
|
4280
4909
|
*/
|
|
@@ -4517,9 +5146,16 @@ export declare class View {
|
|
|
4517
5146
|
* Get the image origin for a image UID.
|
|
4518
5147
|
*
|
|
4519
5148
|
* @param {string} uid The UID.
|
|
4520
|
-
* @returns {
|
|
5149
|
+
* @returns {Point3D|undefined} The origin.
|
|
5150
|
+
*/
|
|
5151
|
+
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
5152
|
+
/**
|
|
5153
|
+
* Check if the image includes an UID.
|
|
5154
|
+
*
|
|
5155
|
+
* @param {string} uid The UID.
|
|
5156
|
+
* @returns {boolean} True if present.
|
|
4521
5157
|
*/
|
|
4522
|
-
|
|
5158
|
+
includesImageUid(uid: string): boolean;
|
|
4523
5159
|
/**
|
|
4524
5160
|
* Check if the current position (default) or
|
|
4525
5161
|
* the provided position is in bounds.
|
|
@@ -4539,11 +5175,11 @@ export declare class View {
|
|
|
4539
5175
|
* Set the current position.
|
|
4540
5176
|
*
|
|
4541
5177
|
* @param {Point} position The new position.
|
|
4542
|
-
* @param {boolean} silent Flag to fire event or not.
|
|
5178
|
+
* @param {boolean} [silent] Flag to fire event or not.
|
|
4543
5179
|
* @returns {boolean} False if not in bounds.
|
|
4544
5180
|
* @fires View#positionchange
|
|
4545
5181
|
*/
|
|
4546
|
-
setCurrentPosition(position: Point, silent
|
|
5182
|
+
setCurrentPosition(position: Point, silent?: boolean): boolean;
|
|
4547
5183
|
/**
|
|
4548
5184
|
* Set the current index.
|
|
4549
5185
|
*
|
|
@@ -4625,6 +5261,12 @@ export declare class View {
|
|
|
4625
5261
|
* @returns {number} The index.
|
|
4626
5262
|
*/
|
|
4627
5263
|
getScrollIndex(): number;
|
|
5264
|
+
/**
|
|
5265
|
+
* Is this view in the same orientation as the image aquisition.
|
|
5266
|
+
*
|
|
5267
|
+
* @returns {boolean} True if in aquisition plane.
|
|
5268
|
+
*/
|
|
5269
|
+
isAquisitionOrientation(): boolean;
|
|
4628
5270
|
#private;
|
|
4629
5271
|
}
|
|
4630
5272
|
|
|
@@ -4764,12 +5406,19 @@ export declare class ViewController {
|
|
|
4764
5406
|
*/
|
|
4765
5407
|
getCurrentImageUid(): string;
|
|
4766
5408
|
/**
|
|
4767
|
-
* Get the image origin
|
|
5409
|
+
* Get the image origin for a image UID.
|
|
5410
|
+
*
|
|
5411
|
+
* @param {string} uid The UID.
|
|
5412
|
+
* @returns {Point3D|undefined} The origin.
|
|
5413
|
+
*/
|
|
5414
|
+
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
5415
|
+
/**
|
|
5416
|
+
* Check if the image includes an UID.
|
|
4768
5417
|
*
|
|
4769
5418
|
* @param {string} uid The UID.
|
|
4770
|
-
* @returns {
|
|
5419
|
+
* @returns {boolean} True if present.
|
|
4771
5420
|
*/
|
|
4772
|
-
|
|
5421
|
+
includesImageUid(uid: string): boolean;
|
|
4773
5422
|
/**
|
|
4774
5423
|
* Get the current oriented index.
|
|
4775
5424
|
*
|
|
@@ -4791,16 +5440,30 @@ export declare class ViewController {
|
|
|
4791
5440
|
/**
|
|
4792
5441
|
* Get the first origin or at a given position.
|
|
4793
5442
|
*
|
|
4794
|
-
* @param {Point} [position]
|
|
5443
|
+
* @param {Point} [position] Optional position.
|
|
4795
5444
|
* @returns {Point3D} The origin.
|
|
4796
5445
|
*/
|
|
4797
5446
|
getOrigin(position?: Point): Point3D;
|
|
5447
|
+
/**
|
|
5448
|
+
* Is this view in the same orientation as the image aquisition.
|
|
5449
|
+
*
|
|
5450
|
+
* @returns {boolean} True if in aquisition plane.
|
|
5451
|
+
*/
|
|
5452
|
+
isAquisitionOrientation(): boolean;
|
|
5453
|
+
/**
|
|
5454
|
+
* Get a list of points that define the plane at input position,
|
|
5455
|
+
* given this classes orientation.
|
|
5456
|
+
*
|
|
5457
|
+
* @param {Point} position The position.
|
|
5458
|
+
* @returns {Point3D[]} An origin and 2 cosines vectors.
|
|
5459
|
+
*/
|
|
5460
|
+
getPlanePoints(position: Point): Point3D[];
|
|
4798
5461
|
/**
|
|
4799
5462
|
* Get the current scroll position value.
|
|
4800
5463
|
*
|
|
4801
|
-
* @returns {
|
|
5464
|
+
* @returns {number} The value.
|
|
4802
5465
|
*/
|
|
4803
|
-
getCurrentScrollPosition():
|
|
5466
|
+
getCurrentScrollPosition(): number;
|
|
4804
5467
|
/**
|
|
4805
5468
|
* Generate display image data to be given to a canvas.
|
|
4806
5469
|
*
|
|
@@ -4860,7 +5523,7 @@ export declare class ViewController {
|
|
|
4860
5523
|
* Can window and level be applied to the data?
|
|
4861
5524
|
*
|
|
4862
5525
|
* @returns {boolean} True if possible.
|
|
4863
|
-
* @deprecated
|
|
5526
|
+
* @deprecated Since v0.33, please use isMonochrome instead.
|
|
4864
5527
|
*/
|
|
4865
5528
|
canWindowLevel(): boolean;
|
|
4866
5529
|
/**
|
|
@@ -4930,9 +5593,11 @@ export declare class ViewController {
|
|
|
4930
5593
|
* Get a world position from a 2D plane position.
|
|
4931
5594
|
*
|
|
4932
5595
|
* @param {Point2D} point2D The input point.
|
|
5596
|
+
* @param {number} [k] Optional slice index,
|
|
5597
|
+
* if undefined, uses the current one.
|
|
4933
5598
|
* @returns {Point} The associated position.
|
|
4934
5599
|
*/
|
|
4935
|
-
getPositionFromPlanePoint(point2D: Point2D): Point;
|
|
5600
|
+
getPositionFromPlanePoint(point2D: Point2D, k?: number): Point;
|
|
4936
5601
|
/**
|
|
4937
5602
|
* Get a 2D plane position from a world position.
|
|
4938
5603
|
*
|
|
@@ -4940,6 +5605,13 @@ export declare class ViewController {
|
|
|
4940
5605
|
* @returns {Point2D} The 2D position.
|
|
4941
5606
|
*/
|
|
4942
5607
|
getPlanePositionFromPosition(point: Point): Point2D;
|
|
5608
|
+
/**
|
|
5609
|
+
* Get the index of a world position.
|
|
5610
|
+
*
|
|
5611
|
+
* @param {Point} point The 3D position.
|
|
5612
|
+
* @returns {Index} The index.
|
|
5613
|
+
*/
|
|
5614
|
+
getIndexFromPosition(point: Point): Index;
|
|
4943
5615
|
/**
|
|
4944
5616
|
* Set the current index.
|
|
4945
5617
|
*
|