dwv 0.33.0-beta.3 → 0.33.0-beta.5

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
@@ -27,10 +27,10 @@ export declare class App {
27
27
  /**
28
28
  * Get the image.
29
29
  *
30
- * @param {number} index The data index.
30
+ * @param {string} dataId The data id.
31
31
  * @returns {Image} The associated image.
32
32
  */
33
- getImage(index: number): Image_2;
33
+ getImage(dataId: string): Image_2;
34
34
  /**
35
35
  * Get the last loaded image.
36
36
  *
@@ -38,12 +38,12 @@ export declare class App {
38
38
  */
39
39
  getLastImage(): Image_2;
40
40
  /**
41
- * Set the image at the given index.
41
+ * Set the image at the given id.
42
42
  *
43
- * @param {number} index The data index.
43
+ * @param {string} dataId The data id.
44
44
  * @param {Image} img The associated image.
45
45
  */
46
- setImage(index: number, img: Image_2): void;
46
+ setImage(dataId: string, img: Image_2): void;
47
47
  /**
48
48
  * Set the last image.
49
49
  *
@@ -55,16 +55,16 @@ export declare class App {
55
55
  *
56
56
  * @param {Image} image The new image.
57
57
  * @param {object} meta The image meta.
58
- * @returns {number} The new image id.
58
+ * @returns {string} The new image data id.
59
59
  */
60
- addNewImage(image: Image_2, meta: object): number;
60
+ addNewImage(image: Image_2, meta: object): string;
61
61
  /**
62
62
  * Get the meta data.
63
63
  *
64
- * @param {number} index The data index.
64
+ * @param {string} dataId The data id.
65
65
  * @returns {object} The list of meta data.
66
66
  */
67
- getMetaData(index: number): object;
67
+ getMetaData(dataId: string): object;
68
68
  /**
69
69
  * Get the list of ids in the data storage.
70
70
  *
@@ -115,21 +115,21 @@ export declare class App {
115
115
  */
116
116
  getActiveLayerGroup(): LayerGroup;
117
117
  /**
118
- * Get the view layers associated to a data index.
118
+ * Get the view layers associated to a data id.
119
119
  * The layer are available after the first loaded item.
120
120
  *
121
- * @param {number} index The data index.
121
+ * @param {string} dataId The data id.
122
122
  * @returns {Array} The layers.
123
123
  */
124
- getViewLayersByDataIndex(index: number): any[];
124
+ getViewLayersByDataId(dataId: string): any[];
125
125
  /**
126
- * Get the draw layers associated to a data index.
126
+ * Get the draw layers associated to a data id.
127
127
  * The layer are available after the first loaded item.
128
128
  *
129
- * @param {number} index The data index.
129
+ * @param {string} dataId The data id.
130
130
  * @returns {Array} The layers.
131
131
  */
132
- getDrawLayersByDataIndex(index: number): any[];
132
+ getDrawLayersByDataId(dataId: string): any[];
133
133
  /**
134
134
  * Get a layer group by div id.
135
135
  * The layer is available after the first loaded item.
@@ -161,7 +161,7 @@ export declare class App {
161
161
  * Initialise the application.
162
162
  *
163
163
  * @param {object} opt The application option with:
164
- * - `dataViewConfigs`: data indexed object containing the data view
164
+ * - `dataViewConfigs`: dataId indexed object containing the data view
165
165
  * configurations in the form of a list of objects containing:
166
166
  * - divId: the HTML div id
167
167
  * - orientation: optional 'axial', 'coronal' or 'sagittal' orientation
@@ -288,6 +288,12 @@ export declare class App {
288
288
  * Init the Window/Level display
289
289
  */
290
290
  initWLDisplay(): void;
291
+ /**
292
+ * Set the imageSmoothing flag value. Default is false.
293
+ *
294
+ * @param {boolean} flag True to enable smoothing.
295
+ */
296
+ setImageSmoothing(flag: boolean): void;
291
297
  /**
292
298
  * Get the data view config.
293
299
  * Carefull, returns a reference, do not modify without resetting.
@@ -304,25 +310,26 @@ export declare class App {
304
310
  /**
305
311
  * Add a data view config.
306
312
  *
307
- * @param {number} dataId The data id.
313
+ * @param {string} dataId The data id.
308
314
  * @param {object} config The view configuration.
309
315
  */
310
- addDataViewConfig(dataId: number, config: object): void;
316
+ addDataViewConfig(dataId: string, config: object): void;
311
317
  /**
312
318
  * Remove a data view config.
313
319
  *
314
- * @param {number} dataId The data id.
320
+ * @param {string} dataId The data id.
315
321
  * @param {object} config The view configuration.
316
322
  */
317
- removeDataViewConfig(dataId: number, config: object): void;
323
+ removeDataViewConfig(dataId: string, config: object): void;
318
324
  /**
319
325
  * Update a data view config.
326
+ * Removes and re-creates the layer if found.
320
327
  *
321
- * @param {number} dataId The data id.
328
+ * @param {string} dataId The data id.
322
329
  * @param {string} divId The div id.
323
330
  * @param {object} config The view configuration.
324
331
  */
325
- updateDataViewConfig(dataId: number, divId: string, config: object): void;
332
+ updateDataViewConfig(dataId: string, divId: string, config: object): void;
326
333
  /**
327
334
  * Set the layer groups binders.
328
335
  *
@@ -332,10 +339,10 @@ export declare class App {
332
339
  /**
333
340
  * Render the current data.
334
341
  *
335
- * @param {number} dataIndex The data index to render.
342
+ * @param {string} dataId The data id to render.
336
343
  * @param {Array} [viewConfigs] The list of configs to render.
337
344
  */
338
- render(dataIndex: number, viewConfigs?: any[]): void;
345
+ render(dataId: string, viewConfigs?: any[]): void;
339
346
  /**
340
347
  * Zoom to the layers.
341
348
  *
@@ -460,18 +467,18 @@ export declare class App {
460
467
  */
461
468
  getCurrentStackIndex(): number;
462
469
  /**
463
- * Get the overlay data for a data index.
470
+ * Get the overlay data for a data id.
464
471
  *
465
- * @param {number} dataIndex The data index.
466
- * @returns {OverlayData} The overlay data.
472
+ * @param {string} dataId The data id.
473
+ * @returns {OverlayData|undefined} The overlay data.
467
474
  */
468
- getOverlayData(dataIndex: number): OverlayData;
475
+ getOverlayData(dataId: string): OverlayData | undefined;
469
476
  /**
470
477
  * Toggle overlay listeners.
471
478
  *
472
- * @param {number} dataIndex The data index.
479
+ * @param {string} dataId The data id.
473
480
  */
474
- toggleOverlayListeners(dataIndex: number): void;
481
+ toggleOverlayListeners(dataId: string): void;
475
482
  #private;
476
483
  }
