dwv 0.33.0-beta.42 → 0.33.0-beta.44
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 +148 -88
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +7 -7
package/dist/dwv.d.ts
CHANGED
|
@@ -41,12 +41,6 @@ export declare class App {
|
|
|
41
41
|
* @returns {Image|undefined} The associated image.
|
|
42
42
|
*/
|
|
43
43
|
getImage(dataId: string): Image_2 | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Get the last loaded image.
|
|
46
|
-
*
|
|
47
|
-
* @returns {Image|undefined} The image.
|
|
48
|
-
*/
|
|
49
|
-
getLastImage(): Image_2 | undefined;
|
|
50
44
|
/**
|
|
51
45
|
* Set the image at the given id.
|
|
52
46
|
*
|
|
@@ -54,12 +48,6 @@ export declare class App {
|
|
|
54
48
|
* @param {Image} img The associated image.
|
|
55
49
|
*/
|
|
56
50
|
setImage(dataId: string, img: Image_2): void;
|
|
57
|
-
/**
|
|
58
|
-
* Set the last image.
|
|
59
|
-
*
|
|
60
|
-
* @param {Image} img The associated image.
|
|
61
|
-
*/
|
|
62
|
-
setLastImage(img: Image_2): void;
|
|
63
51
|
/**
|
|
64
52
|
* Add a new image.
|
|
65
53
|
*
|
|
@@ -135,9 +123,9 @@ export declare class App {
|
|
|
135
123
|
* Get the active layer group.
|
|
136
124
|
* The layer is available after the first loaded item.
|
|
137
125
|
*
|
|
138
|
-
* @returns {LayerGroup} The layer group.
|
|
126
|
+
* @returns {LayerGroup|undefined} The layer group.
|
|
139
127
|
*/
|
|
140
|
-
getActiveLayerGroup(): LayerGroup;
|
|
128
|
+
getActiveLayerGroup(): LayerGroup | undefined;
|
|
141
129
|
/**
|
|
142
130
|
* Set the active layer group.
|
|
143
131
|
*
|
|
@@ -191,7 +179,7 @@ export declare class App {
|
|
|
191
179
|
/**
|
|
192
180
|
* Initialise the application.
|
|
193
181
|
*
|
|
194
|
-
* @param {AppOptions} opt The application options
|
|
182
|
+
* @param {AppOptions} opt The application options.
|
|
195
183
|
* @example
|
|
196
184
|
* // create the dwv app
|
|
197
185
|
* const app = new dwv.App();
|
|
@@ -263,9 +251,9 @@ export declare class App {
|
|
|
263
251
|
*
|
|
264
252
|
* @param {string[]} urls The list of urls to load.
|
|
265
253
|
* @param {object} [options] The options object, can contain:
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
254
|
+
* - requestHeaders: an array of {name, value} to use as request headers,
|
|
255
|
+
* - withCredentials: boolean xhr.withCredentials flag to pass to the request,
|
|
256
|
+
* - batchSize: the size of the request url batch.
|
|
269
257
|
* @fires App#loadstart
|
|
270
258
|
* @fires App#loadprogress
|
|
271
259
|
* @fires App#loaditem
|
|
@@ -458,13 +446,14 @@ export declare class App {
|
|
|
458
446
|
onKeydown: (event: KeyboardEvent) => void;
|
|
459
447
|
/**
|
|
460
448
|
* Key down event handler example.
|
|
461
|
-
* - CRTL-Z: undo
|
|
462
|
-
* - CRTL-Y: redo
|
|
463
|
-
* - CRTL-ARROW_LEFT: next element on fourth dim
|
|
464
|
-
* - CRTL-ARROW_UP: next element on third dim
|
|
465
|
-
* - CRTL-ARROW_RIGHT: previous element on fourth dim
|
|
466
|
-
* - CRTL-ARROW_DOWN: previous element on third dim
|
|
467
|
-
*
|
|
449
|
+
* - CRTL-Z: undo,
|
|
450
|
+
* - CRTL-Y: redo,
|
|
451
|
+
* - CRTL-ARROW_LEFT: next element on fourth dim,
|
|
452
|
+
* - CRTL-ARROW_UP: next element on third dim,
|
|
453
|
+
* - CRTL-ARROW_RIGHT: previous element on fourth dim,
|
|
454
|
+
* - CRTL-ARROW_DOWN: previous element on third dim.
|
|
455
|
+
*
|
|
456
|
+
* Applies to the active view of the active layer group.
|
|
468
457
|
*
|
|
469
458
|
* @param {KeyboardEvent} event The key down event.
|
|
470
459
|
* @fires UndoStack#undo
|
|
@@ -473,11 +462,11 @@ export declare class App {
|
|
|
473
462
|
*/
|
|
474
463
|
defaultOnKeydown: (event: KeyboardEvent) => void;
|
|
475
464
|
/**
|
|
476
|
-
* Reset the display
|
|
465
|
+
* Reset the display.
|
|
477
466
|
*/
|
|
478
467
|
resetDisplay(): void;
|
|
479
468
|
/**
|
|
480
|
-
* Reset the app zoom.
|
|
469
|
+
* Reset the app zoom.
|
|
481
470
|
*/
|
|
482
471
|
resetZoom(): void;
|
|
483
472
|
/**
|
|
@@ -495,7 +484,7 @@ export declare class App {
|
|
|
495
484
|
*/
|
|
496
485
|
setWindowLevelPreset(preset: string): void;
|
|
497
486
|
/**
|
|
498
|
-
* Set the tool
|
|
487
|
+
* Set the tool.
|
|
499
488
|
*
|
|
500
489
|
* @param {string} tool The tool.
|
|
501
490
|
*/
|
|
@@ -507,13 +496,13 @@ export declare class App {
|
|
|
507
496
|
*/
|
|
508
497
|
setToolFeatures(list: object): void;
|
|
509
498
|
/**
|
|
510
|
-
* Undo the last action
|
|
499
|
+
* Undo the last action.
|
|
511
500
|
*
|
|
512
501
|
* @fires UndoStack#undo
|
|
513
502
|
*/
|
|
514
503
|
undo(): void;
|
|
515
504
|
/**
|
|
516
|
-
* Redo the last action
|
|
505
|
+
* Redo the last action.
|
|
517
506
|
*
|
|
518
507
|
* @fires UndoStack#redo
|
|
519
508
|
*/
|
|
@@ -581,15 +570,16 @@ export declare class AppOptions {
|
|
|
581
570
|
binders: string[] | undefined;
|
|
582
571
|
/**
|
|
583
572
|
* Optional boolean flag to trigger the first data render
|
|
584
|
-
* after the first loaded data or not. Defaults to true
|
|
573
|
+
* after the first loaded data or not. Defaults to true.
|
|
585
574
|
*
|
|
586
575
|
* @type {boolean|undefined}
|
|
587
576
|
*/
|
|
588
577
|
viewOnFirstLoadItem: boolean | undefined;
|
|
589
578
|
/**
|
|
590
|
-
* Optional default
|
|
591
|
-
*
|
|
592
|
-
*
|
|
579
|
+
* Optional default chraracterset string used for DICOM parsing if
|
|
580
|
+
* not passed in DICOM file.
|
|
581
|
+
*
|
|
582
|
+
* Valid values: {@link https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings}.
|
|
593
583
|
*
|
|
594
584
|
* @type {string|undefined}
|
|
595
585
|
*/
|
|
@@ -600,6 +590,12 @@ export declare class AppOptions {
|
|
|
600
590
|
* @type {object|undefined}
|
|
601
591
|
*/
|
|
602
592
|
overlayConfig: object | undefined;
|
|
593
|
+
/**
|
|
594
|
+
* DOM root document.
|
|
595
|
+
*
|
|
596
|
+
* @type {DocumentFragment}
|
|
597
|
+
*/
|
|
598
|
+
rootDocument: DocumentFragment;
|
|
603
599
|
}
|
|
604
600
|
|
|
605
601
|
export declare namespace BLACK {
|
|
@@ -610,8 +606,10 @@ export declare namespace BLACK {
|
|
|
610
606
|
|
|
611
607
|
/**
|
|
612
608
|
* Build a multipart message.
|
|
613
|
-
*
|
|
614
|
-
*
|
|
609
|
+
*
|
|
610
|
+
* Ref:
|
|
611
|
+
* - {@link https://en.wikipedia.org/wiki/MIME#Multipart_messages},
|
|
612
|
+
* - {@link https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/Samples/JavaScript/stow-rs.js}.
|
|
615
613
|
*
|
|
616
614
|
* @param {Array} parts The message parts as an array of object containing
|
|
617
615
|
* content headers and messages as the data property (as returned by parse).
|
|
@@ -672,7 +670,7 @@ export declare class ChangeSegmentColourCommand {
|
|
|
672
670
|
|
|
673
671
|
/**
|
|
674
672
|
* Colour map: red, green and blue components
|
|
675
|
-
*
|
|
673
|
+
* to associate with intensity values.
|
|
676
674
|
*/
|
|
677
675
|
export declare class ColourMap {
|
|
678
676
|
/**
|
|
@@ -881,7 +879,7 @@ export declare class DeleteSegmentCommand {
|
|
|
881
879
|
/**
|
|
882
880
|
* DICOM code: item of a basic code sequence.
|
|
883
881
|
*
|
|
884
|
-
* @
|
|
882
|
+
* Ref: {@link https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_8.8.html}.
|
|
885
883
|
*/
|
|
886
884
|
export declare class DicomCode {
|
|
887
885
|
/**
|
|
@@ -1036,7 +1034,7 @@ export declare class DicomWriter {
|
|
|
1036
1034
|
* if nothing is found the default rule is applied.
|
|
1037
1035
|
*
|
|
1038
1036
|
* @param {Object<string, WriterRule>} rules The input rules.
|
|
1039
|
-
* @param {boolean} [addMissingTags]
|
|
1037
|
+
* @param {boolean} [addMissingTags] If true, explicit tags that
|
|
1040
1038
|
* have replace rule and a value will be
|
|
1041
1039
|
* added if missing. Defaults to false.
|
|
1042
1040
|
*/
|
|
@@ -1051,7 +1049,7 @@ export declare class DicomWriter {
|
|
|
1051
1049
|
* Get the element to write according to the class rules.
|
|
1052
1050
|
* Priority order: tagName, groupName, default.
|
|
1053
1051
|
*
|
|
1054
|
-
* @param {DataElement} element The element to check
|
|
1052
|
+
* @param {DataElement} element The element to check.
|
|
1055
1053
|
* @returns {DataElement|null} The element to write, can be null.
|
|
1056
1054
|
*/
|
|
1057
1055
|
getElementToWrite(element: DataElement): DataElement | null;
|
|
@@ -1246,6 +1244,10 @@ export declare class DrawLayer {
|
|
|
1246
1244
|
* @returns {string} The string id.
|
|
1247
1245
|
*/
|
|
1248
1246
|
getId(): string;
|
|
1247
|
+
/**
|
|
1248
|
+
* Remove the HTML element from the DOM.
|
|
1249
|
+
*/
|
|
1250
|
+
removeFromDOM(): void;
|
|
1249
1251
|
/**
|
|
1250
1252
|
* Get the layer base size (without scale).
|
|
1251
1253
|
*
|
|
@@ -1319,11 +1321,11 @@ export declare class DrawLayer {
|
|
|
1319
1321
|
isVisible(): boolean;
|
|
1320
1322
|
/**
|
|
1321
1323
|
* Draw the content (imageData) of the layer.
|
|
1322
|
-
* The imageData variable needs to be set
|
|
1324
|
+
* The imageData variable needs to be set.
|
|
1323
1325
|
*/
|
|
1324
1326
|
draw(): void;
|
|
1325
1327
|
/**
|
|
1326
|
-
* Initialise the layer: set the canvas and context
|
|
1328
|
+
* Initialise the layer: set the canvas and context.
|
|
1327
1329
|
*
|
|
1328
1330
|
* @param {Scalar2D} size The image size as {x,y}.
|
|
1329
1331
|
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
@@ -1497,7 +1499,7 @@ export declare class Geometry {
|
|
|
1497
1499
|
* Warning: the size comes as stored in DICOM, meaning that it could
|
|
1498
1500
|
* be oriented.
|
|
1499
1501
|
*
|
|
1500
|
-
* @param {Matrix33} [viewOrientation] The view orientation (optional)
|
|
1502
|
+
* @param {Matrix33} [viewOrientation] The view orientation (optional).
|
|
1501
1503
|
* @returns {Size} The object size.
|
|
1502
1504
|
*/
|
|
1503
1505
|
getSize(viewOrientation?: Matrix33): Size;
|
|
@@ -1506,7 +1508,7 @@ export declare class Geometry {
|
|
|
1506
1508
|
* Warning: the spacing comes as stored in DICOM, meaning that it could
|
|
1507
1509
|
* be oriented.
|
|
1508
1510
|
*
|
|
1509
|
-
* @param {Matrix33} [viewOrientation] The view orientation (optional)
|
|
1511
|
+
* @param {Matrix33} [viewOrientation] The view orientation (optional).
|
|
1510
1512
|
* @returns {Spacing} The object spacing.
|
|
1511
1513
|
*/
|
|
1512
1514
|
getSpacing(viewOrientation?: Matrix33): Spacing;
|
|
@@ -1678,9 +1680,10 @@ export declare function getMousePoint(event: object): Point2D;
|
|
|
1678
1680
|
* Get the name of an image orientation patient.
|
|
1679
1681
|
*
|
|
1680
1682
|
* @param {number[]} orientation The image orientation patient.
|
|
1681
|
-
* @returns {string} The orientation
|
|
1683
|
+
* @returns {string|undefined} The orientation
|
|
1684
|
+
* name: axial, coronal or sagittal.
|
|
1682
1685
|
*/
|
|
1683
|
-
export declare function getOrientationName(orientation: number[]): string;
|
|
1686
|
+
export declare function getOrientationName(orientation: number[]): string | undefined;
|
|
1684
1687
|
|
|
1685
1688
|
/**
|
|
1686
1689
|
* Get the PixelData Tag.
|
|
@@ -1728,11 +1731,14 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
|
|
|
1728
1731
|
|
|
1729
1732
|
/**
|
|
1730
1733
|
* Get a UID for a DICOM tag.
|
|
1731
|
-
* Note: Use https://github.com/uuidjs/uuid?
|
|
1732
1734
|
*
|
|
1733
|
-
* @
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1735
|
+
* Note: Use {@link https://github.com/uuidjs/uuid}?
|
|
1736
|
+
*
|
|
1737
|
+
* Ref:
|
|
1738
|
+
* - {@link http://dicom.nema.org/dicom/2013/output/chtml/part05/chapter_9.html},
|
|
1739
|
+
* - {@link http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html},
|
|
1740
|
+
* - {@link https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid}.
|
|
1741
|
+
*
|
|
1736
1742
|
* @param {string} tagName The input tag.
|
|
1737
1743
|
* @returns {string} The corresponding UID.
|
|
1738
1744
|
*/
|
|
@@ -1740,8 +1746,9 @@ export declare function getUID(tagName: string): string;
|
|
|
1740
1746
|
|
|
1741
1747
|
/**
|
|
1742
1748
|
* Check that an input buffer includes the DICOM prefix 'DICM'
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1749
|
+
* after the 128 bytes preamble.
|
|
1750
|
+
*
|
|
1751
|
+
* Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}.
|
|
1745
1752
|
*
|
|
1746
1753
|
* @param {ArrayBuffer} buffer The buffer to check.
|
|
1747
1754
|
* @returns {boolean} True if the buffer includes the prefix.
|
|
@@ -1826,7 +1833,7 @@ declare class Image_2 {
|
|
|
1826
1833
|
/**
|
|
1827
1834
|
* Get the data buffer of the image.
|
|
1828
1835
|
*
|
|
1829
|
-
* @todo
|
|
1836
|
+
* @todo Dangerous...
|
|
1830
1837
|
* @returns {TypedArray} The data buffer of the image.
|
|
1831
1838
|
*/
|
|
1832
1839
|
getBuffer(): Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array;
|
|
@@ -2261,18 +2268,18 @@ export declare function labToUintLab(triplet: object): object;
|
|
|
2261
2268
|
/**
|
|
2262
2269
|
* Layer group.
|
|
2263
2270
|
*
|
|
2264
|
-
* Display position: {x,y}
|
|
2265
|
-
* Plane position: Index (access: get(i))
|
|
2266
|
-
* (world) Position: Point3D (access: getX, getY, getZ)
|
|
2271
|
+
* - Display position: {x,y},
|
|
2272
|
+
* - Plane position: Index (access: get(i)),
|
|
2273
|
+
* - (world) Position: Point3D (access: getX, getY, getZ).
|
|
2267
2274
|
*
|
|
2268
2275
|
* Display -> World:
|
|
2269
|
-
* planePos = viewLayer.displayToPlanePos(displayPos)
|
|
2270
|
-
*
|
|
2271
|
-
* pos = viewController.getPositionFromPlanePoint(planePos)
|
|
2276
|
+
* - planePos = viewLayer.displayToPlanePos(displayPos)
|
|
2277
|
+
* -> compensate for layer scale and offset,
|
|
2278
|
+
* - pos = viewController.getPositionFromPlanePoint(planePos).
|
|
2272
2279
|
*
|
|
2273
|
-
* World ->
|
|
2274
|
-
* planePos = viewController.getOffset3DFromPlaneOffset(pos)
|
|
2275
|
-
*
|
|
2280
|
+
* World -> Display:
|
|
2281
|
+
* - planePos = viewController.getOffset3DFromPlaneOffset(pos)
|
|
2282
|
+
* no need yet for a planePos to displayPos...
|
|
2276
2283
|
*/
|
|
2277
2284
|
export declare class LayerGroup {
|
|
2278
2285
|
/**
|
|
@@ -2316,7 +2323,7 @@ export declare class LayerGroup {
|
|
|
2316
2323
|
*/
|
|
2317
2324
|
getBaseScale(): Scalar3D;
|
|
2318
2325
|
/**
|
|
2319
|
-
* Get the added scale: the scale added to the base scale
|
|
2326
|
+
* Get the added scale: the scale added to the base scale.
|
|
2320
2327
|
*
|
|
2321
2328
|
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
2322
2329
|
*/
|
|
@@ -2333,6 +2340,14 @@ export declare class LayerGroup {
|
|
|
2333
2340
|
* @returns {number} The number of layers.
|
|
2334
2341
|
*/
|
|
2335
2342
|
getNumberOfLayers(): number;
|
|
2343
|
+
/**
|
|
2344
|
+
* Check if this layerGroup contains a layer with the input id.
|
|
2345
|
+
*
|
|
2346
|
+
* @param {string} id The layer id to look for.
|
|
2347
|
+
* @returns {boolean} True if this group contains
|
|
2348
|
+
* a layer with the input id.
|
|
2349
|
+
*/
|
|
2350
|
+
includes(id: string): boolean;
|
|
2336
2351
|
/**
|
|
2337
2352
|
* Get the number of view layers handled by this class.
|
|
2338
2353
|
*
|
|
@@ -2411,12 +2426,16 @@ export declare class LayerGroup {
|
|
|
2411
2426
|
/**
|
|
2412
2427
|
* Add a view layer.
|
|
2413
2428
|
*
|
|
2429
|
+
* The new layer will be marked as the active view layer.
|
|
2430
|
+
*
|
|
2414
2431
|
* @returns {ViewLayer} The created layer.
|
|
2415
2432
|
*/
|
|
2416
2433
|
addViewLayer(): ViewLayer;
|
|
2417
2434
|
/**
|
|
2418
2435
|
* Add a draw layer.
|
|
2419
2436
|
*
|
|
2437
|
+
* The new layer will be marked as the active draw layer.
|
|
2438
|
+
*
|
|
2420
2439
|
* @returns {DrawLayer} The created layer.
|
|
2421
2440
|
*/
|
|
2422
2441
|
addDrawLayer(): DrawLayer;
|
|
@@ -2439,6 +2458,17 @@ export declare class LayerGroup {
|
|
|
2439
2458
|
* @param {ViewLayer | DrawLayer} layer The layer to remove.
|
|
2440
2459
|
*/
|
|
2441
2460
|
removeLayer(layer: ViewLayer | DrawLayer): void;
|
|
2461
|
+
/**
|
|
2462
|
+
* Displays a tooltip in a temporary `span`.
|
|
2463
|
+
* Works with css to hide/show the span only on mouse hover.
|
|
2464
|
+
*
|
|
2465
|
+
* @param {Point2D} point The update point.
|
|
2466
|
+
*/
|
|
2467
|
+
showTooltip(point: Point2D): void;
|
|
2468
|
+
/**
|
|
2469
|
+
* Remove the tooltip html div.
|
|
2470
|
+
*/
|
|
2471
|
+
removeTooltipDiv(): void;
|
|
2442
2472
|
/**
|
|
2443
2473
|
* Test if one of the view layers satisfies an input callbackFn.
|
|
2444
2474
|
*
|
|
@@ -2476,23 +2506,24 @@ export declare class LayerGroup {
|
|
|
2476
2506
|
*/
|
|
2477
2507
|
updateLayersToPositionChange: (event: object) => void;
|
|
2478
2508
|
/**
|
|
2479
|
-
* Calculate the
|
|
2509
|
+
* Calculate the div to world size ratio needed to fit
|
|
2510
|
+
* the largest data.
|
|
2480
2511
|
*
|
|
2481
|
-
* @returns {number|undefined} The
|
|
2512
|
+
* @returns {number|undefined} The ratio.
|
|
2482
2513
|
*/
|
|
2483
|
-
|
|
2514
|
+
getDivToWorldSizeRatio(): number | undefined;
|
|
2484
2515
|
/**
|
|
2485
|
-
*
|
|
2516
|
+
* Fit to container: set the layers div to world size ratio.
|
|
2486
2517
|
*
|
|
2487
|
-
* @param {number}
|
|
2518
|
+
* @param {number} divToWorldSizeRatio The ratio.
|
|
2488
2519
|
*/
|
|
2489
|
-
|
|
2520
|
+
fitToContainer(divToWorldSizeRatio: number): void;
|
|
2490
2521
|
/**
|
|
2491
|
-
* Get the largest data size.
|
|
2522
|
+
* Get the largest data world (mm) size.
|
|
2492
2523
|
*
|
|
2493
2524
|
* @returns {Scalar2D|undefined} The largest size as {x,y}.
|
|
2494
2525
|
*/
|
|
2495
|
-
|
|
2526
|
+
getMaxWorldSize(): Scalar2D | undefined;
|
|
2496
2527
|
/**
|
|
2497
2528
|
* Flip all layers along the Z axis without offset compensation.
|
|
2498
2529
|
*/
|
|
@@ -2635,7 +2666,7 @@ export declare class MaskFactory {
|
|
|
2635
2666
|
/**
|
|
2636
2667
|
* DICOM (mask) segment: item of a SegmentSequence (0062,0002).
|
|
2637
2668
|
*
|
|
2638
|
-
* @
|
|
2669
|
+
* Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.8.20.4.html}.
|
|
2639
2670
|
*/
|
|
2640
2671
|
export declare class MaskSegment {
|
|
2641
2672
|
/**
|
|
@@ -2804,7 +2835,7 @@ export declare class MaskSegmentViewHelper {
|
|
|
2804
2835
|
*/
|
|
2805
2836
|
export declare class Matrix33 {
|
|
2806
2837
|
/**
|
|
2807
|
-
* @param {number[]} values
|
|
2838
|
+
* @param {number[]} values Row-major ordered 9 values.
|
|
2808
2839
|
*/
|
|
2809
2840
|
constructor(values: number[]);
|
|
2810
2841
|
/**
|
|
@@ -2893,7 +2924,7 @@ export declare class Matrix33 {
|
|
|
2893
2924
|
*/
|
|
2894
2925
|
getColAbsMax(col: number): object;
|
|
2895
2926
|
/**
|
|
2896
|
-
* Get this matrix with only zero and +/- ones instead of the maximum
|
|
2927
|
+
* Get this matrix with only zero and +/- ones instead of the maximum.
|
|
2897
2928
|
*
|
|
2898
2929
|
* @returns {Matrix33} The simplified matrix.
|
|
2899
2930
|
*/
|
|
@@ -3272,9 +3303,11 @@ export declare class Point3D {
|
|
|
3272
3303
|
|
|
3273
3304
|
/**
|
|
3274
3305
|
* Round a float number to a given precision.
|
|
3275
|
-
*
|
|
3306
|
+
*
|
|
3307
|
+
* Inspired from {@link https://stackoverflow.com/a/49729715/3639892}.
|
|
3308
|
+
*
|
|
3276
3309
|
* Can be a solution to not have trailing zero as when
|
|
3277
|
-
*
|
|
3310
|
+
* using toFixed or toPrecision.
|
|
3278
3311
|
* '+number.toFixed(precision)' does not pass all the tests...
|
|
3279
3312
|
*
|
|
3280
3313
|
* @param {number} number The number to round.
|
|
@@ -3284,7 +3317,7 @@ export declare class Point3D {
|
|
|
3284
3317
|
export declare function precisionRound(number: number, precision: number): number;
|
|
3285
3318
|
|
|
3286
3319
|
/**
|
|
3287
|
-
* Rescale Slope and Intercept
|
|
3320
|
+
* Rescale Slope and Intercept.
|
|
3288
3321
|
*/
|
|
3289
3322
|
export declare class RescaleSlopeAndIntercept {
|
|
3290
3323
|
/**
|
|
@@ -3582,7 +3615,7 @@ export declare class Spacing {
|
|
|
3582
3615
|
/**
|
|
3583
3616
|
* Convert sRGB to CIE LAB (standard illuminant D65).
|
|
3584
3617
|
*
|
|
3585
|
-
* @param {RGB} triplet sRGB triplet as {r,g,b}.
|
|
3618
|
+
* @param {RGB} triplet 'sRGB' triplet as {r,g,b}.
|
|
3586
3619
|
* @returns {object} CIE LAB triplet as {l,a,b}.
|
|
3587
3620
|
*/
|
|
3588
3621
|
export declare function srgbToCielab(triplet: RGB): object;
|
|
@@ -3643,7 +3676,8 @@ export declare class Tag {
|
|
|
3643
3676
|
isWithVR(): boolean;
|
|
3644
3677
|
/**
|
|
3645
3678
|
* Is the tag group a private tag group ?
|
|
3646
|
-
*
|
|
3679
|
+
*
|
|
3680
|
+
* See: {@link http://dicom.nema.org/medical/dicom/2015a/output/html/part05.html#sect_7.8}.
|
|
3647
3681
|
*
|
|
3648
3682
|
* @returns {boolean} True if the tag group is private,
|
|
3649
3683
|
* ie if its group is an odd number.
|
|
@@ -3829,7 +3863,8 @@ export declare class Vector3D {
|
|
|
3829
3863
|
* vector that is perpendicular to both a and b.
|
|
3830
3864
|
* If both vectors are parallel, the cross product is a zero vector.
|
|
3831
3865
|
*
|
|
3832
|
-
* @
|
|
3866
|
+
* Ref: {@link https://en.wikipedia.org/wiki/Cross_product}.
|
|
3867
|
+
*
|
|
3833
3868
|
* @param {Vector3D} vector3D The input vector.
|
|
3834
3869
|
* @returns {Vector3D} The result vector.
|
|
3835
3870
|
*/
|
|
@@ -3837,7 +3872,8 @@ export declare class Vector3D {
|
|
|
3837
3872
|
/**
|
|
3838
3873
|
* Get the dot product with another Vector3D.
|
|
3839
3874
|
*
|
|
3840
|
-
* @
|
|
3875
|
+
* Ref: {@link https://en.wikipedia.org/wiki/Dot_product}.
|
|
3876
|
+
*
|
|
3841
3877
|
* @param {Vector3D} vector3D The input vector.
|
|
3842
3878
|
* @returns {number} The dot product.
|
|
3843
3879
|
*/
|
|
@@ -4027,7 +4063,7 @@ export declare class View {
|
|
|
4027
4063
|
*
|
|
4028
4064
|
* @param {Point} position The new position.
|
|
4029
4065
|
* @param {boolean} silent Flag to fire event or not.
|
|
4030
|
-
* @returns {boolean} False if not in bounds
|
|
4066
|
+
* @returns {boolean} False if not in bounds.
|
|
4031
4067
|
* @fires View#positionchange
|
|
4032
4068
|
*/
|
|
4033
4069
|
setCurrentPosition(position: Point, silent: boolean): boolean;
|
|
@@ -4300,7 +4336,7 @@ export declare class ViewController {
|
|
|
4300
4336
|
/**
|
|
4301
4337
|
* Get the image rescaled value at the input position.
|
|
4302
4338
|
*
|
|
4303
|
-
* @param {Point} position
|
|
4339
|
+
* @param {Point} position The input position.
|
|
4304
4340
|
* @returns {number|undefined} The image value or undefined if out of bounds
|
|
4305
4341
|
* or no quantifiable (for ex RGB).
|
|
4306
4342
|
*/
|
|
@@ -4308,7 +4344,7 @@ export declare class ViewController {
|
|
|
4308
4344
|
/**
|
|
4309
4345
|
* Get the image pixel unit.
|
|
4310
4346
|
*
|
|
4311
|
-
* @returns {string} The unit
|
|
4347
|
+
* @returns {string} The unit.
|
|
4312
4348
|
*/
|
|
4313
4349
|
getPixelUnit(): string;
|
|
4314
4350
|
/**
|
|
@@ -4545,6 +4581,18 @@ export declare class ViewController {
|
|
|
4545
4581
|
* @param {alphaFn} func The function.
|
|
4546
4582
|
*/
|
|
4547
4583
|
setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void;
|
|
4584
|
+
/**
|
|
4585
|
+
* Bind the view image to the provided layer.
|
|
4586
|
+
*
|
|
4587
|
+
* @param {ViewLayer} viewLayer The layer to bind.
|
|
4588
|
+
*/
|
|
4589
|
+
bindImageAndLayer(viewLayer: ViewLayer): void;
|
|
4590
|
+
/**
|
|
4591
|
+
* Unbind the view image to the provided layer.
|
|
4592
|
+
*
|
|
4593
|
+
* @param {ViewLayer} viewLayer The layer to bind.
|
|
4594
|
+
*/
|
|
4595
|
+
unbindImageAndLayer(viewLayer: ViewLayer): void;
|
|
4548
4596
|
/**
|
|
4549
4597
|
* Add an event listener to this class.
|
|
4550
4598
|
*
|
|
@@ -4623,6 +4671,14 @@ export declare class ViewLayer {
|
|
|
4623
4671
|
* @function
|
|
4624
4672
|
*/
|
|
4625
4673
|
onimageset: (event: object) => void;
|
|
4674
|
+
/**
|
|
4675
|
+
* Bind this layer to the view image.
|
|
4676
|
+
*/
|
|
4677
|
+
bindImage(): void;
|
|
4678
|
+
/**
|
|
4679
|
+
* Unbind this layer to the view image.
|
|
4680
|
+
*/
|
|
4681
|
+
unbindImage(): void;
|
|
4626
4682
|
/**
|
|
4627
4683
|
* Handle an image content change event.
|
|
4628
4684
|
*
|
|
@@ -4643,6 +4699,10 @@ export declare class ViewLayer {
|
|
|
4643
4699
|
* @returns {string} The string id.
|
|
4644
4700
|
*/
|
|
4645
4701
|
getId(): string;
|
|
4702
|
+
/**
|
|
4703
|
+
* Remove the HTML element from the DOM.
|
|
4704
|
+
*/
|
|
4705
|
+
removeFromDOM(): void;
|
|
4646
4706
|
/**
|
|
4647
4707
|
* Get the layer base size (without scale).
|
|
4648
4708
|
*
|
|
@@ -4768,14 +4828,14 @@ export declare class ViewLayer {
|
|
|
4768
4828
|
isVisible(): boolean;
|
|
4769
4829
|
/**
|
|
4770
4830
|
* Draw the content (imageData) of the layer.
|
|
4771
|
-
* The imageData variable needs to be set
|
|
4831
|
+
* The imageData variable needs to be set.
|
|
4772
4832
|
*
|
|
4773
4833
|
* @fires App#renderstart
|
|
4774
4834
|
* @fires App#renderend
|
|
4775
4835
|
*/
|
|
4776
4836
|
draw(): void;
|
|
4777
4837
|
/**
|
|
4778
|
-
* Initialise the layer: set the canvas and context
|
|
4838
|
+
* Initialise the layer: set the canvas and context.
|
|
4779
4839
|
*
|
|
4780
4840
|
* @param {Scalar2D} size The image size as {x,y}.
|
|
4781
4841
|
* @param {Scalar2D} spacing The image spacing as {x,y}.
|
|
@@ -4785,11 +4845,11 @@ export declare class ViewLayer {
|
|
|
4785
4845
|
/**
|
|
4786
4846
|
* Fit the layer to its parent container.
|
|
4787
4847
|
*
|
|
4788
|
-
* @param {number}
|
|
4848
|
+
* @param {number} divToWorldSizeRatio The div to world size ratio.
|
|
4789
4849
|
* @param {Scalar2D} fitSize The fit size as {x,y}.
|
|
4790
4850
|
* @param {Scalar2D} fitOffset The fit offset as {x,y}.
|
|
4791
4851
|
*/
|
|
4792
|
-
fitToContainer(
|
|
4852
|
+
fitToContainer(divToWorldSizeRatio: number, fitSize: Scalar2D, fitOffset: Scalar2D): void;
|
|
4793
4853
|
/**
|
|
4794
4854
|
* Enable and listen to container interaction events.
|
|
4795
4855
|
*/
|