dwv 0.32.1 → 0.32.2-beta.0
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 +300 -65
- package/dist/dwv.min.js +1 -1
- package/dist/dwv.min.js.map +1 -1
- package/package.json +1 -1
package/dist/dwv.d.ts
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function addTagsToDictionary(group: string, tags: object): void;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* List of ViewConfigs indexed by dataIds.
|
|
11
|
+
*
|
|
12
|
+
* @typedef {Object<string, ViewConfig[]>} DataViewConfigs
|
|
13
|
+
*/
|
|
9
14
|
/**
|
|
10
15
|
* Main application class.
|
|
11
16
|
*
|
|
@@ -153,25 +158,13 @@ export declare class App {
|
|
|
153
158
|
*
|
|
154
159
|
* @param {object} cmd The command to add.
|
|
155
160
|
* @fires UndoStack#undoadd
|
|
161
|
+
* @function
|
|
156
162
|
*/
|
|
157
163
|
addToUndoStack: (cmd: object) => void;
|
|
158
164
|
/**
|
|
159
165
|
* Initialise the application.
|
|
160
166
|
*
|
|
161
|
-
* @param {
|
|
162
|
-
* - `dataViewConfigs`: data indexed object containing the data view
|
|
163
|
-
* configurations in the form of a list of objects containing:
|
|
164
|
-
* - divId: the HTML div id
|
|
165
|
-
* - orientation: optional 'axial', 'coronal' or 'sagittal' orientation
|
|
166
|
-
* string (default undefined keeps the original slice order)
|
|
167
|
-
* - `binders`: array of layerGroup binders
|
|
168
|
-
* - `tools`: tool name indexed object containing individual tool
|
|
169
|
-
* configurations in the form of a list of objects containing:
|
|
170
|
-
* - options: array of tool options
|
|
171
|
-
* - `viewOnFirstLoadItem`: boolean flag to trigger the first data render
|
|
172
|
-
* after the first loaded data or not
|
|
173
|
-
* - `defaultCharacterSet`: the default chraracter set string used for DICOM
|
|
174
|
-
* parsing
|
|
167
|
+
* @param {AppOptions} opt The application options
|
|
175
168
|
* @example
|
|
176
169
|
* // create the dwv app
|
|
177
170
|
* const app = new dwv.App();
|
|
@@ -199,7 +192,7 @@ export declare class App {
|
|
|
199
192
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
200
193
|
* ]);
|
|
201
194
|
*/
|
|
202
|
-
init(opt:
|
|
195
|
+
init(opt: AppOptions): void;
|
|
203
196
|
/**
|
|
204
197
|
* Reset the application.
|
|
205
198
|
*/
|
|
@@ -227,19 +220,20 @@ export declare class App {
|
|
|
227
220
|
/**
|
|
228
221
|
* Load a list of files. Can be image files or a state file.
|
|
229
222
|
*
|
|
230
|
-
* @param {
|
|
223
|
+
* @param {File[]} files The list of files to load.
|
|
231
224
|
* @fires App#loadstart
|
|
232
225
|
* @fires App#loadprogress
|
|
233
226
|
* @fires App#loaditem
|
|
234
227
|
* @fires App#loadend
|
|
235
228
|
* @fires App#loaderror
|
|
236
229
|
* @fires App#loadabort
|
|
230
|
+
* @function
|
|
237
231
|
*/
|
|
238
|
-
loadFiles: (files:
|
|
232
|
+
loadFiles: (files: File[]) => void;
|
|
239
233
|
/**
|
|
240
234
|
* Load a list of URLs. Can be image files or a state file.
|
|
241
235
|
*
|
|
242
|
-
* @param {
|
|
236
|
+
* @param {string[]} urls The list of urls to load.
|
|
243
237
|
* @param {object} [options] The options object, can contain:
|
|
244
238
|
* - requestHeaders: an array of {name, value} to use as request headers
|
|
245
239
|
* - withCredentials: boolean xhr.withCredentials flag to pass to the request
|
|
@@ -250,13 +244,15 @@ export declare class App {
|
|
|
250
244
|
* @fires App#loadend
|
|
251
245
|
* @fires App#loaderror
|
|
252
246
|
* @fires App#loadabort
|
|
247
|
+
* @function
|
|
253
248
|
*/
|
|
254
|
-
loadURLs: (urls:
|
|
249
|
+
loadURLs: (urls: string[], options?: object) => void;
|
|
255
250
|
/**
|
|
256
251
|
* Load from an input uri.
|
|
257
252
|
*
|
|
258
253
|
* @param {string} uri The input uri, for example: 'window.location.href'.
|
|
259
254
|
* @param {object} [options] Optional url request options.
|
|
255
|
+
* @function
|
|
260
256
|
*/
|
|
261
257
|
loadFromUri: (uri: string, options?: object) => void;
|
|
262
258
|
/**
|
|
@@ -270,6 +266,7 @@ export declare class App {
|
|
|
270
266
|
* @fires App#loadend
|
|
271
267
|
* @fires App#loaderror
|
|
272
268
|
* @fires App#loadabort
|
|
269
|
+
* @function
|
|
273
270
|
*/
|
|
274
271
|
loadImageObject: (data: any[]) => void;
|
|
275
272
|
/**
|
|
@@ -289,15 +286,20 @@ export declare class App {
|
|
|
289
286
|
* Get the data view config.
|
|
290
287
|
* Carefull, returns a reference, do not modify without resetting.
|
|
291
288
|
*
|
|
292
|
-
* @returns {
|
|
289
|
+
* @returns {Object<string, ViewConfig[]>} The configuration list.
|
|
293
290
|
*/
|
|
294
|
-
|
|
291
|
+
getDataViewConfigs(): {
|
|
292
|
+
[x: string]: ViewConfig[];
|
|
293
|
+
};
|
|
295
294
|
/**
|
|
296
|
-
* Set the data view configuration
|
|
295
|
+
* Set the data view configuration.
|
|
296
|
+
* Resets the stage and recreates all the views.
|
|
297
297
|
*
|
|
298
|
-
* @param {
|
|
298
|
+
* @param {Object<string, ViewConfig[]>} configs The configuration list.
|
|
299
299
|
*/
|
|
300
|
-
|
|
300
|
+
setDataViewConfigs(configs: {
|
|
301
|
+
[x: string]: ViewConfig[];
|
|
302
|
+
}): void;
|
|
301
303
|
/**
|
|
302
304
|
* Set the layer groups binders.
|
|
303
305
|
*
|
|
@@ -354,6 +356,8 @@ export declare class App {
|
|
|
354
356
|
* Handle resize: fit the display to the window.
|
|
355
357
|
* To be called once the image is loaded.
|
|
356
358
|
* Can be connected to a window 'resize' event.
|
|
359
|
+
*
|
|
360
|
+
* @function
|
|
357
361
|
*/
|
|
358
362
|
onResize: () => void;
|
|
359
363
|
/**
|
|
@@ -361,6 +365,7 @@ export declare class App {
|
|
|
361
365
|
*
|
|
362
366
|
* @param {KeyboardEvent} event The key down event.
|
|
363
367
|
* @fires App#keydown
|
|
368
|
+
* @function
|
|
364
369
|
*/
|
|
365
370
|
onKeydown: (event: KeyboardEvent) => void;
|
|
366
371
|
/**
|
|
@@ -375,6 +380,7 @@ export declare class App {
|
|
|
375
380
|
* @param {KeyboardEvent} event The key down event.
|
|
376
381
|
* @fires UndoStack#undo
|
|
377
382
|
* @fires UndoStack#redo
|
|
383
|
+
* @function
|
|
378
384
|
*/
|
|
379
385
|
defaultOnKeydown: (event: KeyboardEvent) => void;
|
|
380
386
|
/**
|
|
@@ -388,9 +394,9 @@ export declare class App {
|
|
|
388
394
|
/**
|
|
389
395
|
* Set the colour map.
|
|
390
396
|
*
|
|
391
|
-
* @param {string}
|
|
397
|
+
* @param {string} name The colour map name.
|
|
392
398
|
*/
|
|
393
|
-
setColourMap(
|
|
399
|
+
setColourMap(name: string): void;
|
|
394
400
|
/**
|
|
395
401
|
* Set the window/level preset.
|
|
396
402
|
*
|
|
@@ -436,6 +442,51 @@ export declare class App {
|
|
|
436
442
|
#private;
|
|
437
443
|
}
|
|
438
444
|
|
|
445
|
+
/**
|
|
446
|
+
* Application options.
|
|
447
|
+
*/
|
|
448
|
+
export declare class AppOptions {
|
|
449
|
+
/**
|
|
450
|
+
* DataId indexed object containing the data view configurations.
|
|
451
|
+
*
|
|
452
|
+
* @type {Object<string, ViewConfig[]>}
|
|
453
|
+
*/
|
|
454
|
+
dataViewConfigs: {
|
|
455
|
+
[x: string]: ViewConfig[];
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Tool name indexed object containing individual tool configurations.
|
|
459
|
+
*
|
|
460
|
+
* @type {Object<string, {options: string[]}>}
|
|
461
|
+
*/
|
|
462
|
+
tools: {
|
|
463
|
+
[x: string]: {
|
|
464
|
+
options: string[];
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Optional array of layerGroup binder names.
|
|
469
|
+
*
|
|
470
|
+
* @type {string[]|undefined}
|
|
471
|
+
*/
|
|
472
|
+
binders: string[] | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* Optional boolean flag to trigger the first data render
|
|
475
|
+
* after the first loaded data or not. Defaults to true;
|
|
476
|
+
*
|
|
477
|
+
* @type {boolean|undefined}
|
|
478
|
+
*/
|
|
479
|
+
viewOnFirstLoadItem: boolean | undefined;
|
|
480
|
+
/**
|
|
481
|
+
* Optional default chraracter set string used for DICOM parsing if
|
|
482
|
+
* not passed in DICOM file.
|
|
483
|
+
* Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings
|
|
484
|
+
*
|
|
485
|
+
* @type {string|undefined}
|
|
486
|
+
*/
|
|
487
|
+
defaultCharacterSet: string | undefined;
|
|
488
|
+
}
|
|
489
|
+
|
|
439
490
|
/**
|
|
440
491
|
* Build a multipart message.
|
|
441
492
|
* See: https://en.wikipedia.org/wiki/MIME#Multipart_messages
|
|
@@ -448,6 +499,31 @@ export declare class App {
|
|
|
448
499
|
*/
|
|
449
500
|
export declare function buildMultipart(parts: any[], boundary: string): Uint8Array;
|
|
450
501
|
|
|
502
|
+
/**
|
|
503
|
+
* Colour map: red, green and blue components
|
|
504
|
+
* to associate with intensity values.
|
|
505
|
+
*/
|
|
506
|
+
export declare class ColourMap {
|
|
507
|
+
/**
|
|
508
|
+
* Red component: 256 values in the [0, 255] range.
|
|
509
|
+
*
|
|
510
|
+
* @type {number[]}
|
|
511
|
+
*/
|
|
512
|
+
red: number[];
|
|
513
|
+
/**
|
|
514
|
+
* Green component: 256 values in the [0, 255] range.
|
|
515
|
+
*
|
|
516
|
+
* @type {number[]}
|
|
517
|
+
*/
|
|
518
|
+
green: number[];
|
|
519
|
+
/**
|
|
520
|
+
* Blue component: 256 values in the [0, 255] range.
|
|
521
|
+
*
|
|
522
|
+
* @type {number[]}
|
|
523
|
+
*/
|
|
524
|
+
blue: number[];
|
|
525
|
+
}
|
|
526
|
+
|
|
451
527
|
/**
|
|
452
528
|
* Create an Image from DICOM elements.
|
|
453
529
|
*
|
|
@@ -483,6 +559,64 @@ export declare namespace customUI {
|
|
|
483
559
|
export function openRoiDialog(data: any, callback: Function): void;
|
|
484
560
|
}
|
|
485
561
|
|
|
562
|
+
/**
|
|
563
|
+
* DICOM data element.
|
|
564
|
+
*/
|
|
565
|
+
export declare class DataElement {
|
|
566
|
+
/**
|
|
567
|
+
* @param {string} vr The element VR (Value Representation).
|
|
568
|
+
*/
|
|
569
|
+
constructor(vr: string);
|
|
570
|
+
/**
|
|
571
|
+
* The element Value Representation.
|
|
572
|
+
*
|
|
573
|
+
* @type {string}
|
|
574
|
+
*/
|
|
575
|
+
vr: string;
|
|
576
|
+
/**
|
|
577
|
+
* The element value.
|
|
578
|
+
*
|
|
579
|
+
* @type {Array}
|
|
580
|
+
*/
|
|
581
|
+
value: any[];
|
|
582
|
+
/**
|
|
583
|
+
* The element dicom tag.
|
|
584
|
+
*
|
|
585
|
+
* @type {Tag}
|
|
586
|
+
*/
|
|
587
|
+
tag: Tag;
|
|
588
|
+
/**
|
|
589
|
+
* The element Value Length.
|
|
590
|
+
*
|
|
591
|
+
* @type {number}
|
|
592
|
+
*/
|
|
593
|
+
vl: number;
|
|
594
|
+
/**
|
|
595
|
+
* Flag to know if defined or undefined sequence length.
|
|
596
|
+
*
|
|
597
|
+
* @type {boolean}
|
|
598
|
+
*/
|
|
599
|
+
undefinedLength: boolean;
|
|
600
|
+
/**
|
|
601
|
+
* The element start offset.
|
|
602
|
+
*
|
|
603
|
+
* @type {number}
|
|
604
|
+
*/
|
|
605
|
+
startOffset: number;
|
|
606
|
+
/**
|
|
607
|
+
* The element end offset.
|
|
608
|
+
*
|
|
609
|
+
* @type {number}
|
|
610
|
+
*/
|
|
611
|
+
endOffset: number;
|
|
612
|
+
/**
|
|
613
|
+
* The sequence items.
|
|
614
|
+
*
|
|
615
|
+
* @type {Array}
|
|
616
|
+
*/
|
|
617
|
+
items: any[];
|
|
618
|
+
}
|
|
619
|
+
|
|
486
620
|
/**
|
|
487
621
|
* Decoder scripts to be passed to web workers for image decoding.
|
|
488
622
|
*/
|
|
@@ -553,14 +687,16 @@ export declare class DicomParser {
|
|
|
553
687
|
*/
|
|
554
688
|
setDecoderCharacterSet(characterSet: string): void;
|
|
555
689
|
/**
|
|
556
|
-
* Get the
|
|
690
|
+
* Get the DICOM data elements.
|
|
557
691
|
*
|
|
558
|
-
* @returns {
|
|
692
|
+
* @returns {Object<string, DataElement>} The data elements.
|
|
559
693
|
*/
|
|
560
|
-
getDicomElements():
|
|
694
|
+
getDicomElements(): {
|
|
695
|
+
[x: string]: DataElement;
|
|
696
|
+
};
|
|
561
697
|
/**
|
|
562
698
|
* Parse the complete DICOM file (given as input to the class).
|
|
563
|
-
* Fills in the member object '
|
|
699
|
+
* Fills in the member object 'dataElements'.
|
|
564
700
|
*
|
|
565
701
|
* @param {ArrayBuffer} buffer The input array buffer.
|
|
566
702
|
*/
|
|
@@ -571,16 +707,27 @@ export declare class DicomParser {
|
|
|
571
707
|
/**
|
|
572
708
|
* DICOM writer.
|
|
573
709
|
*
|
|
574
|
-
*
|
|
710
|
+
* @example
|
|
711
|
+
* // XMLHttpRequest onload callback
|
|
712
|
+
* const onload = function (event) {
|
|
575
713
|
* const parser = new DicomParser();
|
|
576
|
-
* parser.parse(
|
|
577
|
-
*
|
|
714
|
+
* parser.parse(event.target.response);
|
|
715
|
+
* // create writer with parser data elements
|
|
578
716
|
* const writer = new DicomWriter(parser.getDicomElements());
|
|
717
|
+
* // create modified buffer and put it in a Blol
|
|
579
718
|
* const blob = new Blob([writer.getBuffer()], {type: 'application/dicom'});
|
|
580
|
-
*
|
|
719
|
+
* // example download link
|
|
581
720
|
* const element = document.getElementById("download");
|
|
582
721
|
* element.href = URL.createObjectURL(blob);
|
|
583
722
|
* element.download = "anonym.dcm";
|
|
723
|
+
* };
|
|
724
|
+
* // DICOM file request
|
|
725
|
+
* const request = new XMLHttpRequest();
|
|
726
|
+
* const url = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm';
|
|
727
|
+
* request.open('GET', url);
|
|
728
|
+
* request.responseType = 'arraybuffer';
|
|
729
|
+
* request.onload = onload;
|
|
730
|
+
* request.send();
|
|
584
731
|
*/
|
|
585
732
|
export declare class DicomWriter {
|
|
586
733
|
/**
|
|
@@ -591,10 +738,16 @@ export declare class DicomWriter {
|
|
|
591
738
|
setUseUnVrForPrivateSq(flag: boolean): void;
|
|
592
739
|
/**
|
|
593
740
|
* Set the writing rules.
|
|
741
|
+
* List of writer rules indexed by either `default`, tagName or groupName.
|
|
742
|
+
* Each DICOM element will be checked to see if a rule is applicable.
|
|
743
|
+
* First checked by tagName and then by groupName,
|
|
744
|
+
* if nothing is found the default rule is applied.
|
|
594
745
|
*
|
|
595
|
-
* @param {
|
|
746
|
+
* @param {Object<string, WriterRule>} rules The input rules.
|
|
596
747
|
*/
|
|
597
|
-
setRules(rules:
|
|
748
|
+
setRules(rules: {
|
|
749
|
+
[x: string]: WriterRule;
|
|
750
|
+
}): void;
|
|
598
751
|
/**
|
|
599
752
|
* Use a TextEncoder instead of the default text decoder.
|
|
600
753
|
*/
|
|
@@ -603,13 +756,23 @@ export declare class DicomWriter {
|
|
|
603
756
|
* Use default anonymisation rules.
|
|
604
757
|
*/
|
|
605
758
|
useDefaultAnonymisationRules(): void;
|
|
759
|
+
/**
|
|
760
|
+
* Get the element to write according to the class rules.
|
|
761
|
+
* Priority order: tagName, groupName, default.
|
|
762
|
+
*
|
|
763
|
+
* @param {DataElement} element The element to check
|
|
764
|
+
* @returns {DataElement|null} The element to write, can be null.
|
|
765
|
+
*/
|
|
766
|
+
getElementToWrite(element: DataElement): DataElement | null;
|
|
606
767
|
/**
|
|
607
768
|
* Get the ArrayBuffer corresponding to input DICOM elements.
|
|
608
769
|
*
|
|
609
|
-
* @param {
|
|
770
|
+
* @param {Object<string, DataElement>} dataElements The elements to write.
|
|
610
771
|
* @returns {ArrayBuffer} The elements as a buffer.
|
|
611
772
|
*/
|
|
612
|
-
getBuffer(
|
|
773
|
+
getBuffer(dataElements: {
|
|
774
|
+
[x: string]: DataElement;
|
|
775
|
+
}): ArrayBuffer;
|
|
613
776
|
#private;
|
|
614
777
|
}
|
|
615
778
|
|
|
@@ -984,6 +1147,12 @@ export declare class Geometry {
|
|
|
984
1147
|
#private;
|
|
985
1148
|
}
|
|
986
1149
|
|
|
1150
|
+
/**
|
|
1151
|
+
* List of DICOM data elements indexed via a 8 character string formed from
|
|
1152
|
+
* the group and element numbers.
|
|
1153
|
+
*
|
|
1154
|
+
* @typedef {Object<string, DataElement>} DataElements
|
|
1155
|
+
*/
|
|
987
1156
|
/**
|
|
988
1157
|
* Get the version of the library.
|
|
989
1158
|
*
|
|
@@ -992,15 +1161,20 @@ export declare class Geometry {
|
|
|
992
1161
|
export declare function getDwvVersion(): string;
|
|
993
1162
|
|
|
994
1163
|
/**
|
|
995
|
-
* Get the DICOM elements from a DICOM json tags object.
|
|
1164
|
+
* Get the DICOM elements from a 'simple' DICOM json tags object.
|
|
996
1165
|
* The json is a simplified version of the oficial DICOM json with
|
|
997
1166
|
* tag names instead of keys and direct values (no value property) for
|
|
998
|
-
* simple tags.
|
|
1167
|
+
* simple tags. See synthetic test data (in tests/dicom) for examples.
|
|
999
1168
|
*
|
|
1000
|
-
* @param {
|
|
1001
|
-
*
|
|
1169
|
+
* @param {Object<string, any>} jsonTags The DICOM
|
|
1170
|
+
* json tags object.
|
|
1171
|
+
* @returns {Object<string, DataElement>} The DICOM elements.
|
|
1002
1172
|
*/
|
|
1003
|
-
export declare function getElementsFromJSONTags(jsonTags:
|
|
1173
|
+
export declare function getElementsFromJSONTags(jsonTags: {
|
|
1174
|
+
[x: string]: any;
|
|
1175
|
+
}): {
|
|
1176
|
+
[x: string]: DataElement;
|
|
1177
|
+
};
|
|
1004
1178
|
|
|
1005
1179
|
/**
|
|
1006
1180
|
* Get the name of an image orientation patient.
|
|
@@ -1058,6 +1232,16 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation
|
|
|
1058
1232
|
*/
|
|
1059
1233
|
export declare function getUID(tagName: string): string;
|
|
1060
1234
|
|
|
1235
|
+
/**
|
|
1236
|
+
* Check that an input buffer includes the DICOM prefix 'DICM'
|
|
1237
|
+
* after the 128 bytes preamble.
|
|
1238
|
+
* Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1}
|
|
1239
|
+
*
|
|
1240
|
+
* @param {ArrayBuffer} buffer The buffer to check.
|
|
1241
|
+
* @returns {boolean} True if the buffer includes the prefix.
|
|
1242
|
+
*/
|
|
1243
|
+
export declare function hasDicomPrefix(buffer: ArrayBuffer): boolean;
|
|
1244
|
+
|
|
1061
1245
|
export declare namespace i18n {
|
|
1062
1246
|
/**
|
|
1063
1247
|
* Get the translated text.
|
|
@@ -1082,7 +1266,7 @@ export declare namespace i18n {
|
|
|
1082
1266
|
* const dicomParser = new dwv.DicomParser();
|
|
1083
1267
|
* dicomParser.parse(event.target.response);
|
|
1084
1268
|
* // create the image object
|
|
1085
|
-
* const image = createImage(dicomParser.getDicomElements());
|
|
1269
|
+
* const image = dwv.createImage(dicomParser.getDicomElements());
|
|
1086
1270
|
* // result div
|
|
1087
1271
|
* const div = document.getElementById('dwv');
|
|
1088
1272
|
* // display the image size
|
|
@@ -1692,6 +1876,7 @@ export declare class LayerGroup {
|
|
|
1692
1876
|
* Update layers (but not the active view layer) to a position change.
|
|
1693
1877
|
*
|
|
1694
1878
|
* @param {object} event The position change event.
|
|
1879
|
+
* @function
|
|
1695
1880
|
*/
|
|
1696
1881
|
updateLayersToPositionChange: (event: object) => void;
|
|
1697
1882
|
/**
|
|
@@ -1796,14 +1981,10 @@ export declare namespace logger {
|
|
|
1796
1981
|
/**
|
|
1797
1982
|
* List of available lookup tables (lut).
|
|
1798
1983
|
*
|
|
1799
|
-
* @type {Object<string,
|
|
1984
|
+
* @type {Object<string, ColourMap>}
|
|
1800
1985
|
*/
|
|
1801
|
-
export declare const
|
|
1802
|
-
[x: string]:
|
|
1803
|
-
red: number[];
|
|
1804
|
-
green: number[];
|
|
1805
|
-
blue: number[];
|
|
1806
|
-
};
|
|
1986
|
+
export declare const luts: {
|
|
1987
|
+
[x: string]: ColourMap;
|
|
1807
1988
|
};
|
|
1808
1989
|
|
|
1809
1990
|
/**
|
|
@@ -2470,10 +2651,12 @@ export declare class TagValueExtractor {
|
|
|
2470
2651
|
/**
|
|
2471
2652
|
* Get the time.
|
|
2472
2653
|
*
|
|
2473
|
-
* @param {
|
|
2654
|
+
* @param {Object<string, DataElement>} _elements The DICOM elements.
|
|
2474
2655
|
* @returns {number|undefined} The time value if available.
|
|
2475
2656
|
*/
|
|
2476
|
-
getTime(_elements:
|
|
2657
|
+
getTime(_elements: {
|
|
2658
|
+
[x: string]: DataElement;
|
|
2659
|
+
}): number | undefined;
|
|
2477
2660
|
}
|
|
2478
2661
|
|
|
2479
2662
|
/**
|
|
@@ -2507,10 +2690,10 @@ export declare class Vector3D {
|
|
|
2507
2690
|
/**
|
|
2508
2691
|
* Check for Vector3D equality.
|
|
2509
2692
|
*
|
|
2510
|
-
* @param {
|
|
2693
|
+
* @param {Vector3D} rhs The other vector to compare to.
|
|
2511
2694
|
* @returns {boolean} True if both vectors are equal.
|
|
2512
2695
|
*/
|
|
2513
|
-
equals(rhs:
|
|
2696
|
+
equals(rhs: Vector3D): boolean;
|
|
2514
2697
|
/**
|
|
2515
2698
|
* Get a string representation of the Vector3D.
|
|
2516
2699
|
*
|
|
@@ -2681,9 +2864,9 @@ export declare class View {
|
|
|
2681
2864
|
/**
|
|
2682
2865
|
* Set the default colour map.
|
|
2683
2866
|
*
|
|
2684
|
-
* @param {
|
|
2867
|
+
* @param {ColourMap} map The colour map.
|
|
2685
2868
|
*/
|
|
2686
|
-
setDefaultColourMap(map:
|
|
2869
|
+
setDefaultColourMap(map: ColourMap): void;
|
|
2687
2870
|
/**
|
|
2688
2871
|
* Add window presets to the existing ones.
|
|
2689
2872
|
*
|
|
@@ -2693,16 +2876,16 @@ export declare class View {
|
|
|
2693
2876
|
/**
|
|
2694
2877
|
* Get the colour map of the image.
|
|
2695
2878
|
*
|
|
2696
|
-
* @returns {
|
|
2879
|
+
* @returns {ColourMap} The colour map of the image.
|
|
2697
2880
|
*/
|
|
2698
|
-
getColourMap():
|
|
2881
|
+
getColourMap(): ColourMap;
|
|
2699
2882
|
/**
|
|
2700
2883
|
* Set the colour map of the image.
|
|
2701
2884
|
*
|
|
2702
|
-
* @param {
|
|
2885
|
+
* @param {ColourMap} map The colour map of the image.
|
|
2703
2886
|
* @fires View#colourchange
|
|
2704
2887
|
*/
|
|
2705
|
-
setColourMap(map:
|
|
2888
|
+
setColourMap(map: ColourMap): void;
|
|
2706
2889
|
/**
|
|
2707
2890
|
* Get the current position.
|
|
2708
2891
|
*
|
|
@@ -2847,6 +3030,38 @@ export declare class View {
|
|
|
2847
3030
|
#private;
|
|
2848
3031
|
}
|
|
2849
3032
|
|
|
3033
|
+
/**
|
|
3034
|
+
* View configuration: mainly defines the ´divId´
|
|
3035
|
+
* of the associated HTML div.
|
|
3036
|
+
*/
|
|
3037
|
+
export declare class ViewConfig {
|
|
3038
|
+
/**
|
|
3039
|
+
* Associated HTML div id.
|
|
3040
|
+
*
|
|
3041
|
+
* @type {string}
|
|
3042
|
+
*/
|
|
3043
|
+
divId: string;
|
|
3044
|
+
/**
|
|
3045
|
+
* Optional orientation of the data; 'axial', 'coronal' or 'sagittal'.
|
|
3046
|
+
* If undefined, will use the data aquisition plane.
|
|
3047
|
+
*
|
|
3048
|
+
* @type {string|undefined}
|
|
3049
|
+
*/
|
|
3050
|
+
orientation: string | undefined;
|
|
3051
|
+
/**
|
|
3052
|
+
* Optional view colour map.
|
|
3053
|
+
*
|
|
3054
|
+
* @type {ColourMap|undefined}
|
|
3055
|
+
*/
|
|
3056
|
+
colourMap: ColourMap | undefined;
|
|
3057
|
+
/**
|
|
3058
|
+
* Optional layer opacity; in [0, 1] range.
|
|
3059
|
+
*
|
|
3060
|
+
* @type {number|undefined}
|
|
3061
|
+
*/
|
|
3062
|
+
opacity: number | undefined;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
2850
3065
|
/**
|
|
2851
3066
|
* View controller.
|
|
2852
3067
|
*/
|
|
@@ -3166,15 +3381,15 @@ export declare class ViewController {
|
|
|
3166
3381
|
/**
|
|
3167
3382
|
* Get the colour map.
|
|
3168
3383
|
*
|
|
3169
|
-
* @returns {
|
|
3384
|
+
* @returns {ColourMap} The colour map.
|
|
3170
3385
|
*/
|
|
3171
|
-
getColourMap():
|
|
3386
|
+
getColourMap(): ColourMap;
|
|
3172
3387
|
/**
|
|
3173
3388
|
* Set the colour map.
|
|
3174
3389
|
*
|
|
3175
|
-
* @param {
|
|
3390
|
+
* @param {ColourMap} colourMap The colour map.
|
|
3176
3391
|
*/
|
|
3177
|
-
setColourMap(colourMap:
|
|
3392
|
+
setColourMap(colourMap: ColourMap): void;
|
|
3178
3393
|
/**
|
|
3179
3394
|
* @callback alphaFn@callback alphaFn
|
|
3180
3395
|
* @param {object} value The pixel value.
|
|
@@ -3256,12 +3471,14 @@ export declare class ViewLayer {
|
|
|
3256
3471
|
* Handle an image set event.
|
|
3257
3472
|
*
|
|
3258
3473
|
* @param {object} event The event.
|
|
3474
|
+
* @function
|
|
3259
3475
|
*/
|
|
3260
3476
|
onimageset: (event: object) => void;
|
|
3261
3477
|
/**
|
|
3262
3478
|
* Handle an image change event.
|
|
3263
3479
|
*
|
|
3264
3480
|
* @param {object} event The event.
|
|
3481
|
+
* @function
|
|
3265
3482
|
*/
|
|
3266
3483
|
onimagechange: (event: object) => void;
|
|
3267
3484
|
/**
|
|
@@ -3567,4 +3784,22 @@ export declare class WindowLut {
|
|
|
3567
3784
|
#private;
|
|
3568
3785
|
}
|
|
3569
3786
|
|
|
3787
|
+
/**
|
|
3788
|
+
* Writer rule.
|
|
3789
|
+
*/
|
|
3790
|
+
export declare class WriterRule {
|
|
3791
|
+
/**
|
|
3792
|
+
* Rule action: `copy`, `remove`, `clear` or `replace`.
|
|
3793
|
+
*
|
|
3794
|
+
* @type {string}
|
|
3795
|
+
*/
|
|
3796
|
+
action: string;
|
|
3797
|
+
/**
|
|
3798
|
+
* Value to use for replace action.
|
|
3799
|
+
*
|
|
3800
|
+
* @type {any}
|
|
3801
|
+
*/
|
|
3802
|
+
value: any;
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3570
3805
|
export { }
|