dwv 0.35.0-beta.2 → 0.35.0-beta.21

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
  *
@@ -2384,6 +2411,13 @@ export declare function getRectangleIndices(center: Index, size: number[], dir:
2384
2411
  */
2385
2412
  export declare function getReverseOrientation(ori: string): string;
2386
2413
 
2414
+ /**
2415
+ * Get a segmentation DICOM code.
2416
+ *
2417
+ * @returns {DicomCode} The code.
2418
+ */
2419
+ export declare function getSegmentationCode(): DicomCode;
2420
+
2387
2421
  /**
2388
2422
  * Get a content item object from a dicom element.
2389
2423
  *
@@ -2449,6 +2483,14 @@ export declare function getUID(tagName: string): string;
2449
2483
  */
2450
2484
  export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
2451
2485
 
2486
+ /**
2487
+ * Convert a hex color into RGB.
2488
+ *
2489
+ * @param {string} hexStr The hex color as '#ab01ef'.
2490
+ * @returns {RGB} The RGB values as {r,g,b}.
2491
+ */
2492
+ export declare function hexToRgb(hexStr: string): RGB;
2493
+
2452
2494
  export declare namespace i18n {
2453
2495
  /**
2454
2496
  * Get the translated text.
@@ -2950,14 +2992,32 @@ export declare class Index {
2950
2992
  */
2951
2993
  compare(rhs: Index): number[];
2952
2994
  /**
2953
- * Add another index to this one.
2995
+ * Add another index to this one and return
2996
+ * the result as a new index.
2954
2997
  *
2955
2998
  * @param {Index} rhs The index to add.
2956
2999
  * @returns {Index} The index representing the sum of both indices.
2957
3000
  */
2958
3001
  add(rhs: Index): Index;
2959
3002
  /**
2960
- * Get the current index with a new 2D base.
3003
+ * Increment this index by 1 at the given dimension
3004
+ * and return the result as a new index.
3005
+ *
3006
+ * @param {number} dim The dimension number.
3007
+ * @returns {Index} The result index.
3008
+ */
3009
+ next(dim: number): Index;
3010
+ /**
3011
+ * Decrement this index by 1 at the given dimension
3012
+ * and return the result as a new index.
3013
+ *
3014
+ * @param {number} dim The dimension number.
3015
+ * @returns {Index} The result index.
3016
+ */
3017
+ previous(dim: number): Index;
3018
+ /**
3019
+ * Get the current index with a new 2D base
3020
+ * and return the result as a new index.
2961
3021
  *
2962
3022
  * @param {number} i The new 0 index.
2963
3023
  * @param {number} j The new 1 index.
@@ -3006,6 +3066,12 @@ export declare class LayerGroup {
3006
3066
  * @param {HTMLElement} containerDiv The associated HTML div.
3007
3067
  */
3008
3068
  constructor(containerDiv: HTMLElement);
3069
+ /**
3070
+ * Get the position helper.
3071
+ *
3072
+ * @returns {PositionHelper} The position helper.
3073
+ */
3074
+ getPositionHelper(): PositionHelper;
3009
3075
  /**
3010
3076
  * Get the showCrosshair flag.
3011
3077
  *
@@ -3027,9 +3093,9 @@ export declare class LayerGroup {
3027
3093
  /**
3028
3094
  * Get the Id of the container div.
3029
3095
  *
3030
- * @returns {string} The id of the div.
3096
+ * @returns {string|undefined} The id of the div.
3031
3097
  */
3032
- getDivId(): string;
3098
+ getDivId(): string | undefined;
3033
3099
  /**
3034
3100
  * Get the layer scale.
3035
3101
  *
@@ -3103,6 +3169,12 @@ export declare class LayerGroup {
3103
3169
  * @returns {number} The number of layers.
3104
3170
  */
3105
3171
  getNumberOfViewLayers(): number;
3172
+ /**
3173
+ * Get the active image layer.
3174
+ *
3175
+ * @returns {ViewLayer|DrawLayer|undefined} The layer.
3176
+ */
3177
+ getActiveLayer(): ViewLayer | DrawLayer | undefined;
3106
3178
  /**
3107
3179
  * Get the active image layer.
3108
3180
  *
@@ -3115,6 +3187,13 @@ export declare class LayerGroup {
3115
3187
  * @returns {ViewLayer|undefined} The layer.
3116
3188
  */
3117
3189
  getBaseViewLayer(): ViewLayer | undefined;
3190
+ /**
3191
+ * Get a view layer associated to a data id.
3192
+ *
3193
+ * @param {string} id The layer id.
3194
+ * @returns {ViewLayer|undefined} The layer.
3195
+ */
3196
+ getViewLayerById(id: string): ViewLayer | undefined;
3118
3197
  /**
3119
3198
  * Get the view layers associated to a data id.
3120
3199
  *
@@ -3141,6 +3220,13 @@ export declare class LayerGroup {
3141
3220
  * @returns {DrawLayer|undefined} The layer.
3142
3221
  */
3143
3222
  getActiveDrawLayer(): DrawLayer | undefined;
3223
+ /**
3224
+ * Get a draw layer associated to a data id.
3225
+ *
3226
+ * @param {string} id The layer id.
3227
+ * @returns {DrawLayer|undefined} The layer.
3228
+ */
3229
+ getDrawLayerById(id: string): DrawLayer | undefined;
3144
3230
  /**
3145
3231
  * Get the draw layers associated to a data id.
3146
3232
  *
@@ -3149,30 +3235,17 @@ export declare class LayerGroup {
3149
3235
  */
3150
3236
  getDrawLayersByDataId(dataId: string): DrawLayer[];
3151
3237
  /**
3152
- * Set the active view layer.
3238
+ * Set the active layer.
3153
3239
  *
3154
3240
  * @param {number} index The index of the layer to set as active.
3155
3241
  */
3156
- setActiveViewLayer(index: number): void;
3242
+ setActiveLayer(index: number): void;
3157
3243
  /**
3158
- * Set the active view layer with a data id.
3244
+ * Set the active layer with a data id.
3159
3245
  *
3160
3246
  * @param {string} dataId The data id.
3161
3247
  */
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;
3248
+ setActiveLayerByDataId(dataId: string): void;
3176
3249
  /**
3177
3250
  * Add a view layer.
3178
3251
  *
@@ -3206,6 +3279,7 @@ export declare class LayerGroup {
3206
3279
  * methods to define the active index.
3207
3280
  *
3208
3281
  * @param {ViewLayer | DrawLayer} layer The layer to remove.
3282
+ * @fires LayerGroup#removelayer
3209
3283
  */
3210
3284
  removeLayer(layer: ViewLayer | DrawLayer): void;
3211
3285
  /**
@@ -3241,7 +3315,7 @@ export declare class LayerGroup {
3241
3315
  */
3242
3316
  moreThanOne(dim: number): boolean;
3243
3317
  /**
3244
- * Update layers (but not the active view layer) to a position change.
3318
+ * Update layers (but not the event source layer) to a position change.
3245
3319
  *
3246
3320
  * @param {object} event The position change event.
3247
3321
  * @function
@@ -3368,10 +3442,11 @@ export declare class MaskFactory {
3368
3442
  */
3369
3443
  getWarning(): string | undefined;
3370
3444
  /**
3371
- * Check dicom elements. Throws an error if not suitable.
3445
+ * Check dicom elements.
3372
3446
  *
3373
3447
  * @param {Object<string, DataElement>} _dicomElements The DICOM tags.
3374
3448
  * @returns {string|undefined} A possible warning.
3449
+ * @throws Error for missing or wrong data.
3375
3450
  */
3376
3451
  checkElements(_dicomElements: {
3377
3452
  [x: string]: DataElement;
@@ -3384,6 +3459,7 @@ export declare class MaskFactory {
3384
3459
  * Uint16Array | Int16Array |
3385
3460
  * Uint32Array | Int32Array} pixelBuffer The pixel buffer.
3386
3461
  * @returns {Image} A new Image.
3462
+ * @throws Error for missing or wrong data.
3387
3463
  */
3388
3464
  create(dataElements: {
3389
3465
  [x: string]: DataElement;
@@ -3605,11 +3681,18 @@ export declare class Matrix33 {
3605
3681
  * Check for Matrix33 equality.
3606
3682
  *
3607
3683
  * @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
3684
  * @returns {boolean} True if both matrices are equal.
3611
3685
  */
3612
- equals(rhs: Matrix33, p?: number): boolean;
3686
+ equals(rhs: Matrix33): boolean;
3687
+ /**
3688
+ * Check for Matrix33 similarity.
3689
+ *
3690
+ * @param {Matrix33} rhs The other matrix to compare to.
3691
+ * @param {number} [tol] Optional number comparison tolerance,
3692
+ * defaults to Number.EPSILON.
3693
+ * @returns {boolean} True if both matrices are similar.
3694
+ */
3695
+ isSimilar(rhs: Matrix33, tol?: number): boolean;
3613
3696
  /**
3614
3697
  * Get a string representation of the Matrix33.
3615
3698
  *
@@ -3884,6 +3967,13 @@ export declare class PlaneHelper {
3884
3967
  * @returns {Index} The corresponding index.
3885
3968
  */
3886
3969
  worldToIndex(point: Point): Index;
3970
+ /**
3971
+ * Image index to world.
3972
+ *
3973
+ * @param {Index} index The input index.
3974
+ * @returns {Point} The corresponding point.
3975
+ */
3976
+ indexToWorld(index: Index): Point;
3887
3977
  /**
3888
3978
  * Is this view in the same orientation as the image aquisition.
3889
3979
  *
@@ -3902,13 +3992,13 @@ export declare class PlaneHelper {
3902
3992
  *
3903
3993
  * @returns {number} The index.
3904
3994
  */
3905
- getScrollIndex(): number;
3995
+ getScrollDimIndex(): number;
3906
3996
  /**
3907
3997
  * Get the native (image) scroll dimension index.
3908
3998
  *
3909
3999
  * @returns {number} The index.
3910
4000
  */
3911
- getNativeScrollIndex(): number;
4001
+ getNativeScrollDimIndex(): number;
3912
4002
  #private;
3913
4003
  }
3914
4004
 
@@ -4092,11 +4182,11 @@ export declare class Point3D {
4092
4182
  * Check for Point3D similarity.
4093
4183
  *
4094
4184
  * @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.
4185
+ * @param {number} [tol] Optional number comparison tolerance,
4186
+ * defaults to Number.EPSILON.
4187
+ * @returns {boolean} True if both points are similar.
4098
4188
  */
4099
- isSimilar(rhs: Point3D, tol: number): boolean;
4189
+ isSimilar(rhs: Point3D, tol?: number): boolean;
4100
4190
  /**
4101
4191
  * Get a string representation of the Point3D.
4102
4192
  *
@@ -4127,6 +4217,153 @@ export declare class Point3D {
4127
4217
  #private;
4128
4218
  }
4129
4219
 
4220
+ /**
4221
+ * Position helper.
4222
+ */
4223
+ export declare class PositionHelper {
4224
+ /**
4225
+ * @param {View} view The associated view.
4226
+ */
4227
+ constructor(view: View);
4228
+ /**
4229
+ * Get the geometry.
4230
+ *
4231
+ * @returns {Geometry} The geometry.
4232
+ */
4233
+ getGeometry(): Geometry;
4234
+ /**
4235
+ * Get the scroll index.
4236
+ *
4237
+ * @returns {number} The scroll index.
4238
+ */
4239
+ getScrollDimIndex(): number;
4240
+ /**
4241
+ * Get the maximum dimension value.
4242
+ *
4243
+ * @param {number} dim The dimension.
4244
+ * @returns {number} The maximum value.
4245
+ */
4246
+ getMaximumDimValue(dim: number): number;
4247
+ /**
4248
+ * Get the maximum scroll value.
4249
+ *
4250
+ * @returns {number} The maximum value.
4251
+ */
4252
+ getMaximumScrollValue(): number;
4253
+ /**
4254
+ * Get the current position.
4255
+ *
4256
+ * @returns {Point} The current position.
4257
+ */
4258
+ getCurrentPosition(): Point;
4259
+ /**
4260
+ * Get the value at dimension index for the current position.
4261
+ *
4262
+ * @param {number} dim The dimension.
4263
+ * @returns {number} The value.
4264
+ */
4265
+ getCurrentPositionDimValue(dim: number): number;
4266
+ /**
4267
+ * Get the value at scroll index for the current position.
4268
+ *
4269
+ * @returns {number} The value.
4270
+ */
4271
+ getCurrentPositionScrollValue(): number;
4272
+ /**
4273
+ * Get the current position updated at the provided dimension index
4274
+ * with the input value.
4275
+ *
4276
+ * @param {number} dim The dimension.
4277
+ * @param {number} value The value to used at dimension index.
4278
+ * @returns {Point} The position.
4279
+ */
4280
+ getCurrentPositionAtDimValue(dim: number, value: number): Point;
4281
+ /**
4282
+ * Get the current position updated at scroll index with the input value.
4283
+ *
4284
+ * @param {number} value The value to use at scroll index.
4285
+ * @returns {Point} The position.
4286
+ */
4287
+ getCurrentPositionAtScrollValue(value: number): Point;
4288
+ /**
4289
+ * Get the current index.
4290
+ *
4291
+ * @returns {Index} The current index.
4292
+ */
4293
+ getCurrentIndex(): Index;
4294
+ /**
4295
+ * Set the current position.
4296
+ *
4297
+ * @param {Point} position The position.
4298
+ * @param {boolean} [silent] Flag to fire event or not.
4299
+ * @returns {boolean} True if possible and in bounds.
4300
+ */
4301
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
4302
+ /**
4303
+ * Set the current position only if it is in the geometry bounds.
4304
+ *
4305
+ * @param {Point} position The position.
4306
+ * @param {boolean} [silent] Flag to fire event or not.
4307
+ * @returns {boolean} True if possible and in bounds.
4308
+ */
4309
+ setCurrentPositionSafe(position: Point, silent?: boolean): boolean;
4310
+ /**
4311
+ * Merge with another helper.
4312
+ *
4313
+ * @param {PositionHelper} rhs The helper to merge with this one.
4314
+ */
4315
+ merge(rhs: PositionHelper): void;
4316
+ /**
4317
+ * Check if the current position (default) or
4318
+ * the provided position is in bounds.
4319
+ *
4320
+ * @param {Point} position Optional position.
4321
+ * @returns {boolean} True is the position is in bounds.
4322
+ */
4323
+ isPositionInBounds(position: Point): boolean;
4324
+ /**
4325
+ * Get the current position incremented in the input direction.
4326
+ *
4327
+ * @param {number} dim The direction in which to increment.
4328
+ * @returns {Point} The resulting point.
4329
+ */
4330
+ getIncrementPosition(dim: number): Point;
4331
+ /**
4332
+ * Get the current position decremented in the input direction.
4333
+ *
4334
+ * @param {number} dim The direction in which to decrement.
4335
+ * @returns {Point} The resulting point.
4336
+ */
4337
+ getDecrementPosition(dim: number): Point;
4338
+ /**
4339
+ * Increment the current position along the provided dim.
4340
+ *
4341
+ * @param {number} dim The direction in which to increment.
4342
+ * @returns {boolean} True if possible and in bounds.
4343
+ */
4344
+ incrementPosition(dim: number): boolean;
4345
+ /**
4346
+ * Decrement the current position along the provided dim.
4347
+ *
4348
+ * @param {number} dim The direction in which to decrement.
4349
+ * @returns {boolean} True if possible and in bounds.
4350
+ */
4351
+ decrementPosition(dim: number): boolean;
4352
+ /**
4353
+ * Increment the current position along the scroll dimension.
4354
+ *
4355
+ * @returns {boolean} True if possible and in bounds.
4356
+ */
4357
+ incrementPositionAlongScroll(): boolean;
4358
+ /**
4359
+ * Decrement the current position along the scroll dimension.
4360
+ *
4361
+ * @returns {boolean} True if possible and in bounds.
4362
+ */
4363
+ decrementPositionAlongScroll(): boolean;
4364
+ #private;
4365
+ }
4366
+
4130
4367
  /**
4131
4368
  * Round a float number to a given precision.
4132
4369
  *
@@ -4266,10 +4503,12 @@ export declare class Rectangle {
4266
4503
  * Quantify a rectangle according to view information.
4267
4504
  *
4268
4505
  * @param {ViewController} viewController The associated view controller.
4506
+ * @param {Index} index The index at which to get the
4507
+ * image values.
4269
4508
  * @param {string[]} flags A list of stat values to calculate.
4270
4509
  * @returns {object} A quantification object.
4271
4510
  */
4272
- quantify(viewController: ViewController, flags: string[]): object;
4511
+ quantify(viewController: ViewController, index: Index, flags: string[]): object;
4273
4512
  #private;
4274
4513
  }
4275
4514
 
@@ -4347,6 +4586,14 @@ export declare class RGB {
4347
4586
  b: number;
4348
4587
  }
4349
4588
 
4589
+ /**
4590
+ * Convert RGB to its hex equivalent.
4591
+ *
4592
+ * @param {RGB} rgb The RGB object as {r,g,b}.
4593
+ * @returns {string} A string representing the hex color as '#ab01ef'.
4594
+ */
4595
+ export declare function rgbToHex(rgb: RGB): string;
4596
+
4350
4597
  /**
4351
4598
  * Region Of Interest shape.
4352
4599
  * Note: should be a closed path.
@@ -4393,9 +4640,9 @@ export declare class ROI {
4393
4640
  * a non-self-intersecting closed polygon.
4394
4641
  * Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}.
4395
4642
  *
4396
- * @returns {Point2D} The centroid point.
4643
+ * @returns {Point2D|undefined} The centroid point.
4397
4644
  */
4398
- getCentroid(): Point2D;
4645
+ getCentroid(): Point2D | undefined;
4399
4646
  #private;
4400
4647
  }
4401
4648
 
@@ -4698,6 +4945,12 @@ export declare class Tag {
4698
4945
  * @returns {string|undefined} The VR.
4699
4946
  */
4700
4947
  getVrFromDictionary(): string | undefined;
4948
+ /**
4949
+ * Get the multiplicity from the dicom dictionary.
4950
+ *
4951
+ * @returns {number|undefined} The multiplicity.
4952
+ */
4953
+ getMultiplicityFromDictionary(): number | undefined;
4701
4954
  /**
4702
4955
  * Get the tag name from the dicom dictionary.
4703
4956
  *
@@ -4707,23 +4960,6 @@ export declare class Tag {
4707
4960
  #private;
4708
4961
  }
4709
4962
 
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
4963
  /**
4728
4964
  * Toolbox controller.
4729
4965
  */
@@ -5185,23 +5421,23 @@ export declare class View {
5185
5421
  */
5186
5422
  getOrigin(position?: Point): Point3D;
5187
5423
  /**
5188
- * Set the current position.
5424
+ * Set the current position via an index.
5189
5425
  *
5190
- * @param {Point} position The new position.
5426
+ * @param {Index} index The new index.
5191
5427
  * @param {boolean} [silent] Flag to fire event or not.
5192
5428
  * @returns {boolean} False if not in bounds.
5193
5429
  * @fires View#positionchange
5194
5430
  */
5195
- setCurrentPosition(position: Point, silent?: boolean): boolean;
5431
+ setCurrentIndex(index: Index, silent?: boolean): boolean;
5196
5432
  /**
5197
- * Set the current index.
5433
+ * Set current position.
5198
5434
  *
5199
- * @param {Index} index The new index.
5435
+ * @param {Point} position The new position.
5200
5436
  * @param {boolean} [silent] Flag to fire event or not.
5201
5437
  * @returns {boolean} False if not in bounds.
5202
5438
  * @fires View#positionchange
5203
5439
  */
5204
- setCurrentIndex(index: Index, silent?: boolean): boolean;
5440
+ setCurrentPosition(position: Point, silent?: boolean): boolean;
5205
5441
  /**
5206
5442
  * Set the view window/level.
5207
5443
  *
@@ -5273,7 +5509,7 @@ export declare class View {
5273
5509
  *
5274
5510
  * @returns {number} The index.
5275
5511
  */
5276
- getScrollIndex(): number;
5512
+ getScrollDimIndex(): number;
5277
5513
  /**
5278
5514
  * Is this view in the same orientation as the image aquisition.
5279
5515
  *
@@ -5400,6 +5636,18 @@ export declare class ViewController {
5400
5636
  * @returns {boolean} True if the controler is playing.
5401
5637
  */
5402
5638
  isPlaying(): boolean;
5639
+ /**
5640
+ * Get the position helper.
5641
+ *
5642
+ * @returns {PositionHelper} The helper.
5643
+ */
5644
+ getPositionHelper(): PositionHelper;
5645
+ /**
5646
+ * Get a clone of the position helper.
5647
+ *
5648
+ * @returns {PositionHelper} The helper clone.
5649
+ */
5650
+ getPositionHelperClone(): PositionHelper;
5403
5651
  /**
5404
5652
  * Get the current position.
5405
5653
  *
@@ -5439,17 +5687,17 @@ export declare class ViewController {
5439
5687
  */
5440
5688
  getCurrentOrientedIndex(): Index;
5441
5689
  /**
5442
- * Get the scroll index.
5690
+ * Get the scroll dimension index.
5443
5691
  *
5444
5692
  * @returns {number} The index.
5445
5693
  */
5446
- getScrollIndex(): number;
5694
+ getScrollDimIndex(): number;
5447
5695
  /**
5448
- * Get the current scroll index value.
5696
+ * Get the current index scroll value.
5449
5697
  *
5450
- * @returns {object} The value.
5698
+ * @returns {number} The value.
5451
5699
  */
5452
- getCurrentScrollIndexValue(): object;
5700
+ getCurrentIndexScrollValue(): number;
5453
5701
  /**
5454
5702
  * Get the first origin or at a given position.
5455
5703
  *
@@ -5516,16 +5764,20 @@ export declare class ViewController {
5516
5764
  *
5517
5765
  * @param {Point2D} min Minimum point.
5518
5766
  * @param {Point2D} max Maximum point.
5767
+ * @param {Index} index The index at which to get the
5768
+ * image values (combined with min/max).
5519
5769
  * @returns {Array} A list of values.
5520
5770
  */
5521
- getImageRegionValues(min: Point2D, max: Point2D): any[];
5771
+ getImageRegionValues(min: Point2D, max: Point2D, index: Index): any[];
5522
5772
  /**
5523
5773
  * Get some values from the associated image in variable regions.
5524
5774
  *
5525
5775
  * @param {number[][][]} regions A list of [x, y] pairs (min, max).
5776
+ * @param {Index} index The index at which to get the
5777
+ * image values (combined with regions min/max).
5526
5778
  * @returns {Array} A list of values.
5527
5779
  */
5528
- getImageVariableRegionValues(regions: number[][][]): any[];
5780
+ getImageVariableRegionValues(regions: number[][][], index: Index): any[];
5529
5781
  /**
5530
5782
  * Can the image values be quantified?
5531
5783
  *
@@ -5648,62 +5900,6 @@ export declare class ViewController {
5648
5900
  * @returns {Vector3D} The 3D world offset.
5649
5901
  */
5650
5902
  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
5903
  /**
5708
5904
  * Scroll play: loop through all slices.
5709
5905
  */