dwv 0.33.0-beta.15 → 0.33.0-beta.16

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
@@ -34,15 +34,15 @@ export declare class App {
34
34
  * Get the image.
35
35
  *
36
36
  * @param {string} dataId The data id.
37
- * @returns {Image} The associated image.
37
+ * @returns {Image|undefined} The associated image.
38
38
  */
39
- getImage(dataId: string): Image_2;
39
+ getImage(dataId: string): Image_2 | undefined;
40
40
  /**
41
41
  * Get the last loaded image.
42
42
  *
43
- * @returns {Image} The image.
43
+ * @returns {Image|undefined} The image.
44
44
  */
45
- getLastImage(): Image_2;
45
+ getLastImage(): Image_2 | undefined;
46
46
  /**
47
47
  * Set the image at the given id.
48
48
  *
@@ -70,15 +70,22 @@ export declare class App {
70
70
  * Get the meta data.
71
71
  *
72
72
  * @param {string} dataId The data id.
73
- * @returns {object} The list of meta data.
73
+ * @returns {object|undefined} The list of meta data.
74
74
  */
75
- getMetaData(dataId: string): object;
75
+ getMetaData(dataId: string): object | undefined;
76
76
  /**
77
77
  * Get the list of ids in the data storage.
78
78
  *
79
- * @returns {Array} The list of data ids.
79
+ * @returns {string[]} The list of data ids.
80
80
  */
81
- getDataIds(): any[];
81
+ getDataIds(): string[];
82
+ /**
83
+ * Get the list of dataIds that contain the input UIDs.
84
+ *
85
+ * @param {string[]} uids A list of UIDs.
86
+ * @returns {string[]} The list of dataIds that contain the UIDs.
87
+ */
88
+ getDataIdsFromSopUids(uids: string[]): string[];
82
89
  /**
83
90
  * Can the data be scrolled?
84
91
  *
@@ -726,14 +733,11 @@ export declare const decoderScripts: {
726
733
  /**
727
734
  * List of default window level presets.
728
735
  *
729
- * @type {Object.<string, Object.<string, {center: number, width: number}>>}
736
+ * @type {Object.<string, Object.<string, WindowLevel>>}
730
737
  */
731
738
  export declare const defaultPresets: {
732
739
  [x: string]: {
733
- [x: string]: {
734
- center: number;
735
- width: number;
736
- };
740
+ [x: string]: WindowLevel;
737
741
  };
738
742
  };
739
743
 
@@ -1613,6 +1617,13 @@ declare class Image_2 {
1613
1617
  * @returns {string} The UID.
1614
1618
  */
1615
1619
  getImageUid(index?: Index): string;
1620
+ /**
1621
+ * Check if this image includes the input uids.
1622
+ *
1623
+ * @param {string[]} uids UIDs to test for presence.
1624
+ * @returns {boolean} True if all uids are in this image uids.
1625
+ */
1626
+ containsImageUids(uids: string[]): boolean;
1616
1627
  /**
1617
1628
  * Get the geometry of the image.
1618
1629
  *
@@ -2702,39 +2713,6 @@ export declare class Point3D {
2702
2713
  */
2703
2714
  export declare function precisionRound(number: number, precision: number): number;
2704
2715
 
2705
- /**
2706
- * Rescale LUT class.
2707
- * Typically converts from integer to float.
2708
- */
2709
- export declare class RescaleLut {
2710
- /**
2711
- * @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
2712
- * @param {number} bitsStored The number of bits used to store the data.
2713
- */
2714
- constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
2715
- /**
2716
- * Get the Rescale Slope and Intercept (RSI).
2717
- *
2718
- * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
2719
- */
2720
- getRSI(): RescaleSlopeAndIntercept;
2721
- /**
2722
- * Get the length of the LUT array.
2723
- *
2724
- * @returns {number} The length of the LUT array.
2725
- */
2726
- getLength(): number;
2727
- /**
2728
- * Get the value of the LUT at the given offset.
2729
- *
2730
- * @param {number} offset The input offset in [0,2^bitsStored] range
2731
- * or full range for ID rescale.
2732
- * @returns {number} The float32 value of the LUT at the given offset.
2733
- */
2734
- getValue(offset: number): number;
2735
- #private;
2736
- }
2737
-
2738
2716
  /**
2739
2717
  * Rescale Slope and Intercept
2740
2718
  */
@@ -3306,14 +3284,6 @@ export declare class View {
3306
3284
  * @fires View#alphafuncchange
3307
3285
  */
3308
3286
  setAlphaFunction(func: (value: object, index: object) => number): void;
3309
- /**
3310
- * Get the window LUT of the image.
3311
- * Warning: can be undefined in no window/level was set.
3312
- *
3313
- * @returns {WindowLut} The window LUT of the image.
3314
- * @fires View#wlchange
3315
- */
3316
- getCurrentWindowLut(): WindowLut;
3317
3287
  /**
3318
3288
  * Get the window presets.
3319
3289
  *
@@ -3404,14 +3374,19 @@ export declare class View {
3404
3374
  /**
3405
3375
  * Set the view window/level.
3406
3376
  *
3407
- * @param {number} center The window center.
3408
- * @param {number} width The window width.
3377
+ * @param {WindowLevel} wl The window and level.
3409
3378
  * @param {string} [name] Associated preset name, defaults to 'manual'.
3410
3379
  * Warning: uses the latest set rescale LUT or the default linear one.
3411
3380
  * @param {boolean} [silent] Flag to launch events with skipGenerate.
3412
3381
  * @fires View#wlchange
3413
3382
  */
3414
- setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void;
3383
+ setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void;
3384
+ /**
3385
+ * Get the window/level.
3386
+ *
3387
+ * @returns {WindowLevel} The window and level.
3388
+ */
3389
+ getWindowLevel(): WindowLevel;
3415
3390
  /**
3416
3391
  * Set the window level to the preset with the input name.
3417
3392
  *
@@ -3446,9 +3421,9 @@ export declare class View {
3446
3421
  * Get the image window/level that covers the full data range.
3447
3422
  * Warning: uses the latest set rescale LUT or the default linear one.
3448
3423
  *
3449
- * @returns {WindowCenterAndWidth} A min/max window level.
3424
+ * @returns {WindowLevel} A min/max window level.
3450
3425
  */
3451
- getWindowLevelMinMax(): WindowCenterAndWidth;
3426
+ getWindowLevelMinMax(): WindowLevel;
3452
3427
  /**
3453
3428
  * Set the image window/level to cover the full data range.
3454
3429
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -3861,9 +3836,9 @@ export declare class ViewController {
3861
3836
  /**
3862
3837
  * Get the window/level.
3863
3838
  *
3864
- * @returns {object} The window center and width.
3839
+ * @returns {WindowLevel} The window and level.
3865
3840
  */
3866
- getWindowLevel(): object;
3841
+ getWindowLevel(): WindowLevel;
3867
3842
  /**
3868
3843
  * Get the current window level preset name.
3869
3844
  *
@@ -3871,12 +3846,11 @@ export declare class ViewController {
3871
3846
  */
3872
3847
  getCurrentWindowPresetName(): string;
3873
3848
  /**
3874
- * Set the window/level.
3849
+ * Set the window and level.
3875
3850
  *
3876
- * @param {number} wc The window center.
3877
- * @param {number} ww The window width.
3851
+ * @param {WindowLevel} wl The window and level.
3878
3852
  */
3879
- setWindowLevel(wc: number, ww: number): void;
3853
+ setWindowLevel(wl: WindowLevel): void;
3880
3854
  /**
3881
3855
  * Get the colour map.
3882
3856
  *
@@ -4162,101 +4136,33 @@ export declare class ViewLayer {
4162
4136
  }
4163
4137
 
4164
4138
  /**
4165
- * WindowCenterAndWidth class.
4166
- * <br>Pseudo-code:
4167
- * <pre>
4168
- * if (x &lt;= c - 0.5 - (w-1)/2), then y = ymin
4169
- * else if (x > c - 0.5 + (w-1)/2), then y = ymax,
4170
- * else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
4171
- * </pre>
4172
- *
4173
- * @see DICOM doc for [Window Center and Window Width]{@link http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.11.html#sect_C.11.2.1.2}
4139
+ * Window and Level also known as window width and center.
4174
4140
  */
4175
- export declare class WindowCenterAndWidth {
4141
+ export declare class WindowLevel {
4176
4142
  /**
4177
4143
  * @param {number} center The window center.
4178
4144
  * @param {number} width The window width.
4179
4145
  */
4180
4146
  constructor(center: number, width: number);
4181
4147
  /**
4182
- * Get the window center.
4183
- *
4184
- * @returns {number} The window center.
4185
- */
4186
- getCenter(): number;
4187
- /**
4188
- * Get the window width.
4189
- *
4190
- * @returns {number} The window width.
4191
- */
4192
- getWidth(): number;
4193
- /**
4194
- * Set the signed offset.
4195
- *
4196
- * @param {number} offset The signed data offset,
4197
- * typically: slope * ( size / 2).
4198
- */
4199
- setSignedOffset(offset: number): void;
4200
- /**
4201
- * Apply the window level on an input value.
4202
- *
4203
- * @param {number} value The value to rescale as an integer.
4204
- * @returns {number} The leveled value, in the
4205
- * [ymin, ymax] range (default [0,255]).
4206
- */
4207
- apply(value: number): number;
4208
- /**
4209
- * Check for window level equality.
4210
- *
4211
- * @param {WindowCenterAndWidth} rhs The other window level to compare to.
4212
- * @returns {boolean} True if both window level are equal.
4213
- */
4214
- equals(rhs: WindowCenterAndWidth): boolean;
4215
- #private;
4216
- }
4217
-
4218
- /**
4219
- * Window LUT class.
4220
- * Typically converts from float to integer.
4221
- */
4222
- export declare class WindowLut {
4223
- /**
4224
- * Construct a window LUT object, window level is set with
4225
- * the 'setWindowLevel' method.
4226
- *
4227
- * @param {RescaleLut} rescaleLut The associated rescale LUT.
4228
- * @param {boolean} isSigned Flag to know if the data is signed or not.
4229
- * @param {boolean} isDiscrete Flag to know if the input data is discrete.
4230
- */
4231
- constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
4232
- /**
4233
- * Get the window / level.
4148
+ * The window center.
4234
4149
  *
4235
- * @returns {WindowCenterAndWidth} The window / level.
4236
- */
4237
- getWindowLevel(): WindowCenterAndWidth;
4238
- /**
4239
- * Get the rescale lut.
4240
- *
4241
- * @returns {RescaleLut} The rescale lut.
4150
+ * @type {number}
4242
4151
  */
4243
- getRescaleLut(): RescaleLut;
4152
+ center: number;
4244
4153
  /**
4245
- * Set the window center and width.
4154
+ * The window width.
4246
4155
  *
4247
- * @param {WindowCenterAndWidth} wl The window level.
4156
+ * @type {number}
4248
4157
  */
4249
- setWindowLevel(wl: WindowCenterAndWidth): void;
4158
+ width: number;
4250
4159
  /**
4251
- * Get the value of the LUT at the given offset.
4160
+ * Check for equality.
4252
4161
  *
4253
- * @param {number} offset The input offset in [0,2^bitsStored] range
4254
- * for discrete data or full range for non discrete.
4255
- * @returns {number} The integer value (default [0,255]) of the LUT
4256
- * at the given offset.
4162
+ * @param {WindowLevel} rhs The other object to compare to.
4163
+ * @returns {boolean} True if both objects are equal.
4257
4164
  */
4258
- getValue(offset: number): number;
4259
- #private;
4165
+ equals(rhs: WindowLevel): boolean;
4260
4166
  }
4261
4167
 
4262
4168
  /**