dwv 0.34.0-beta.14 → 0.34.0-beta.16
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 +145 -39
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +14 -14
package/dist/dwv.d.ts
CHANGED
|
@@ -66,6 +66,18 @@ export declare class Annotation {
|
|
|
66
66
|
* @type {Point2D|undefined}
|
|
67
67
|
*/
|
|
68
68
|
labelPosition: Point2D | undefined;
|
|
69
|
+
/**
|
|
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;
|
|
69
81
|
/**
|
|
70
82
|
* Set the associated view controller.
|
|
71
83
|
*
|
|
@@ -73,11 +85,11 @@ export declare class Annotation {
|
|
|
73
85
|
*/
|
|
74
86
|
setViewController(viewController: ViewController): void;
|
|
75
87
|
/**
|
|
76
|
-
* Get the
|
|
88
|
+
* Get the centroid of the math shape.
|
|
77
89
|
*
|
|
78
|
-
* @returns {
|
|
90
|
+
* @returns {Point|undefined} The 3D centroid point.
|
|
79
91
|
*/
|
|
80
|
-
|
|
92
|
+
getCentroid(): Point | undefined;
|
|
81
93
|
/**
|
|
82
94
|
* Set the annotation text expression.
|
|
83
95
|
*
|
|
@@ -676,25 +688,20 @@ export declare class App {
|
|
|
676
688
|
/**
|
|
677
689
|
* Set the drawings of the active layer group.
|
|
678
690
|
*
|
|
679
|
-
* @deprecated
|
|
680
|
-
* @param {Array}
|
|
681
|
-
* @param {Array}
|
|
682
|
-
|
|
683
|
-
setDrawings(_drawings: any[], _drawingsDetails: any[]): void;
|
|
684
|
-
/**
|
|
685
|
-
* Get the JSON state of the app.
|
|
686
|
-
*
|
|
687
|
-
* @deprecated
|
|
688
|
-
* @returns {string} The state of the app as a JSON string.
|
|
691
|
+
* @deprecated Please switch to DICOM SR annotations.
|
|
692
|
+
* @param {Array} drawings An array of drawings.
|
|
693
|
+
* @param {Array} drawingsDetails An array of drawings details.
|
|
694
|
+
* @param {string} dataId The converted data id.
|
|
689
695
|
*/
|
|
690
|
-
|
|
696
|
+
setDrawings(drawings: any[], drawingsDetails: any[], dataId: string): void;
|
|
691
697
|
/**
|
|
692
698
|
* Apply a JSON state to this app.
|
|
693
699
|
*
|
|
694
700
|
* @deprecated
|
|
695
701
|
* @param {string} jsonState The state of the app as a JSON string.
|
|
702
|
+
* @param {string} dataId The state data id.
|
|
696
703
|
*/
|
|
697
|
-
applyJsonState(jsonState: string): void;
|
|
704
|
+
applyJsonState(jsonState: string, dataId: string): void;
|
|
698
705
|
/**
|
|
699
706
|
* Handle resize: fit the display to the window.
|
|
700
707
|
* To be called once the image is loaded.
|
|
@@ -1528,12 +1535,6 @@ export declare class DrawController {
|
|
|
1528
1535
|
* @param {string} value The value of the meta data.
|
|
1529
1536
|
*/
|
|
1530
1537
|
setAnnotationMeta(key: string, value: string): void;
|
|
1531
|
-
/**
|
|
1532
|
-
* Get draw store details.
|
|
1533
|
-
*
|
|
1534
|
-
* @deprecated
|
|
1535
|
-
*/
|
|
1536
|
-
getDrawStoreDetails(): void;
|
|
1537
1538
|
#private;
|
|
1538
1539
|
}
|
|
1539
1540
|
|
|
@@ -1565,6 +1566,12 @@ export declare class DrawLayer {
|
|
|
1565
1566
|
* @returns {string} The id.
|
|
1566
1567
|
*/
|
|
1567
1568
|
getDataId(): string;
|
|
1569
|
+
/**
|
|
1570
|
+
* Get the reference data id.
|
|
1571
|
+
*
|
|
1572
|
+
* @returns {string} The id.
|
|
1573
|
+
*/
|
|
1574
|
+
getReferenceLayerId(): string;
|
|
1568
1575
|
/**
|
|
1569
1576
|
* Get the Konva stage.
|
|
1570
1577
|
*
|
|
@@ -1688,8 +1695,9 @@ export declare class DrawLayer {
|
|
|
1688
1695
|
*
|
|
1689
1696
|
* @param {Scalar2D} size The image size as {x,y}.
|
|
1690
1697
|
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
1698
|
+
* @param {string} refLayerId The reference image dataId.
|
|
1691
1699
|
*/
|
|
1692
|
-
initialise(size: Scalar2D, spacing: Scalar2D): void;
|
|
1700
|
+
initialise(size: Scalar2D, spacing: Scalar2D, refLayerId: string): void;
|
|
1693
1701
|
/**
|
|
1694
1702
|
* Set the annotation group.
|
|
1695
1703
|
*
|
|
@@ -1778,17 +1786,10 @@ export declare class DrawLayer {
|
|
|
1778
1786
|
* Set the current position.
|
|
1779
1787
|
*
|
|
1780
1788
|
* @param {Point} position The new position.
|
|
1781
|
-
* @param {Index}
|
|
1789
|
+
* @param {Index} index The new index.
|
|
1782
1790
|
* @returns {boolean} True if the position was updated.
|
|
1783
1791
|
*/
|
|
1784
|
-
setCurrentPosition(position: Point,
|
|
1785
|
-
/**
|
|
1786
|
-
* Activate the current draw layer.
|
|
1787
|
-
*
|
|
1788
|
-
* @param {Point} position The current position.
|
|
1789
|
-
* @param {number} scrollIndex The scroll index.
|
|
1790
|
-
*/
|
|
1791
|
-
activateDrawLayer(position: Point, scrollIndex: number): void;
|
|
1792
|
+
setCurrentPosition(position: Point, index: Index): boolean;
|
|
1792
1793
|
/**
|
|
1793
1794
|
* Get the current position group.
|
|
1794
1795
|
*
|
|
@@ -2128,7 +2129,7 @@ export declare function getEllipseIndices(center: Index, radius: number[], dir:
|
|
|
2128
2129
|
* @param {object} event The event to get the layer div id from. Expecting
|
|
2129
2130
|
* an event origininating from a canvas inside a layer HTML div
|
|
2130
2131
|
* with the 'layer' class and id generated with `getLayerDivId`.
|
|
2131
|
-
* @returns {object} The layer details as {groupDivId, layerId}.
|
|
2132
|
+
* @returns {object} The layer details as {groupDivId, layerIndex, layerId}.
|
|
2132
2133
|
*/
|
|
2133
2134
|
export declare function getLayerDetailsFromEvent(event: object): object;
|
|
2134
2135
|
|
|
@@ -2888,9 +2889,10 @@ export declare class LayerGroup {
|
|
|
2888
2889
|
/**
|
|
2889
2890
|
* Set the active draw layer.
|
|
2890
2891
|
*
|
|
2891
|
-
* @param {number} index The index of the layer to set as active
|
|
2892
|
+
* @param {number|undefined} index The index of the layer to set as active
|
|
2893
|
+
* or undefined to not set any.
|
|
2892
2894
|
*/
|
|
2893
|
-
setActiveDrawLayer(index: number): void;
|
|
2895
|
+
setActiveDrawLayer(index: number | undefined): void;
|
|
2894
2896
|
/**
|
|
2895
2897
|
* Set the active draw layer with a data id.
|
|
2896
2898
|
*
|
|
@@ -3501,11 +3503,10 @@ export declare class OverlayData {
|
|
|
3501
3503
|
*/
|
|
3502
3504
|
export declare class PlaneHelper {
|
|
3503
3505
|
/**
|
|
3504
|
-
* @param {
|
|
3505
|
-
* @param {Matrix33} imageOrientation The image oientation.
|
|
3506
|
+
* @param {Geometry} imageGeometry The image geometry.
|
|
3506
3507
|
* @param {Matrix33} viewOrientation The view orientation.
|
|
3507
3508
|
*/
|
|
3508
|
-
constructor(
|
|
3509
|
+
constructor(imageGeometry: Geometry, viewOrientation: Matrix33);
|
|
3509
3510
|
/**
|
|
3510
3511
|
* Get a 3D offset from a plane one.
|
|
3511
3512
|
*
|
|
@@ -3569,6 +3570,34 @@ export declare class PlaneHelper {
|
|
|
3569
3570
|
* @returns {Point3D} The de-orienteded point.
|
|
3570
3571
|
*/
|
|
3571
3572
|
getImageDeOrientedPoint3D(point: Point3D): Point3D;
|
|
3573
|
+
/**
|
|
3574
|
+
* Get a world position from a 2D plane position.
|
|
3575
|
+
*
|
|
3576
|
+
* @param {Point2D} point2D The input point.
|
|
3577
|
+
* @param {number} k The slice index.
|
|
3578
|
+
* @returns {Point3D} The associated position.
|
|
3579
|
+
*/
|
|
3580
|
+
getPositionFromPlanePoint(point2D: Point2D, k: number): Point3D;
|
|
3581
|
+
/**
|
|
3582
|
+
* Get a list of points that define the plane at position k.
|
|
3583
|
+
*
|
|
3584
|
+
* @param {number} k The slice index value.
|
|
3585
|
+
* @returns {Point3D[]} A couple of 3D points.
|
|
3586
|
+
*/
|
|
3587
|
+
getPlanePoints(k: number): Point3D[];
|
|
3588
|
+
/**
|
|
3589
|
+
* Image world to index.
|
|
3590
|
+
*
|
|
3591
|
+
* @param {Point} point The input point.
|
|
3592
|
+
* @returns {Index} The corresponding index.
|
|
3593
|
+
*/
|
|
3594
|
+
worldToIndex(point: Point): Index;
|
|
3595
|
+
/**
|
|
3596
|
+
* Is this view in the same orientation as the image aquisition.
|
|
3597
|
+
*
|
|
3598
|
+
* @returns {boolean} True if in aquisition plane.
|
|
3599
|
+
*/
|
|
3600
|
+
isAquisitionOrientation(): boolean;
|
|
3572
3601
|
/**
|
|
3573
3602
|
* Reorder values to follow target orientation.
|
|
3574
3603
|
*
|
|
@@ -3691,6 +3720,12 @@ export declare class Point2D {
|
|
|
3691
3720
|
* @returns {number} The Y position of the point.
|
|
3692
3721
|
*/
|
|
3693
3722
|
getY(): number;
|
|
3723
|
+
/**
|
|
3724
|
+
* Get the centroid of the point, ie itself.
|
|
3725
|
+
*
|
|
3726
|
+
* @returns {Point2D} The centroid point.
|
|
3727
|
+
*/
|
|
3728
|
+
getCentroid(): Point2D;
|
|
3694
3729
|
/**
|
|
3695
3730
|
* Check for Point2D equality.
|
|
3696
3731
|
*
|
|
@@ -4292,12 +4327,55 @@ export declare class ToolConfig {
|
|
|
4292
4327
|
* List of client provided tools to be added to
|
|
4293
4328
|
* the default ones.
|
|
4294
4329
|
*
|
|
4330
|
+
* @example
|
|
4331
|
+
* // custom tool
|
|
4332
|
+
* class AlertTool {
|
|
4333
|
+
* mousedown() {alert('AlertTool mousedown');}
|
|
4334
|
+
* init() {}
|
|
4335
|
+
* activate() {}
|
|
4336
|
+
* }
|
|
4337
|
+
* // pass it to dwv tool list
|
|
4338
|
+
* dwv.toolList['Alert'] = AlertTool;
|
|
4339
|
+
* // create the dwv app
|
|
4340
|
+
* const app = new dwv.App();
|
|
4341
|
+
* // initialise
|
|
4342
|
+
* const viewConfig0 = new dwv.ViewConfig('layerGroup0');
|
|
4343
|
+
* const viewConfigs = {'*': [viewConfig0]};
|
|
4344
|
+
* const options = new dwv.AppOptions(viewConfigs);
|
|
4345
|
+
* options.tools = {Alert: {}};
|
|
4346
|
+
* app.init(options);
|
|
4347
|
+
* // activate tool
|
|
4348
|
+
* app.addEventListener('load', function () {
|
|
4349
|
+
* app.setTool('Alert');
|
|
4350
|
+
* });
|
|
4351
|
+
* // load dicom data
|
|
4352
|
+
* app.loadURLs([
|
|
4353
|
+
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
4354
|
+
* ]);
|
|
4355
|
+
*
|
|
4295
4356
|
* @type {Object<string, any>}
|
|
4296
4357
|
*/
|
|
4297
4358
|
export declare const toolList: {
|
|
4298
4359
|
[x: string]: any;
|
|
4299
4360
|
};
|
|
4300
4361
|
|
|
4362
|
+
export declare namespace toolOptions {
|
|
4363
|
+
export namespace draw {
|
|
4364
|
+
{ ArrowFactory };
|
|
4365
|
+
{ CircleFactory };
|
|
4366
|
+
{ EllipseFactory };
|
|
4367
|
+
{ ProtractorFactory };
|
|
4368
|
+
{ RectangleFactory };
|
|
4369
|
+
{ RoiFactory };
|
|
4370
|
+
{ RulerFactory };
|
|
4371
|
+
}
|
|
4372
|
+
export namespace filter {
|
|
4373
|
+
{ Threshold };
|
|
4374
|
+
{ Sobel };
|
|
4375
|
+
{ Sharpen };
|
|
4376
|
+
}
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4301
4379
|
/**
|
|
4302
4380
|
* Immutable 3D vector.
|
|
4303
4381
|
*/
|
|
@@ -4648,6 +4726,12 @@ export declare class View {
|
|
|
4648
4726
|
* @returns {number} The index.
|
|
4649
4727
|
*/
|
|
4650
4728
|
getScrollIndex(): number;
|
|
4729
|
+
/**
|
|
4730
|
+
* Is this view in the same orientation as the image aquisition.
|
|
4731
|
+
*
|
|
4732
|
+
* @returns {boolean} True if in aquisition plane.
|
|
4733
|
+
*/
|
|
4734
|
+
isAquisitionOrientation(): boolean;
|
|
4651
4735
|
#private;
|
|
4652
4736
|
}
|
|
4653
4737
|
|
|
@@ -4814,10 +4898,23 @@ export declare class ViewController {
|
|
|
4814
4898
|
/**
|
|
4815
4899
|
* Get the first origin or at a given position.
|
|
4816
4900
|
*
|
|
4817
|
-
* @param {Point} [position]
|
|
4901
|
+
* @param {Point} [position] Optional position.
|
|
4818
4902
|
* @returns {Point3D} The origin.
|
|
4819
4903
|
*/
|
|
4820
4904
|
getOrigin(position?: Point): Point3D;
|
|
4905
|
+
/**
|
|
4906
|
+
* Is this view in the same orientation as the image aquisition.
|
|
4907
|
+
*
|
|
4908
|
+
* @returns {boolean} True if in aquisition plane.
|
|
4909
|
+
*/
|
|
4910
|
+
isAquisitionOrientation(): boolean;
|
|
4911
|
+
/**
|
|
4912
|
+
* Get a list of points that define the plane at position k.
|
|
4913
|
+
*
|
|
4914
|
+
* @param {number} k The slice index value.
|
|
4915
|
+
* @returns {Point3D[]} A couple of 3D points.
|
|
4916
|
+
*/
|
|
4917
|
+
getPlanePoints(k: number): Point3D[];
|
|
4821
4918
|
/**
|
|
4822
4919
|
* Get the current scroll position value.
|
|
4823
4920
|
*
|
|
@@ -4953,9 +5050,11 @@ export declare class ViewController {
|
|
|
4953
5050
|
* Get a world position from a 2D plane position.
|
|
4954
5051
|
*
|
|
4955
5052
|
* @param {Point2D} point2D The input point.
|
|
5053
|
+
* @param {number} [k] Optional slice index,
|
|
5054
|
+
* if undefined, uses the current one.
|
|
4956
5055
|
* @returns {Point} The associated position.
|
|
4957
5056
|
*/
|
|
4958
|
-
getPositionFromPlanePoint(point2D: Point2D): Point;
|
|
5057
|
+
getPositionFromPlanePoint(point2D: Point2D, k?: number): Point;
|
|
4959
5058
|
/**
|
|
4960
5059
|
* Get a 2D plane position from a world position.
|
|
4961
5060
|
*
|
|
@@ -4963,6 +5062,13 @@ export declare class ViewController {
|
|
|
4963
5062
|
* @returns {Point2D} The 2D position.
|
|
4964
5063
|
*/
|
|
4965
5064
|
getPlanePositionFromPosition(point: Point): Point2D;
|
|
5065
|
+
/**
|
|
5066
|
+
* Get the index of a world position.
|
|
5067
|
+
*
|
|
5068
|
+
* @param {Point} point The 3D position.
|
|
5069
|
+
* @returns {Index} The index.
|
|
5070
|
+
*/
|
|
5071
|
+
getIndexFromPosition(point: Point): Index;
|
|
4966
5072
|
/**
|
|
4967
5073
|
* Set the current index.
|
|
4968
5074
|
*
|