dwv 0.34.0-beta.17 → 0.34.0-beta.19
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 +544 -24
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +1 -1
package/dist/dwv.d.ts
CHANGED
|
@@ -79,10 +79,30 @@ export declare class Annotation {
|
|
|
79
79
|
*/
|
|
80
80
|
planePoints: Point3D[] | undefined;
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
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.
|
|
83
90
|
*
|
|
84
91
|
* @param {ViewController} viewController The associated view controller.
|
|
85
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
|
+
*/
|
|
86
106
|
setViewController(viewController: ViewController): void;
|
|
87
107
|
/**
|
|
88
108
|
* Get the centroid of the math shape.
|
|
@@ -116,12 +136,6 @@ export declare class Annotation {
|
|
|
116
136
|
* @returns {object} The factory.
|
|
117
137
|
*/
|
|
118
138
|
getFactory(): object;
|
|
119
|
-
/**
|
|
120
|
-
* Get the string type of this annotation.
|
|
121
|
-
*
|
|
122
|
-
* @returns {string} The type.
|
|
123
|
-
*/
|
|
124
|
-
getType(): string;
|
|
125
139
|
#private;
|
|
126
140
|
}
|
|
127
141
|
|
|
@@ -158,6 +172,18 @@ export declare class AnnotationGroup {
|
|
|
158
172
|
* @param {boolean} flag True to make the annotation group editable.
|
|
159
173
|
*/
|
|
160
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;
|
|
161
187
|
/**
|
|
162
188
|
* Add a new annotation.
|
|
163
189
|
*
|
|
@@ -407,6 +433,16 @@ export declare class App {
|
|
|
407
433
|
* @returns {ViewLayer[]} The layers.
|
|
408
434
|
*/
|
|
409
435
|
getViewLayersByDataId(dataId: string): ViewLayer[];
|
|
436
|
+
/**
|
|
437
|
+
* Get a list of view layers according to an input callback function.
|
|
438
|
+
*
|
|
439
|
+
* @param {Function} [callbackFn] A function that takes
|
|
440
|
+
* a ViewLayer as input and returns a boolean. If undefined,
|
|
441
|
+
* returns all view layers.
|
|
442
|
+
* @returns {ViewLayer[]} The layers that
|
|
443
|
+
* satisfy the callbackFn.
|
|
444
|
+
*/
|
|
445
|
+
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
410
446
|
/**
|
|
411
447
|
* Get the draw layers associated to a data id.
|
|
412
448
|
* The layer are available after the first loaded item.
|
|
@@ -415,6 +451,16 @@ export declare class App {
|
|
|
415
451
|
* @returns {DrawLayer[]} The layers.
|
|
416
452
|
*/
|
|
417
453
|
getDrawLayersByDataId(dataId: string): DrawLayer[];
|
|
454
|
+
/**
|
|
455
|
+
* Get a list of draw layers according to an input callback function.
|
|
456
|
+
*
|
|
457
|
+
* @param {Function} [callbackFn] A function that takes
|
|
458
|
+
* a DrawLayer as input and returns a boolean. If undefined,
|
|
459
|
+
* returns all draw layers.
|
|
460
|
+
* @returns {DrawLayer[]} The layers that
|
|
461
|
+
* satisfy the callbackFn.
|
|
462
|
+
*/
|
|
463
|
+
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
418
464
|
/**
|
|
419
465
|
* Get a layer group by div id.
|
|
420
466
|
* The layer is available after the first loaded item.
|
|
@@ -965,6 +1011,79 @@ export declare class ChangeSegmentColourCommand {
|
|
|
965
1011
|
#private;
|
|
966
1012
|
}
|
|
967
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* Circle shape.
|
|
1016
|
+
*/
|
|
1017
|
+
export declare class Circle {
|
|
1018
|
+
/**
|
|
1019
|
+
* @param {Point2D} centre A Point2D representing the centre
|
|
1020
|
+
* of the circle.
|
|
1021
|
+
* @param {number} radius The radius of the circle.
|
|
1022
|
+
*/
|
|
1023
|
+
constructor(centre: Point2D, radius: number);
|
|
1024
|
+
/**
|
|
1025
|
+
* Get the centre (point) of the circle.
|
|
1026
|
+
*
|
|
1027
|
+
* @returns {Point2D} The center (point) of the circle.
|
|
1028
|
+
*/
|
|
1029
|
+
getCenter(): Point2D;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get the centroid of the circle.
|
|
1032
|
+
*
|
|
1033
|
+
* @returns {Point2D} The centroid point.
|
|
1034
|
+
*/
|
|
1035
|
+
getCentroid(): Point2D;
|
|
1036
|
+
/**
|
|
1037
|
+
* Get the radius of the circle.
|
|
1038
|
+
*
|
|
1039
|
+
* @returns {number} The radius of the circle.
|
|
1040
|
+
*/
|
|
1041
|
+
getRadius(): number;
|
|
1042
|
+
/**
|
|
1043
|
+
* Check for equality.
|
|
1044
|
+
*
|
|
1045
|
+
* @param {Circle} rhs The object to compare to.
|
|
1046
|
+
* @returns {boolean} True if both objects are equal.
|
|
1047
|
+
*/
|
|
1048
|
+
equals(rhs: Circle): boolean;
|
|
1049
|
+
/**
|
|
1050
|
+
* Get the surface of the circle.
|
|
1051
|
+
*
|
|
1052
|
+
* @returns {number} The surface of the circle.
|
|
1053
|
+
*/
|
|
1054
|
+
getSurface(): number;
|
|
1055
|
+
/**
|
|
1056
|
+
* Get the surface of the circle according to a spacing.
|
|
1057
|
+
*
|
|
1058
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
1059
|
+
* @returns {number} The surface of the circle multiplied by the given
|
|
1060
|
+
* spacing or null for null spacings.
|
|
1061
|
+
*/
|
|
1062
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
1063
|
+
/**
|
|
1064
|
+
* Get the rounded limits of the circle.
|
|
1065
|
+
*
|
|
1066
|
+
* See: {@link https://en.wikipedia.org/wiki/Circle#Equations}.
|
|
1067
|
+
*
|
|
1068
|
+
* Circle formula: `x*x + y*y = r*r`.
|
|
1069
|
+
*
|
|
1070
|
+
* Implies: `y = (+-) sqrt(r*r - x*x)`.
|
|
1071
|
+
*
|
|
1072
|
+
* @returns {number[][][]} The rounded limits:
|
|
1073
|
+
* list of [x, y] pairs (min, max).
|
|
1074
|
+
*/
|
|
1075
|
+
getRound(): number[][][];
|
|
1076
|
+
/**
|
|
1077
|
+
* Quantify an circle according to view information.
|
|
1078
|
+
*
|
|
1079
|
+
* @param {ViewController} viewController The associated view controller.
|
|
1080
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
1081
|
+
* @returns {object} A quantification object.
|
|
1082
|
+
*/
|
|
1083
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
1084
|
+
#private;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
968
1087
|
/**
|
|
969
1088
|
* Colour map: red, green and blue components
|
|
970
1089
|
* to associate with intensity values.
|
|
@@ -1885,6 +2004,86 @@ export declare class DrawShapeHandler {
|
|
|
1885
2004
|
#private;
|
|
1886
2005
|
}
|
|
1887
2006
|
|
|
2007
|
+
/**
|
|
2008
|
+
* Ellipse shape.
|
|
2009
|
+
*/
|
|
2010
|
+
export declare class Ellipse {
|
|
2011
|
+
/**
|
|
2012
|
+
* @param {Point2D} centre A Point2D representing the centre
|
|
2013
|
+
* of the ellipse.
|
|
2014
|
+
* @param {number} a The radius of the ellipse on the horizontal axe.
|
|
2015
|
+
* @param {number} b The radius of the ellipse on the vertical axe.
|
|
2016
|
+
*/
|
|
2017
|
+
constructor(centre: Point2D, a: number, b: number);
|
|
2018
|
+
/**
|
|
2019
|
+
* Get the centre (point) of the ellipse.
|
|
2020
|
+
*
|
|
2021
|
+
* @returns {Point2D} The center (point) of the ellipse.
|
|
2022
|
+
*/
|
|
2023
|
+
getCenter(): Point2D;
|
|
2024
|
+
/**
|
|
2025
|
+
* Get the centroid of the ellipse.
|
|
2026
|
+
*
|
|
2027
|
+
* @returns {Point2D} The centroid point.
|
|
2028
|
+
*/
|
|
2029
|
+
getCentroid(): Point2D;
|
|
2030
|
+
/**
|
|
2031
|
+
* Get the radius of the ellipse on the horizontal axe.
|
|
2032
|
+
*
|
|
2033
|
+
* @returns {number} The radius of the ellipse on the horizontal axe.
|
|
2034
|
+
*/
|
|
2035
|
+
getA(): number;
|
|
2036
|
+
/**
|
|
2037
|
+
* Get the radius of the ellipse on the vertical axe.
|
|
2038
|
+
*
|
|
2039
|
+
* @returns {number} The radius of the ellipse on the vertical axe.
|
|
2040
|
+
*/
|
|
2041
|
+
getB(): number;
|
|
2042
|
+
/**
|
|
2043
|
+
* Check for equality.
|
|
2044
|
+
*
|
|
2045
|
+
* @param {Ellipse} rhs The object to compare to.
|
|
2046
|
+
* @returns {boolean} True if both objects are equal.
|
|
2047
|
+
*/
|
|
2048
|
+
equals(rhs: Ellipse): boolean;
|
|
2049
|
+
/**
|
|
2050
|
+
* Get the surface of the ellipse.
|
|
2051
|
+
*
|
|
2052
|
+
* @returns {number} The surface of the ellipse.
|
|
2053
|
+
*/
|
|
2054
|
+
getSurface(): number;
|
|
2055
|
+
/**
|
|
2056
|
+
* Get the surface of the ellipse according to a spacing.
|
|
2057
|
+
*
|
|
2058
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
2059
|
+
* @returns {number} The surface of the ellipse multiplied by the given
|
|
2060
|
+
* spacing or null for null spacings.
|
|
2061
|
+
*/
|
|
2062
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
2063
|
+
/**
|
|
2064
|
+
* Get the rounded limits of the ellipse.
|
|
2065
|
+
*
|
|
2066
|
+
* See: {@link https://en.wikipedia.org/wiki/Ellipse#Standard_equation}.
|
|
2067
|
+
*
|
|
2068
|
+
* Ellipse formula: `x*x / a*a + y*y / b*b = 1`.
|
|
2069
|
+
*
|
|
2070
|
+
* Implies: `y = (+-)(b/a) * sqrt(a*a - x*x)`.
|
|
2071
|
+
*
|
|
2072
|
+
* @returns {number[][][]} The rounded limits:
|
|
2073
|
+
* list of [x, y] pairs (min, max).
|
|
2074
|
+
*/
|
|
2075
|
+
getRound(): number[][][];
|
|
2076
|
+
/**
|
|
2077
|
+
* Quantify an ellipse according to view information.
|
|
2078
|
+
*
|
|
2079
|
+
* @param {ViewController} viewController The associated view controller.
|
|
2080
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
2081
|
+
* @returns {object} A quantification object.
|
|
2082
|
+
*/
|
|
2083
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
2084
|
+
#private;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
1888
2087
|
/**
|
|
1889
2088
|
* 2D/3D Geometry class.
|
|
1890
2089
|
*/
|
|
@@ -2144,11 +2343,12 @@ export declare function getMousePoint(event: object): Point2D;
|
|
|
2144
2343
|
/**
|
|
2145
2344
|
* Get the name of an image orientation patient.
|
|
2146
2345
|
*
|
|
2147
|
-
* @param {number[]}
|
|
2346
|
+
* @param {number[]} cosines The image orientation
|
|
2347
|
+
* patient cosines (6 values).
|
|
2148
2348
|
* @returns {string|undefined} The orientation
|
|
2149
2349
|
* name: axial, coronal or sagittal.
|
|
2150
2350
|
*/
|
|
2151
|
-
export declare function getOrientationName(
|
|
2351
|
+
export declare function getOrientationName(cosines: number[]): string | undefined;
|
|
2152
2352
|
|
|
2153
2353
|
/**
|
|
2154
2354
|
* Get the PixelData Tag.
|
|
@@ -2299,6 +2499,13 @@ declare class Image_2 {
|
|
|
2299
2499
|
* @returns {Point3D|undefined} The origin.
|
|
2300
2500
|
*/
|
|
2301
2501
|
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
2502
|
+
/**
|
|
2503
|
+
* Check if the image includes an UID.
|
|
2504
|
+
*
|
|
2505
|
+
* @param {string} uid The UID.
|
|
2506
|
+
* @returns {boolean} True if present.
|
|
2507
|
+
*/
|
|
2508
|
+
includesImageUid(uid: string): boolean;
|
|
2302
2509
|
/**
|
|
2303
2510
|
* Check if this image includes the input uids.
|
|
2304
2511
|
*
|
|
@@ -2823,6 +3030,35 @@ export declare class LayerGroup {
|
|
|
2823
3030
|
* a layer with the input id.
|
|
2824
3031
|
*/
|
|
2825
3032
|
includes(id: string): boolean;
|
|
3033
|
+
/**
|
|
3034
|
+
* Get a list of view layers according to an input callback function.
|
|
3035
|
+
*
|
|
3036
|
+
* @param {Function} [callbackFn] A function that takes
|
|
3037
|
+
* a ViewLayer as input and returns a boolean. If undefined,
|
|
3038
|
+
* returns all view layers.
|
|
3039
|
+
* @returns {ViewLayer[]} The layers that
|
|
3040
|
+
* satisfy the callbackFn.
|
|
3041
|
+
*/
|
|
3042
|
+
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
3043
|
+
/**
|
|
3044
|
+
* Test if one of the view layers satisfies an input callbackFn.
|
|
3045
|
+
*
|
|
3046
|
+
* @param {Function} callbackFn A function that takes
|
|
3047
|
+
* a ViewLayer as input and returns a boolean.
|
|
3048
|
+
* @returns {boolean} True if one of the ViewLayers
|
|
3049
|
+
* satisfies the callbackFn.
|
|
3050
|
+
*/
|
|
3051
|
+
someViewLayer(callbackFn: Function): boolean;
|
|
3052
|
+
/**
|
|
3053
|
+
* Get a list of draw layers according to an input callback function.
|
|
3054
|
+
*
|
|
3055
|
+
* @param {Function} [callbackFn] A function that takes
|
|
3056
|
+
* a DrawLayer as input and returns a boolean. If undefined,
|
|
3057
|
+
* returns all draw layers.
|
|
3058
|
+
* @returns {DrawLayer[]} The layers that
|
|
3059
|
+
* satisfy the callbackFn.
|
|
3060
|
+
*/
|
|
3061
|
+
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
2826
3062
|
/**
|
|
2827
3063
|
* Get the number of view layers handled by this class.
|
|
2828
3064
|
*
|
|
@@ -2945,14 +3181,6 @@ export declare class LayerGroup {
|
|
|
2945
3181
|
* Remove the tooltip html div.
|
|
2946
3182
|
*/
|
|
2947
3183
|
removeTooltipDiv(): void;
|
|
2948
|
-
/**
|
|
2949
|
-
* Test if one of the view layers satisfies an input callbackFn.
|
|
2950
|
-
*
|
|
2951
|
-
* @param {Function} callbackFn A function that takes a ViewLayer as input
|
|
2952
|
-
* and returns a boolean.
|
|
2953
|
-
* @returns {boolean} True if one of the ViewLayers satisfies the callbackFn.
|
|
2954
|
-
*/
|
|
2955
|
-
someViewLayer(callbackFn: Function): boolean;
|
|
2956
3184
|
/**
|
|
2957
3185
|
* Can the input position be set on one of the view layers.
|
|
2958
3186
|
*
|
|
@@ -3507,6 +3735,18 @@ export declare class PlaneHelper {
|
|
|
3507
3735
|
* @param {Matrix33} viewOrientation The view orientation.
|
|
3508
3736
|
*/
|
|
3509
3737
|
constructor(imageGeometry: Geometry, viewOrientation: Matrix33);
|
|
3738
|
+
/**
|
|
3739
|
+
* Get the view orientation.
|
|
3740
|
+
*
|
|
3741
|
+
* @returns {Matrix33} The orientation matrix.
|
|
3742
|
+
*/
|
|
3743
|
+
getViewOrientation(): Matrix33;
|
|
3744
|
+
/**
|
|
3745
|
+
* Get the target orientation.
|
|
3746
|
+
*
|
|
3747
|
+
* @returns {Matrix33} The orientation matrix.
|
|
3748
|
+
*/
|
|
3749
|
+
getTargetOrientation(): Matrix33;
|
|
3510
3750
|
/**
|
|
3511
3751
|
* Get a 3D offset from a plane one.
|
|
3512
3752
|
*
|
|
@@ -3582,7 +3822,7 @@ export declare class PlaneHelper {
|
|
|
3582
3822
|
* Get a list of points that define the plane at position k.
|
|
3583
3823
|
*
|
|
3584
3824
|
* @param {number} k The slice index value.
|
|
3585
|
-
* @returns {Point3D[]}
|
|
3825
|
+
* @returns {Point3D[]} An origin and 2 cosines vectors.
|
|
3586
3826
|
*/
|
|
3587
3827
|
getPlanePoints(k: number): Point3D[];
|
|
3588
3828
|
/**
|
|
@@ -3623,7 +3863,7 @@ export declare class PlaneHelper {
|
|
|
3623
3863
|
/**
|
|
3624
3864
|
* Immutable point.
|
|
3625
3865
|
* Warning: the input array is NOT cloned, modifying it will
|
|
3626
|
-
* modify the
|
|
3866
|
+
* modify the point values.
|
|
3627
3867
|
*/
|
|
3628
3868
|
export declare class Point {
|
|
3629
3869
|
/**
|
|
@@ -3631,26 +3871,26 @@ export declare class Point {
|
|
|
3631
3871
|
*/
|
|
3632
3872
|
constructor(values: number[]);
|
|
3633
3873
|
/**
|
|
3634
|
-
* Get the
|
|
3874
|
+
* Get the point value at the given array index.
|
|
3635
3875
|
*
|
|
3636
3876
|
* @param {number} i The index to get.
|
|
3637
3877
|
* @returns {number} The value.
|
|
3638
3878
|
*/
|
|
3639
3879
|
get(i: number): number;
|
|
3640
3880
|
/**
|
|
3641
|
-
* Get the length of the
|
|
3881
|
+
* Get the length of the point.
|
|
3642
3882
|
*
|
|
3643
3883
|
* @returns {number} The length.
|
|
3644
3884
|
*/
|
|
3645
3885
|
length(): number;
|
|
3646
3886
|
/**
|
|
3647
|
-
* Get a string representation of the
|
|
3887
|
+
* Get a string representation of the point.
|
|
3648
3888
|
*
|
|
3649
|
-
* @returns {string} The
|
|
3889
|
+
* @returns {string} The point as a string.
|
|
3650
3890
|
*/
|
|
3651
3891
|
toString(): string;
|
|
3652
3892
|
/**
|
|
3653
|
-
* Get the values of this
|
|
3893
|
+
* Get the values of this point.
|
|
3654
3894
|
*
|
|
3655
3895
|
* @returns {number[]} The array of values.
|
|
3656
3896
|
*/
|
|
@@ -3720,6 +3960,12 @@ export declare class Point2D {
|
|
|
3720
3960
|
* @returns {number} The Y position of the point.
|
|
3721
3961
|
*/
|
|
3722
3962
|
getY(): number;
|
|
3963
|
+
/**
|
|
3964
|
+
* Get the values of this point.
|
|
3965
|
+
*
|
|
3966
|
+
* @returns {number[]} The array of values.
|
|
3967
|
+
*/
|
|
3968
|
+
getValues(): number[];
|
|
3723
3969
|
/**
|
|
3724
3970
|
* Get the centroid of the point, ie itself.
|
|
3725
3971
|
*
|
|
@@ -3777,6 +4023,12 @@ export declare class Point3D {
|
|
|
3777
4023
|
* @returns {number} The Z position of the point.
|
|
3778
4024
|
*/
|
|
3779
4025
|
getZ(): number;
|
|
4026
|
+
/**
|
|
4027
|
+
* Get the values of this point.
|
|
4028
|
+
*
|
|
4029
|
+
* @returns {number[]} The array of values.
|
|
4030
|
+
*/
|
|
4031
|
+
getValues(): number[];
|
|
3780
4032
|
/**
|
|
3781
4033
|
* Check for Point3D equality.
|
|
3782
4034
|
*
|
|
@@ -3838,6 +4090,137 @@ export declare class Point3D {
|
|
|
3838
4090
|
*/
|
|
3839
4091
|
export declare function precisionRound(number: number, precision: number): number;
|
|
3840
4092
|
|
|
4093
|
+
/**
|
|
4094
|
+
* Protractor shape: 3 points from which to calculate an angle.
|
|
4095
|
+
*/
|
|
4096
|
+
export declare class Protractor {
|
|
4097
|
+
/**
|
|
4098
|
+
* @param {Point2D[]} points The list of Point2D that make
|
|
4099
|
+
* the protractor.
|
|
4100
|
+
*/
|
|
4101
|
+
constructor(points: Point2D[]);
|
|
4102
|
+
/**
|
|
4103
|
+
* Get a point of the list.
|
|
4104
|
+
*
|
|
4105
|
+
* @param {number} index The index of the point
|
|
4106
|
+
* to get (beware, no size check).
|
|
4107
|
+
* @returns {Point2D|undefined} The Point2D at the given index.
|
|
4108
|
+
*/
|
|
4109
|
+
getPoint(index: number): Point2D | undefined;
|
|
4110
|
+
/**
|
|
4111
|
+
* Get the length of the path (should be 3).
|
|
4112
|
+
*
|
|
4113
|
+
* @returns {number} The length of the path.
|
|
4114
|
+
*/
|
|
4115
|
+
getLength(): number;
|
|
4116
|
+
/**
|
|
4117
|
+
* Get the centroid of the protractor.
|
|
4118
|
+
*
|
|
4119
|
+
* @returns {Point2D} THe centroid point.
|
|
4120
|
+
*/
|
|
4121
|
+
getCentroid(): Point2D;
|
|
4122
|
+
/**
|
|
4123
|
+
* Quantify a path according to view information.
|
|
4124
|
+
*
|
|
4125
|
+
* @param {ViewController} _viewController The associated view controller.
|
|
4126
|
+
* @param {string[]} _flags A list of stat values to calculate.
|
|
4127
|
+
* @returns {object} A quantification object.
|
|
4128
|
+
*/
|
|
4129
|
+
quantify(_viewController: ViewController, _flags: string[]): object;
|
|
4130
|
+
#private;
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
/**
|
|
4134
|
+
* Rectangle shape.
|
|
4135
|
+
*/
|
|
4136
|
+
export declare class Rectangle {
|
|
4137
|
+
/**
|
|
4138
|
+
* @param {Point2D} begin A Point2D representing the beginning
|
|
4139
|
+
* of the rectangle.
|
|
4140
|
+
* @param {Point2D} end A Point2D representing the end
|
|
4141
|
+
* of the rectangle.
|
|
4142
|
+
*/
|
|
4143
|
+
constructor(begin: Point2D, end: Point2D);
|
|
4144
|
+
/**
|
|
4145
|
+
* Get the begin point of the rectangle.
|
|
4146
|
+
*
|
|
4147
|
+
* @returns {Point2D} The begin point of the rectangle.
|
|
4148
|
+
*/
|
|
4149
|
+
getBegin(): Point2D;
|
|
4150
|
+
/**
|
|
4151
|
+
* Get the end point of the rectangle.
|
|
4152
|
+
*
|
|
4153
|
+
* @returns {Point2D} The end point of the rectangle.
|
|
4154
|
+
*/
|
|
4155
|
+
getEnd(): Point2D;
|
|
4156
|
+
/**
|
|
4157
|
+
* Check for equality.
|
|
4158
|
+
*
|
|
4159
|
+
* @param {Rectangle} rhs The object to compare to.
|
|
4160
|
+
* @returns {boolean} True if both objects are equal.
|
|
4161
|
+
*/
|
|
4162
|
+
equals(rhs: Rectangle): boolean;
|
|
4163
|
+
/**
|
|
4164
|
+
* Get the surface of the rectangle.
|
|
4165
|
+
*
|
|
4166
|
+
* @returns {number} The surface of the rectangle.
|
|
4167
|
+
*/
|
|
4168
|
+
getSurface(): number;
|
|
4169
|
+
/**
|
|
4170
|
+
* Get the surface of the rectangle according to a spacing.
|
|
4171
|
+
*
|
|
4172
|
+
* @param {Scalar2D} spacing2D The 2D spacing.
|
|
4173
|
+
* @returns {number} The surface of the rectangle multiplied by the given
|
|
4174
|
+
* spacing or null for null spacings.
|
|
4175
|
+
*/
|
|
4176
|
+
getWorldSurface(spacing2D: Scalar2D): number;
|
|
4177
|
+
/**
|
|
4178
|
+
* Get the real width of the rectangle.
|
|
4179
|
+
*
|
|
4180
|
+
* @returns {number} The real width of the rectangle.
|
|
4181
|
+
*/
|
|
4182
|
+
getRealWidth(): number;
|
|
4183
|
+
/**
|
|
4184
|
+
* Get the real height of the rectangle.
|
|
4185
|
+
*
|
|
4186
|
+
* @returns {number} The real height of the rectangle.
|
|
4187
|
+
*/
|
|
4188
|
+
getRealHeight(): number;
|
|
4189
|
+
/**
|
|
4190
|
+
* Get the width of the rectangle.
|
|
4191
|
+
*
|
|
4192
|
+
* @returns {number} The width of the rectangle.
|
|
4193
|
+
*/
|
|
4194
|
+
getWidth(): number;
|
|
4195
|
+
/**
|
|
4196
|
+
* Get the height of the rectangle.
|
|
4197
|
+
*
|
|
4198
|
+
* @returns {number} The height of the rectangle.
|
|
4199
|
+
*/
|
|
4200
|
+
getHeight(): number;
|
|
4201
|
+
/**
|
|
4202
|
+
* Get the rounded limits of the rectangle.
|
|
4203
|
+
*
|
|
4204
|
+
* @returns {object} The rounded limits as {min, max} (Point2D).
|
|
4205
|
+
*/
|
|
4206
|
+
getRound(): object;
|
|
4207
|
+
/**
|
|
4208
|
+
* Get the centroid of the rectangle.
|
|
4209
|
+
*
|
|
4210
|
+
* @returns {Point2D} The centroid point.
|
|
4211
|
+
*/
|
|
4212
|
+
getCentroid(): Point2D;
|
|
4213
|
+
/**
|
|
4214
|
+
* Quantify a rectangle according to view information.
|
|
4215
|
+
*
|
|
4216
|
+
* @param {ViewController} viewController The associated view controller.
|
|
4217
|
+
* @param {string[]} flags A list of stat values to calculate.
|
|
4218
|
+
* @returns {object} A quantification object.
|
|
4219
|
+
*/
|
|
4220
|
+
quantify(viewController: ViewController, flags: string[]): object;
|
|
4221
|
+
#private;
|
|
4222
|
+
}
|
|
4223
|
+
|
|
3841
4224
|
/**
|
|
3842
4225
|
* Rescale Slope and Intercept.
|
|
3843
4226
|
*/
|
|
@@ -3912,6 +4295,58 @@ export declare class RGB {
|
|
|
3912
4295
|
b: number;
|
|
3913
4296
|
}
|
|
3914
4297
|
|
|
4298
|
+
/**
|
|
4299
|
+
* Region Of Interest shape.
|
|
4300
|
+
* Note: should be a closed path.
|
|
4301
|
+
*/
|
|
4302
|
+
export declare class ROI {
|
|
4303
|
+
/**
|
|
4304
|
+
* @param {Point2D[]} [points] Optional initial point list.
|
|
4305
|
+
*/
|
|
4306
|
+
constructor(points?: Point2D[]);
|
|
4307
|
+
/**
|
|
4308
|
+
* Get a point of the list at a given index.
|
|
4309
|
+
*
|
|
4310
|
+
* @param {number} index The index of the point to get
|
|
4311
|
+
* (beware, no size check).
|
|
4312
|
+
* @returns {Point2D|undefined} The Point2D at the given index.
|
|
4313
|
+
*/
|
|
4314
|
+
getPoint(index: number): Point2D | undefined;
|
|
4315
|
+
/**
|
|
4316
|
+
* Get the point list.
|
|
4317
|
+
*
|
|
4318
|
+
* @returns {Point2D[]} The list.
|
|
4319
|
+
*/
|
|
4320
|
+
getPoints(): Point2D[];
|
|
4321
|
+
/**
|
|
4322
|
+
* Get the length of the point list.
|
|
4323
|
+
*
|
|
4324
|
+
* @returns {number} The length of the point list.
|
|
4325
|
+
*/
|
|
4326
|
+
getLength(): number;
|
|
4327
|
+
/**
|
|
4328
|
+
* Add a point to the ROI.
|
|
4329
|
+
*
|
|
4330
|
+
* @param {Point2D} point The Point2D to add.
|
|
4331
|
+
*/
|
|
4332
|
+
addPoint(point: Point2D): void;
|
|
4333
|
+
/**
|
|
4334
|
+
* Add points to the ROI.
|
|
4335
|
+
*
|
|
4336
|
+
* @param {Point2D[]} rhs The array of POints2D to add.
|
|
4337
|
+
*/
|
|
4338
|
+
addPoints(rhs: Point2D[]): void;
|
|
4339
|
+
/**
|
|
4340
|
+
* Get the centroid of the roi. Only valid for
|
|
4341
|
+
* a non-self-intersecting closed polygon.
|
|
4342
|
+
* Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}.
|
|
4343
|
+
*
|
|
4344
|
+
* @returns {Point2D} The centroid point.
|
|
4345
|
+
*/
|
|
4346
|
+
getCentroid(): Point2D;
|
|
4347
|
+
#private;
|
|
4348
|
+
}
|
|
4349
|
+
|
|
3915
4350
|
/**
|
|
3916
4351
|
* Mutable 2D scalar ({x,y}).
|
|
3917
4352
|
*/
|
|
@@ -4359,6 +4794,77 @@ export declare const toolList: {
|
|
|
4359
4794
|
[x: string]: any;
|
|
4360
4795
|
};
|
|
4361
4796
|
|
|
4797
|
+
/**
|
|
4798
|
+
* List of client provided tool options to be added to
|
|
4799
|
+
* the default ones.
|
|
4800
|
+
*
|
|
4801
|
+
* @example
|
|
4802
|
+
* // custom factory
|
|
4803
|
+
* class LoveFactory {
|
|
4804
|
+
* getName() {return 'love';}
|
|
4805
|
+
* static supports(mathShape) {return mathShape instanceof ROI;}
|
|
4806
|
+
* getNPoints() {return 1;}
|
|
4807
|
+
* getTimeout() {return 0;}
|
|
4808
|
+
* setAnnotationMathShape(annotation, points) {
|
|
4809
|
+
* const px = points[0].getX();
|
|
4810
|
+
* const py = points[0].getY();
|
|
4811
|
+
* annotation.mathShape = new dwv.ROI([
|
|
4812
|
+
* new dwv.Point2D(px+15,py), new dwv.Point2D(px+10,py-10),
|
|
4813
|
+
* new dwv.Point2D(px,py), new dwv.Point2D(px-10,py-10),
|
|
4814
|
+
* new dwv.Point2D(px-15,py), new dwv.Point2D(px,py+20)
|
|
4815
|
+
* ]);
|
|
4816
|
+
* annotation.getFactory = function () {return new LoveFactory();}
|
|
4817
|
+
* }
|
|
4818
|
+
* createShapeGroup(annotation, style) {
|
|
4819
|
+
* const roi = annotation.mathShape;
|
|
4820
|
+
* // konva line
|
|
4821
|
+
* const arr = [];
|
|
4822
|
+
* for (let i = 0; i < roi.getLength(); ++i) {
|
|
4823
|
+
* arr.push(roi.getPoint(i).getX());
|
|
4824
|
+
* arr.push(roi.getPoint(i).getY());
|
|
4825
|
+
* }
|
|
4826
|
+
* const shape = new Konva.Line({
|
|
4827
|
+
* name: 'shape', points: arr,
|
|
4828
|
+
* stroke: 'red', strokeWidth: 2,
|
|
4829
|
+
* closed: true
|
|
4830
|
+
* });
|
|
4831
|
+
* // konva group
|
|
4832
|
+
* const group = new Konva.Group();
|
|
4833
|
+
* group.name('love-group');
|
|
4834
|
+
* group.visible(true);
|
|
4835
|
+
* group.id(annotation.id);
|
|
4836
|
+
* group.add(shape);
|
|
4837
|
+
* return group;
|
|
4838
|
+
* }
|
|
4839
|
+
* }
|
|
4840
|
+
* // pass it to dwv option list
|
|
4841
|
+
* dwv.toolOptions['draw'] = {LoveFactory};
|
|
4842
|
+
* // create the dwv app
|
|
4843
|
+
* const app = new dwv.App();
|
|
4844
|
+
* // initialise
|
|
4845
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
4846
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
4847
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
4848
|
+
* options.tools = {Draw: {options: ['Love']}};
|
|
4849
|
+
* app.init(options);
|
|
4850
|
+
* // activate tool
|
|
4851
|
+
* app.addEventListener('load', function () {
|
|
4852
|
+
* app.setTool('Draw');
|
|
4853
|
+
* app.setToolFeatures({shapeName: 'Love'});
|
|
4854
|
+
* });
|
|
4855
|
+
* // load dicom data
|
|
4856
|
+
* app.loadURLs([
|
|
4857
|
+
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
4858
|
+
* ]);
|
|
4859
|
+
*
|
|
4860
|
+
* @type {Object<string, Object<string, any>>}
|
|
4861
|
+
*/
|
|
4862
|
+
export declare const toolOptions: {
|
|
4863
|
+
[x: string]: {
|
|
4864
|
+
[x: string]: any;
|
|
4865
|
+
};
|
|
4866
|
+
};
|
|
4867
|
+
|
|
4362
4868
|
/**
|
|
4363
4869
|
* Immutable 3D vector.
|
|
4364
4870
|
*/
|
|
@@ -4604,6 +5110,13 @@ export declare class View {
|
|
|
4604
5110
|
* @returns {Point3D|undefined} The origin.
|
|
4605
5111
|
*/
|
|
4606
5112
|
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
5113
|
+
/**
|
|
5114
|
+
* Check if the image includes an UID.
|
|
5115
|
+
*
|
|
5116
|
+
* @param {string} uid The UID.
|
|
5117
|
+
* @returns {boolean} True if present.
|
|
5118
|
+
*/
|
|
5119
|
+
includesImageUid(uid: string): boolean;
|
|
4607
5120
|
/**
|
|
4608
5121
|
* Check if the current position (default) or
|
|
4609
5122
|
* the provided position is in bounds.
|
|
@@ -4860,6 +5373,13 @@ export declare class ViewController {
|
|
|
4860
5373
|
* @returns {Point3D|undefined} The origin.
|
|
4861
5374
|
*/
|
|
4862
5375
|
getOriginForImageUid(uid: string): Point3D | undefined;
|
|
5376
|
+
/**
|
|
5377
|
+
* Check if the image includes an UID.
|
|
5378
|
+
*
|
|
5379
|
+
* @param {string} uid The UID.
|
|
5380
|
+
* @returns {boolean} True if present.
|
|
5381
|
+
*/
|
|
5382
|
+
includesImageUid(uid: string): boolean;
|
|
4863
5383
|
/**
|
|
4864
5384
|
* Get the current oriented index.
|
|
4865
5385
|
*
|