dwv 0.33.0-beta.30 → 0.33.0-beta.31

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
@@ -4,9 +4,13 @@ import Konva from 'konva';
4
4
  * Add tags to the dictionary.
5
5
  *
6
6
  * @param {string} group The group key.
7
- * @param {object} tags The tags to add.
7
+ * @param {Object<string, string[]>} tags The tags to add as an
8
+ * object indexed by element key with values as:
9
+ * [VR, multiplicity, TagName] (all strings).
8
10
  */
9
- export declare function addTagsToDictionary(group: string, tags: object): void;
11
+ export declare function addTagsToDictionary(group: string, tags: {
12
+ [x: string]: string[];
13
+ }): void;
10
14
 
11
15
  /**
12
16
  * List of ViewConfigs indexed by dataIds.
@@ -106,21 +110,21 @@ export declare class App {
106
110
  /**
107
111
  * Get the active layer group scale on top of the base scale.
108
112
  *
109
- * @returns {object} The scale as {x,y}.
113
+ * @returns {Scalar3D} The scale as {x,y,z}.
110
114
  */
111
- getAddedScale(): object;
115
+ getAddedScale(): Scalar3D;
112
116
  /**
113
117
  * Get the base scale of the active layer group.
114
118
  *
115
- * @returns {object} The scale as {x,y}.
119
+ * @returns {Scalar3D} The scale as {x,y,z}.
116
120
  */
117
- getBaseScale(): object;
121
+ getBaseScale(): Scalar3D;
118
122
  /**
119
123
  * Get the layer offset of the active layer group.
120
124
  *
121
- * @returns {object} The offset.
125
+ * @returns {Scalar3D} The offset as {x,y,z}.
122
126
  */
123
- getOffset(): object;
127
+ getOffset(): Scalar3D;
124
128
  /**
125
129
  * Get the toolbox controller.
126
130
  *
@@ -933,10 +937,6 @@ export declare class DicomWriter {
933
937
  * Use a TextEncoder instead of the default text decoder.
934
938
  */
935
939
  useSpecialTextEncoder(): void;
936
- /**
937
- * Use default anonymisation rules.
938
- */
939
- useDefaultAnonymisationRules(): void;
940
940
  /**
941
941
  * Get the element to write according to the class rules.
942
942
  * Priority order: tagName, groupName, default.
@@ -1127,9 +1127,9 @@ export declare class DrawLayer {
1127
1127
  /**
1128
1128
  * Set the plane helper.
1129
1129
  *
1130
- * @param {object} helper The helper.
1130
+ * @param {PlaneHelper} helper The helper.
1131
1131
  */
1132
- setPlaneHelper(helper: object): void;
1132
+ setPlaneHelper(helper: PlaneHelper): void;
1133
1133
  /**
1134
1134
  * Get the id of the layer.
1135
1135
  *
@@ -1139,9 +1139,9 @@ export declare class DrawLayer {
1139
1139
  /**
1140
1140
  * Get the layer base size (without scale).
1141
1141
  *
1142
- * @returns {object} The size as {x,y}.
1142
+ * @returns {Scalar2D} The size as {x,y}.
1143
1143
  */
1144
- getBaseSize(): object;
1144
+ getBaseSize(): Scalar2D;
1145
1145
  /**
1146
1146
  * Get the layer opacity.
1147
1147
  *
@@ -1177,16 +1177,16 @@ export declare class DrawLayer {
1177
1177
  /**
1178
1178
  * Set the layer scale.
1179
1179
  *
1180
- * @param {object} newScale The scale as {x,y}.
1180
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
1181
1181
  * @param {Point3D} [center] The scale center.
1182
1182
  */
1183
- setScale(newScale: object, center?: Point3D): void;
1183
+ setScale(newScale: Scalar3D, center?: Point3D): void;
1184
1184
  /**
1185
1185
  * Set the layer offset.
1186
1186
  *
1187
- * @param {object} newOffset The offset as {x,y}.
1187
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
1188
1188
  */
