dwv 0.35.1 → 0.36.0-beta.10
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/assets/workers/labeling.worker.min.js +1 -1
- package/dist/assets/workers/labeling.worker.min.js.map +1 -1
- package/dist/assets/workers/resampling.worker.min.js +2 -0
- package/dist/assets/workers/resampling.worker.min.js.map +1 -0
- package/dist/dwv.d.ts +513 -40
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/dist/dwv.node.min.js +1 -1
- package/dist/dwv.node.min.js.map +1 -1
- package/package.json +12 -12
package/dist/dwv.d.ts
CHANGED
|
@@ -240,14 +240,16 @@ export declare class AnnotationGroup {
|
|
|
240
240
|
* Add a new annotation.
|
|
241
241
|
*
|
|
242
242
|
* @param {Annotation} annotation The annotation to add.
|
|
243
|
+
* @param {boolean} [propagate] Whether the event propagates
|
|
244
|
+
* outside of dwv or not, defaults to true.
|
|
243
245
|
*/
|
|
244
|
-
add(annotation: Annotation): void;
|
|
246
|
+
add(annotation: Annotation, propagate?: boolean): void;
|
|
245
247
|
/**
|
|
246
248
|
* Update an existing annotation.
|
|
247
249
|
*
|
|
248
250
|
* @param {Annotation} annotation The annotation to update.
|
|
249
251
|
* @param {string[]} [propKeys] Optional properties that got updated.
|
|
250
|
-
* @param {boolean} [propagate] Whether the
|
|
252
|
+
* @param {boolean} [propagate] Whether the event propagates
|
|
251
253
|
* outside of dwv or not, defaults to true.
|
|
252
254
|
*/
|
|
253
255
|
update(annotation: Annotation, propKeys?: string[], propagate?: boolean): void;
|
|
@@ -255,8 +257,10 @@ export declare class AnnotationGroup {
|
|
|
255
257
|
* Remove an annotation.
|
|
256
258
|
*
|
|
257
259
|
* @param {string} uid The UID of the annotation to remove.
|
|
260
|
+
* @param {boolean} [propagate] Whether the event propagates
|
|
261
|
+
* outside of dwv or not, defaults to true.
|
|
258
262
|
*/
|
|
259
|
-
remove(uid: string): void;
|
|
263
|
+
remove(uid: string, propagate?: boolean): void;
|
|
260
264
|
/**
|
|
261
265
|
* Set the associated view controller.
|
|
262
266
|
*
|
|
@@ -432,13 +436,20 @@ export declare class App {
|
|
|
432
436
|
* @param {Image} img The associated image.
|
|
433
437
|
*/
|
|
434
438
|
setImage(dataId: string, img: Image_2): void;
|
|
439
|
+
/**
|
|
440
|
+
* Get the next data id.
|
|
441
|
+
*
|
|
442
|
+
* @returns {string} The data id.
|
|
443
|
+
*/
|
|
444
|
+
getNextDataId(): string;
|
|
435
445
|
/**
|
|
436
446
|
* Add a new DicomData.
|
|
437
447
|
*
|
|
448
|
+
* @param {string} dataId The data id.
|
|
438
449
|
* @param {DicomData} data The new data.
|
|
439
|
-
* @returns {
|
|
450
|
+
* @returns {boolean} False if the data cannot be added.
|
|
440
451
|
*/
|
|
441
|
-
addData(data: DicomData):
|
|
452
|
+
addData(dataId: string, data: DicomData): boolean;
|
|
442
453
|
/**
|
|
443
454
|
* Get the meta data.
|
|
444
455
|
*
|
|
@@ -461,6 +472,13 @@ export declare class App {
|
|
|
461
472
|
* @returns {string[]} The list of dataIds that contain the UIDs.
|
|
462
473
|
*/
|
|
463
474
|
getDataIdsFromSopUids(uids: string[]): string[];
|
|
475
|
+
/**
|
|
476
|
+
* Get the first data id with the given SeriesInstanceUID.
|
|
477
|
+
*
|
|
478
|
+
* @param {string} uid The SeriesInstanceUID.
|
|
479
|
+
* @returns {string} The data id.
|
|
480
|
+
*/
|
|
481
|
+
getDataIdFromSeriesUid(uid: string): string;
|
|
464
482
|
/**
|
|
465
483
|
* Can the data (of the active view of the active layer) be scrolled?
|
|
466
484
|
*
|
|
@@ -693,6 +711,8 @@ export declare class App {
|
|
|
693
711
|
*
|
|
694
712
|
* @param {string} uri The input uri, for example: 'window.location.href'.
|
|
695
713
|
* @param {object} [options] Optional url request options.
|
|
714
|
+
* @deprecated Since v0.36, please extract the file list and
|
|
715
|
+
* pass it to loadURLs. State from uri is no longer supported.
|
|
696
716
|
* @function
|
|
697
717
|
*/
|
|
698
718
|
loadFromUri: (uri: string, options?: object) => void;
|
|
@@ -783,8 +803,10 @@ export declare class App {
|
|
|
783
803
|
*
|
|
784
804
|
* @param {string} dataId The data id.
|
|
785
805
|
* @param {ViewConfig} config The view configuration.
|
|
806
|
+
* @param {boolean} [doRender] Render data after configuration
|
|
807
|
+
* add. Defaults to true.
|
|
786
808
|
*/
|
|
787
|
-
addDataViewConfig(dataId: string, config: ViewConfig): void;
|
|
809
|
+
addDataViewConfig(dataId: string, config: ViewConfig, doRender?: boolean): void;
|
|
788
810
|
/**
|
|
789
811
|
* Remove a data view config.
|
|
790
812
|
* Removes the associated layer if found, removes
|
|
@@ -831,6 +853,27 @@ export declare class App {
|
|
|
831
853
|
* @param {number} ty The translation along Y.
|
|
832
854
|
*/
|
|
833
855
|
translate(tx: number, ty: number): void;
|
|
856
|
+
/**
|
|
857
|
+
* Resample one image to match the orientation of another.
|
|
858
|
+
*
|
|
859
|
+
* @param {string} dataIdTarget The target image id to resample.
|
|
860
|
+
* @param {string} dataIdSource The source image id to copy the
|
|
861
|
+
* orientation from.
|
|
862
|
+
*/
|
|
863
|
+
resampleMatch(dataIdTarget: string, dataIdSource: string): void;
|
|
864
|
+
/**
|
|
865
|
+
* Resample an image to match an arbitrary orientation.
|
|
866
|
+
*
|
|
867
|
+
* @param {string} dataIdTarget The target image id to resample.
|
|
868
|
+
* @param {Matrix33} orientation The orientation to resample to.
|
|
869
|
+
*/
|
|
870
|
+
resample(dataIdTarget: string, orientation: Matrix33): void;
|
|
871
|
+
/**
|
|
872
|
+
* Revert an image back to its original orientation.
|
|
873
|
+
*
|
|
874
|
+
* @param {string} dataIdTarget The target image id to revert.
|
|
875
|
+
*/
|
|
876
|
+
revertResample(dataIdTarget: string): void;
|
|
834
877
|
/**
|
|
835
878
|
* Set the active view layer (of the active layer group) opacity.
|
|
836
879
|
*
|
|
@@ -1052,6 +1095,24 @@ export declare class AppOptions {
|
|
|
1052
1095
|
rootDocument: DocumentFragment;
|
|
1053
1096
|
}
|
|
1054
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* Class to store a boolean result and a message.
|
|
1100
|
+
*/
|
|
1101
|
+
export declare class BooleanResult {
|
|
1102
|
+
/**
|
|
1103
|
+
* @param {boolean} success The success flag.
|
|
1104
|
+
*/
|
|
1105
|
+
constructor(success: boolean);
|
|
1106
|
+
/**
|
|
1107
|
+
* @type {boolean}
|
|
1108
|
+
*/
|
|
1109
|
+
success: boolean;
|
|
1110
|
+
/**
|
|
1111
|
+
* @type {string|undefined}
|
|
1112
|
+
*/
|
|
1113
|
+
message: string | undefined;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1055
1116
|
/**
|
|
1056
1117
|
* Build a multipart message.
|
|
1057
1118
|
*
|
|
@@ -1282,8 +1343,10 @@ export declare namespace custom {
|
|
|
1282
1343
|
[x: string]: string;
|
|
1283
1344
|
};
|
|
1284
1345
|
};
|
|
1346
|
+
let privateBValueRules: object[];
|
|
1285
1347
|
let openRoiDialog: any;
|
|
1286
|
-
let
|
|
1348
|
+
let getVolumeIdTagValue: any;
|
|
1349
|
+
let getPostLoadVolumeIdTagValue: any;
|
|
1287
1350
|
let getTagPixelUnit: any;
|
|
1288
1351
|
}
|
|
1289
1352
|
|
|
@@ -1478,6 +1541,43 @@ export declare class DicomData {
|
|
|
1478
1541
|
* @type {any|undefined}
|
|
1479
1542
|
*/
|
|
1480
1543
|
buffer: any | undefined;
|
|
1544
|
+
/**
|
|
1545
|
+
* Number of files/urls associated to the data.
|
|
1546
|
+
*
|
|
1547
|
+
* @type {number}
|
|
1548
|
+
*/
|
|
1549
|
+
numberOfFiles: number;
|
|
1550
|
+
/**
|
|
1551
|
+
* List of data creation warning.
|
|
1552
|
+
*
|
|
1553
|
+
* @type {string[]}
|
|
1554
|
+
*/
|
|
1555
|
+
warn: string[];
|
|
1556
|
+
/**
|
|
1557
|
+
* Get the image complete flag (for image data).
|
|
1558
|
+
*
|
|
1559
|
+
* @returns {boolean|undefined} True if the image is complete.
|
|
1560
|
+
*/
|
|
1561
|
+
getComplete(): boolean | undefined;
|
|
1562
|
+
/**
|
|
1563
|
+
* Set the image complete flag (for image data).
|
|
1564
|
+
*
|
|
1565
|
+
* @param {boolean} flag True if the image is complete.
|
|
1566
|
+
*/
|
|
1567
|
+
setComplete(flag: boolean): void;
|
|
1568
|
+
/**
|
|
1569
|
+
* Get the duplicate origin flag.
|
|
1570
|
+
*
|
|
1571
|
+
* @returns {boolean} The flag.
|
|
1572
|
+
*/
|
|
1573
|
+
hasDuplicateOrigin(): boolean;
|
|
1574
|
+
/**
|
|
1575
|
+
* Append slice and update meta data.
|
|
1576
|
+
*
|
|
1577
|
+
* @param {DicomData} data The data to append.
|
|
1578
|
+
*/
|
|
1579
|
+
appendData(data: DicomData): void;
|
|
1580
|
+
#private;
|
|
1481
1581
|
}
|
|
1482
1582
|
|
|
1483
1583
|
/**
|
|
@@ -2206,6 +2306,15 @@ export declare class Ellipse {
|
|
|
2206
2306
|
#private;
|
|
2207
2307
|
}
|
|
2208
2308
|
|
|
2309
|
+
/**
|
|
2310
|
+
* Check for window level equality.
|
|
2311
|
+
*
|
|
2312
|
+
* @param {WindowLevel} wl0 The first window level.
|
|
2313
|
+
* @param {WindowLevel} wl1 The second window level.
|
|
2314
|
+
* @returns {boolean} True if both objects are equal.
|
|
2315
|
+
*/
|
|
2316
|
+
export declare function equalWl(wl0: WindowLevel, wl1: WindowLevel): boolean;
|
|
2317
|
+
|
|
2209
2318
|
/**
|
|
2210
2319
|
* 2D/3D Geometry class.
|
|
2211
2320
|
*/
|
|
@@ -2219,12 +2328,24 @@ export declare class Geometry {
|
|
|
2219
2328
|
* @param {number} [time] Optional time index.
|
|
2220
2329
|
*/
|
|
2221
2330
|
constructor(origins: Point3D[], size: Size, spacing: Spacing, orientation?: Matrix33, time?: number);
|
|
2331
|
+
/**
|
|
2332
|
+
* Clone the geometry.
|
|
2333
|
+
*
|
|
2334
|
+
* @returns {Geometry} A clone of this geometry.
|
|
2335
|
+
*/
|
|
2336
|
+
clone(): Geometry;
|
|
2222
2337
|
/**
|
|
2223
2338
|
* Get the time value that was passed at construction.
|
|
2224
2339
|
*
|
|
2225
2340
|
* @returns {number} The time value.
|
|
2226
2341
|
*/
|
|
2227
2342
|
getInitialTime(): number;
|
|
2343
|
+
/**
|
|
2344
|
+
* Set the initial time.
|
|
2345
|
+
*
|
|
2346
|
+
* @param {number} time The new time.
|
|
2347
|
+
*/
|
|
2348
|
+
setInitialTime(time: number): void;
|
|
2228
2349
|
/**
|
|
2229
2350
|
* Get the total number of slices.
|
|
2230
2351
|
* Can be different from what is stored in the size object
|
|
@@ -2279,6 +2400,11 @@ export declare class Geometry {
|
|
|
2279
2400
|
* @returns {Size} The object size.
|
|
2280
2401
|
*/
|
|
2281
2402
|
getSize(viewOrientation?: Matrix33): Size;
|
|
2403
|
+
/**
|
|
2404
|
+
* Calculate slice spacing from origins and replace current
|
|
2405
|
+
* if needed.
|
|
2406
|
+
*/
|
|
2407
|
+
updateSliceSpacing(): void;
|
|
2282
2408
|
/**
|
|
2283
2409
|
* Get the object spacing.
|
|
2284
2410
|
* Warning: the spacing comes as stored in DICOM, meaning that it could
|
|
@@ -2310,10 +2436,28 @@ export declare class Geometry {
|
|
|
2310
2436
|
* magic...
|
|
2311
2437
|
*
|
|
2312
2438
|
* @param {Point3D} point The point to evaluate.
|
|
2313
|
-
* @param {number} time Optional time index.
|
|
2439
|
+
* @param {number} [time] Optional time index.
|
|
2314
2440
|
* @returns {number} The slice index.
|
|
2315
2441
|
*/
|
|
2316
|
-
getSliceIndex(point: Point3D, time
|
|
2442
|
+
getSliceIndex(point: Point3D, time?: number): number;
|
|
2443
|
+
/**
|
|
2444
|
+
* Check if another geometry is compatible with this one, ie that
|
|
2445
|
+
* slices with these geometries can be merged into one volume.
|
|
2446
|
+
*
|
|
2447
|
+
* @param {Geometry} rhs The geometry to check.
|
|
2448
|
+
* @returns {BooleanResult} Result with success set to true if
|
|
2449
|
+
* the geometry is compatible.
|
|
2450
|
+
*/
|
|
2451
|
+
canAppend(rhs: Geometry): BooleanResult;
|
|
2452
|
+
/**
|
|
2453
|
+
* Check if an origin can be appended to this geometry.
|
|
2454
|
+
*
|
|
2455
|
+
* @param {Point3D} origin The origin to append.
|
|
2456
|
+
* @param {number} [time] Optional time index.
|
|
2457
|
+
* @returns {BooleanResult} Result with success set to true if
|
|
2458
|
+
* the origin is compatible.
|
|
2459
|
+
*/
|
|
2460
|
+
canAppendOrigin(origin: Point3D, time?: number): BooleanResult;
|
|
2317
2461
|
/**
|
|
2318
2462
|
* Append an origin to the geometry.
|
|
2319
2463
|
*
|
|
@@ -2476,6 +2620,16 @@ export declare function getEllipseIndices(center: Index, radius: number[], dir:
|
|
|
2476
2620
|
*/
|
|
2477
2621
|
export declare function getLayerDetailsFromEvent(event: object): object;
|
|
2478
2622
|
|
|
2623
|
+
/**
|
|
2624
|
+
* Get the manufacturer.
|
|
2625
|
+
*
|
|
2626
|
+
* @param {Object<string, DataElement>} elements The DICOM tags.
|
|
2627
|
+
* @returns {string|undefined} The manufacturer.
|
|
2628
|
+
*/
|
|
2629
|
+
export declare function getManufacturer(elements: {
|
|
2630
|
+
[x: string]: DataElement;
|
|
2631
|
+
}): string | undefined;
|
|
2632
|
+
|
|
2479
2633
|
/**
|
|
2480
2634
|
* Get the offset of an input mouse event.
|
|
2481
2635
|
*
|
|
@@ -2484,6 +2638,17 @@ export declare function getLayerDetailsFromEvent(event: object): object;
|
|
|
2484
2638
|
*/
|
|
2485
2639
|
export declare function getMousePoint(event: object): Point2D;
|
|
2486
2640
|
|
|
2641
|
+
/**
|
|
2642
|
+
* Get the normalised manufacturer.
|
|
2643
|
+
*
|
|
2644
|
+
* @param {Object<string, DataElement>} elements The DICOM tags.
|
|
2645
|
+
* @returns {string|undefined} The manufacturer as a unique
|
|
2646
|
+
* all lower case string.
|
|
2647
|
+
*/
|
|
2648
|
+
export declare function getNormalisedManufacturer(elements: {
|
|
2649
|
+
[x: string]: DataElement;
|
|
2650
|
+
}): string | undefined;
|
|
2651
|
+
|
|
2487
2652
|
/**
|
|
2488
2653
|
* Get the name of an image orientation patient.
|
|
2489
2654
|
*
|
|
@@ -2511,6 +2676,16 @@ export declare function getPixelDataTag(): Tag;
|
|
|
2511
2676
|
*/
|
|
2512
2677
|
export declare function getRectangleIndices(center: Index, size: number[], dir: number[]): Index[];
|
|
2513
2678
|
|
|
2679
|
+
/**
|
|
2680
|
+
* Get the referenced series UID from the data elements.
|
|
2681
|
+
*
|
|
2682
|
+
* @param {Object<string, DataElement>} dataElements The data elements.
|
|
2683
|
+
* @returns {string|undefined} The referenced series UID.
|
|
2684
|
+
*/
|
|
2685
|
+
export declare function getReferencedSeriesUID(dataElements: {
|
|
2686
|
+
[x: string]: DataElement;
|
|
2687
|
+
}): string | undefined;
|
|
2688
|
+
|
|
2514
2689
|
/**
|
|
2515
2690
|
* Get patient orientation label in the reverse direction.
|
|
2516
2691
|
*
|
|
@@ -2580,6 +2755,25 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
|
|
|
2580
2755
|
*/
|
|
2581
2756
|
export declare function getUID(tagName: string): string;
|
|
2582
2757
|
|
|
2758
|
+
/**
|
|
2759
|
+
* Get a list of URLs from a uri containing key-value pairs as in:
|
|
2760
|
+
* `[dwv root]?input=encodeURIComponent([root]?key0=value0&key1=value1)`.
|
|
2761
|
+
*
|
|
2762
|
+
* @param {string} uri The input URI.
|
|
2763
|
+
* @returns {string[]|undefined} The list of URLs.
|
|
2764
|
+
*/
|
|
2765
|
+
export declare function getURLsFromKeyValueUri(uri: string): string[] | undefined;
|
|
2766
|
+
|
|
2767
|
+
/**
|
|
2768
|
+
* Handle (ie call callback) with the list of urls contained in
|
|
2769
|
+
* a WEASIS XML manifest provided via a uri as in:
|
|
2770
|
+
* `[dwv root]?input=encodeURIComponent('[manifest file]')&type=manifest`.
|
|
2771
|
+
*
|
|
2772
|
+
* @param {string} uri The input URI.
|
|
2773
|
+
* @param {Function} callback The function to call with the decoded file urls.
|
|
2774
|
+
*/
|
|
2775
|
+
export declare function handleURLsFromWeasisXMLManifest(uri: string, callback: Function): void;
|
|
2776
|
+
|
|
2583
2777
|
/**
|
|
2584
2778
|
* Check that an input buffer includes the DICOM prefix 'DICM'
|
|
2585
2779
|
* after the 128 bytes preamble.
|
|
@@ -2655,6 +2849,18 @@ declare class Image_2 {
|
|
|
2655
2849
|
* @param {string[]} [imageUids] An array of Uids indexed to slice number.
|
|
2656
2850
|
*/
|
|
2657
2851
|
constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]);
|
|
2852
|
+
/**
|
|
2853
|
+
* Set the image complete flag.
|
|
2854
|
+
*
|
|
2855
|
+
* @param {boolean} flag True if the data is complete.
|
|
2856
|
+
*/
|
|
2857
|
+
setComplete(flag: boolean): void;
|
|
2858
|
+
/**
|
|
2859
|
+
* Get the image complete flag.
|
|
2860
|
+
*
|
|
2861
|
+
* @returns {boolean} True if the data is complete.
|
|
2862
|
+
*/
|
|
2863
|
+
getComplete(): boolean;
|
|
2658
2864
|
/**
|
|
2659
2865
|
* Get the image UID at a given index.
|
|
2660
2866
|
*
|
|
@@ -2853,6 +3059,14 @@ declare class Image_2 {
|
|
|
2853
3059
|
* @returns {Image} A clone of this image.
|
|
2854
3060
|
*/
|
|
2855
3061
|
clone(): Image_2;
|
|
3062
|
+
/**
|
|
3063
|
+
* Check if another image can be appended to this one.
|
|
3064
|
+
*
|
|
3065
|
+
* @param {Image} rhs The image to check.
|
|
3066
|
+
* @returns {BooleanResult} Result with success set to true if
|
|
3067
|
+
* the image can be appended.
|
|
3068
|
+
*/
|
|
3069
|
+
canAppend(rhs: Image_2): BooleanResult;
|
|
2856
3070
|
/**
|
|
2857
3071
|
* Append a slice to the image.
|
|
2858
3072
|
*
|
|
@@ -3040,10 +3254,50 @@ declare class Image_2 {
|
|
|
3040
3254
|
* Note: Uses the raw buffer values.
|
|
3041
3255
|
*/
|
|
3042
3256
|
compose(rhs: Image_2, operator: Function): Image_2;
|
|
3257
|
+
/**
|
|
3258
|
+
* Initialize the contour buffer.
|
|
3259
|
+
* Should be called on every segmentation image, or any image where
|
|
3260
|
+
* contour rendering needs to be supported.
|
|
3261
|
+
*/
|
|
3262
|
+
initializeContour(): void;
|
|
3263
|
+
/**
|
|
3264
|
+
* Get whether or not the contour buffer has been initialized.
|
|
3265
|
+
*
|
|
3266
|
+
* @returns {boolean} True if buffer has been initialized.
|
|
3267
|
+
*/
|
|
3268
|
+
countourIsInitialized(): boolean;
|
|
3269
|
+
/**
|
|
3270
|
+
* Calculate the distance to the nearest border pixel.
|
|
3271
|
+
* (or return the cached distance).
|
|
3272
|
+
*
|
|
3273
|
+
* @param {number} index Index/offset of the pixel to check.
|
|
3274
|
+
* @param {Matrix33} viewOrientation The orientation of the view.
|
|
3275
|
+
* @returns {number} The distance to the nearest border pixel or 0.
|
|
3276
|
+
*/
|
|
3277
|
+
getContourDistance(index: number, viewOrientation: Matrix33): number;
|
|
3043
3278
|
/**
|
|
3044
3279
|
* Recalculate labels.
|
|
3045
3280
|
*/
|
|
3046
3281
|
recalculateLabels(): void;
|
|
3282
|
+
/**
|
|
3283
|
+
* Return if this image has been resampled.
|
|
3284
|
+
*
|
|
3285
|
+
* @returns {boolean} If the image has been resampled.
|
|
3286
|
+
*/
|
|
3287
|
+
isResampled(): boolean;
|
|
3288
|
+
/**
|
|
3289
|
+
* Resample this image to a new orientation.
|
|
3290
|
+
*
|
|
3291
|
+
* @param {Matrix33} orientation The orientation to resample to.
|
|
3292
|
+
* @param {boolean|undefined} interpolated Default true, if true use bilinear
|
|
3293
|
+
* sampling, otherwise use nearest neighbor.
|
|
3294
|
+
* @param {Point|undefined} centerOfRotation World space center of rotation.
|
|
3295
|
+
*/
|
|
3296
|
+
resample(orientation: Matrix33, interpolated?: boolean | undefined, centerOfRotation?: Point | undefined): void;
|
|
3297
|
+
/**
|
|
3298
|
+
* Revert a resampled image to its original state.
|
|
3299
|
+
*/
|
|
3300
|
+
revert(): void;
|
|
3047
3301
|
#private;
|
|
3048
3302
|
}
|
|
3049
3303
|
export { Image_2 as Image }
|
|
@@ -3436,6 +3690,14 @@ export declare class LayerGroup {
|
|
|
3436
3690
|
* @returns {boolean} True if one view layer can be scrolled.
|
|
3437
3691
|
*/
|
|
3438
3692
|
canScroll(): boolean;
|
|
3693
|
+
/**
|
|
3694
|
+
* Returns whether or not a layer group should have its zoom/pan/etc
|
|
3695
|
+
* synced to other views. Used for things like Secondary Capture where
|
|
3696
|
+
* there is no meaningful real-world scale.
|
|
3697
|
+
*
|
|
3698
|
+
* @returns {boolean} Whether to sync the zoom/pan.
|
|
3699
|
+
*/
|
|
3700
|
+
shouldBind(): boolean;
|
|
3439
3701
|
/**
|
|
3440
3702
|
* Does one of the view layer have more than one slice in the
|
|
3441
3703
|
* given dimension.
|
|
@@ -3709,6 +3971,12 @@ export declare class MaskSegmentHelper {
|
|
|
3709
3971
|
* @param {Image} mask The associated mask image.
|
|
3710
3972
|
*/
|
|
3711
3973
|
constructor(mask: Image_2);
|
|
3974
|
+
/**
|
|
3975
|
+
* Get the associated mask image.
|
|
3976
|
+
*
|
|
3977
|
+
* @returns {Image} The mask image.
|
|
3978
|
+
*/
|
|
3979
|
+
getMask(): Image_2;
|
|
3712
3980
|
/**
|
|
3713
3981
|
* Check if a segment is part of the segments list.
|
|
3714
3982
|
*
|
|
@@ -3755,6 +4023,76 @@ export declare class MaskSegmentHelper {
|
|
|
3755
4023
|
* @param {MaskSegment} segment The segment to update.
|
|
3756
4024
|
*/
|
|
3757
4025
|
updateSegment(segment: MaskSegment): void;
|
|
4026
|
+
/**
|
|
4027
|
+
* The overlap count of a single segment with another segment.
|
|
4028
|
+
*
|
|
4029
|
+
* @typedef OverlapCount@typedef OverlapCount
|
|
4030
|
+
* @property {string} label The segment label.
|
|
4031
|
+
* @property {number} count The number of overlapping voxels.
|
|
4032
|
+
* @property {number} percentage The overlap percentage between 0 and 1.
|
|
4033
|
+
*/
|
|
4034
|
+
/**
|
|
4035
|
+
* The count of overlapping voxels of a single segment with a set of
|
|
4036
|
+
* different segments.
|
|
4037
|
+
*
|
|
4038
|
+
* @typedef Overlap@typedef Overlap
|
|
4039
|
+
* @property {string} label The segment label.
|
|
4040
|
+
* @property {Object.<number, OverlapCount>} overlap A Dictionary
|
|
4041
|
+
* containing the counts. The key is the segment number of the overlapping
|
|
4042
|
+
* segment.
|
|
4043
|
+
* @property {number} count The voxel volume of this segment.
|
|
4044
|
+
*/
|
|
4045
|
+
/**
|
|
4046
|
+
* An Dictionary containing the count of overlapping voxels between two
|
|
4047
|
+
* sets of segments.
|
|
4048
|
+
* The key is the segment number of a segment in the first set.
|
|
4049
|
+
* The value is a Dictionary of all of the segments in the second set
|
|
4050
|
+
* that overlap with the key segment.
|
|
4051
|
+
*
|
|
4052
|
+
* @typedef {Object.<number, Overlap>} OverlapMap
|
|
4053
|
+
*/
|
|
4054
|
+
/**
|
|
4055
|
+
* Find the overlap for each segment between two segmentation masks.
|
|
4056
|
+
* It is assumed these images have the same orientation.
|
|
4057
|
+
*
|
|
4058
|
+
* @param {MaskSegmentHelper} rhs The helper of the
|
|
4059
|
+
* segmentation image to find overlap with.
|
|
4060
|
+
* @returns {OverlapMap} The overlapping voxel counts. First level is the
|
|
4061
|
+
* segments from this image, second level is the compare image segments.
|
|
4062
|
+
*/
|
|
4063
|
+
findOverlap(rhs: MaskSegmentHelper): {
|
|
4064
|
+
[x: number]: {
|
|
4065
|
+
/**
|
|
4066
|
+
* The segment label.
|
|
4067
|
+
*/
|
|
4068
|
+
label: string;
|
|
4069
|
+
/**
|
|
4070
|
+
* A Dictionary
|
|
4071
|
+
* containing the counts. The key is the segment number of the overlapping
|
|
4072
|
+
* segment.
|
|
4073
|
+
*/
|
|
4074
|
+
overlap: {
|
|
4075
|
+
[x: number]: {
|
|
4076
|
+
/**
|
|
4077
|
+
* The segment label.
|
|
4078
|
+
*/
|
|
4079
|
+
label: string;
|
|
4080
|
+
/**
|
|
4081
|
+
* The number of overlapping voxels.
|
|
4082
|
+
*/
|
|
4083
|
+
count: number;
|
|
4084
|
+
/**
|
|
4085
|
+
* The overlap percentage between 0 and 1.
|
|
4086
|
+
*/
|
|
4087
|
+
percentage: number;
|
|
4088
|
+
};
|
|
4089
|
+
};
|
|
4090
|
+
/**
|
|
4091
|
+
* The voxel volume of this segment.
|
|
4092
|
+
*/
|
|
4093
|
+
count: number;
|
|
4094
|
+
};
|
|
4095
|
+
};
|
|
3758
4096
|
#private;
|
|
3759
4097
|
}
|
|
3760
4098
|
|
|
@@ -3781,18 +4119,6 @@ export declare class MaskSegmentViewHelper {
|
|
|
3781
4119
|
* @param {number} segmentNumber The segment number.
|
|
3782
4120
|
*/
|
|
3783
4121
|
removeFromHidden(segmentNumber: number): void;
|
|
3784
|
-
/**
|
|
3785
|
-
* @callback alphaFn@callback alphaFn
|
|
3786
|
-
* @param {number|number[]} value The pixel value.
|
|
3787
|
-
* @param {number} index The values' index.
|
|
3788
|
-
* @returns {number} The opacity of the input value.
|
|
3789
|
-
*/
|
|
3790
|
-
/**
|
|
3791
|
-
* Get the alpha function to apply hidden colors.
|
|
3792
|
-
*
|
|
3793
|
-
* @returns {alphaFn} The corresponding alpha function.
|
|
3794
|
-
*/
|
|
3795
|
-
getAlphaFunc(): (value: number | number[], index: number) => number;
|
|
3796
4122
|
#private;
|
|
3797
4123
|
}
|
|
3798
4124
|
|
|
@@ -3861,6 +4187,19 @@ export declare class Matrix33 {
|
|
|
3861
4187
|
* @returns {number[]} The result 3D array.
|
|
3862
4188
|
*/
|
|
3863
4189
|
multiplyArray3D(array3D: number[]): number[];
|
|
4190
|
+
/**
|
|
4191
|
+
* Multiply this matrix by a 3D typed array.
|
|
4192
|
+
*
|
|
4193
|
+
* @typedef {(
|
|
4194
|
+
* Uint8Array | Int8Array |
|
|
4195
|
+
* Uint16Array | Int16Array |
|
|
4196
|
+
* Uint32Array | Int32Array
|
|
4197
|
+
* )} TypedArray
|
|
4198
|
+
*
|
|
4199
|
+
* @param {TypedArray} sourceArray The input 3D array.
|
|
4200
|
+
* @param {TypedArray} outArray The array to write to.
|
|
4201
|
+
*/
|
|
4202
|
+
multiplyTypedArray3D(sourceArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, outArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array): void;
|
|
3864
4203
|
/**
|
|
3865
4204
|
* Multiply this matrix by a 3D vector.
|
|
3866
4205
|
*
|
|
@@ -3908,9 +4247,22 @@ export declare class Matrix33 {
|
|
|
3908
4247
|
* @returns {number} The index of the absolute maximum of the last column.
|
|
3909
4248
|
*/
|
|
3910
4249
|
getThirdColMajorDirection(): number;
|
|
4250
|
+
/**
|
|
4251
|
+
* Get the values of the matrix as an array.
|
|
4252
|
+
*
|
|
4253
|
+
* @returns {number[]} The matrix.
|
|
4254
|
+
*/
|
|
4255
|
+
getValues(): number[];
|
|
3911
4256
|
#private;
|
|
3912
4257
|
}
|
|
3913
4258
|
|
|
4259
|
+
export declare namespace NormalisedManufacturers {
|
|
4260
|
+
let GE: string;
|
|
4261
|
+
let SIEMENS: string;
|
|
4262
|
+
let PHILIPS: string;
|
|
4263
|
+
let HITASHI: string;
|
|
4264
|
+
}
|
|
4265
|
+
|
|
3914
4266
|
/**
|
|
3915
4267
|
* Number range.
|
|
3916
4268
|
*/
|
|
@@ -4416,7 +4768,7 @@ export declare class PositionHelper {
|
|
|
4416
4768
|
* with the input value.
|
|
4417
4769
|
*
|
|
4418
4770
|
* @param {number} dim The dimension.
|
|
4419
|
-
* @param {number} value The value to
|
|
4771
|
+
* @param {number} value The value to use at dimension index.
|
|
4420
4772
|
* @returns {Point} The position.
|
|
4421
4773
|
*/
|
|
4422
4774
|
getCurrentPositionAtDimValue(dim: number, value: number): Point;
|
|
@@ -5429,7 +5781,7 @@ export declare class Vector3D {
|
|
|
5429
5781
|
* ctx.putImageData(imageData, 0, 0);
|
|
5430
5782
|
* // update html
|
|
5431
5783
|
* const div = document.getElementById('dwv');
|
|
5432
|
-
* div.appendChild(canvas)
|
|
5784
|
+
* div.appendChild(canvas);
|
|
5433
5785
|
* };
|
|
5434
5786
|
* // DICOM file request
|
|
5435
5787
|
* const request = new XMLHttpRequest();
|
|
@@ -5453,9 +5805,22 @@ export declare class View {
|
|
|
5453
5805
|
/**
|
|
5454
5806
|
* Set the associated image.
|
|
5455
5807
|
*
|
|
5456
|
-
* @param {Image}
|
|
5808
|
+
* @param {Image} image The associated image.
|
|
5457
5809
|
*/
|
|
5458
|
-
setImage(
|
|
5810
|
+
setImage(image: Image_2): void;
|
|
5811
|
+
/**
|
|
5812
|
+
* Check is the associated image is a mask.
|
|
5813
|
+
*
|
|
5814
|
+
* @returns {boolean} True if the associated image is a mask.
|
|
5815
|
+
*/
|
|
5816
|
+
isMask(): boolean;
|
|
5817
|
+
/**
|
|
5818
|
+
* Set the mask segment view helper to handle
|
|
5819
|
+
* hidden segments.
|
|
5820
|
+
*
|
|
5821
|
+
* @param {MaskSegmentViewHelper} helper The helper.
|
|
5822
|
+
*/
|
|
5823
|
+
setMaskViewHelper(helper: MaskSegmentViewHelper): void;
|
|
5459
5824
|
/**
|
|
5460
5825
|
* Get the view orientation.
|
|
5461
5826
|
*
|
|
@@ -5468,6 +5833,35 @@ export declare class View {
|
|
|
5468
5833
|
* @param {Matrix33} mat33 The orientation matrix.
|
|
5469
5834
|
*/
|
|
5470
5835
|
setOrientation(mat33: Matrix33): void;
|
|
5836
|
+
/**
|
|
5837
|
+
* Get the fill opacity relative to the global opacity.
|
|
5838
|
+
*
|
|
5839
|
+
* @returns {number} The fill opacity (between 0 and 1).
|
|
5840
|
+
*/
|
|
5841
|
+
getFillOpacity(): number;
|
|
5842
|
+
/**
|
|
5843
|
+
* Set the fill opacity relative to the global opacity.
|
|
5844
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
5845
|
+
* function that makes use of it.
|
|
5846
|
+
*
|
|
5847
|
+
* @param {number} opacity The fill opacity (between 0 and 1).
|
|
5848
|
+
*/
|
|
5849
|
+
setFillOpacity(opacity: number): void;
|
|
5850
|
+
/**
|
|
5851
|
+
* Get the thickness of the contour in pixels.
|
|
5852
|
+
*
|
|
5853
|
+
* @returns {number} The contour thickness (0 <= integer <= MAX_CONTOUR_SIZE).
|
|
5854
|
+
*/
|
|
5855
|
+
getContourThickness(): number;
|
|
5856
|
+
/**
|
|
5857
|
+
* Set the thickness of the contour in pixels.
|
|
5858
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
5859
|
+
* function that makes use of it.
|
|
5860
|
+
*
|
|
5861
|
+
* @param {number} thickness The contour thickness
|
|
5862
|
+
* (0 <= integer <= MAX_CONTOUR_SIZE).
|
|
5863
|
+
*/
|
|
5864
|
+
setContourThickness(thickness: number): void;
|
|
5471
5865
|
/**
|
|
5472
5866
|
* Initialise the view: set initial index.
|
|
5473
5867
|
*/
|
|
@@ -5483,12 +5877,6 @@ export declare class View {
|
|
|
5483
5877
|
* @returns {number} The milliseconds per frame.
|
|
5484
5878
|
*/
|
|
5485
5879
|
getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number;
|
|
5486
|
-
/**
|
|
5487
|
-
* @callback alphaFn@callback alphaFn
|
|
5488
|
-
* @param {number[]|number} value The pixel value.
|
|
5489
|
-
* @param {number} index The values' index.
|
|
5490
|
-
* @returns {number} The opacity of the input value.
|
|
5491
|
-
*/
|
|
5492
5880
|
/**
|
|
5493
5881
|
* Get the alpha function.
|
|
5494
5882
|
*
|
|
@@ -5725,6 +6113,18 @@ export declare class ViewConfig {
|
|
|
5725
6113
|
* @type {number|undefined}
|
|
5726
6114
|
*/
|
|
5727
6115
|
opacity: number | undefined;
|
|
6116
|
+
/**
|
|
6117
|
+
* Optional segmentation layer fill opacity; in [0, 1] range.
|
|
6118
|
+
*
|
|
6119
|
+
* @type {number|undefined}
|
|
6120
|
+
*/
|
|
6121
|
+
fillOpacity: number | undefined;
|
|
6122
|
+
/**
|
|
6123
|
+
* Optional segmentation contour thickness; in [0, 10] range.
|
|
6124
|
+
*
|
|
6125
|
+
* @type {number|undefined}
|
|
6126
|
+
*/
|
|
6127
|
+
contourThickness: number | undefined;
|
|
5728
6128
|
/**
|
|
5729
6129
|
* Optional layer window level preset name.
|
|
5730
6130
|
* If present, the preset name will be used and
|
|
@@ -5761,6 +6161,10 @@ export declare class ViewController {
|
|
|
5761
6161
|
* @returns {PlaneHelper} The helper.
|
|
5762
6162
|
*/
|
|
5763
6163
|
getPlaneHelper(): PlaneHelper;
|
|
6164
|
+
/**
|
|
6165
|
+
* Update the plane helper if there is a change in the image geometry.
|
|
6166
|
+
*/
|
|
6167
|
+
updatePlaneHelper(): void;
|
|
5764
6168
|
/**
|
|
5765
6169
|
* Check is the associated image is a mask.
|
|
5766
6170
|
*
|
|
@@ -6002,6 +6406,12 @@ export declare class ViewController {
|
|
|
6002
6406
|
* @returns {Size} The size.
|
|
6003
6407
|
*/
|
|
6004
6408
|
getImageSize(): Size;
|
|
6409
|
+
/**
|
|
6410
|
+
* Get the oriented image spacing.
|
|
6411
|
+
*
|
|
6412
|
+
* @returns {Spacing} The spacing.
|
|
6413
|
+
*/
|
|
6414
|
+
getImageSpacing(): Spacing;
|
|
6005
6415
|
/**
|
|
6006
6416
|
* Is the data size larger than one in the given dimension?
|
|
6007
6417
|
*
|
|
@@ -6142,6 +6552,41 @@ export declare class ViewController {
|
|
|
6142
6552
|
* @param {alphaFn} func The function.
|
|
6143
6553
|
*/
|
|
6144
6554
|
setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
|
|
6555
|
+
/**
|
|
6556
|
+
* Set the mask segment view helper to handle
|
|
6557
|
+
* hidden segments.
|
|
6558
|
+
*
|
|
6559
|
+
* @param {MaskSegmentViewHelper} helper The helper.
|
|
6560
|
+
*/
|
|
6561
|
+
setMaskViewHelper(helper: MaskSegmentViewHelper): void;
|
|
6562
|
+
/**
|
|
6563
|
+
* Get the fill opacity relative to the global opacity.
|
|
6564
|
+
*
|
|
6565
|
+
* @returns {number} The fill opacity (between 0 and 1).
|
|
6566
|
+
*/
|
|
6567
|
+
getFillOpacity(): number;
|
|
6568
|
+
/**
|
|
6569
|
+
* Set the fill opacity relative to the global opacity.
|
|
6570
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
6571
|
+
* function that makes use of it.
|
|
6572
|
+
*
|
|
6573
|
+
* @param {number} opacity The fill opacity (between 0 and 1).
|
|
6574
|
+
*/
|
|
6575
|
+
setFillOpacity(opacity: number): void;
|
|
6576
|
+
/**
|
|
6577
|
+
* Get the thickness of the contour in pixels.
|
|
6578
|
+
*
|
|
6579
|
+
* @returns {number} The contour thickness (integer >= 1).
|
|
6580
|
+
*/
|
|
6581
|
+
getContourThickness(): number;
|
|
6582
|
+
/**
|
|
6583
|
+
* Set the thickness of the contour in pixels.
|
|
6584
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
6585
|
+
* function that makes use of it.
|
|
6586
|
+
*
|
|
6587
|
+
* @param {number} thickness The contour thickness (integer >= 1).
|
|
6588
|
+
*/
|
|
6589
|
+
setContourThickness(thickness: number): void;
|
|
6145
6590
|
/**
|
|
6146
6591
|
* Bind the view image to the provided layer.
|
|
6147
6592
|
*
|
|
@@ -6238,6 +6683,13 @@ export declare class ViewLayer {
|
|
|
6238
6683
|
* @function
|
|
6239
6684
|
*/
|
|
6240
6685
|
onimagegeometrychange: (event: object) => void;
|
|
6686
|
+
/**
|
|
6687
|
+
* Handle an image resampled event.
|
|
6688
|
+
*
|
|
6689
|
+
* @param {object} event The event.
|
|
6690
|
+
* @function
|
|
6691
|
+
*/
|
|
6692
|
+
onimageresampled: (event: object) => void;
|
|
6241
6693
|
/**
|
|
6242
6694
|
* Get the id of the layer.
|
|
6243
6695
|
*
|
|
@@ -6272,6 +6724,34 @@ export declare class ViewLayer {
|
|
|
6272
6724
|
* @param {number} alpha The opacity ([0:1] range).
|
|
6273
6725
|
*/
|
|
6274
6726
|
setOpacity(alpha: number): void;
|
|
6727
|
+
/**
|
|
6728
|
+
* Get the fill opacity relative to the global opacity.
|
|
6729
|
+
*
|
|
6730
|
+
* @returns {number} The fill opacity (between 0 and 1).
|
|
6731
|
+
*/
|
|
6732
|
+
getFillOpacity(): number;
|
|
6733
|
+
/**
|
|
6734
|
+
* Set the fill opacity relative to the global opacity.
|
|
6735
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
6736
|
+
* function that makes use of it.
|
|
6737
|
+
*
|
|
6738
|
+
* @param {number} opacity The fill opacity (between 0 and 1).
|
|
6739
|
+
*/
|
|
6740
|
+
setFillOpacity(opacity: number): void;
|
|
6741
|
+
/**
|
|
6742
|
+
* Get the thickness of the contour in pixels.
|
|
6743
|
+
*
|
|
6744
|
+
* @returns {number} The contour thickness (integer >= 1).
|
|
6745
|
+
*/
|
|
6746
|
+
getContourThickness(): number;
|
|
6747
|
+
/**
|
|
6748
|
+
* Set the thickness of the contour in pixels.
|
|
6749
|
+
* This only has an effect on segmentation views, or any other alpha
|
|
6750
|
+
* function that makes use of it.
|
|
6751
|
+
*
|
|
6752
|
+
* @param {number} thickness The contour thickness (integer >= 1).
|
|
6753
|
+
*/
|
|
6754
|
+
setContourThickness(thickness: number): void;
|
|
6275
6755
|
/**
|
|
6276
6756
|
* Add a flip offset along the layer X axis.
|
|
6277
6757
|
*/
|
|
@@ -6423,10 +6903,10 @@ export declare class ViewLayer {
|
|
|
6423
6903
|
* Set the current position.
|
|
6424
6904
|
*
|
|
6425
6905
|
* @param {Point} position The new position.
|
|
6426
|
-
* @param {Index} _index The new index.
|
|
6906
|
+
* @param {Index} [_index] The new index (not used).
|
|
6427
6907
|
* @returns {boolean} True if the position was updated.
|
|
6428
6908
|
*/
|
|
6429
|
-
setCurrentPosition(position: Point, _index
|
|
6909
|
+
setCurrentPosition(position: Point, _index?: Index): boolean;
|
|
6430
6910
|
/**
|
|
6431
6911
|
* Clear the context.
|
|
6432
6912
|
*/
|
|
@@ -6455,13 +6935,6 @@ export declare class WindowLevel {
|
|
|
6455
6935
|
* @type {number}
|
|
6456
6936
|
*/
|
|
6457
6937
|
width: number;
|
|
6458
|
-
/**
|
|
6459
|
-
* Check for equality.
|
|
6460
|
-
*
|
|
6461
|
-
* @param {WindowLevel} rhs The other object to compare to.
|
|
6462
|
-
* @returns {boolean} True if both objects are equal.
|
|
6463
|
-
*/
|
|
6464
|
-
equals(rhs: WindowLevel): boolean;
|
|
6465
6938
|
}
|
|
6466
6939
|
|
|
6467
6940
|
/**
|