dwv 0.34.0-beta.15 → 0.34.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dwv.d.ts CHANGED
@@ -84,6 +84,12 @@ export declare class Annotation {
84
84
  * @param {ViewController} viewController The associated view controller.
85
85
  */
86
86
  setViewController(viewController: ViewController): void;
87
+ /**
88
+ * Get the centroid of the math shape.
89
+ *
90
+ * @returns {Point|undefined} The 3D centroid point.
91
+ */
92
+ getCentroid(): Point | undefined;
87
93
  /**
88
94
  * Set the annotation text expression.
89
95
  *
@@ -682,25 +688,20 @@ export declare class App {
682
688
  /**
683
689
  * Set the drawings of the active layer group.
684
690
  *
685
- * @deprecated
686
- * @param {Array} _drawings An array of drawings.
687
- * @param {Array} _drawingsDetails An array of drawings details.
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.
688
695
  */
689
- setDrawings(_drawings: any[], _drawingsDetails: any[]): void;
690
- /**
691
- * Get the JSON state of the app.
692
- *
693
- * @deprecated
694
- * @returns {string} The state of the app as a JSON string.
695
- */
696
- getJsonState(): string;
696
+ setDrawings(drawings: any[], drawingsDetails: any[], dataId: string): void;
697
697
  /**
698
698
  * Apply a JSON state to this app.
699
699
  *
700
700
  * @deprecated
701
701
  * @param {string} jsonState The state of the app as a JSON string.
702
+ * @param {string} dataId The state data id.
702
703
  */
703
- applyJsonState(jsonState: string): void;
704
+ applyJsonState(jsonState: string, dataId: string): void;
704
705
  /**
705
706
  * Handle resize: fit the display to the window.
706
707
  * To be called once the image is loaded.
@@ -1534,12 +1535,6 @@ export declare class DrawController {
1534
1535
  * @param {string} value The value of the meta data.
1535
1536
  */
1536
1537
  setAnnotationMeta(key: string, value: string): void;
1537
- /**
1538
- * Get draw store details.
1539
- *
1540
- * @deprecated
1541
- */
1542
- getDrawStoreDetails(): void;
1543
1538
  #private;
1544
1539
  }
1545
1540
 
@@ -3725,6 +3720,12 @@ export declare class Point2D {
3725
3720
  * @returns {number} The Y position of the point.
3726
3721
  */
3727
3722
  getY(): number;
3723
+ /**
3724
+ * Get the centroid of the point, ie itself.
3725
+ *
3726
+ * @returns {Point2D} The centroid point.
3727
+ */
3728
+ getCentroid(): Point2D;
3728
3729
  /**
3729
3730
  * Check for Point2D equality.
3730
3731
  *
@@ -4326,6 +4327,32 @@ export declare class ToolConfig {
4326
4327
  * List of client provided tools to be added to
4327
4328
  * the default ones.
4328
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
+ *
4329
4356
  * @type {Object<string, any>}
4330
4357
  */
4331
4358
  export declare const toolList: {
@@ -5006,9 +5033,11 @@ export declare class ViewController {
5006
5033
  * Get a world position from a 2D plane position.
5007
5034
  *
5008
5035
  * @param {Point2D} point2D The input point.
5036
+ * @param {number} [k] Optional slice index,
5037
+ * if undefined, uses the current one.
5009
5038
  * @returns {Point} The associated position.
5010
5039
  */
5011
- getPositionFromPlanePoint(point2D: Point2D): Point;
5040
+ getPositionFromPlanePoint(point2D: Point2D, k?: number): Point;
5012
5041
  /**
5013
5042
  * Get a 2D plane position from a world position.
5014
5043
  *
@@ -5016,6 +5045,13 @@ export declare class ViewController {
5016
5045
  * @returns {Point2D} The 2D position.
5017
5046
  */
5018
5047
  getPlanePositionFromPosition(point: Point): Point2D;
5048
+ /**
5049
+ * Get the index of a world position.
5050
+ *
5051
+ * @param {Point} point The 3D position.
5052
+ * @returns {Index} The index.
5053
+ */
5054
+ getIndexFromPosition(point: Point): Index;
5019
5055
  /**
5020
5056
  * Set the current index.
5021
5057
  *