1189
- setOffset(newOffset: object): void;
1189
+ setOffset(newOffset: Scalar3D): void;
1190
1190
  /**
1191
1191
  * Set the base layer offset. Updates the layer offset.
1192
1192
  *
@@ -1215,19 +1215,19 @@ export declare class DrawLayer {
1215
1215
  /**
1216
1216
  * Initialise the layer: set the canvas and context
1217
1217
  *
1218
- * @param {object} size The image size as {x,y}.
1219
- * @param {object} spacing The image spacing as {x,y}.
1218
+ * @param {Scalar2D} size The image size as {x,y}.
1219
+ * @param {Scalar2D} spacing The image spacing as {x,y}.
1220
1220
  * @param {string} dataId The associated data id.
1221
1221
  */
1222
- initialise(size: object, spacing: object, dataId: string): void;
1222
+ initialise(size: Scalar2D, spacing: Scalar2D, dataId: string): void;
1223
1223
  /**
1224
1224
  * Fit the layer to its parent container.
1225
1225
  *
1226
1226
  * @param {number} fitScale1D The 1D fit scale.
1227
- * @param {object} fitSize The fit size as {x,y}.
1228
- * @param {object} fitOffset The fit offset as {x,y}.
1227
+ * @param {Scalar2D} fitSize The fit size as {x,y}.
1228
+ * @param {Scalar2D} fitOffset The fit offset as {x,y}.
1229
1229
  */
1230
- fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void;
1230
+ fitToContainer(fitScale1D: number, fitSize: Scalar2D, fitOffset: Scalar2D): void;
1231
1231
  /**
1232
1232
  * Check the visibility of a given group.
1233
1233
  *
@@ -2133,7 +2133,7 @@ export declare class Index {
2133
2133
  * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to
2134
2134
  * unsigned int CIE LAB ([0, 65535]).
2135
2135
  *
2136
- * @param {object} triplet CIE XYZ triplet as {x,y,z} with CIE LAB range.
2136
+ * @param {object} triplet CIE XYZ triplet as {l,a,b} with CIE LAB range.
2137
2137
  * @returns {object} CIE LAB triplet as {l,a,b} with unsigned range.
2138
2138
  */
2139
2139
  export declare function labToUintLab(triplet: object): object;
