dwv 0.35.0-beta.4 → 0.35.0-beta.6

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
@@ -476,9 +476,9 @@ export declare class App {
476
476
  * The layer is available after the first loaded item.
477
477
  *
478
478
  * @param {string} divId The div id.
479
- * @returns {LayerGroup} The layer group.
479
+ * @returns {LayerGroup|undefined} The layer group.
480
480
  */
481
- getLayerGroupByDivId(divId: string): LayerGroup;
481
+ getLayerGroupByDivId(divId: string): LayerGroup | undefined;
482
482
  /**
483
483
  * Get the number of layer groups.
484
484
  *
@@ -1086,10 +1086,12 @@ export declare class Circle {
1086
1086
  * Quantify an circle according to view information.
1087
1087
  *
1088
1088
  * @param {ViewController} viewController The associated view controller.
1089
+ * @param {Index} index The index at which to get the
1090
+ * image values.
1089
1091
  * @param {string[]} flags A list of stat values to calculate.
1090
1092
  * @returns {object} A quantification object.
1091
1093
  */
1092
- quantify(viewController: ViewController, flags: string[]): object;
1094
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
1093
1095
  #private;
1094
1096
  }
1095
1097
 
@@ -1155,14 +1157,20 @@ export declare function createView(elements: {
1155
1157
  [x: string]: DataElement;
1156
1158
  }, image: Image_2): View;
1157
1159
 
