dwv 0.33.0-beta.14 → 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 +54 -146
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +9 -9
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
|
*
|
|
@@ -61,22 +61,31 @@ export declare class App {
|
|
|
61
61
|
*
|
|
62
62
|
* @param {Image} image The new image.
|
|
63
63
|
* @param {object} meta The image meta.
|
|
64
|
+
* @param {string} source The source of the new image,
|
|
65
|
+
* will be passed with load events.
|
|
64
66
|
* @returns {string} The new image data id.
|
|
65
67
|
*/
|
|
66
|
-
addNewImage(image: Image_2, meta: object): string;
|
|
68
|
+
addNewImage(image: Image_2, meta: object, source: string): string;
|
|
67
69
|
/**
|
|
68
70
|
* Get the meta data.
|
|
69
71
|
*
|
|
70
72
|
* @param {string} dataId The data id.
|
|
71
|
-
* @returns {object} The list of meta data.
|
|
73
|
+
* @returns {object|undefined} The list of meta data.
|
|
72
74
|
*/
|
|
73
|
-
getMetaData(dataId: string): object;
|
|
75
|
+
getMetaData(dataId: string): object | undefined;
|
|
74
76
|
/**
|
|
75
77
|
* Get the list of ids in the data storage.
|
|
76
78
|
*
|
|
77
|
-
* @returns {
|
|
79
|
+
* @returns {string[]} The list of data ids.
|
|
78
80
|
*/
|
|
79
|
-
getDataIds():
|
|
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[];
|
|
80
89
|
/**
|
|
81
90
|
* Can the data be scrolled?
|
|
82
91
|
*
|
|
@@ -724,14 +733,11 @@ export declare const decoderScripts: {
|
|
|
724
733
|
/**
|
|
725
734
|
* List of default window level presets.
|
|
726
735
|
*
|
|
727
|
-
* @type {Object.<string, Object.<string,
|
|
736
|
+
* @type {Object.<string, Object.<string, WindowLevel>>}
|
|
728
737
|
*/
|
|
729
738
|
export declare const defaultPresets: {
|
|
730
739
|
[x: string]: {
|
|
731
|
-
[x: string]:
|
|
732
|
-
center: number;
|
|
733
|
-
width: number;
|
|
734
|
-
};
|
|
740
|
+
[x: string]: WindowLevel;
|
|
735
741
|
};
|
|
736
742
|
};
|
|
737
743
|
|
|
@@ -1611,6 +1617,13 @@ declare class Image_2 {
|
|
|
1611
1617
|
* @returns {string} The UID.
|
|
1612
1618
|
*/
|
|
1613
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;
|
|
1614
1627
|
/**
|
|
1615
1628
|
* Get the geometry of the image.
|
|
1616
1629
|
*
|
|
@@ -2700,39 +2713,6 @@ export declare class Point3D {
|
|
|
2700
2713
|
*/
|
|
2701
2714
|
export declare function precisionRound(number: number, precision: number): number;
|
|
2702
2715
|
|
|
2703
|
-
/**
|
|
2704
|
-
* Rescale LUT class.
|
|
2705
|
-
* Typically converts from integer to float.
|
|
2706
|
-
*/
|
|
2707
|
-
export declare class RescaleLut {
|
|
2708
|
-
/**
|
|
2709
|
-
* @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept.
|
|
2710
|
-
* @param {number} bitsStored The number of bits used to store the data.
|
|
2711
|
-
*/
|
|
2712
|
-
constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number);
|
|
2713
|
-
/**
|
|
2714
|
-
* Get the Rescale Slope and Intercept (RSI).
|
|
2715
|
-
*
|
|
2716
|
-
* @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object.
|
|
2717
|
-
*/
|
|
2718
|
-
getRSI(): RescaleSlopeAndIntercept;
|
|
2719
|
-
/**
|
|
2720
|
-
* Get the length of the LUT array.
|
|
2721
|
-
*
|
|
2722
|
-
* @returns {number} The length of the LUT array.
|
|
2723
|
-
*/
|
|
2724
|
-
getLength(): number;
|
|
2725
|
-
/**
|
|
2726
|
-
* Get the value of the LUT at the given offset.
|
|
2727
|
-
*
|
|
2728
|
-
* @param {number} offset The input offset in [0,2^bitsStored] range
|
|
2729
|
-
* or full range for ID rescale.
|
|
2730
|
-
* @returns {number} The float32 value of the LUT at the given offset.
|
|
2731
|
-
*/
|
|
2732
|
-
getValue(offset: number): number;
|
|
2733
|
-
#private;
|
|
2734
|
-
}
|
|
2735
|
-
|
|
2736
2716
|
/**
|
|
2737
2717
|
* Rescale Slope and Intercept
|
|
2738
2718
|
*/
|
|
@@ -3304,14 +3284,6 @@ export declare class View {
|
|
|
3304
3284
|
* @fires View#alphafuncchange
|
|
3305
3285
|
*/
|
|
3306
3286
|
setAlphaFunction(func: (value: object, index: object) => number): void;
|
|
3307
|
-
/**
|
|
3308
|
-
* Get the window LUT of the image.
|
|
3309
|
-
* Warning: can be undefined in no window/level was set.
|
|
3310
|
-
*
|
|
3311
|
-
* @returns {WindowLut} The window LUT of the image.
|
|
3312
|
-
* @fires View#wlchange
|
|
3313
|
-
*/
|
|
3314
|
-
getCurrentWindowLut(): WindowLut;
|
|
3315
3287
|
/**
|
|
3316
3288
|
* Get the window presets.
|
|
3317
3289
|
*
|
|
@@ -3402,14 +3374,19 @@ export declare class View {
|
|
|
3402
3374
|
/**
|
|
3403
3375
|
* Set the view window/level.
|
|
3404
3376
|
*
|
|
3405
|
-
* @param {
|
|
3406
|
-
* @param {number} width The window width.
|
|
3377
|
+
* @param {WindowLevel} wl The window and level.
|
|
3407
3378
|
* @param {string} [name] Associated preset name, defaults to 'manual'.
|
|
3408
3379
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
3409
3380
|
* @param {boolean} [silent] Flag to launch events with skipGenerate.
|
|
3410
3381
|
* @fires View#wlchange
|
|
3411
3382
|
*/
|
|
3412
|
-
setWindowLevel(
|
|
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;
|
|
3413
3390
|
/**
|
|
3414
3391
|
* Set the window level to the preset with the input name.
|
|
3415
3392
|
*
|
|
@@ -3444,9 +3421,9 @@ export declare class View {
|
|
|
3444
3421
|
* Get the image window/level that covers the full data range.
|
|
3445
3422
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
3446
3423
|
*
|
|
3447
|
-
* @returns {
|
|
3424
|
+
* @returns {WindowLevel} A min/max window level.
|
|
3448
3425
|
*/
|
|
3449
|
-
getWindowLevelMinMax():
|
|
3426
|
+
getWindowLevelMinMax(): WindowLevel;
|
|
3450
3427
|
/**
|
|
3451
3428
|
* Set the image window/level to cover the full data range.
|
|
3452
3429
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
@@ -3859,9 +3836,9 @@ export declare class ViewController {
|
|
|
3859
3836
|
/**
|
|
3860
3837
|
* Get the window/level.
|
|
3861
3838
|
*
|
|
3862
|
-
* @returns {
|
|
3839
|
+
* @returns {WindowLevel} The window and level.
|
|
3863
3840
|
*/
|
|
3864
|
-
getWindowLevel():
|
|
3841
|
+
getWindowLevel(): WindowLevel;
|
|
3865
3842
|
/**
|
|
3866
3843
|
* Get the current window level preset name.
|
|
3867
3844
|
*
|
|
@@ -3869,12 +3846,11 @@ export declare class ViewController {
|
|
|
3869
3846
|
*/
|
|
3870
3847
|
getCurrentWindowPresetName(): string;
|
|
3871
3848
|
/**
|
|
3872
|
-
* Set the window
|
|
3849
|
+
* Set the window and level.
|
|
3873
3850
|
*
|
|
3874
|
-
* @param {
|
|
3875
|
-
* @param {number} ww The window width.
|
|
3851
|
+
* @param {WindowLevel} wl The window and level.
|
|
3876
3852
|
*/
|
|
3877
|
-
setWindowLevel(
|
|
3853
|
+
setWindowLevel(wl: WindowLevel): void;
|
|
3878
3854
|
/**
|
|
3879
3855
|
* Get the colour map.
|
|
3880
3856
|
*
|
|
@@ -4160,101 +4136,33 @@ export declare class ViewLayer {
|
|
|
4160
4136
|
}
|
|
4161
4137
|
|
|
4162
4138
|
/**
|
|
4163
|
-
*
|
|
4164
|
-
* <br>Pseudo-code:
|
|
4165
|
-
* <pre>
|
|
4166
|
-
* if (x <= c - 0.5 - (w-1)/2), then y = ymin
|
|
4167
|
-
* else if (x > c - 0.5 + (w-1)/2), then y = ymax,
|
|
4168
|
-
* else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
|
|
4169
|
-
* </pre>
|
|
4170
|
-
*
|
|
4171
|
-
* @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.
|
|
4172
4140
|
*/
|
|
4173
|
-
export declare class
|
|
4141
|
+
export declare class WindowLevel {
|
|
4174
4142
|
/**
|
|
4175
4143
|
* @param {number} center The window center.
|
|
4176
4144
|
* @param {number} width The window width.
|
|
4177
4145
|
*/
|
|
4178
4146
|
constructor(center: number, width: number);
|
|
4179
4147
|
/**
|
|
4180
|
-
*
|
|
4181
|
-
*
|
|
4182
|
-
* @returns {number} The window center.
|
|
4183
|
-
*/
|
|
4184
|
-
getCenter(): number;
|
|
4185
|
-
/**
|
|
4186
|
-
* Get the window width.
|
|
4187
|
-
*
|
|
4188
|
-
* @returns {number} The window width.
|
|
4189
|
-
*/
|
|
4190
|
-
getWidth(): number;
|
|
4191
|
-
/**
|
|
4192
|
-
* Set the signed offset.
|
|
4193
|
-
*
|
|
4194
|
-
* @param {number} offset The signed data offset,
|
|
4195
|
-
* typically: slope * ( size / 2).
|
|
4196
|
-
*/
|
|
4197
|
-
setSignedOffset(offset: number): void;
|
|
4198
|
-
/**
|
|
4199
|
-
* Apply the window level on an input value.
|
|
4200
|
-
*
|
|
4201
|
-
* @param {number} value The value to rescale as an integer.
|
|
4202
|
-
* @returns {number} The leveled value, in the
|
|
4203
|
-
* [ymin, ymax] range (default [0,255]).
|
|
4204
|
-
*/
|
|
4205
|
-
apply(value: number): number;
|
|
4206
|
-
/**
|
|
4207
|
-
* Check for window level equality.
|
|
4208
|
-
*
|
|
4209
|
-
* @param {WindowCenterAndWidth} rhs The other window level to compare to.
|
|
4210
|
-
* @returns {boolean} True if both window level are equal.
|
|
4211
|
-
*/
|
|
4212
|
-
equals(rhs: WindowCenterAndWidth): boolean;
|
|
4213
|
-
#private;
|
|
4214
|
-
}
|
|
4215
|
-
|
|
4216
|
-
/**
|
|
4217
|
-
* Window LUT class.
|
|
4218
|
-
* Typically converts from float to integer.
|
|
4219
|
-
*/
|
|
4220
|
-
export declare class WindowLut {
|
|
4221
|
-
/**
|
|
4222
|
-
* Construct a window LUT object, window level is set with
|
|
4223
|
-
* the 'setWindowLevel' method.
|
|
4224
|
-
*
|
|
4225
|
-
* @param {RescaleLut} rescaleLut The associated rescale LUT.
|
|
4226
|
-
* @param {boolean} isSigned Flag to know if the data is signed or not.
|
|
4227
|
-
* @param {boolean} isDiscrete Flag to know if the input data is discrete.
|
|
4228
|
-
*/
|
|
4229
|
-
constructor(rescaleLut: RescaleLut, isSigned: boolean, isDiscrete: boolean);
|
|
4230
|
-
/**
|
|
4231
|
-
* Get the window / level.
|
|
4148
|
+
* The window center.
|
|
4232
4149
|
*
|
|
4233
|
-
* @
|
|
4234
|
-
*/
|
|
4235
|
-
getWindowLevel(): WindowCenterAndWidth;
|
|
4236
|
-
/**
|
|
4237
|
-
* Get the rescale lut.
|
|
4238
|
-
*
|
|
4239
|
-
* @returns {RescaleLut} The rescale lut.
|
|
4150
|
+
* @type {number}
|
|
4240
4151
|
*/
|
|
4241
|
-
|
|
4152
|
+
center: number;
|
|
4242
4153
|
/**
|
|
4243
|
-
*
|
|
4154
|
+
* The window width.
|
|
4244
4155
|
*
|
|
4245
|
-
* @
|
|
4156
|
+
* @type {number}
|
|
4246
4157
|
*/
|
|
4247
|
-
|
|
4158
|
+
width: number;
|
|
4248
4159
|
/**
|
|
4249
|
-
*
|
|
4160
|
+
* Check for equality.
|
|
4250
4161
|
*
|
|
4251
|
-
* @param {
|
|
4252
|
-
*
|
|
4253
|
-
* @returns {number} The integer value (default [0,255]) of the LUT
|
|
4254
|
-
* at the given offset.
|
|
4162
|
+
* @param {WindowLevel} rhs The other object to compare to.
|
|
4163
|
+
* @returns {boolean} True if both objects are equal.
|
|
4255
4164
|
*/
|
|
4256
|
-
|
|
4257
|
-
#private;
|
|
4165
|
+
equals(rhs: WindowLevel): boolean;
|
|
4258
4166
|
}
|
|
4259
4167
|
|
|
4260
4168
|
/**
|