@@ -2186,27 +2186,27 @@ export declare class LayerGroup {
2186
2186
  /**
2187
2187
  * Get the layer scale.
2188
2188
  *
2189
- * @returns {object} The scale as {x,y,z}.
2189
+ * @returns {Scalar3D} The scale as {x,y,z}.
2190
2190
  */
2191
- getScale(): object;
2191
+ getScale(): Scalar3D;
2192
2192
  /**
2193
2193
  * Get the base scale.
2194
2194
  *
2195
- * @returns {object} The scale as {x,y,z}.
2195
+ * @returns {Scalar3D} The scale as {x,y,z}.
2196
2196
  */
2197
- getBaseScale(): object;
2197
+ getBaseScale(): Scalar3D;
2198
2198
  /**
2199
2199
  * Get the added scale: the scale added to the base scale
2200
2200
  *
2201
- * @returns {object} The scale as {x,y,z}.
2201
+ * @returns {Scalar3D} The scale as {x,y,z}.
2202
2202
  */
2203
- getAddedScale(): object;
2203
+ getAddedScale(): Scalar3D;
2204
2204
  /**
2205
2205
  * Get the layer offset.
2206
2206
  *
2207
- * @returns {object} The offset as {x,y,z}.
2207
+ * @returns {Scalar3D} The offset as {x,y,z}.
2208
2208
  */
2209
- getOffset(): object;
2209
+ getOffset(): Scalar3D;
2210
2210
  /**
2211
2211
  * Get the number of layers handled by this class.
2212
2212
  *
@@ -2370,9 +2370,9 @@ export declare class LayerGroup {
2370
2370
  /**
2371
2371
  * Get the largest data size.
2372
2372
  *
2373
- * @returns {object|undefined} The largest size as {x,y}.
2373
+ * @returns {Scalar2D|undefined} The largest size as {x,y}.
2374
2374
  */
2375
- getMaxSize(): object | undefined;
2375
+ getMaxSize(): Scalar2D | undefined;
2376
2376
  /**
2377
2377
  * Flip all layers along the Z axis without offset compensation.
2378
2378
  */
@@ -2387,24 +2387,24 @@ export declare class LayerGroup {
2387
2387
  /**
2388
2388
  * Set the layers' scale.
2389
2389
  *
2390
- * @param {object} newScale The scale to apply as {x,y,z}.
2390
+ * @param {Scalar3D} newScale The scale to apply as {x,y,z}.
2391
2391
  * @param {Point3D} [center] The scale center Point3D.
2392
2392
  * @fires LayerGroup#zoomchange
2393
2393
  */
2394
- setScale(newScale: object, center?: Point3D): void;
2394
+ setScale(newScale: Scalar3D, center?: Point3D): void;
2395
2395
  /**
2396
2396
  * Add translation to the layers.
2397
2397
  *
2398
- * @param {object} translation The translation as {x,y,z}.
2398
+ * @param {Scalar3D} translation The translation as {x,y,z}.
2399
2399
  */
2400
- addTranslation(translation: object): void;
2400
+ addTranslation(translation: Scalar3D): void;
2401
2401
  /**
2402
2402
  * Set the layers' offset.
2403
2403
  *
2404
- * @param {object} newOffset The offset as {x,y,z}.
2404
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
2405
2405
  * @fires LayerGroup#offsetchange
2406
2406
  */
2407
- setOffset(newOffset: object): void;
2407
+ setOffset(newOffset: Scalar3D): void;
2408
2408
  /**
2409
2409
  * Reset the stage to its initial scale and no offset.
2410
2410
  */
@@ -2842,17 +2842,17 @@ export declare class PlaneHelper {
2842
2842
  /**
2843
2843
  * Get a 3D offset from a plane one.
2844
2844
  *
2845
- * @param {object} offset2D The plane offset as {x,y}.
2845
+ * @param {Scalar2D} offset2D The plane offset as {x,y}.
2846
2846
  * @returns {Vector3D} The 3D world offset.
2847
2847
  */
2848
- getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
2848
+ getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
2849
2849
  /**
2850
2850
  * Get a plane offset from a 3D one.
2851
2851
  *
2852
- * @param {object} offset3D The 3D offset as {x,y,z}.
2853
- * @returns {object} The plane offset as {x,y}.
2852
+ * @param {Scalar3D} offset3D The 3D offset as {x,y,z}.
2853
+ * @returns {Scalar2D} The plane offset as {x,y}.
2854
2854
  */
2855
- getPlaneOffsetFromOffset3D(offset3D: object): object;
2855
+ getPlaneOffsetFromOffset3D(offset3D: Scalar3D): Scalar2D;
2856
2856
  /**
2857
2857
  * Orient an input vector from real to target space.
2858
2858
  *
@@ -2905,10 +2905,10 @@ export declare class PlaneHelper {
2905
2905
  /**
2906
2906
  * Reorder values to follow target orientation.
2907
2907
  *
2908
- * @param {object} values Values as {x,y,z}.
2909
- * @returns {object} Reoriented values as {x,y,z}.
2908
+ * @param {Scalar3D} values Values as {x,y,z}.
2909
+ * @returns {Scalar3D} Reoriented values as {x,y,z}.
2910
2910
  */
2911
- getTargetOrientedPositiveXYZ(values: object): object;
2911
+ getTargetOrientedPositiveXYZ(values: Scalar3D): Scalar3D;
2912
2912
  /**
2913
2913
  * Get the (view) scroll dimension index.
2914
2914
  *
@@ -3194,6 +3194,48 @@ export declare class RGB {
3194
3194
  b: number;
3195
3195
  }
3196
3196
 
3197
+ /**
3198
+ * Mutable 2D scalar ({x,y}).
3199
+ */
3200
+ export declare class Scalar2D {
3201
+ /**
3202
+ * X value.
3203
+ *
3204
+ * @type {number}
3205
+ */
3206
+ x: number;
3207
+ /**
3208
+ * Y value.
3209
+ *
3210
+ * @type {number}
3211
+ */
3212
+ y: number;
3213
+ }
3214
+
3215
+ /**
3216
+ * Mutable 3D scalar ({x,y,z}).
3217
+ */
3218
+ export declare class Scalar3D {
3219
+ /**
3220
+ * X value.
3221
+ *
3222
+ * @type {number}
3223
+ */
3224
+ x: number;
3225
+ /**
3226
+ * Y value.
3227
+ *
3228
+ * @type {number}
3229
+ */
3230
+ y: number;
3231
+ /**
3232
+ * Z value.
3233
+ *
3234
+ * @type {number}
3235
+ */
3236
+ z: number;
3237
+ }
3238
+
3197
3239
  /**
3198
3240
  * Scroll wheel class: provides a wheel event handler
3199
3241
  * that scroll the corresponding data.
@@ -3317,9 +3359,9 @@ export declare class Size {
3317
3359
  /**
3318
3360
  * Get the 2D base of this size.
3319
3361
  *
3320
- * @returns {object} The 2D base [0,1] as {x,y}.
3362
+ * @returns {Scalar2D} The 2D base [0,1] as {x,y}.
3321
3363
  */
3322
- get2D(): object;
3364
+ get2D(): Scalar2D;
3323
3365
  #private;
3324
3366
  }
3325
3367
 
@@ -3368,9 +3410,9 @@ export declare class Spacing {
3368
3410
  /**
3369
3411
  * Get the 2D base of this size.
3370
3412
  *
3371
- * @returns {object} The 2D base [col,row] as {x,y}.
3413
+ * @returns {Scalar2D} The 2D base [col,row] as {x,y}.
3372
3414
  */
3373
- get2D(): object;
3415
+ get2D(): Scalar2D;
3374
3416
  #private;
3375
3417
  }
3376
3418
 
@@ -3444,12 +3486,6 @@ export declare class Tag {
3444
3486
  * ie if its group is an odd number.
3445
3487
  */
3446
3488
  isPrivate(): boolean;
3447
- /**
3448
- * Get the tag info from the dicom dictionary.
3449
- *
3450
- * @returns {Array|undefined} The info as [vr, multiplicity, name].
3451
- */
3452
- getInfoFromDictionary(): any[] | undefined;
3453
3489
  /**
3454
3490
  * Get the tag Value Representation (VR) from the dicom dictionary.
3455
3491
  *
@@ -4106,9 +4142,9 @@ export declare class ViewController {
4106
4142
  /**
4107
4143
  * Get the current view (2D) spacing.
4108
4144
  *
4109
- * @returns {number[]} The spacing as a 2D array.
4145
+ * @returns {Scalar2D} The spacing as a 2D array.
4110
4146
  */
4111
- get2DSpacing(): number[];
4147
+ get2DSpacing(): Scalar2D;
4112
4148
  /**
4113
4149
  * Get the image rescaled value at the input position.
4114
4150
  *
@@ -4181,9 +4217,9 @@ export declare class ViewController {
4181
4217
  /**
4182
4218
  * Get the image world (mm) 2D size.
4183
4219
  *
4184
- * @returns {object} The 2D size as {x,y}.
4220
+ * @returns {Scalar2D} The 2D size as {x,y}.
4185
4221
  */
4186
- getImageWorldSize(): object;
4222
+ getImageWorldSize(): Scalar2D;
4187
4223
  /**
4188
4224
  * Get the image rescaled data range.
4189
4225
  *
@@ -4247,10 +4283,10 @@ export declare class ViewController {
4247
4283
  /**
4248
4284
  * Get a 3D offset from a plane one.
4249
4285
  *
4250
- * @param {object} offset2D The plane offset as {x,y}.
4286
+ * @param {Scalar2D} offset2D The plane offset as {x,y}.
4251
4287
  * @returns {Vector3D} The 3D world offset.
4252
4288
  */
4253
- getOffset3DFromPlaneOffset(offset2D: object): Vector3D;
4289
+ getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D;
4254
4290
  /**
4255
4291
  * Get the current position incremented in the input direction.
4256
4292
  *
@@ -4394,9 +4430,9 @@ export declare class ViewLayer {
4394
4430
  /**
4395
4431
  * Get the layer zoom offset.
4396
4432
  *
4397
- * @returns {object} The offset as {x,y}.
4433
+ * @returns {Scalar2D} The offset as {x,y}.
4398
4434
  */
4399
- getZoomOffset(): object;
4435
+ getZoomOffset(): Scalar2D;
4400
4436
  /**
4401
4437
  * Set the imageSmoothing flag value.
4402
4438
  *
@@ -4445,15 +4481,15 @@ export declare class ViewLayer {
4445
4481
  /**
4446
4482
  * Get the layer base size (without scale).
4447
4483
  *
4448
- * @returns {object} The size as {x,y}.
4484
+ * @returns {Scalar2D} The size as {x,y}.
4449
4485
  */
4450
- getBaseSize(): object;
4486
+ getBaseSize(): Scalar2D;
4451
4487
  /**
4452
4488
  * Get the image world (mm) 2D size.
4453
4489
  *
4454
- * @returns {object} The 2D size as {x,y}.
4490
+ * @returns {Scalar2D} The 2D size as {x,y}.
4455
4491
  */
4456
- getImageWorldSize(): object;
4492
+ getImageWorldSize(): Scalar2D;
4457
4493
  /**
4458
4494
  * Get the layer opacity.
4459
4495
  *
@@ -4489,18 +4525,18 @@ export declare class ViewLayer {
4489
4525
  /**
4490
4526
  * Set the layer scale.
4491
4527
  *
4492
- * @param {object} newScale The scale as {x,y}.
4528
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
4493
4529
  * @param {Point3D} [center] The scale center.
4494
4530
  */
4495
- setScale(newScale: object, center?: Point3D): void;
4531
+ setScale(newScale: Scalar3D, center?: Point3D): void;
4496
4532
  /**
4497
4533
  * Initialise the layer scale. Works with a zoom offset that
4498
4534
  * comes from a equal view layer (size, scale, offset...).
4499
4535
  *
4500
- * @param {object} newScale The scale as {x,y}.
4501
- * @param {object} zoomOffset The zoom offset as {x,y}.
4536
+ * @param {Scalar3D} newScale The scale as {x,y,z}.
4537
+ * @param {Scalar2D} zoomOffset The zoom offset as {x,y}.
4502
4538
  */
4503
- initScale(newScale: object, zoomOffset: object): void;
4539
+ initScale(newScale: Scalar3D, zoomOffset: Scalar2D): void;
4504
4540
  /**
4505
4541
  * Set the base layer offset. Updates the layer offset.
4506
4542
  *
@@ -4512,9 +4548,9 @@ export declare class ViewLayer {
4512
4548
  /**
4513
4549
  * Set the layer offset.
4514
4550
  *
4515
- * @param {object} newOffset The offset as {x,y}.
4551
+ * @param {Scalar3D} newOffset The offset as {x,y,z}.
4516
4552
  */
4517
- setOffset(newOffset: object): void;
4553
+ setOffset(newOffset: Scalar3D): void;
4518
4554
  /**
4519
4555
  * Transform a display position to a 2D index.
4520
4556
  *
@@ -4574,19 +4610,19 @@ export declare class ViewLayer {
4574
4610
  /**
4575
4611
  * Initialise the layer: set the canvas and context
4576
4612
  *
4577
- * @param {object} size The image size as {x,y}.
4578
- * @param {object} spacing The image spacing as {x,y}.
4613
+ * @param {Scalar2D} size The image size as {x,y}.
4614
+ * @param {Scalar2D} spacing The image spacing as {x,y}.
4579
4615
  * @param {number} alpha The initial data opacity.
4580
4616
  */
4581
- initialise(size: object, spacing: object, alpha: number): void;
4617
+ initialise(size: Scalar2D, spacing: Scalar2D, alpha: number): void;
4582
4618
  /**
4583
4619
  * Fit the layer to its parent container.
4584
4620
  *
4585
4621
  * @param {number} fitScale1D The 1D fit scale.
4586
- * @param {object} fitSize The fit size as {x,y}.
4587
- * @param {object} fitOffset The fit offset as {x,y}.
4622
+ * @param {Scalar2D} fitSize The fit size as {x,y}.
4623
+ * @param {Scalar2D} fitOffset The fit offset as {x,y}.
4588
4624
  */
4589
- fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void;
4625
+ fitToContainer(fitScale1D: number, fitSize: Scalar2D, fitOffset: Scalar2D): void;
4590
4626
  /**
4591
4627
  * Enable and listen to container interaction events.
4592
4628
  */