dwv 0.35.0-beta.2 → 0.35.0-beta.20

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
@@ -78,6 +78,33 @@ export declare class Annotation {
78
78
  * @type {Point3D[]|undefined}
79
79
  */
80
80
  planePoints: Point3D[] | undefined;
81
+ /**
82
+ * Get the concepts ids of the annotation meta data.
83
+ *
84
+ * @returns {string[]} The ids.
85
+ */
86
+ getMetaConceptIds(): string[];
87
+ /**
88
+ * Get an annotation meta data.
89
+ *
90
+ * @param {string} conceptId The value of the concept dicom code.
91
+ * @returns {object|undefined} The corresponding meta data item
92
+ * as {concept, value} or undefined.
93
+ */
94
+ getMetaItem(conceptId: string): object | undefined;
95
+ /**
96
+ * Add annotation meta data.
97
+ *
98
+ * @param {DicomCode} concept The concept code.
99
+ * @param {DicomCode} value The value code.
100
+ */
101
+ addMetaItem(concept: DicomCode, value: DicomCode): void;
102
+ /**
103
+ * Remove an annotation meta data.
104
+ *
105
+ * @param {string} conceptId The value of the concept dicom code.
106
+ */
107
+ removeMetaItem(conceptId: string): void;
81
108
  /**
82
109
  * Get the orientation name for this annotation.
83
110
  *
@@ -276,10 +303,11 @@ export declare class AnnotationGroupFactory {
276
303
  */
277
304
  getWarning(): string | undefined;
278
305
  /**
279
- * Check dicom elements. Throws an error if not suitable.
306
+ * Check dicom elements.
280
307
  *
281
308
  * @param {Object<string, DataElement>} dataElements The DICOM data elements.
282
309
  * @returns {string|undefined} A possible warning.
310
+ * @throws Error for missing or wrong data.
283
311
  */
284
312
  checkElements(dataElements: {
285
313
  [x: string]: DataElement;
@@ -289,6 +317,7 @@ export declare class AnnotationGroupFactory {
289
317
  *
290
318
  * @param {Object<string, DataElement>} dataElements The DICOM tags.
291
319
  * @returns {AnnotationGroup} A new annotation group.
320
+ * @throws Error for missing or wrong data.
292
321
  */
293
322
  create(dataElements: {
294
323
  [x: string]: DataElement;
@@ -476,9 +505,9 @@ export declare class App {
476
505
  * The layer is available after the first loaded item.
477
506
  *
478
507
  * @param {string} divId The div id.
479
- * @returns {LayerGroup} The layer group.
508
+ * @returns {LayerGroup|undefined} The layer group.
480
509
  */
481
- getLayerGroupByDivId(divId: string): LayerGroup;
510
+ getLayerGroupByDivId(divId: string): LayerGroup | undefined;
482
511
  /**
483
512
  * Get the number of layer groups.
484
513
  *
@@ -569,6 +598,7 @@ export declare class App {
569
598
  * Load a list of files. Can be image files or a state file.
570
599
  *
571
600
  * @param {File[]} files The list of files to load.
601
+ * @returns {string} The data ID, '-1' if problem.
572
602
  * @fires App#loadstart
573
603
  * @fires App#loadprogress
574
604
  * @fires App#loaditem
@@ -577,7 +607,7 @@ export declare class App {
577
607
  * @fires App#abort
578
608
  * @function
579
609
  */
580
- loadFiles: (files: File[]) => void;
610
+ loadFiles: (files: File[]) => string;
581
611
  /**
582
612
  * Load a list of URLs. Can be image files or a state file.
583
613
  *
@@ -586,6 +616,7 @@ export declare class App {
586
616
  * - requestHeaders: an array of {name, value} to use as request headers,
587
617
  * - withCredentials: boolean xhr.withCredentials flag to pass to the request,
588
618
  * - batchSize: the size of the request url batch.
619
+ * @returns {string} The data ID, '-1' if problem.
589
620
  * @fires App#loadstart
590
621
  * @fires App#loadprogress
591
622
  * @fires App#loaditem
@@ -594,7 +625,7 @@ export declare class App {
594
625
  * @fires App#abort
595
626
  * @function
596
627
  */
597
- loadURLs: (urls: string[], options?: object) => void;
628
+ loadURLs: (urls: string[], options?: object) => string;
598
629
  /**
599
630
  * Load from an input uri.
600
631
  *
@@ -608,6 +639,7 @@ export declare class App {
608
639
  *
609
640
  * @param {Array} data The list of ArrayBuffers to load
610
641
  * in the form of [{name: "", filename: "", data: data}].
642
+ * @returns {string} The data ID.
611
643
  * @fires App#loadstart
612
644
  * @fires App#loadprogress
613
645
  * @fires App#loaditem
@@ -616,7 +648,7 @@ export declare class App {
616
648
  * @fires App#abort
617
649
  * @function
618
650
  */
619
- loadImageObject: (data: any[]) => void;
651
+ loadImageObject: (data: any[]) => string;
620
652
  /**
621
653
  * Abort all the current loads.
622
654
  */
@@ -693,6 +725,8 @@ export declare class App {
693
725
  addDataViewConfig(dataId: string, config: ViewConfig): void;
694
726
  /**
695
727
  * Remove a data view config.
728
+ * Removes the associated layer if found, removes
729
+ * the layer group if empty.
696
730
  *
697
731
  * @param {string} dataId The data id.
698
732
  * @param {string} divId The div id.
@@ -1086,10 +1120,12 @@ export declare class Circle {
1086
1120
  * Quantify an circle according to view information.
1087
1121
  *
1088
1122
  * @param {ViewController} viewController The associated view controller.
1123
+ * @param {Index} index The index at which to get the
1124
+ * image values.
1089
1125
  * @param {string[]} flags A list of stat values to calculate.
1090
1126
  * @returns {object} A quantification object.
1091
1127
  */
1092
- quantify(viewController: ViewController, flags: string[]): object;
1128
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
1093
1129
  #private;
1094
1130
  }
1095
1131
 
@@ -1155,14 +1191,20 @@ export declare function createView(elements: {
1155
1191
  [x: string]: DataElement;
1156
1192
  }, image: Image_2): View;
1157
1193
 
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;
1194
+ export declare namespace custom {
1195
+ let wlPresets: {
1196
+ [x: string]: {
1197
+ [x: string]: WindowLevel;
1198
+ };
1199
+ };
1200
+ let labelTexts: {
1201
+ [x: string]: {
1202
+ [x: string]: string;
1203
+ };
1204
+ };
1205
+ let openRoiDialog: any;
1206
+ let getTagTime: any;
1207
+ let getTagPixelUnit: any;
1166
1208
  }
1167
1209
 
1168
1210
  /**
@@ -1233,25 +1275,6 @@ export declare const decoderScripts: {
1233
1275
  rle: string;
1234
1276
  };
1235
1277
 
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
1278
  /**
1256
1279
  * Delete segment command.
1257
1280
  */
@@ -1431,12 +1454,20 @@ export declare class DicomParser {
1431
1454
  [x: string]: DataElement;
1432
1455
  };
1433
1456
  /**
1434
- * Parse the complete DICOM file (given as input to the class).
1457
+ * Safely get an elements' first value from the parsed elements.
1458
+ *
1459
+ * @param {string} key The tag key as for example '00100020'.
1460
+ * @returns {any|undefined} The elements' value or undefined.
1461
+ */
1462
+ safeGet(key: string): any | undefined;
1463
+ /**
1464
+ * Parse a DICOM buffer.
1435
1465
  * Fills in the member object 'dataElements'.
1436
1466
  *
1437
1467
  * @param {ArrayBuffer} buffer The input array buffer.
1468
+ * @param {Tag} [untilTag] Optional tag to stop the parsing once reached.
1438
1469
  */
1439
- parse(buffer: ArrayBuffer): void;
1470
+ parse(buffer: ArrayBuffer, untilTag?: Tag): void;
1440
1471
  #private;
1441
1472
  }
1442
1473
 
@@ -1695,7 +1726,7 @@ export declare class DrawLayer {
1695
1726
  */
1696
1727
  getDataId(): string;
1697
1728
  /**
1698
- * Get the reference data id.
1729
+ * Get the reference layer id.
1699
1730
  *
1700
1731
  * @returns {string} The id.
1701
1732
  */
@@ -1918,19 +1949,6 @@ export declare class DrawLayer {
1918
1949
  * @returns {boolean} True if the position was updated.
1919
1950
  */
1920
1951
  setCurrentPosition(position: Point, index?: Index): boolean;
1921
- /**
1922
- * Get the current position group.
1923
- *
1924
- * @returns {Konva.Group|undefined} The Konva.Group.
1925
- */
1926
- getCurrentPosGroup(): Konva.Group | undefined;
1927
- /**
1928
- * Get a Konva group using its id.
1929
- *
1930
- * @param {string} id The group id.
1931
- * @returns {object|undefined} The Konva group.
1932
- */
1933
- getGroup(id: string): object | undefined;
1934
1952
  /**
1935
1953
  * Add an event listener to this class.
1936
1954
  *
@@ -2086,10 +2104,12 @@ export declare class Ellipse {
2086
2104
  * Quantify an ellipse according to view information.
2087
2105
  *
2088
2106
  * @param {ViewController} viewController The associated view controller.
2107
+ * @param {Index} index The index at which to get the
2108
+ * image values.
2089
2109
  * @param {string[]} flags A list of stat values to calculate.
2090
2110
  * @returns {object} A quantification object.
2091
2111
  */
2092
- quantify(viewController: ViewController, flags: string[]): object;
2112
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
2093
2113
  #private;
2094
2114
  }
2095
2115
 
@@ -2098,14 +2118,14 @@ export declare class Ellipse {
2098
2118
  */
2099
2119
  export declare class Geometry {
2100
2120
  /**
2101
- * @param {Point3D} origin The object origin (a 3D point).
2121
+ * @param {Point3D[]} origins The object origins.
2102
2122
  * @param {Size} size The object size.
2103
2123
  * @param {Spacing} spacing The object spacing.
2104
2124
  * @param {Matrix33} [orientation] The object orientation (3*3 matrix,
2105
2125
  * default to 3*3 identity).
2106
2126
  * @param {number} [time] Optional time index.
2107
2127
  */
2108
- constructor(origin: Point3D, size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2128
+ constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
2109
2129
  /**
2110
2130
  * Get the time value that was passed at construction.
2111
2131
  *
@@ -2152,11 +2172,11 @@ export declare class Geometry {
2152
2172
  * Check if a point is in the origin list.
2153
2173
  *
2154
2174
  * @param {Point3D} point3D The point to check.
2155
- * @param {number} tol The comparison tolerance
2156
- * default to Number.EPSILON.
2175
+ * @param {number} [tol] Optional number comparison tolerance
2176
+ * defaults to Number.EPSILON.
2157
2177
  * @returns {boolean} True if in list.
2158
2178
  */
2159
- includesOrigin(point3D: Point3D, tol: number): boolean;
2179
+ includesOrigin(point3D: Point3D, tol?: number): boolean;
2160
2180
  /**
2161
2181
  * Get the object size.
2162
2182
  * Warning: the size comes as stored in DICOM, meaning that it could
@@ -2244,6 +2264,13 @@ export declare class Geometry {
2244
2264
  * @returns {boolean} True if the given coordinates are within bounds.
2245
2265
  */
2246
2266
  isIndexInBounds(index: Index, dirs?: number[]): boolean;
2267
+ /**
2268
+ * Get the geometrical range, ie the minimum and maximum
2269
+ * positions.
2270
+ *
2271
+ * @returns {Point[]} The min and max positions.
2272
+ */
2273
+ getRange(): Point[];
2247
2274
  /**
2248
2275
  * Convert an index into world coordinates.
2249
2276
  *
@@ -2950,14 +2977,32 @@ export declare class Index {
2950
2977
  */
2951
2978
  compare(rhs: Index): number[];
2952
2979
  /**
2953
- * Add another index to this one.
2980
+ * Add another index to this one and return
2981
+ * the result as a new index.
2954
2982
  *
2955
2983
  * @param {Index} rhs The index to add.
2956
2984
  * @returns {Index} The index representing the sum of both indices.
2957
2985
  */
2958
2986
  add(rhs: Index): Index;
2959
2987
  /**
2960
- * Get the current index with a new 2D base.
2988
+ * Increment this index by 1 at the given dimension
2989
+ * and return the result as a new index.
2990
+ *
2991
+ * @param {number} dim The dimension number.
2992
+ * @returns {Index} The result index.
2993
+ */
2994
+ next(dim: number): Index;
2995
+ /**
2996
+ * Decrement this index by 1 at the given dimension
2997
+ * and return the result as a new index.
2998
+ *
2999
+ * @param {number} dim The dimension number.
3000
+ * @returns {Index} The result index.
3001
+ */
3002
+ previous(dim: number): Index;
3003
+ /**
3004
+ * Get the current index with a new 2D base
3005
+ * and return the result as a new index.
2961
3006
  *
2962
3007
  * @param {number} i The new 0 index.
2963
3008
  * @param {number} j The new 1 index.
@@ -3006,6 +3051,12 @@ export declare class LayerGroup {
3006
3051
  * @param {HTMLElement} containerDiv The associated HTML div.
3007
3052
  */
3008
3053
  constructor(containerDiv: HTMLElement);
3054
+ /**
3055
+ * Get the position helper.
3056
+ *
3057
+ * @returns {PositionHelper} The position helper.
3058
+ */
3059
+ getPositionHelper(): PositionHelper;
3009
3060
  /**
3010
3061
  * Get the showCrosshair flag.
3011
3062
  *
@@ -3027,9 +3078,9 @@ export declare class LayerGroup {
3027
3078
  /**
3028
3079
  * Get the Id of the container div.
3029
3080
  *
3030
- * @returns {string} The id of the div.
3081
+ * @returns {string|undefined} The id of the div.
3031
3082
  */
3032
- getDivId(): string;
3083
+ getDivId(): string | undefined;
3033
3084
  /**
3034
3085
  * Get the layer scale.
3035
3086
  *
@@ -3103,6 +3154,12 @@ export declare class LayerGroup {
3103
3154
  * @returns {number} The number of layers.
3104
3155
  */
3105
3156
  getNumberOfViewLayers(): number;
3157
+ /**
3158
+ * Get the active image layer.
3159
+ *
3160
+ * @returns {ViewLayer|DrawLayer|undefined} The layer.
3161
+ */
3162
+ getActiveLayer(): ViewLayer | DrawLayer | undefined;
3106
3163
  /**
3107
3164
  * Get the active image layer.
3108
3165
  *
@@ -3115,6 +3172,13 @@ export declare class LayerGroup {
3115
3172
  * @returns {ViewLayer|undefined} The layer.
3116
3173
  */
3117
3174
  getBaseViewLayer(): ViewLayer | undefined;
3175
+ /**
3176
+ * Get a view layer associated to a data id.
3177
+ *
3178
+ * @param {string} id The layer id.
3179
+ * @returns {ViewLayer|undefined} The layer.
3180
+ */
3181
+ getViewLayerById(id: string): ViewLayer | undefined;
3118
3182
  /**
3119
3183
  * Get the view layers associated to a data id.
3120
3184
  *
@@ -3141,6 +3205,13 @@ export declare class LayerGroup {
3141
3205
  * @returns {DrawLayer|undefined} The layer.
3142
3206
  */
3143
3207
  getActiveDrawLayer(): DrawLayer | undefined;
3208
+ /**
3209
+ * Get a draw layer associated to a data id.
3210
+ *
3211
+ * @param {string} id The layer id.
3212
+ * @returns {DrawLayer|undefined} The layer.
3213
+ */
3214
+ getDrawLayerById(id: string): DrawLayer | undefined;
3144
3215
  /**
3145
3216
  * Get the draw layers associated to a data id.
3146
3217
  *
@@ -3149,30 +3220,17 @@ export declare class LayerGroup {
3149
3220
  */
3150
3221
  getDrawLayersByDataId(dataId: string): DrawLayer[];
3151
3222
  /**
3152
- * Set the active view layer.
3223
+ * Set the active layer.
3153
3224
  *
3154
3225
  * @param {number} index The index of the layer to set as active.
3155
3226
  */
3156
- setActiveViewLayer(index: number): void;
3227
+ setActiveLayer(index: number): void;
3157
3228
  /**
3158
- * Set the active view layer with a data id.
3229
+ * Set the active layer with a data id.
3159
3230
  *
3160
3231
  * @param {string} dataId The data id.
3161
3232
  */
3162
- setActiveViewLayerByDataId(dataId: string): void;
3163
- /**
3164
- * Set the active draw layer.
3165
- *
3166
- * @param {number|undefined} index The index of the layer to set as active
3167
- * or undefined to not set any.
3168
- */
3169
- setActiveDrawLayer(index: number | undefined): void;
3170
- /**
3171
- * Set the active draw layer with a data id.
3172
- *
3173
- * @param {string} dataId The data id.
3174
- */
3175
- setActiveDrawLayerByDataId(dataId: string): void;
3233
+ setActiveLayerByDataId(dataId: string): void;
3176
3234
  /**
3177
3235
  * Add a view layer.
3178
3236
  *
@@ -3206,6 +3264,7 @@ export declare class LayerGroup {
3206
3264
  * methods to define the active index.
3207
3265
  *
3208
3266
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
3267
+ * @fires LayerGroup#removelayer
3209
3268
  */
3210
3269
  removeLayer(layer: ViewLayer | DrawLayer): void;
3211
3270
  /**
@@ -3241,7 +3300,7 @@ export declare class LayerGroup {
3241
3300
  */
3242
3301
  moreThanOne(dim: number): boolean;
3243
3302
  /**
3244
- * Update layers (but not the active view layer) to a position change.
3303
+ * Update layers (but not the event source layer) to a position change.
3245
3304
  *
3246
3305
  * @param {object} event The position change event.
3247
3306
  * @function
@@ -3368,10 +3427,11 @@ export declare class MaskFactory {
3368
3427
  */
3369
3428
  getWarning(): string | undefined;
3370
3429
  /**
3371
- * Check dicom elements. Throws an error if not suitable.
3430
+ * Check dicom elements.
3372
3431
  *
3373
3432
  * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
3374
3433
  * @returns {string|undefined} A possible warning.
3434
+ * @throws Error for missing or wrong data.
3375
3435
  */
3376
3436
  checkElements(_dicomElements: {
3377
3437
  [x: string]: DataElement;
@@ -3384,6 +3444,7 @@ export declare class MaskFactory {
3384
3444
  * Uint16Array | Int16Array |
3385
3445
  * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
3386
3446
  * @returns {Image} A new Image.
3447
+ * @throws Error for missing or wrong data.
3387
3448
  */
3388
3449
  create(dataElements: {
3389
3450
  [x: string]: DataElement;
@@ -3605,11 +3666,18 @@ export declare class Matrix33 {
3605
3666
  * Check for Matrix33 equality.
3606
3667
  *
3607
3668
  * @param {Matrix33} rhs The other matrix to compare to.
3608
- * @param {number} [p] A numeric expression for the precision to use in check
3609
- * (ex: 0.001). Defaults to Number.EPSILON if not provided.
3610
3669
  * @returns {boolean} True if both matrices are equal.
3611
3670
  */
3612
- equals(rhs: Matrix33, p?: number): boolean;
3671
+ equals(rhs: Matrix33): boolean;
3672
+ /**
3673
+ * Check for Matrix33 similarity.
3674
+ *
3675
+ * @param {Matrix33} rhs The other matrix to compare to.
3676
+ * @param {number} [tol] Optional number comparison tolerance,
3677
+ * defaults to Number.EPSILON.
3678
+ * @returns {boolean} True if both matrices are similar.
3679
+ */
3680
+ isSimilar(rhs: Matrix33, tol?: number): boolean;
3613
3681
  /**
3614
3682
  * Get a string representation of the Matrix33.
3615
3683
  *
@@ -3884,6 +3952,13 @@ export declare class PlaneHelper {
3884
3952
  * @returns {Index} The corresponding index.
3885
3953
  */
3886
3954
  worldToIndex(point: Point): Index;
3955
+ /**
3956
+ * Image index to world.
3957
+ *
3958
+ * @param {Index} index The input index.
3959
+ * @returns {Point} The corresponding point.
3960
+ */
3961
+ indexToWorld(index: Index): Point;
3887
3962
  /**
3888
3963
  * Is this view in the same orientation as the image aquisition.
3889
3964
  *
@@ -3902,13 +3977,13 @@ export declare class PlaneHelper {
3902
3977
  *
3903
3978
  * @returns {number} The index.
3904
3979
  */
3905
- getScrollIndex(): number;
3980
+ getScrollDimIndex(): number;
3906
3981
  /**
3907
3982
  * Get the native (image) scroll dimension index.
3908
3983
  *
3909
3984
  * @returns {number} The index.
3910
3985
  */
3911
- getNativeScrollIndex(): number;
3986
+ getNativeScrollDimIndex(): number;
3912
3987
  #private;
3913
3988
  }
3914
3989
 
@@ -4092,11 +4167,11 @@ export declare class Point3D {
4092
4167
  * Check for Point3D similarity.
4093
4168
  *
4094
4169
  * @param {Point3D} rhs The other point to compare to.
4095
- * @param {number} tol Optional comparison tolerance,
4096
- * default to Number.EPSILON.
4097
- * @returns {boolean} True if both points are equal.
4170
+ * @param {number} [tol] Optional number comparison tolerance,
4171
+ * defaults to Number.EPSILON.
4172
+ * @returns {boolean} True if both points are similar.
4098
4173
  */
4099
- isSimilar(rhs: Point3D, tol: number): boolean;
4174
+ isSimilar(rhs: Point3D, tol?: number): boolean;
4100
4175
  /**
4101
4176
  * Get a string representation of the Point3D.
4102
4177
  *
@@ -4127,6 +4202,153 @@ export declare class Point3D {
4127
4202
  #private;
4128
4203
  }
4129
4204
 
4205
+ /**
4206
+ * Position helper.
4207
+ */
4208
+ export declare class PositionHelper {
4209
+ /**
4210
+ * @param {View} view The associated view.
4211
+ */
4212
+ constructor(view: View);
4213
+ /**
4214
+ * Get the geometry.
4215
+ *
4216
+ * @returns {Geometry} The geometry.
4217
+ */
4218
+ getGeometry(): Geometry;
4219
+ /**
4220
+ * Get the scroll index.
4221
+ *
4222
+ * @returns {number} The scroll index.
4223
+ */
4224
+ getScrollDimIndex(): number;
4225
+ /**
4226
+ * Get the maximum dimension value.
4227
+ *
4228
+ * @param {number} dim The dimension.
4229
+ * @returns {number} The maximum value.
4230
+ */
4231
+ getMaximumDimValue(dim: number): number;
4232
+ /**
4233
+ * Get the maximum scroll value.
4234
+ *
4235
+ * @returns {number} The maximum value.
4236
+ */
4237
+ getMaximumScrollValue(): number;
4238
+ /**
4239
+ * Get the current position.
4240
+ *
4241
+ * @returns {Point} The current position.
4242
+ */
4243
+ getCurrentPosition(): Point;
4244
+ /**
4245
+ * Get the value at dimension index for the current position.
4246
+ *
4247
+ * @param {number} dim The dimension.
4248
+ * @returns {number} The value.
4249
+ */
4250
+ getCurrentPositionDimValue(dim: number): number;
4251
+ /**
4252
+ * Get the value at scroll index for the current position.
4253
+ *
4254
+ * @returns {number} The value.
4255
+ */
4256
+ getCurrentPositionScrollValue(): number;
4257
+ /**
4258
+ * Get the current position updated at the provided dimension index
4259
+ * with the input value.
4260
+ *
4261
+ * @param {number} dim The dimension.
4262
+ * @param {number} value The value to used at dimension index.
4263
+ * @returns {Point} The position.
4264
+ */
4265
+ getCurrentPositionAtDimValue(dim: number, value: number): Point;
4266
+ /**
4267
+ * Get the current position updated at scroll index with the input value.
4268
+ *
4269
+ * @param {number} value The value to use at scroll index.
4270
+ * @returns {Point} The position.
4271
+ */
4272
+ getCurrentPositionAtScrollValue(value: number): Point;
4273
+ /**
4274
+ * Get the current index.
4275
+ *
4276
+ * @returns {Index} The current index.
4277
+ */
4278
+ getCurrentIndex(): Index;
4279
+ /**
4280
+ * Set the current position.
4281
+ *
4282
+ * @param {Point} position The position.
4283
+ * @param {boolean} [silent] Flag to fire event or not.
4284
+ * @returns {boolean} True if possible and in bounds.
4285
+ */
4286
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
4287
+ /**
4288
+ * Set the current position only if it is in the geometry bounds.
4289
+ *
4290
+ * @param {Point} position The position.
4291
+ * @param {boolean} [silent] Flag to fire event or not.
4292
+ * @returns {boolean} True if possible and in bounds.
4293
+ */
4294
+ setCurrentPositionSafe(position: Point, silent?: boolean): boolean;
4295
+ /**
4296
+ * Merge with another helper.
4297
+ *
4298
+ * @param {PositionHelper} rhs The helper to merge with this one.
4299
+ */
4300
+ merge(rhs: PositionHelper): void;
4301
+ /**
4302
+ * Check if the current position (default) or
4303
+ * the provided position is in bounds.
4304
+ *
4305
+ * @param {Point} position Optional position.
4306
+ * @returns {boolean} True is the position is in bounds.
4307
+ */
4308
+ isPositionInBounds(position: Point): boolean;
4309
+ /**
4310
+ * Get the current position incremented in the input direction.
4311
+ *
4312
+ * @param {number} dim The direction in which to increment.
4313
+ * @returns {Point} The resulting point.
4314
+ */
4315
+ getIncrementPosition(dim: number): Point;
4316
+ /**
4317
+ * Get the current position decremented in the input direction.
4318
+ *
4319
+ * @param {number} dim The direction in which to decrement.
4320
+ * @returns {Point} The resulting point.
4321
+ */
4322
+ getDecrementPosition(dim: number): Point;
4323
+ /**
4324
+ * Increment the current position along the provided dim.
4325
+ *
4326
+ * @param {number} dim The direction in which to increment.
4327
+ * @returns {boolean} True if possible and in bounds.
4328
+ */
4329
+ incrementPosition(dim: number): boolean;
4330
+ /**
4331
+ * Decrement the current position along the provided dim.
4332
+ *
4333
+ * @param {number} dim The direction in which to decrement.
4334
+ * @returns {boolean} True if possible and in bounds.
4335
+ */
4336
+ decrementPosition(dim: number): boolean;
4337
+ /**
4338
+ * Increment the current position along the scroll dimension.
4339
+ *
4340
+ * @returns {boolean} True if possible and in bounds.
4341
+ */
4342
+ incrementPositionAlongScroll(): boolean;
4343
+ /**
4344
+ * Decrement the current position along the scroll dimension.
4345
+ *
4346
+ * @returns {boolean} True if possible and in bounds.
4347
+ */
4348
+ decrementPositionAlongScroll(): boolean;
4349
+ #private;
4350
+ }
4351
+
4130
4352
  /**
4131
4353
  * Round a float number to a given precision.
4132
4354
  *
@@ -4266,10 +4488,12 @@ export declare class Rectangle {
4266
4488
  * Quantify a rectangle according to view information.
4267
4489
  *
4268
4490
  * @param {ViewController} viewController The associated view controller.
4491
+ * @param {Index} index The index at which to get the
4492
+ * image values.
4269
4493
  * @param {string[]} flags A list of stat values to calculate.
4270
4494
  * @returns {object} A quantification object.
4271
4495
  */
4272
- quantify(viewController: ViewController, flags: string[]): object;
4496
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
4273
4497
  #private;
4274
4498
  }
4275
4499
 
@@ -4393,9 +4617,9 @@ export declare class ROI {
4393
4617
  * a non-self-intersecting closed polygon.
4394
4618
  * Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}.
4395
4619
  *
4396
- * @returns {Point2D} The centroid point.
4620
+ * @returns {Point2D|undefined} The centroid point.
4397
4621
  */
4398
- getCentroid(): Point2D;
4622
+ getCentroid(): Point2D | undefined;
4399
4623
  #private;
4400
4624
  }
4401
4625
 
@@ -4707,23 +4931,6 @@ export declare class Tag {
4707
4931
  #private;
4708
4932
  }
4709
4933
 
4710
- /**
4711
- * Methods used to extract values from DICOM elements.
4712
- *
4713
- * Implemented as class and method to allow for override via its prototype.
4714
- */
4715
- export declare class TagValueExtractor {
4716
- /**
4717
- * Get the time.
4718
- *
4719
- * @param {Object<string, DataElement>} _elements The DICOM elements.
4720
- * @returns {number|undefined} The time value if available.
4721
- */
4722
- getTime(_elements: {
4723
- [x: string]: DataElement;
4724
- }): number | undefined;
4725
- }
4726
-
4727
4934
  /**
4728
4935
  * Toolbox controller.
4729
4936
  */
@@ -5185,23 +5392,23 @@ export declare class View {
5185
5392
  */
5186
5393
  getOrigin(position?: Point): Point3D;
5187
5394
  /**
5188
- * Set the current position.
5395
+ * Set the current position via an index.
5189
5396
  *
5190
- * @param {Point} position The new position.
5397
+ * @param {Index} index The new index.
5191
5398
  * @param {boolean} [silent] Flag to fire event or not.
5192
5399
  * @returns {boolean} False if not in bounds.
5193
5400
  * @fires View#positionchange
5194
5401
  */
5195
- setCurrentPosition(position: Point, silent?: boolean): boolean;
5402
+ setCurrentIndex(index: Index, silent?: boolean): boolean;
5196
5403
  /**
5197
- * Set the current index.
5404
+ * Set current position.
5198
5405
  *
5199
- * @param {Index} index The new index.
5406
+ * @param {Point} position The new position.
5200
5407
  * @param {boolean} [silent] Flag to fire event or not.
5201
5408
  * @returns {boolean} False if not in bounds.
5202
5409
  * @fires View#positionchange
5203
5410
  */
5204
- setCurrentIndex(index: Index, silent?: boolean): boolean;
5411
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
5205
5412
  /**
5206
5413
  * Set the view window/level.
5207
5414
  *
@@ -5273,7 +5480,7 @@ export declare class View {
5273
5480
  *
5274
5481
  * @returns {number} The index.
5275
5482
  */
5276
- getScrollIndex(): number;
5483
+ getScrollDimIndex(): number;
5277
5484
  /**
5278
5485
  * Is this view in the same orientation as the image aquisition.
5279
5486
  *
@@ -5400,6 +5607,18 @@ export declare class ViewController {
5400
5607
  * @returns {boolean} True if the controler is playing.
5401
5608
  */
5402
5609
  isPlaying(): boolean;
5610
+ /**
5611
+ * Get the position helper.
5612
+ *
5613
+ * @returns {PositionHelper} The helper.
5614
+ */
5615
+ getPositionHelper(): PositionHelper;
5616
+ /**
5617
+ * Get a clone of the position helper.
5618
+ *
5619
+ * @returns {PositionHelper} The helper clone.
5620
+ */
5621
+ getPositionHelperClone(): PositionHelper;
5403
5622
  /**
5404
5623
  * Get the current position.
5405
5624
  *
@@ -5439,17 +5658,17 @@ export declare class ViewController {
5439
5658
  */
5440
5659
  getCurrentOrientedIndex(): Index;
5441
5660
  /**
5442
- * Get the scroll index.
5661
+ * Get the scroll dimension index.
5443
5662
  *
5444
5663
  * @returns {number} The index.
5445
5664
  */
5446
- getScrollIndex(): number;
5665
+ getScrollDimIndex(): number;
5447
5666
  /**
5448
- * Get the current scroll index value.
5667
+ * Get the current index scroll value.
5449
5668
  *
5450
- * @returns {object} The value.
5669
+ * @returns {number} The value.
5451
5670
  */
5452
- getCurrentScrollIndexValue(): object;
5671
+ getCurrentIndexScrollValue(): number;
5453
5672
  /**
5454
5673
  * Get the first origin or at a given position.
5455
5674
  *
@@ -5516,16 +5735,20 @@ export declare class ViewController {
5516
5735
  *
5517
5736
  * @param {Point2D} min Minimum point.
5518
5737
  * @param {Point2D} max Maximum point.
5738
+ * @param {Index} index The index at which to get the
5739
+ * image values (combined with min/max).
5519
5740
  * @returns {Array} A list of values.
5520
5741
  */
5521
- getImageRegionValues(min: Point2D, max: Point2D): any[];
5742
+ getImageRegionValues(min: Point2D, max: Point2D, index: Index): any[];
5522
5743
  /**
5523
5744
  * Get some values from the associated image in variable regions.
5524
5745
  *
5525
5746
  * @param {number[][][]} regions A list of [x, y] pairs (min, max).
5747
+ * @param {Index} index The index at which to get the
5748
+ * image values (combined with regions min/max).
5526
5749
  * @returns {Array} A list of values.
5527
5750
  */
5528
- getImageVariableRegionValues(regions: number[][][]): any[];
5751
+ getImageVariableRegionValues(regions: number[][][], index: Index): any[];
5529
5752
  /**
5530
5753
  * Can the image values be quantified?
5531
5754
  *
@@ -5648,62 +5871,6 @@ export declare class ViewController {
5648
5871
  * @returns {Vector3D} The 3D world offset.
5649
5872
  */
5650
5873
  getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
5651
- /**
5652
- * Get the current position incremented in the input direction.
5653
- *
5654
- * @param {number} dim The direction in which to increment.
5655
- * @returns {Point} The resulting point.
5656
- */
5657
- getIncrementPosition(dim: number): Point;
5658
- /**
5659
- * Get the current position decremented in the input direction.
5660
- *
5661
- * @param {number} dim The direction in which to decrement.
5662
- * @returns {Point} The resulting point.
5663
- */
5664
- getDecrementPosition(dim: number): Point;
5665
- /**
5666
- * Get the current position decremented in the scroll direction.
5667
- *
5668
- * @returns {Point} The resulting point.
5669
- */
5670
- getIncrementScrollPosition(): Point;
5671
- /**
5672
- * Get the current position decremented in the scroll direction.
5673
- *
5674
- * @returns {Point} The resulting point.
5675
- */
5676
- getDecrementScrollPosition(): Point;
5677
- /**
5678
- * Increment the provided dimension.
5679
- *
5680
- * @param {number} dim The dimension to increment.
5681
- * @param {boolean} [silent] Do not send event.
5682
- * @returns {boolean} False if not in bounds.
5683
- */
5684
- incrementIndex(dim: number, silent?: boolean): boolean;
5685
- /**
5686
- * Decrement the provided dimension.
5687
- *
5688
- * @param {number} dim The dimension to increment.
5689
- * @param {boolean} [silent] Do not send event.
5690
- * @returns {boolean} False if not in bounds.
5691
- */
5692
- decrementIndex(dim: number, silent?: boolean): boolean;
5693
- /**
5694
- * Decrement the scroll dimension index.
5695
- *
5696
- * @param {boolean} [silent] Do not send event.
5697
- * @returns {boolean} False if not in bounds.
5698
- */
5699
- decrementScrollIndex(silent?: boolean): boolean;
5700
- /**
5701
- * Increment the scroll dimension index.
5702
- *
5703
- * @param {boolean} [silent] Do not send event.
5704
- * @returns {boolean} False if not in bounds.
5705
- */
5706
- incrementScrollIndex(silent?: boolean): boolean;
5707
5874
  /**
5708
5875
  * Scroll play: loop through all slices.
5709
5876
  */