477
484
 
@@ -670,11 +677,11 @@ export declare class DrawLayer {
670
677
  */
671
678
  constructor(containerDiv: HTMLDivElement);
672
679
  /**
673
- * Get the associated data index.
680
+ * Get the associated data id.
674
681
  *
675
- * @returns {number} The index.
682
+ * @returns {string} The id.
676
683
  */
677
- getDataIndex(): number;
684
+ getDataId(): string;
678
685
  /**
679
686
  * Get the Konva stage.
680
687
  *
@@ -731,6 +738,10 @@ export declare class DrawLayer {
731
738
  * Add a flip offset along the layer Y axis.
732
739
  */
733
740
  addFlipOffsetY(): void;
741
+ /**
742
+ * Flip the scale along the layer Z axis.
743
+ */
744
+ flipScaleZ(): void;
734
745
  /**
735
746
  * Set the layer scale.
736
747
  *
@@ -774,9 +785,9 @@ export declare class DrawLayer {
774
785
  *
775
786
  * @param {object} size The image size as {x,y}.
776
787
  * @param {object} spacing The image spacing as {x,y}.
777
- * @param {number} index The associated data index.
788
+ * @param {string} dataId The associated data id.
778
789
  */
779
- initialise(size: object, spacing: object, index: number): void;
790
+ initialise(size: object, spacing: object, dataId: string): void;
780
791
  /**
781
792
  * Fit the layer to its parent container.
782
793
  *
@@ -1597,18 +1608,6 @@ export declare class LayerGroup {
1597
1608
  * @param {HTMLElement} containerDiv The associated HTML div.
1598
1609
  */
1599
1610
  constructor(containerDiv: HTMLElement);
1600
- /**
1601
- * Get the target orientation.
1602
- *
1603
- * @returns {Matrix33} The orientation matrix.
1604
- */
1605
- getTargetOrientation(): Matrix33;
1606
- /**
1607
- * Set the target orientation.
1608
- *
1609
- * @param {Matrix33} orientation The orientation matrix.
1610
- */
1611
- setTargetOrientation(orientation: Matrix33): void;
1612
1611
  /**
1613
1612
  * Get the showCrosshair flag.
1614
1613
  *
@@ -1621,6 +1620,12 @@ export declare class LayerGroup {
1621
1620
  * @param {boolean} flag True to display the crosshair.
1622
1621
  */
1623
1622
  setShowCrosshair(flag: boolean): void;
1623
+ /**
1624
+ * Set the imageSmoothing flag value.
1625
+ *
1626
+ * @param {boolean} flag True to enable smoothing.
1627
+ */
1628
+ setImageSmoothing(flag: boolean): void;
1624
1629
  /**
1625
1630
  * Get the Id of the container div.
1626
1631
  *
@@ -1660,16 +1665,16 @@ export declare class LayerGroup {
1660
1665
  /**
1661
1666
  * Get the active image layer.
1662
1667
  *
1663
- * @returns {ViewLayer} The layer.
1668
+ * @returns {ViewLayer|undefined} The layer.
1664
1669
  */
1665
- getActiveViewLayer(): ViewLayer;
1670
+ getActiveViewLayer(): ViewLayer | undefined;
1666
1671
  /**
1667
- * Get the view layers associated to a data index.
1672
+ * Get the view layers associated to a data id.
1668
1673
  *
1669
- * @param {number} index The data index.
1674
+ * @param {string} dataId The data id.
1670
1675
  * @returns {ViewLayer[]} The layers.
1671
1676
  */
1672
- getViewLayersByDataIndex(index: number): ViewLayer[];
1677
+ getViewLayersByDataId(dataId: string): ViewLayer[];
1673
1678
  /**
1674
1679
  * Search view layers for equal imae meta data.
1675
1680
  *
@@ -1686,16 +1691,16 @@ export declare class LayerGroup {
1686
1691
  /**
1687
1692
  * Get the active draw layer.
1688
1693
  *
1689
- * @returns {DrawLayer} The layer.
1694
+ * @returns {DrawLayer|undefined} The layer.
1690
1695
  */
1691
- getActiveDrawLayer(): DrawLayer;
1696
+ getActiveDrawLayer(): DrawLayer | undefined;
1692
1697
  /**
1693
- * Get the draw layers associated to a data index.
1698
+ * Get the draw layers associated to a data id.
1694
1699
  *
1695
- * @param {number} index The data index.
1700
+ * @param {string} dataId The data id.
1696
1701
  * @returns {DrawLayer[]} The layers.
1697
1702
  */
1698
- getDrawLayersByDataIndex(index: number): DrawLayer[];
1703
+ getDrawLayersByDataId(dataId: string): DrawLayer[];
1699
1704
  /**
1700
1705
  * Set the active view layer.
1701
1706
  *
@@ -1703,11 +1708,11 @@ export declare class LayerGroup {
1703
1708
  */
1704
1709
  setActiveViewLayer(index: number): void;
1705
1710
  /**
1706
- * Set the active view layer with a data index.
1711
+ * Set the active view layer with a data id.
1707
1712
  *
1708
- * @param {number} index The data index.
1713
+ * @param {string} dataId The data id.
1709
1714
  */
1710
- setActiveViewLayerByDataIndex(index: number): void;
1715
+ setActiveViewLayerByDataId(dataId: string): void;
1711
1716
  /**
1712
1717
  * Set the active draw layer.
1713
1718
  *
@@ -1715,11 +1720,11 @@ export declare class LayerGroup {
1715
1720
  */
1716
1721
  setActiveDrawLayer(index: number): void;
1717
1722
  /**
1718
- * Set the active draw layer with a data index.
1723
+ * Set the active draw layer with a data id.
1719
1724
  *
1720
- * @param {number} index The data index.
1725
+ * @param {string} dataId The data id.
1721
1726
  */
1722
- setActiveDrawLayerByDataIndex(index: number): void;
1727
+ setActiveDrawLayerByDataId(dataId: string): void;
1723
1728
  /**
1724
1729
  * Add a view layer.
1725
1730
  *
@@ -1738,6 +1743,9 @@ export declare class LayerGroup {
1738
1743
  empty(): void;
1739
1744
  /**
1740
1745
  * Remove a layer from this layer group.
1746
+ * Warning: if current active layer, the index will
1747
+ * be set to `undefined`. Call one of the setActive
1748
+ * methods to define the active index.
1741
1749
  *
1742
1750
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
1743
1751
  */
@@ -1974,10 +1982,10 @@ export declare class Matrix33 {
1974
1982
  export declare class OverlayData {
1975
1983
  /**
1976
1984
  * @param {App} app The associated application.
1977
- * @param {number} dataId The associated data ID.
1985
+ * @param {string} dataId The associated data id.
1978
1986
  * @param {object} configs The overlay config.
1979
1987
  */
1980
- constructor(app: App, dataId: number, configs: object);
1988
+ constructor(app: App, dataId: string, configs: object);
1981
1989
  /**
1982
1990
  * Reset the data.
1983
1991
  */
@@ -2942,9 +2950,9 @@ export declare class View {
2942
2950
  export declare class ViewController {
2943
2951
  /**
2944
2952
  * @param {View} view The associated view.
2945
- * @param {number} index The associated data index.
2953
+ * @param {string} dataId The associated data id.
2946
2954
  */
2947
- constructor(view: View, index: number);
2955
+ constructor(view: View, dataId: string);
2948
2956
  /**
2949
2957
  * Get the plane helper.
2950
2958
  *
@@ -3071,13 +3079,13 @@ export declare class ViewController {
3071
3079
  * Set the associated image.
3072
3080
  *
3073
3081
  * @param {Image} img The associated image.
3074
- * @param {number} index The data index of the image.
3082
+ * @param {string} dataId The data id of the image.
3075
3083
  */
3076
- setImage(img: Image_2, index: number): void;
3084
+ setImage(img: Image_2, dataId: string): void;
3077
3085
  /**
3078
- * Get the current spacing.
3086
+ * Get the current view (2D) spacing.
3079
3087
  *
3080
- * @returns {Array} The 2D spacing.
3088
+ * @returns {Array} The spacing as a 2D array.
3081
3089
  */
3082
3090
  get2DSpacing(): any[];
3083
3091
  /**
@@ -3323,24 +3331,24 @@ export declare class ViewLayer {
3323
3331
  */
3324
3332
  constructor(containerDiv: HTMLElement);
3325
3333
  /**
3326
- * Get the associated data index.
3334
+ * Get the associated data id.
3327
3335
  *
3328
- * @returns {number} The index.
3336
+ * @returns {string} The data id.
3329
3337
  */
3330
- getDataIndex(): number;
3338
+ getDataId(): string;
3331
3339
  /**
3332
- * Set the imageSmoothingEnabled flag value.
3340
+ * Set the imageSmoothing flag value.
3333
3341
  *
3334
3342
  * @param {boolean} flag True to enable smoothing.
3335
3343
  */
3336
- enableImageSmoothing(flag: boolean): void;
3344
+ setImageSmoothing(flag: boolean): void;
3337
3345
  /**
3338
3346
  * Set the associated view.
3339
3347
  *
3340
3348
  * @param {object} view The view.
3341
- * @param {number} index The associated data index.
3349
+ * @param {string} dataId The associated data id.
3342
3350
  */
3343
- setView(view: object, index: number): void;
3351
+ setView(view: object, dataId: string): void;
3344
3352
  /**
3345
3353
  * Get the view controller.
3346
3354
  *
@@ -3403,6 +3411,10 @@ export declare class ViewLayer {
3403
3411
  * Add a flip offset along the layer Y axis.
3404
3412
  */
3405
3413
  addFlipOffsetY(): void;
3414
+ /**
3415
+ * Flip the scale along the layer Z axis.
3416
+ */
3417
+ flipScaleZ(): void;
3406
3418
  /**
3407
3419
  * Set the layer scale.
3408
3420
  *