1158
- export declare namespace customUI {
1159
- /**
1160
- * Open a dialogue to edit roi data. Defaults to window.prompt.
1161
- *
1162
- * @param {Annotation} annotation The roi data.
1163
- * @param {Function} callback The callback to launch on dialogue exit.
1164
- */
1165
- export function openRoiDialog(annotation: Annotation, callback: Function): void;
1160
+ export declare namespace custom {
1161
+ let wlPresets: {
1162
+ [x: string]: {
1163
+ [x: string]: WindowLevel;
1164
+ };
1165
+ };
1166
+ let labelTexts: {
1167
+ [x: string]: {
1168
+ [x: string]: string;
1169
+ };
1170
+ };
1171
+ let openRoiDialog: any;
1172
+ let getTagTime: any;
1173
+ let getTagPixelUnit: any;
1166
1174
  }
1167
1175
 
1168
1176
  /**
@@ -1233,25 +1241,6 @@ export declare const decoderScripts: {
1233
1241
  rle: string;
1234
1242
  };
1235
1243
 
1236
- /**
1237
- * List of default window level presets.
1238
- *
1239
- * @type {Object.<string, Object.<string, WindowLevel>>}
1240
- */
1241
- export declare const defaultPresets: {
1242
- [x: string]: {
1243
- [x: string]: WindowLevel;
1244
- };
1245
- };
1246
-
1247
- export declare namespace defaults {
1248
- let labelText: {
1249
- [x: string]: {
1250
- [x: string]: string;
1251
- };
1252
- };
1253
- }
1254
-
1255
1244
  /**
1256
1245
  * Delete segment command.
1257
1246
  */
@@ -2081,10 +2070,12 @@ export declare class Ellipse {
2081
2070
  * Quantify an ellipse according to view information.
2082
2071
  *
2083
2072
  * @param {ViewController} viewController The associated view controller.
2073
+ * @param {Index} index The index at which to get the
2074
+ * image values.
2084
2075
  * @param {string[]} flags A list of stat values to calculate.
2085
2076
  * @returns {object} A quantification object.
2086
2077
  */
2087
- quantify(viewController: ViewController, flags: string[]): object;
2078
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
2088
2079
  #private;
2089
2080
  }
2090
2081
 
@@ -2093,14 +2084,14 @@ export declare class Ellipse {
2093
2084
  */
2094
2085
  export declare class Geometry {
2095
2086
  /**
2096
- * @param {Point3D} origin The object origin (a 3D point).
2087
+ * @param {Point3D[]} origins The object origins.
2097
2088
  * @param {Size} size The object size.
2098
2089
  * @param {Spacing} spacing The object spacing.
2099
2090
  * @param {Matrix33} [orientation] The object orientation (3*3 matrix,
2100
2091
  * default to 3*3 identity).
2101
2092
  * @param {number} [time] Optional time index.
2102
2093
  */
2103
- constructor(origin: Point3D, size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2094
+ constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2104
2095
  /**
2105
2096
  * Get the time value that was passed at construction.
2106
2097
  *
@@ -2239,6 +2230,13 @@ export declare class Geometry {
2239
2230
  * @returns {boolean} True if the given coordinates are within bounds.
2240
2231
  */
2241
2232
  isIndexInBounds(index: Index, dirs?: number[]): boolean;
2233
+ /**
2234
+ * Get the geometrical range, ie the minimum and maximum
2235
+ * positions.
2236
+ *
2237
+ * @returns {Point[]} The min and max positions.
2238
+ */
2239
+ getRange(): Point[];
2242
2240
  /**
2243
2241
  * Convert an index into world coordinates.
2244
2242
  *
@@ -2945,14 +2943,32 @@ export declare class Index {
2945
2943
  */
2946
2944
  compare(rhs: Index): number[];
2947
2945
  /**
2948
- * Add another index to this one.
2946
+ * Add another index to this one and return
2947
+ * the result as a new index.
2949
2948
  *
2950
2949
  * @param {Index} rhs The index to add.
2951
2950
  * @returns {Index} The index representing the sum of both indices.
2952
2951
  */
2953
2952
  add(rhs: Index): Index;
2954
2953
  /**
2955
- * Get the current index with a new 2D base.
2954
+ * Increment this index by 1 at the given dimension
2955
+ * and return the result as a new index.
2956
+ *
2957
+ * @param {number} dim The dimension number.
2958
+ * @returns {Index} The result index.
2959
+ */
2960
+ next(dim: number): Index;
2961
+ /**
2962
+ * Decrement this index by 1 at the given dimension
2963
+ * and return the result as a new index.
2964
+ *
2965
+ * @param {number} dim The dimension number.
2966
+ * @returns {Index} The result index.
2967
+ */
2968
+ previous(dim: number): Index;
2969
+ /**
2970
+ * Get the current index with a new 2D base
2971
+ * and return the result as a new index.
2956
2972
  *
2957
2973
  * @param {number} i The new 0 index.
2958
2974
  * @param {number} j The new 1 index.
@@ -3001,6 +3017,12 @@ export declare class LayerGroup {
3001
3017
  * @param {HTMLElement} containerDiv The associated HTML div.
3002
3018
  */
3003
3019
  constructor(containerDiv: HTMLElement);
3020
+ /**
3021
+ * Get the position helper.
3022
+ *
3023
+ * @returns {PositionHelper} The position helper.
3024
+ */
3025
+ getPositionHelper(): PositionHelper;
3004
3026
  /**
3005
3027
  * Get the showCrosshair flag.
3006
3028
  *
@@ -3022,9 +3044,9 @@ export declare class LayerGroup {
3022
3044
  /**
3023
3045
  * Get the Id of the container div.
3024
3046
  *
3025
- * @returns {string} The id of the div.
3047
+ * @returns {string|undefined} The id of the div.
3026
3048
  */
3027
- getDivId(): string;
3049
+ getDivId(): string | undefined;
3028
3050
  /**
3029
3051
  * Get the layer scale.
3030
3052
  *
@@ -3236,7 +3258,7 @@ export declare class LayerGroup {
3236
3258
  */
3237
3259
  moreThanOne(dim: number): boolean;
3238
3260
  /**
3239
- * Update layers (but not the active view layer) to a position change.
3261
+ * Update layers (but not the event source layer) to a position change.
3240
3262
  *
3241
3263
  * @param {object} event The position change event.
3242
3264
  * @function
@@ -4122,6 +4144,111 @@ export declare class Point3D {
4122
4144
  #private;
4123
4145
  }
4124
4146
 
4147
+ /**
4148
+ * Position helper.
4149
+ */
4150
+ export declare class PositionHelper {
4151
+ /**
4152
+ * @param {View} view The associated view.
4153
+ */
4154
+ constructor(view: View);
4155
+ /**
4156
+ * Get the geometry.
4157
+ *
4158
+ * @returns {Geometry} The geometry.
4159
+ */
4160
+ getGeometry(): Geometry;
4161
+ /**
4162
+ * Get the scroll index.
4163
+ *
4164
+ * @returns {number} The scroll index.
4165
+ */
4166
+ getScrollIndex(): number;
4167
+ /**
4168
+ * Get the current position.
4169
+ *
4170
+ * @returns {Point} The current position.
4171
+ */
4172
+ getCurrentPositon(): Point;
4173
+ /**
4174
+ * Set the current position.
4175
+ *
4176
+ * @param {Point} position The position.
4177
+ * @param {boolean} [silent] Flag to fire event or not.
4178
+ * @returns {boolean} True if possible and in bounds.
4179
+ */
4180
+ setCurrentPositon(position: Point, silent?: boolean): boolean;
4181
+ /**
4182
+ * Set the current position only if it is in the geometry bounds.
4183
+ *
4184
+ * @param {Point} position The position.
4185
+ * @param {boolean} [silent] Flag to fire event or not.
4186
+ * @returns {boolean} True if possible and in bounds.
4187
+ */
4188
+ setCurrentPositonSafe(position: Point, silent?: boolean): boolean;
4189
+ /**
4190
+ * Merge with another helper.
4191
+ *
4192
+ * @param {PositionHelper} rhs The helper to merge with this one.
4193
+ */
4194
+ merge(rhs: PositionHelper): void;
4195
+ /**
4196
+ * Check if the current position (default) or
4197
+ * the provided position is in bounds.
4198
+ *
4199
+ * @param {Point} position Optional position.
4200
+ * @returns {boolean} True is the position is in bounds.
4201
+ */
4202
+ isPositionInBounds(position: Point): boolean;
4203
+ /**
4204
+ * Get the current index.
4205
+ *
4206
+ * @returns {Index} The current index.
4207
+ */
4208
+ getCurrentIndex(): Index;
4209
+ /**
4210
+ * Get the current position incremented in the input direction.
4211
+ *
4212
+ * @param {number} dim The direction in which to increment.
4213
+ * @returns {Point} The resulting point.
4214
+ */
4215
+ getIncrementPosition(dim: number): Point;
4216
+ /**
4217
+ * Get the current position decremented in the input direction.
4218
+ *
4219
+ * @param {number} dim The direction in which to decrement.
4220
+ * @returns {Point} The resulting point.
4221
+ */
4222
+ getDecrementPosition(dim: number): Point;
4223
+ /**
4224
+ * Increment the current position along the provided dim.
4225
+ *
4226
+ * @param {number} dim The direction in which to increment.
4227
+ * @returns {boolean} True if possible and in bounds.
4228
+ */
4229
+ incrementPosition(dim: number): boolean;
4230
+ /**
4231
+ * Decrement the current position along the provided dim.
4232
+ *
4233
+ * @param {number} dim The direction in which to decrement.
4234
+ * @returns {boolean} True if possible and in bounds.
4235
+ */
4236
+ decrementPosition(dim: number): boolean;
4237
+ /**
4238
+ * Increment the current position along the scroll dimension.
4239
+ *
4240
+ * @returns {boolean} True if possible and in bounds.
4241
+ */
4242
+ incrementScrollPosition(): boolean;
4243
+ /**
4244
+ * Decrement the current position along the scroll dimension.
4245
+ *
4246
+ * @returns {boolean} True if possible and in bounds.
4247
+ */
4248
+ decrementScrollPosition(): boolean;
4249
+ #private;
4250
+ }
4251
+
4125
4252
  /**
4126
4253
  * Round a float number to a given precision.
4127
4254
  *
@@ -4261,10 +4388,12 @@ export declare class Rectangle {
4261
4388
  * Quantify a rectangle according to view information.
4262
4389
  *
4263
4390
  * @param {ViewController} viewController The associated view controller.
4391
+ * @param {Index} index The index at which to get the
4392
+ * image values.
4264
4393
  * @param {string[]} flags A list of stat values to calculate.
4265
4394
  * @returns {object} A quantification object.
4266
4395
  */
4267
- quantify(viewController: ViewController, flags: string[]): object;
4396
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
4268
4397
  #private;
4269
4398
  }
4270
4399
 
@@ -4702,23 +4831,6 @@ export declare class Tag {
4702
4831
  #private;
4703
4832
  }
4704
4833
 
4705
- /**
4706
- * Methods used to extract values from DICOM elements.
4707
- *
4708
- * Implemented as class and method to allow for override via its prototype.
4709
- */
4710
- export declare class TagValueExtractor {
4711
- /**
4712
- * Get the time.
4713
- *
4714
- * @param {Object<string, DataElement>} _elements The DICOM elements.
4715
- * @returns {number|undefined} The time value if available.
4716
- */
4717
- getTime(_elements: {
4718
- [x: string]: DataElement;
4719
- }): number | undefined;
4720
- }
4721
-
4722
4834
  /**
4723
4835
  * Toolbox controller.
4724
4836
  */
@@ -5395,6 +5507,12 @@ export declare class ViewController {
5395
5507
  * @returns {boolean} True if the controler is playing.
5396
5508
  */
5397
5509
  isPlaying(): boolean;
5510
+ /**
5511
+ * Get the position helper.
5512
+ *
5513
+ * @returns {PositionHelper} The helper.
5514
+ */
5515
+ getPositionHelper(): PositionHelper;
5398
5516
  /**
5399
5517
  * Get the current position.
5400
5518
  *
@@ -5442,9 +5560,9 @@ export declare class ViewController {
5442
5560
  /**
5443
5561
  * Get the current scroll index value.
5444
5562
  *
5445
- * @returns {object} The value.
5563
+ * @returns {number} The value.
5446
5564
  */
5447
- getCurrentScrollIndexValue(): object;
5565
+ getCurrentScrollIndexValue(): number;
5448
5566
  /**
5449
5567
  * Get the first origin or at a given position.
5450
5568
  *
@@ -5511,16 +5629,20 @@ export declare class ViewController {
5511
5629
  *
5512
5630
  * @param {Point2D} min Minimum point.
5513
5631
  * @param {Point2D} max Maximum point.
5632
+ * @param {Index} index The index at which to get the
5633
+ * image values (combined with min/max).
5514
5634
  * @returns {Array} A list of values.
5515
5635
  */
5516
- getImageRegionValues(min: Point2D, max: Point2D): any[];
5636
+ getImageRegionValues(min: Point2D, max: Point2D, index: Index): any[];
5517
5637
  /**
5518
5638
  * Get some values from the associated image in variable regions.
5519
5639
  *
5520
5640
  * @param {number[][][]} regions A list of [x, y] pairs (min, max).
5641
+ * @param {Index} index The index at which to get the
5642
+ * image values (combined with regions min/max).
5521
5643
  * @returns {Array} A list of values.
5522
5644
  */
5523
- getImageVariableRegionValues(regions: number[][][]): any[];
5645
+ getImageVariableRegionValues(regions: number[][][], index: Index): any[];
5524
5646
  /**
5525
5647
  * Can the image values be quantified?
5526
5648
  *
@@ -5643,62 +5765,6 @@ export declare class ViewController {
5643
5765
  * @returns {Vector3D} The 3D world offset.
5644
5766
  */
5645
5767
  getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
5646
- /**
5647
- * Get the current position incremented in the input direction.
5648
- *
5649
- * @param {number} dim The direction in which to increment.
5650
- * @returns {Point} The resulting point.
5651
- */
5652
- getIncrementPosition(dim: number): Point;
5653
- /**
5654
- * Get the current position decremented in the input direction.
5655
- *
5656
- * @param {number} dim The direction in which to decrement.
5657
- * @returns {Point} The resulting point.
5658
- */
5659
- getDecrementPosition(dim: number): Point;
5660
- /**
5661
- * Get the current position decremented in the scroll direction.
5662
- *
5663
- * @returns {Point} The resulting point.
5664
- */
5665
- getIncrementScrollPosition(): Point;
5666
- /**
5667
- * Get the current position decremented in the scroll direction.
5668
- *
5669
- * @returns {Point} The resulting point.
5670
- */
5671
- getDecrementScrollPosition(): Point;
5672
- /**
5673
- * Increment the provided dimension.
5674
- *
5675
- * @param {number} dim The dimension to increment.
5676
- * @param {boolean} [silent] Do not send event.
5677
- * @returns {boolean} False if not in bounds.
5678
- */
5679
- incrementIndex(dim: number, silent?: boolean): boolean;
5680
- /**
5681
- * Decrement the provided dimension.
5682
- *
5683
- * @param {number} dim The dimension to increment.
5684
- * @param {boolean} [silent] Do not send event.
5685
- * @returns {boolean} False if not in bounds.
5686
- */
5687
- decrementIndex(dim: number, silent?: boolean): boolean;
5688
- /**
5689
- * Decrement the scroll dimension index.
5690
- *
5691
- * @param {boolean} [silent] Do not send event.
5692
- * @returns {boolean} False if not in bounds.
5693
- */
5694
- decrementScrollIndex(silent?: boolean): boolean;
5695
- /**
5696
- * Increment the scroll dimension index.
5697
- *
5698
- * @param {boolean} [silent] Do not send event.
5699
- * @returns {boolean} False if not in bounds.
5700
- */
5701
- incrementScrollIndex(silent?: boolean): boolean;
5702
5768
  /**
5703
5769
  * Scroll play: loop through all slices.
5704
5770
  */