dwv 0.37.0-beta.2 → 0.37.0-beta.4
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/dev/bench/bench.html +94 -0
- package/dev/bench/bench.js +316 -0
- package/dev/bench/benchFunctionRunner.js +83 -0
- package/dev/bench/dataRunner.js +171 -0
- package/dev/bench/gui.js +184 -0
- package/dev/bench/listen.js +70 -0
- package/dev/bench/parsers/dwv-current.html +45 -0
- package/dev/bench/parsers/dwv-previous.html +45 -0
- package/dev/dicom/binaryPixGenerator.js +108 -0
- package/dev/dicom/dicomGenerator.js +215 -0
- package/dev/dicom/filePixGenerator.js +96 -0
- package/dev/dicom/gradSquarePixGenerator.js +107 -0
- package/dev/dicom/mprPixGenerator.js +247 -0
- package/dev/dicom/pages/anonymiser.html +86 -0
- package/dev/dicom/pages/anonymiser.js +154 -0
- package/dev/dicom/pages/generator.html +92 -0
- package/dev/dicom/pages/generator.js +329 -0
- package/dev/dicom/pages/synthetic-data.html +19 -0
- package/dev/dicom/pages/synthetic-data.js +164 -0
- package/dev/dicom/squarePixGenerator.js +233 -0
- package/dev/favicon.ico +0 -0
- package/dev/image/pages/colourmaps.html +16 -0
- package/dev/image/pages/colourmaps.js +65 -0
- package/dev/index.html +37 -0
- package/dev/pacs/dcmweb.html +80 -0
- package/dev/pacs/dcmweb.js +577 -0
- package/dev/pacs/images/acute_leukemia.png +0 -0
- package/dev/pacs/images/babymri-dcmdir.png +0 -0
- package/dev/pacs/images/babymri-rect.png +0 -0
- package/dev/pacs/images/babymri-zip.png +0 -0
- package/dev/pacs/images/babymri.png +0 -0
- package/dev/pacs/images/brainmri-png.png +0 -0
- package/dev/pacs/images/brainpet-jpg.png +0 -0
- package/dev/pacs/images/cerebrix.png +0 -0
- package/dev/pacs/images/goudurix.png +0 -0
- package/dev/pacs/images/multiframe-test1.png +0 -0
- package/dev/pacs/images/toutatix.png +0 -0
- package/dev/pacs/images/us.png +0 -0
- package/dev/pacs/index.html +97 -0
- package/dev/pacs/index.js +287 -0
- package/dev/pacs/overlays.js +51 -0
- package/dev/pacs/viewer.html +401 -0
- package/dev/pacs/viewer.js +1275 -0
- package/dev/pacs/viewer.rendertest.js +96 -0
- package/dev/pacs/viewer.ui.annot.js +607 -0
- package/dev/pacs/viewer.ui.brush.js +181 -0
- package/dev/pacs/viewer.ui.datatable.js +674 -0
- package/dev/pacs/viewer.ui.draw.js +141 -0
- package/dev/pacs/viewer.ui.icons.js +88 -0
- package/dev/pacs/viewer.ui.js +198 -0
- package/dev/pacs/viewer.ui.segment.js +1263 -0
- package/dev/visual/appgui.js +125 -0
- package/dev/visual/images/dicompyler-ct.0.jpg +0 -0
- package/dev/visual/images/gdcm-CR-MONO1-10-chest.jpg +0 -0
- package/dev/visual/images/gdcm-CT-MONO2-8-abdo.jpg +0 -0
- package/dev/visual/images/gdcm-US-RGB-8-epicard.jpg +0 -0
- package/dev/visual/images/gdcm-US-RGB-8-esopecho.jpg +0 -0
- package/dev/visual/images/leadtools-8BitsJpegLossyGrayScale.jpg +0 -0
- package/dev/visual/images/leadtools-flowers-16-mono2-rle.jpg +0 -0
- package/dev/visual/images/leadtools-flowers-8-mono2-rle.jpg +0 -0
- package/dev/visual/images/nema-ct1_j2ki.jpg +0 -0
- package/dev/visual/images/nema-ct1_jpll.jpg +0 -0
- package/dev/visual/images/nema-mr1_jply.jpg +0 -0
- package/dev/visual/images/nema-nm1_j2kr.jpg +0 -0
- package/dev/visual/images/nema-nm1_jpll.jpg +0 -0
- package/dev/visual/images/nema-nm1_jply.jpg +0 -0
- package/dev/visual/images/nema-us1_j2ki.jpg +0 -0
- package/dev/visual/images/nema-vl2_j2kr.jpg +0 -0
- package/dev/visual/images/osirix-cerebrix.jpg +0 -0
- package/dev/visual/images/osirix-goudurix.jpg +0 -0
- package/dev/visual/images/osirix-toutatix-100.jpg +0 -0
- package/dev/visual/index-jpeg.js +104 -0
- package/dev/visual/index-jpeg2000.js +103 -0
- package/dev/visual/index-rle.js +70 -0
- package/dev/visual/index.html +20 -0
- package/dev/visual/index.js +123 -0
- package/dev/visual/style.css +37 -0
- package/dist/assets/workers/jpeg2000.worker.min.js +1 -1
- package/dist/assets/workers/jpeg2000.worker.min.js.map +1 -1
- package/dist/assets/workers/jpegbaseline.worker.min.js +1 -1
- package/dist/assets/workers/jpegbaseline.worker.min.js.map +1 -1
- 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 +1 -1
- package/dist/assets/workers/resampling.worker.min.js.map +1 -1
- package/dist/dwv.d.ts +1355 -415
- 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 +20 -20
package/dist/dwv.d.ts
CHANGED
|
@@ -4,14 +4,20 @@ import Konva from 'konva';
|
|
|
4
4
|
* Add tags to the dictionary.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} group The group key.
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {Record<string, string[]>} tags The tags to add as an
|
|
8
8
|
* object indexed by element key with values as:
|
|
9
9
|
* [VR, multiplicity, TagName] (all strings).
|
|
10
10
|
*/
|
|
11
|
-
export declare function addTagsToDictionary(group: string, tags:
|
|
12
|
-
[x: string]: string[];
|
|
13
|
-
}): void;
|
|
11
|
+
export declare function addTagsToDictionary(group: string, tags: Record<string, string[]>): void;
|
|
14
12
|
|
|
13
|
+
/**
|
|
14
|
+
* @import {Point2D} from '../math/point.js';
|
|
15
|
+
* @import {Index} from '../math/index.js';
|
|
16
|
+
* @import {NumberValue} from '../math/number.js';
|
|
17
|
+
* @import {ViewController} from '../app/viewController.js';
|
|
18
|
+
* @import {PlaneHelper} from './planeHelper.js';
|
|
19
|
+
* @import {DicomCode} from '../dicom/dicomCode.js';
|
|
20
|
+
*/
|
|
15
21
|
/**
|
|
16
22
|
* Image annotation.
|
|
17
23
|
*/
|
|
@@ -29,7 +35,7 @@ export declare class Annotation {
|
|
|
29
35
|
*/
|
|
30
36
|
trackingUid: string;
|
|
31
37
|
/**
|
|
32
|
-
* Referenced image SOP
|
|
38
|
+
* Referenced image SOP instance UID.
|
|
33
39
|
*
|
|
34
40
|
* @type {string}
|
|
35
41
|
*/
|
|
@@ -67,11 +73,9 @@ export declare class Annotation {
|
|
|
67
73
|
/**
|
|
68
74
|
* Annotation quantification.
|
|
69
75
|
*
|
|
70
|
-
* @type {
|
|
76
|
+
* @type {Record<string, NumberValue>|undefined}
|
|
71
77
|
*/
|
|
72
|
-
quantification:
|
|
73
|
-
[x: string]: Value;
|
|
74
|
-
} | undefined;
|
|
78
|
+
quantification: Record<string, NumberValue> | undefined;
|
|
75
79
|
/**
|
|
76
80
|
* Text expression. Can contain variables surrounded with '{}' that will
|
|
77
81
|
* be extracted from the quantification object.
|
|
@@ -167,12 +171,10 @@ export declare class Annotation {
|
|
|
167
171
|
/**
|
|
168
172
|
* Set the annotation text expression.
|
|
169
173
|
*
|
|
170
|
-
* @param {
|
|
174
|
+
* @param {Record<string, string>} labelText The list of label
|
|
171
175
|
* texts indexed by modality.
|
|
172
176
|
*/
|
|
173
|
-
setTextExpr(labelText:
|
|
174
|
-
[x: string]: string;
|
|
175
|
-
}): void;
|
|
177
|
+
setTextExpr(labelText: Record<string, string>): void;
|
|
176
178
|
/**
|
|
177
179
|
* Get the annotation label text by applying the
|
|
178
180
|
* text expression on the current quantification.
|
|
@@ -196,7 +198,7 @@ export declare class Annotation {
|
|
|
196
198
|
/**
|
|
197
199
|
* Annotation group.
|
|
198
200
|
*/
|
|
199
|
-
export declare class AnnotationGroup {
|
|
201
|
+
export declare class AnnotationGroup extends EventTarget {
|
|
200
202
|
/**
|
|
201
203
|
* @param {Annotation[]} [list] Optional list, will
|
|
202
204
|
* create new if not provided.
|
|
@@ -279,11 +281,9 @@ export declare class AnnotationGroup {
|
|
|
279
281
|
/**
|
|
280
282
|
* Get the meta data.
|
|
281
283
|
*
|
|
282
|
-
* @returns {
|
|
284
|
+
* @returns {Record<string, any>} The meta data.
|
|
283
285
|
*/
|
|
284
|
-
getMeta():
|
|
285
|
-
[x: string]: any;
|
|
286
|
-
};
|
|
286
|
+
getMeta(): Record<string, any>;
|
|
287
287
|
/**
|
|
288
288
|
* Check if this list contains a meta data value.
|
|
289
289
|
*
|
|
@@ -305,22 +305,6 @@ export declare class AnnotationGroup {
|
|
|
305
305
|
* @param {string|object} value The value of the meta data.
|
|
306
306
|
*/
|
|
307
307
|
setMetaValue(key: string, value: string | object): void;
|
|
308
|
-
/**
|
|
309
|
-
* Add an event listener to this class.
|
|
310
|
-
*
|
|
311
|
-
* @param {string} type The event type.
|
|
312
|
-
* @param {Function} callback The function associated with the provided
|
|
313
|
-
* event type, will be called with the fired event.
|
|
314
|
-
*/
|
|
315
|
-
addEventListener(type: string, callback: Function): void;
|
|
316
|
-
/**
|
|
317
|
-
* Remove an event listener from this class.
|
|
318
|
-
*
|
|
319
|
-
* @param {string} type The event type.
|
|
320
|
-
* @param {Function} callback The function associated with the provided
|
|
321
|
-
* event type.
|
|
322
|
-
*/
|
|
323
|
-
removeEventListener(type: string, callback: Function): void;
|
|
324
308
|
#private;
|
|
325
309
|
}
|
|
326
310
|
|
|
@@ -338,64 +322,50 @@ export declare class AnnotationGroupFactory {
|
|
|
338
322
|
/**
|
|
339
323
|
* Check dicom elements.
|
|
340
324
|
*
|
|
341
|
-
* @param {
|
|
325
|
+
* @param {Record<string, DataElement>} dataElements The DICOM data elements.
|
|
342
326
|
* @returns {string|undefined} A possible warning.
|
|
343
327
|
*/
|
|
344
|
-
checkElements(dataElements:
|
|
345
|
-
[x: string]: DataElement;
|
|
346
|
-
}): string | undefined;
|
|
328
|
+
checkElements(dataElements: Record<string, DataElement>): string | undefined;
|
|
347
329
|
/**
|
|
348
330
|
* Get an {@link AnnotationGroup} object from the read DICOM file.
|
|
349
331
|
*
|
|
350
|
-
* @param {
|
|
332
|
+
* @param {Record<string, DataElement>} dataElements The DICOM tags.
|
|
351
333
|
* @returns {AnnotationGroup} A new annotation group.
|
|
352
334
|
* @throws {Error} Error for missing or wrong data.
|
|
353
335
|
*/
|
|
354
|
-
create(dataElements:
|
|
355
|
-
[x: string]: DataElement;
|
|
356
|
-
}): AnnotationGroup;
|
|
336
|
+
create(dataElements: Record<string, DataElement>): AnnotationGroup;
|
|
357
337
|
/**
|
|
358
338
|
* Get an {@link CADReport} object from the read DICOM file.
|
|
359
339
|
*
|
|
360
|
-
* @param {
|
|
340
|
+
* @param {Record<string, DataElement>} dataElements The DICOM tags.
|
|
361
341
|
* @returns {CADReport|undefined} A new CAD report.
|
|
362
342
|
*/
|
|
363
|
-
createCADReport(dataElements:
|
|
364
|
-
[x: string]: DataElement;
|
|
365
|
-
}): CADReport | undefined;
|
|
343
|
+
createCADReport(dataElements: Record<string, DataElement>): CADReport | undefined;
|
|
366
344
|
/**
|
|
367
345
|
* Convert an annotation group into a DICOM SR object using the
|
|
368
346
|
* TID 1500 template.
|
|
369
347
|
*
|
|
370
348
|
* @param {AnnotationGroup} annotationGroup The annotation group.
|
|
371
|
-
* @param {
|
|
372
|
-
* @returns {
|
|
349
|
+
* @param {Record<string, any>} [extraTags] Optional list of extra tags.
|
|
350
|
+
* @returns {Record<string, DataElement>} A list of dicom elements.
|
|
373
351
|
*/
|
|
374
|
-
toDicom(annotationGroup: AnnotationGroup, extraTags?:
|
|
375
|
-
[x: string]: any;
|
|
376
|
-
}): {
|
|
377
|
-
[x: string]: DataElement;
|
|
378
|
-
};
|
|
352
|
+
toDicom(annotationGroup: AnnotationGroup, extraTags?: Record<string, any>): Record<string, DataElement>;
|
|
379
353
|
/**
|
|
380
354
|
* Convert a CAD report into a DICOM CAD report SR object using
|
|
381
355
|
* the TID 4100 template.
|
|
382
356
|
*
|
|
383
357
|
* @param {CADReport} report The CAD report.
|
|
384
|
-
* @param {
|
|
385
|
-
* @returns {
|
|
358
|
+
* @param {Record<string, any>} [extraTags] Optional list of extra tags.
|
|
359
|
+
* @returns {Record<string, DataElement>} A list of dicom elements.
|
|
386
360
|
*/
|
|
387
|
-
toDicomCADReport(report: CADReport, extraTags?:
|
|
388
|
-
[x: string]: any;
|
|
389
|
-
}): {
|
|
390
|
-
[x: string]: DataElement;
|
|
391
|
-
};
|
|
361
|
+
toDicomCADReport(report: CADReport, extraTags?: Record<string, any>): Record<string, DataElement>;
|
|
392
362
|
#private;
|
|
393
363
|
}
|
|
394
364
|
|
|
395
365
|
/**
|
|
396
366
|
* List of ViewConfigs indexed by dataIds.
|
|
397
367
|
*
|
|
398
|
-
* @typedef {
|
|
368
|
+
* @typedef {Record<string, ViewConfig[]>} DataViewConfigs
|
|
399
369
|
*/
|
|
400
370
|
/**
|
|
401
371
|
* Main application class.
|
|
@@ -414,12 +384,19 @@ export declare class AnnotationGroupFactory {
|
|
|
414
384
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
415
385
|
* ]);
|
|
416
386
|
*/
|
|
417
|
-
export declare class App {
|
|
387
|
+
export declare class App extends EventTarget {
|
|
388
|
+
/**
|
|
389
|
+
* Get the data controller.
|
|
390
|
+
*
|
|
391
|
+
* @returns {DataController} The data controller.
|
|
392
|
+
*/
|
|
393
|
+
getDataController(): DataController;
|
|
418
394
|
/**
|
|
419
395
|
* Get a DicomData.
|
|
420
396
|
*
|
|
421
397
|
* @param {string} dataId The data id.
|
|
422
398
|
* @returns {DicomData|undefined} The data.
|
|
399
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
423
400
|
*/
|
|
424
401
|
getData(dataId: string): DicomData | undefined;
|
|
425
402
|
/**
|
|
@@ -435,12 +412,14 @@ export declare class App {
|
|
|
435
412
|
*
|
|
436
413
|
* @param {string} dataId The data id.
|
|
437
414
|
* @param {Image} img The associated image.
|
|
415
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
438
416
|
*/
|
|
439
417
|
setImage(dataId: string, img: Image_2): void;
|
|
440
418
|
/**
|
|
441
419
|
* Get the next data id.
|
|
442
420
|
*
|
|
443
421
|
* @returns {string} The data id.
|
|
422
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
444
423
|
*/
|
|
445
424
|
getNextDataId(): string;
|
|
446
425
|
/**
|
|
@@ -449,21 +428,22 @@ export declare class App {
|
|
|
449
428
|
* @param {string} dataId The data id.
|
|
450
429
|
* @param {DicomData} data The new data.
|
|
451
430
|
* @returns {boolean} False if the data cannot be added.
|
|
431
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
452
432
|
*/
|
|
453
433
|
addData(dataId: string, data: DicomData): boolean;
|
|
454
434
|
/**
|
|
455
435
|
* Get the meta data.
|
|
456
436
|
*
|
|
457
437
|
* @param {string} dataId The data id.
|
|
458
|
-
* @returns {
|
|
438
|
+
* @returns {Record<string, DataElement>|undefined} The list of meta data.
|
|
439
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
459
440
|
*/
|
|
460
|
-
getMetaData(dataId: string):
|
|
461
|
-
[x: string]: DataElement;
|
|
462
|
-
} | undefined;
|
|
441
|
+
getMetaData(dataId: string): Record<string, DataElement> | undefined;
|
|
463
442
|
/**
|
|
464
443
|
* Get the list of ids in the data storage.
|
|
465
444
|
*
|
|
466
445
|
* @returns {string[]} The list of data ids.
|
|
446
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
467
447
|
*/
|
|
468
448
|
getDataIds(): string[];
|
|
469
449
|
/**
|
|
@@ -471,6 +451,7 @@ export declare class App {
|
|
|
471
451
|
*
|
|
472
452
|
* @param {string[]} uids A list of UIDs.
|
|
473
453
|
* @returns {string[]} The list of dataIds that contain the UIDs.
|
|
454
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
474
455
|
*/
|
|
475
456
|
getDataIdsFromSopUids(uids: string[]): string[];
|
|
476
457
|
/**
|
|
@@ -478,6 +459,7 @@ export declare class App {
|
|
|
478
459
|
*
|
|
479
460
|
* @param {string} uid The SeriesInstanceUID.
|
|
480
461
|
* @returns {string} The data id.
|
|
462
|
+
* @deprecated Since v0.37, please use via app.getDataController.
|
|
481
463
|
*/
|
|
482
464
|
getDataIdFromSeriesUid(uid: string): string;
|
|
483
465
|
/**
|
|
@@ -501,18 +483,21 @@ export declare class App {
|
|
|
501
483
|
* Get the active layer group scale on top of the base scale.
|
|
502
484
|
*
|
|
503
485
|
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
486
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
504
487
|
*/
|
|
505
488
|
getAddedScale(): Scalar3D;
|
|
506
489
|
/**
|
|
507
490
|
* Get the base scale of the active layer group.
|
|
508
491
|
*
|
|
509
492
|
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
493
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
510
494
|
*/
|
|
511
495
|
getBaseScale(): Scalar3D;
|
|
512
496
|
/**
|
|
513
497
|
* Get the layer offset of the active layer group.
|
|
514
498
|
*
|
|
515
499
|
* @returns {Scalar3D} The offset as {x,y,z}.
|
|
500
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
516
501
|
*/
|
|
517
502
|
getOffset(): Scalar3D;
|
|
518
503
|
/**
|
|
@@ -521,17 +506,33 @@ export declare class App {
|
|
|
521
506
|
* @returns {ToolboxController} The controller.
|
|
522
507
|
*/
|
|
523
508
|
getToolboxController(): ToolboxController;
|
|
509
|
+
/**
|
|
510
|
+
* Get the stage controller.
|
|
511
|
+
*
|
|
512
|
+
* @returns {StageController} The stage controller.
|
|
513
|
+
*/
|
|
514
|
+
getStageController(): StageController;
|
|
515
|
+
/**
|
|
516
|
+
* Get the undo controller.
|
|
517
|
+
*
|
|
518
|
+
* @returns {UndoController} The undo controller.
|
|
519
|
+
*/
|
|
520
|
+
getUndoController(): UndoController;
|
|
524
521
|
/**
|
|
525
522
|
* Get the active layer group.
|
|
526
523
|
* The layer is available after the first loaded item.
|
|
527
524
|
*
|
|
528
525
|
* @returns {LayerGroup|undefined} The layer group.
|
|
526
|
+
* @deprecated Since v0.37, use
|
|
527
|
+
* `app.getStageController().getActiveLayerGroup()` instead.
|
|
529
528
|
*/
|
|
530
529
|
getActiveLayerGroup(): LayerGroup | undefined;
|
|
531
530
|
/**
|
|
532
531
|
* Set the active layer group.
|
|
533
532
|
*
|
|
534
533
|
* @param {number} index The layer group index.
|
|
534
|
+
* @deprecated Since v0.37, use
|
|
535
|
+
* `app.getStageController().setActiveLayerGroup()` instead.
|
|
535
536
|
*/
|
|
536
537
|
setActiveLayerGroup(index: number): void;
|
|
537
538
|
/**
|
|
@@ -540,6 +541,8 @@ export declare class App {
|
|
|
540
541
|
*
|
|
541
542
|
* @param {string} dataId The data id.
|
|
542
543
|
* @returns {ViewLayer[]} The layers.
|
|
544
|
+
* @deprecated Since v0.37, use
|
|
545
|
+
* `app.getStageController().getViewLayersByDataId()` instead.
|
|
543
546
|
*/
|
|
544
547
|
getViewLayersByDataId(dataId: string): ViewLayer[];
|
|
545
548
|
/**
|
|
@@ -550,6 +553,8 @@ export declare class App {
|
|
|
550
553
|
* returns all view layers.
|
|
551
554
|
* @returns {ViewLayer[]} The layers that
|
|
552
555
|
* satisfy the callbackFn.
|
|
556
|
+
* @deprecated Since v0.37, use
|
|
557
|
+
* `app.getStageController().getViewLayers()` instead.
|
|
553
558
|
*/
|
|
554
559
|
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
555
560
|
/**
|
|
@@ -558,6 +563,8 @@ export declare class App {
|
|
|
558
563
|
*
|
|
559
564
|
* @param {string} dataId The data id.
|
|
560
565
|
* @returns {DrawLayer[]} The layers.
|
|
566
|
+
* @deprecated Since v0.37, use
|
|
567
|
+
* `app.getStageController().getDrawLayersByDataId()` instead.
|
|
561
568
|
*/
|
|
562
569
|
getDrawLayersByDataId(dataId: string): DrawLayer[];
|
|
563
570
|
/**
|
|
@@ -568,6 +575,8 @@ export declare class App {
|
|
|
568
575
|
* returns all draw layers.
|
|
569
576
|
* @returns {DrawLayer[]} The layers that
|
|
570
577
|
* satisfy the callbackFn.
|
|
578
|
+
* @deprecated Since v0.37, use
|
|
579
|
+
* `app.getStageController().getDrawLayers()` instead.
|
|
571
580
|
*/
|
|
572
581
|
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
573
582
|
/**
|
|
@@ -576,12 +585,16 @@ export declare class App {
|
|
|
576
585
|
*
|
|
577
586
|
* @param {string} divId The div id.
|
|
578
587
|
* @returns {LayerGroup|undefined} The layer group.
|
|
588
|
+
* @deprecated Since v0.37, use
|
|
589
|
+
* `app.getStageController().getLayerGroupByDivId()` instead.
|
|
579
590
|
*/
|
|
580
591
|
getLayerGroupByDivId(divId: string): LayerGroup | undefined;
|
|
581
592
|
/**
|
|
582
593
|
* Get the number of layer groups.
|
|
583
594
|
*
|
|
584
595
|
* @returns {number} The number of groups.
|
|
596
|
+
* @deprecated Since v0.37, use
|
|
597
|
+
* `app.getStageController().getNumberOfLayerGroups()` instead.
|
|
585
598
|
*/
|
|
586
599
|
getNumberOfLayerGroups(): number;
|
|
587
600
|
/**
|
|
@@ -595,6 +608,7 @@ export declare class App {
|
|
|
595
608
|
*
|
|
596
609
|
* @param {Command} cmd The command to add.
|
|
597
610
|
* @fires UndoStack#undoadd
|
|
611
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
598
612
|
* @function
|
|
599
613
|
*/
|
|
600
614
|
addToUndoStack: (cmd: Command) => void;
|
|
@@ -604,6 +618,7 @@ export declare class App {
|
|
|
604
618
|
* @param {string} name The name of the command to remove.
|
|
605
619
|
* @returns {boolean} True if the command was found and removed.
|
|
606
620
|
* @fires UndoStack#undoremove
|
|
621
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
607
622
|
* @function
|
|
608
623
|
*/
|
|
609
624
|
removeFromUndoStack: (name: string) => boolean;
|
|
@@ -632,7 +647,7 @@ export declare class App {
|
|
|
632
647
|
* button.disabled = false;
|
|
633
648
|
* button.onclick = function () {
|
|
634
649
|
* // render data #0
|
|
635
|
-
* app.render(0);
|
|
650
|
+
* app.getStageController().render(0);
|
|
636
651
|
* };
|
|
637
652
|
* });
|
|
638
653
|
* // load dicom data
|
|
@@ -653,28 +668,114 @@ export declare class App {
|
|
|
653
668
|
resetLayout(): void;
|
|
654
669
|
/**
|
|
655
670
|
* Reset the zoom and pan of the stage.
|
|
671
|
+
*
|
|
672
|
+
* @deprecated Since v0.37, use
|
|
673
|
+
* `app.getStageController().resetZoomPan()` instead.
|
|
656
674
|
*/
|
|
657
675
|
resetZoomPan(): void;
|
|
658
676
|
/**
|
|
659
677
|
* Reset the position and window level of the stage.
|
|
678
|
+
*
|
|
679
|
+
* @deprecated Since v0.37, use
|
|
680
|
+
* `app.getStageController().resetViews()` instead.
|
|
660
681
|
*/
|
|
661
682
|
resetViews(): void;
|
|
662
683
|
/**
|
|
663
|
-
*
|
|
684
|
+
* Load start event.
|
|
664
685
|
*
|
|
665
|
-
* @
|
|
666
|
-
* @
|
|
667
|
-
*
|
|
686
|
+
* @event App#loadstart
|
|
687
|
+
* @type {CustomEvent}
|
|
688
|
+
* @property {object} detail The event detail.
|
|
689
|
+
* @property {string} detail.dataid The data id.
|
|
690
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
691
|
+
* @property {*} detail.source The load source: string for an url,
|
|
692
|
+
* File for a file.
|
|
668
693
|
*/
|
|
669
|
-
addEventListener(type: string, callback: Function): void;
|
|
670
694
|
/**
|
|
671
|
-
*
|
|
695
|
+
* Load progress event.
|
|
672
696
|
*
|
|
673
|
-
* @
|
|
674
|
-
* @
|
|
675
|
-
*
|
|
697
|
+
* @event App#loadprogress
|
|
698
|
+
* @type {CustomEvent}
|
|
699
|
+
* @property {object} detail The event detail.
|
|
700
|
+
* @property {string} detail.dataid The data id.
|
|
701
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
702
|
+
* @property {*} detail.source The load source: string for an url,
|
|
703
|
+
* File for a file.
|
|
704
|
+
* @property {number} detail.loaded The loaded percentage.
|
|
705
|
+
* @property {number} detail.total The total percentage.
|
|
706
|
+
*/
|
|
707
|
+
/**
|
|
708
|
+
* Load item event: fired when an item has been successfully loaded.
|
|
709
|
+
*
|
|
710
|
+
* @event App#loaditem
|
|
711
|
+
* @type {CustomEvent}
|
|
712
|
+
* @property {object} detail The event detail.
|
|
713
|
+
* @property {string} detail.dataid The data id.
|
|
714
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
715
|
+
* @property {*} detail.source The load source: string for an url,
|
|
716
|
+
* File for a file.
|
|
717
|
+
* @property {object} detail.data The loaded meta data.
|
|
718
|
+
* @property {boolean} detail.isfirstitem True if the item is the first
|
|
719
|
+
* one loaded for the data id.
|
|
720
|
+
*/
|
|
721
|
+
/**
|
|
722
|
+
* Load event: fired when a load finishes successfully.
|
|
723
|
+
*
|
|
724
|
+
* @event App#load
|
|
725
|
+
* @type {CustomEvent}
|
|
726
|
+
* @property {object} detail The event detail.
|
|
727
|
+
* @property {string} detail.dataid The data id.
|
|
728
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
729
|
+
* @property {*} detail.source The load source: string for an url,
|
|
730
|
+
* File for a file.
|
|
731
|
+
*/
|
|
732
|
+
/**
|
|
733
|
+
* Load end event: fired when the load finishes,
|
|
734
|
+
* successfully or not.
|
|
735
|
+
*
|
|
736
|
+
* @event App#loadend
|
|
737
|
+
* @type {CustomEvent}
|
|
738
|
+
* @property {object} detail The event detail.
|
|
739
|
+
* @property {string} detail.dataid The data id.
|
|
740
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
741
|
+
* @property {*} detail.source The load source: string for an url,
|
|
742
|
+
* File for a file.
|
|
743
|
+
*/
|
|
744
|
+
/**
|
|
745
|
+
* Load error event.
|
|
746
|
+
*
|
|
747
|
+
* @event App#error
|
|
748
|
+
* @type {CustomEvent}
|
|
749
|
+
* @property {object} detail The event detail.
|
|
750
|
+
* @property {string} detail.dataid The data id.
|
|
751
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
752
|
+
* @property {*} detail.source The load source: string for an url,
|
|
753
|
+
* File for a file.
|
|
754
|
+
* @property {object} detail.error The error.
|
|
755
|
+
* @property {object} detail.target The event target.
|
|
756
|
+
*/
|
|
757
|
+
/**
|
|
758
|
+
* Load timeout event.
|
|
759
|
+
*
|
|
760
|
+
* @event App#timeout
|
|
761
|
+
* @type {CustomEvent}
|
|
762
|
+
* @property {object} detail The event detail.
|
|
763
|
+
* @property {string} detail.dataid The data id.
|
|
764
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
765
|
+
* @property {*} detail.source The load source: an url as a string.
|
|
766
|
+
* @property {object} detail.target The event target.
|
|
767
|
+
*/
|
|
768
|
+
/**
|
|
769
|
+
* Load abort event.
|
|
770
|
+
*
|
|
771
|
+
* @event App#abort
|
|
772
|
+
* @type {CustomEvent}
|
|
773
|
+
* @property {object} detail The event detail.
|
|
774
|
+
* @property {string} detail.dataid The data id.
|
|
775
|
+
* @property {string} detail.loadtype The load type: image or state.
|
|
776
|
+
* @property {*} detail.source The load source: string for an url,
|
|
777
|
+
* File for a file.
|
|
676
778
|
*/
|
|
677
|
-
removeEventListener(type: string, callback: Function): void;
|
|
678
779
|
/**
|
|
679
780
|
* Load a list of files. Can be image files or a state file.
|
|
680
781
|
*
|
|
@@ -745,6 +846,9 @@ export declare class App {
|
|
|
745
846
|
/**
|
|
746
847
|
* Fit the display to the data of each layer group.
|
|
747
848
|
* To be called once the image is loaded.
|
|
849
|
+
*
|
|
850
|
+
* @deprecated Since v0.37, use
|
|
851
|
+
* `app.getStageController().fitToContainer()` instead.
|
|
748
852
|
*/
|
|
749
853
|
fitToContainer(): void;
|
|
750
854
|
/**
|
|
@@ -759,6 +863,8 @@ export declare class App {
|
|
|
759
863
|
* Set the imageSmoothing flag value. Default is false.
|
|
760
864
|
*
|
|
761
865
|
* @param {boolean} flag True to enable smoothing.
|
|
866
|
+
* @deprecated Since v0.37, use
|
|
867
|
+
* `app.getStageController().setImageSmoothing()` instead.
|
|
762
868
|
*/
|
|
763
869
|
setImageSmoothing(flag: boolean): void;
|
|
764
870
|
/**
|
|
@@ -768,37 +874,40 @@ export declare class App {
|
|
|
768
874
|
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
769
875
|
* (default to false).
|
|
770
876
|
* @returns {ViewConfig[]} The list of associated configs.
|
|
877
|
+
* @deprecated Since v0.37, use
|
|
878
|
+
* `app.getStageController().getViewConfigs()` instead.
|
|
771
879
|
*/
|
|
772
880
|
getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
|
|
773
881
|
/**
|
|
774
|
-
* Get the layer group configuration for a data id and group
|
|
775
|
-
* div id.
|
|
882
|
+
* Get the layer group configuration for a data id and group div id.
|
|
776
883
|
*
|
|
777
884
|
* @param {string} dataId The data id.
|
|
778
885
|
* @param {string} groupDivId The layer group div id.
|
|
779
886
|
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
780
887
|
* (default to false).
|
|
781
888
|
* @returns {ViewConfig|undefined} The associated config.
|
|
889
|
+
* @deprecated Since v0.37, use
|
|
890
|
+
* `app.getStageController().getViewConfig()` instead.
|
|
782
891
|
*/
|
|
783
892
|
getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
|
|
784
893
|
/**
|
|
785
894
|
* Get the data view config.
|
|
786
|
-
*
|
|
895
|
+
* Careful, returns a reference; do not modify without resetting.
|
|
787
896
|
*
|
|
788
|
-
* @returns {
|
|
897
|
+
* @returns {Record<string, ViewConfig[]>} The configuration list.
|
|
898
|
+
* @deprecated Since v0.37, use
|
|
899
|
+
* `app.getStageController().getDataViewConfigs()` instead.
|
|
789
900
|
*/
|
|
790
|
-
getDataViewConfigs():
|
|
791
|
-
[x: string]: ViewConfig[];
|
|
792
|
-
};
|
|
901
|
+
getDataViewConfigs(): Record<string, ViewConfig[]>;
|
|
793
902
|
/**
|
|
794
903
|
* Set the data view configuration.
|
|
795
904
|
* Resets the stage and recreates all the views.
|
|
796
905
|
*
|
|
797
|
-
* @param {
|
|
906
|
+
* @param {Record<string, ViewConfig[]>} configs The configuration list.
|
|
907
|
+
* @deprecated Since v0.37, use
|
|
908
|
+
* `app.getStageController().setDataViewConfigs()` instead.
|
|
798
909
|
*/
|
|
799
|
-
setDataViewConfigs(configs:
|
|
800
|
-
[x: string]: ViewConfig[];
|
|
801
|
-
}): void;
|
|
910
|
+
setDataViewConfigs(configs: Record<string, ViewConfig[]>): void;
|
|
802
911
|
/**
|
|
803
912
|
* Add a data view config.
|
|
804
913
|
*
|
|
@@ -806,6 +915,8 @@ export declare class App {
|
|
|
806
915
|
* @param {ViewConfig} config The view configuration.
|
|
807
916
|
* @param {boolean} [doRender] Render data after configuration
|
|
808
917
|
* add. Defaults to true.
|
|
918
|
+
* @deprecated Since v0.37, use
|
|
919
|
+
* `app.getStageController().addDataViewConfig()` instead.
|
|
809
920
|
*/
|
|
810
921
|
addDataViewConfig(dataId: string, config: ViewConfig, doRender?: boolean): void;
|
|
811
922
|
/**
|
|
@@ -815,6 +926,8 @@ export declare class App {
|
|
|
815
926
|
*
|
|
816
927
|
* @param {string} dataId The data id.
|
|
817
928
|
* @param {string} divId The div id.
|
|
929
|
+
* @deprecated Since v0.37, use
|
|
930
|
+
* `app.getStageController().removeDataViewConfig()` instead.
|
|
818
931
|
*/
|
|
819
932
|
removeDataViewConfig(dataId: string, divId: string): void;
|
|
820
933
|
/**
|
|
@@ -824,6 +937,8 @@ export declare class App {
|
|
|
824
937
|
* @param {string} dataId The data id.
|
|
825
938
|
* @param {string} divId The div id.
|
|
826
939
|
* @param {ViewConfig} config The view configuration.
|
|
940
|
+
* @deprecated Since v0.37, use
|
|
941
|
+
* `app.getStageController().updateDataViewConfig()` instead.
|
|
827
942
|
*/
|
|
828
943
|
updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void;
|
|
829
944
|
/**
|
|
@@ -837,6 +952,8 @@ export declare class App {
|
|
|
837
952
|
*
|
|
838
953
|
* @param {string} dataId The data id to render.
|
|
839
954
|
* @param {ViewConfig[]} [viewConfigs] The list of configs to render.
|
|
955
|
+
* @deprecated Since v0.37, use
|
|
956
|
+
* `app.getStageController().render()` instead.
|
|
840
957
|
*/
|
|
841
958
|
render(dataId: string, viewConfigs?: ViewConfig[]): void;
|
|
842
959
|
/**
|
|
@@ -845,6 +962,7 @@ export declare class App {
|
|
|
845
962
|
* @param {number} step The step to add to the current zoom.
|
|
846
963
|
* @param {number} cx The zoom center X coordinate.
|
|
847
964
|
* @param {number} cy The zoom center Y coordinate.
|
|
965
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
848
966
|
*/
|
|
849
967
|
zoom(step: number, cx: number, cy: number): void;
|
|
850
968
|
/**
|
|
@@ -852,6 +970,7 @@ export declare class App {
|
|
|
852
970
|
*
|
|
853
971
|
* @param {number} tx The translation along X.
|
|
854
972
|
* @param {number} ty The translation along Y.
|
|
973
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
855
974
|
*/
|
|
856
975
|
translate(tx: number, ty: number): void;
|
|
857
976
|
/**
|
|
@@ -912,11 +1031,12 @@ export declare class App {
|
|
|
912
1031
|
/**
|
|
913
1032
|
* Key down callback. Meant to be used in tools.
|
|
914
1033
|
*
|
|
915
|
-
* @param {
|
|
1034
|
+
* @param {object} event The KeyboardEvent down event
|
|
1035
|
+
* augmented with a context.
|
|
916
1036
|
* @fires App#keydown
|
|
917
1037
|
* @function
|
|
918
1038
|
*/
|
|
919
|
-
onKeydown: (event:
|
|
1039
|
+
onKeydown: (event: object) => void;
|
|
920
1040
|
/**
|
|
921
1041
|
* Key down event handler example.
|
|
922
1042
|
* - CRTL-Z: undo,
|
|
@@ -974,24 +1094,28 @@ export declare class App {
|
|
|
974
1094
|
* Undo the last action.
|
|
975
1095
|
*
|
|
976
1096
|
* @fires UndoStack#undo
|
|
1097
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
977
1098
|
*/
|
|
978
1099
|
undo(): void;
|
|
979
1100
|
/**
|
|
980
1101
|
* Redo the last action.
|
|
981
1102
|
*
|
|
982
1103
|
* @fires UndoStack#redo
|
|
1104
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
983
1105
|
*/
|
|
984
1106
|
redo(): void;
|
|
985
1107
|
/**
|
|
986
1108
|
* Get the undo stack size.
|
|
987
1109
|
*
|
|
988
1110
|
* @returns {number} The size of the stack.
|
|
1111
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
989
1112
|
*/
|
|
990
1113
|
getStackSize(): number;
|
|
991
1114
|
/**
|
|
992
1115
|
* Get the current undo stack index.
|
|
993
1116
|
*
|
|
994
1117
|
* @returns {number} The stack index.
|
|
1118
|
+
* @deprecated Since v0.37, please use via app.getUndoController.
|
|
995
1119
|
*/
|
|
996
1120
|
getCurrentStackIndex(): number;
|
|
997
1121
|
/**
|
|
@@ -1023,13 +1147,6 @@ export declare class App {
|
|
|
1023
1147
|
* @param {string} refDataId The reference data id.
|
|
1024
1148
|
*/
|
|
1025
1149
|
addAndRenderAnnotationData(data: DicomData, divId: string, refDataId: string): void;
|
|
1026
|
-
/**
|
|
1027
|
-
* Add a draw layer.
|
|
1028
|
-
*
|
|
1029
|
-
* @param {string} dataId The data id.
|
|
1030
|
-
* @param {ViewConfig} viewConfig The data view config.
|
|
1031
|
-
*/
|
|
1032
|
-
addDrawLayer(dataId: string, viewConfig: ViewConfig): void;
|
|
1033
1150
|
#private;
|
|
1034
1151
|
}
|
|
1035
1152
|
|
|
@@ -1038,28 +1155,22 @@ export declare class App {
|
|
|
1038
1155
|
*/
|
|
1039
1156
|
export declare class AppOptions {
|
|
1040
1157
|
/**
|
|
1041
|
-
* @param {
|
|
1158
|
+
* @param {Record<string, ViewConfig[]>} [dataViewConfigs] Optional dataId
|
|
1042
1159
|
* indexed object containing the data view configurations.
|
|
1043
1160
|
*/
|
|
1044
|
-
constructor(dataViewConfigs?:
|
|
1045
|
-
[x: string]: ViewConfig[];
|
|
1046
|
-
});
|
|
1161
|
+
constructor(dataViewConfigs?: Record<string, ViewConfig[]>);
|
|
1047
1162
|
/**
|
|
1048
1163
|
* DataId indexed object containing the data view configurations.
|
|
1049
1164
|
*
|
|
1050
|
-
* @type {
|
|
1165
|
+
* @type {Record<string, ViewConfig[]>|undefined}
|
|
1051
1166
|
*/
|
|
1052
|
-
dataViewConfigs:
|
|
1053
|
-
[x: string]: ViewConfig[];
|
|
1054
|
-
} | undefined;
|
|
1167
|
+
dataViewConfigs: Record<string, ViewConfig[]> | undefined;
|
|
1055
1168
|
/**
|
|
1056
1169
|
* Tool name indexed object containing individual tool configurations.
|
|
1057
1170
|
*
|
|
1058
|
-
* @type {
|
|
1171
|
+
* @type {Record<string, ToolConfig>|undefined}
|
|
1059
1172
|
*/
|
|
1060
|
-
tools:
|
|
1061
|
-
[x: string]: ToolConfig;
|
|
1062
|
-
} | undefined;
|
|
1173
|
+
tools: Record<string, ToolConfig> | undefined;
|
|
1063
1174
|
/**
|
|
1064
1175
|
* Optional array of layerGroup binder names.
|
|
1065
1176
|
*
|
|
@@ -1114,6 +1225,23 @@ export declare class BooleanResult {
|
|
|
1114
1225
|
message: string | undefined;
|
|
1115
1226
|
}
|
|
1116
1227
|
|
|
1228
|
+
/**
|
|
1229
|
+
* Extract polygon contours from a mask slice using Moore neighborhood tracing.
|
|
1230
|
+
* Returns one polygon per connected region with the given segment value.
|
|
1231
|
+
*
|
|
1232
|
+
* @param {Uint8Array} buffer The mask buffer (all slices).
|
|
1233
|
+
* @param {number} sliceOffset Byte offset of the slice in buffer.
|
|
1234
|
+
* @param {number} width Slice width in pixels.
|
|
1235
|
+
* @param {number} height Slice height in pixels.
|
|
1236
|
+
* @param {number} value Segment value to trace.
|
|
1237
|
+
* @returns {Array.<Array.<{x: number, y: number}>>} One polygon per
|
|
1238
|
+
* connected region.
|
|
1239
|
+
*/
|
|
1240
|
+
export declare function bufferToPolygons(buffer: Uint8Array, sliceOffset: number, width: number, height: number, value: number): Array<Array<{
|
|
1241
|
+
x: number;
|
|
1242
|
+
y: number;
|
|
1243
|
+
}>>;
|
|
1244
|
+
|
|
1117
1245
|
/**
|
|
1118
1246
|
* Build a multipart message.
|
|
1119
1247
|
*
|
|
@@ -1146,6 +1274,11 @@ export declare class CADReport {
|
|
|
1146
1274
|
comment: string;
|
|
1147
1275
|
}
|
|
1148
1276
|
|
|
1277
|
+
/**
|
|
1278
|
+
* @import {Image} from '../image/image.js';
|
|
1279
|
+
* @import {MaskSegment} from '../dicom/dicomSegment.js';
|
|
1280
|
+
* @import {RGB} from '../utils/colour.js';
|
|
1281
|
+
*/
|
|
1149
1282
|
/**
|
|
1150
1283
|
* Change segment colour command.
|
|
1151
1284
|
*/
|
|
@@ -1247,11 +1380,9 @@ export declare class Circle {
|
|
|
1247
1380
|
* @param {Index} index The index at which to get the
|
|
1248
1381
|
* image values.
|
|
1249
1382
|
* @param {string[]} flags A list of stat values to calculate.
|
|
1250
|
-
* @returns {
|
|
1383
|
+
* @returns {Record<string, NumberValue>} A quantification object.
|
|
1251
1384
|
*/
|
|
1252
|
-
quantify(viewController: ViewController, index: Index, flags: string[]):
|
|
1253
|
-
[x: string]: Value;
|
|
1254
|
-
};
|
|
1385
|
+
quantify(viewController: ViewController, index: Index, flags: string[]): Record<string, NumberValue>;
|
|
1255
1386
|
#private;
|
|
1256
1387
|
}
|
|
1257
1388
|
|
|
@@ -1309,45 +1440,31 @@ export declare class Command {
|
|
|
1309
1440
|
/**
|
|
1310
1441
|
* Create an Image from DICOM elements.
|
|
1311
1442
|
*
|
|
1312
|
-
* @param {
|
|
1443
|
+
* @param {Record<string, DataElement>} elements The DICOM elements.
|
|
1313
1444
|
* @returns {Image} The Image object.
|
|
1314
1445
|
*/
|
|
1315
|
-
export declare function createImage(elements:
|
|
1316
|
-
[x: string]: DataElement;
|
|
1317
|
-
}): Image_2;
|
|
1446
|
+
export declare function createImage(elements: Record<string, DataElement>): Image_2;
|
|
1318
1447
|
|
|
1319
1448
|
/**
|
|
1320
1449
|
* Create a mask Image from DICOM elements.
|
|
1321
1450
|
*
|
|
1322
|
-
* @param {
|
|
1451
|
+
* @param {Record<string, DataElement>} elements The DICOM elements.
|
|
1323
1452
|
* @returns {Image} The mask Image object.
|
|
1324
1453
|
*/
|
|
1325
|
-
export declare function createMaskImage(elements:
|
|
1326
|
-
[x: string]: DataElement;
|
|
1327
|
-
}): Image_2;
|
|
1454
|
+
export declare function createMaskImage(elements: Record<string, DataElement>): Image_2;
|
|
1328
1455
|
|
|
1329
1456
|
/**
|
|
1330
1457
|
* Create a View from DICOM elements and image.
|
|
1331
1458
|
*
|
|
1332
|
-
* @param {
|
|
1459
|
+
* @param {Record<string, DataElement>} elements The DICOM elements.
|
|
1333
1460
|
* @param {Image} image The associated image.
|
|
1334
1461
|
* @returns {View} The View object.
|
|
1335
1462
|
*/
|
|
1336
|
-
export declare function createView(elements:
|
|
1337
|
-
[x: string]: DataElement;
|
|
1338
|
-
}, image: Image_2): View;
|
|
1463
|
+
export declare function createView(elements: Record<string, DataElement>, image: Image_2): View;
|
|
1339
1464
|
|
|
1340
1465
|
export declare namespace custom {
|
|
1341
|
-
let wlPresets:
|
|
1342
|
-
|
|
1343
|
-
[x: string]: WindowLevel;
|
|
1344
|
-
};
|
|
1345
|
-
};
|
|
1346
|
-
let labelTexts: {
|
|
1347
|
-
[x: string]: {
|
|
1348
|
-
[x: string]: string;
|
|
1349
|
-
};
|
|
1350
|
-
};
|
|
1466
|
+
let wlPresets: Record<string, Record<string, WindowLevel>>;
|
|
1467
|
+
let labelTexts: Record<string, Record<string, string>>;
|
|
1351
1468
|
let privateBValueRules: object[];
|
|
1352
1469
|
let openRoiDialog: any;
|
|
1353
1470
|
let getVolumeIdTagValue: any;
|
|
@@ -1355,6 +1472,115 @@ export declare namespace custom {
|
|
|
1355
1472
|
let getTagPixelUnit: any;
|
|
1356
1473
|
}
|
|
1357
1474
|
|
|
1475
|
+
/**
|
|
1476
|
+
* DicomData controller.
|
|
1477
|
+
*/
|
|
1478
|
+
export declare class DataController extends EventTarget {
|
|
1479
|
+
/**
|
|
1480
|
+
* Get the next data id.
|
|
1481
|
+
*
|
|
1482
|
+
* @returns {string} The data id.
|
|
1483
|
+
*/
|
|
1484
|
+
getNextDataId(): string;
|
|
1485
|
+
/**
|
|
1486
|
+
* Get the list of ids in the data storage.
|
|
1487
|
+
*
|
|
1488
|
+
* @returns {string[]} The list of data ids.
|
|
1489
|
+
*/
|
|
1490
|
+
getDataIds(): string[];
|
|
1491
|
+
/**
|
|
1492
|
+
* Reset the class: empty the data storage.
|
|
1493
|
+
*/
|
|
1494
|
+
reset(): void;
|
|
1495
|
+
/**
|
|
1496
|
+
* Get a data at a given index.
|
|
1497
|
+
*
|
|
1498
|
+
* @param {string} dataId The data id.
|
|
1499
|
+
* @returns {DicomData|undefined} The DICOM data.
|
|
1500
|
+
*/
|
|
1501
|
+
get(dataId: string): DicomData | undefined;
|
|
1502
|
+
/**
|
|
1503
|
+
* Get the list of dataIds that contain the input UIDs.
|
|
1504
|
+
*
|
|
1505
|
+
* @param {string[]} uids A list of UIDs.
|
|
1506
|
+
* @returns {string[]} The list of dataIds that contain the UIDs.
|
|
1507
|
+
*/
|
|
1508
|
+
getDataIdsFromSopUids(uids: string[]): string[];
|
|
1509
|
+
/**
|
|
1510
|
+
* Get the first data id with the given SeriesInstanceUID.
|
|
1511
|
+
*
|
|
1512
|
+
* @param {string} uid The SeriesInstanceUID.
|
|
1513
|
+
* @returns {string} The data id.
|
|
1514
|
+
*/
|
|
1515
|
+
getDataIdFromSeriesUid(uid: string): string;
|
|
1516
|
+
/**
|
|
1517
|
+
* Set the image at a given index.
|
|
1518
|
+
*
|
|
1519
|
+
* @param {string} dataId The data id.
|
|
1520
|
+
* @param {Image} image The image to set.
|
|
1521
|
+
*/
|
|
1522
|
+
setImage(dataId: string, image: Image_2): void;
|
|
1523
|
+
/**
|
|
1524
|
+
* Add a new data.
|
|
1525
|
+
*
|
|
1526
|
+
* @param {string} dataId The data id.
|
|
1527
|
+
* @param {DicomData} data The data.
|
|
1528
|
+
* @returns {boolean} False if the data cannot be added.
|
|
1529
|
+
*/
|
|
1530
|
+
add(dataId: string, data: DicomData): boolean;
|
|
1531
|
+
/**
|
|
1532
|
+
* Remove a data from the list.
|
|
1533
|
+
*
|
|
1534
|
+
* @param {string} dataId The data id.
|
|
1535
|
+
*/
|
|
1536
|
+
remove(dataId: string): void;
|
|
1537
|
+
/**
|
|
1538
|
+
* Stash a data from the list.
|
|
1539
|
+
*
|
|
1540
|
+
* @param {string} dataId The data id.
|
|
1541
|
+
*/
|
|
1542
|
+
stash(dataId: string): void;
|
|
1543
|
+
/**
|
|
1544
|
+
* Unstash a data from the list.
|
|
1545
|
+
*
|
|
1546
|
+
* @param {string} dataId The data id.
|
|
1547
|
+
*/
|
|
1548
|
+
unstash(dataId: string): void;
|
|
1549
|
+
/**
|
|
1550
|
+
* Get the list of ids in the stashed data storage.
|
|
1551
|
+
*
|
|
1552
|
+
* @returns {string[]} The list of data ids.
|
|
1553
|
+
*/
|
|
1554
|
+
getStashedDataIds(): string[];
|
|
1555
|
+
/**
|
|
1556
|
+
* Get a stashed data at a given index.
|
|
1557
|
+
*
|
|
1558
|
+
* @param {string} dataId The data id.
|
|
1559
|
+
* @returns {DicomData|undefined} The DICOM data.
|
|
1560
|
+
*/
|
|
1561
|
+
getStashed(dataId: string): DicomData | undefined;
|
|
1562
|
+
/**
|
|
1563
|
+
* Update the current data.
|
|
1564
|
+
*
|
|
1565
|
+
* @param {string} dataId The data id.
|
|
1566
|
+
* @param {DicomData} data The data.
|
|
1567
|
+
*/
|
|
1568
|
+
update(dataId: string, data: DicomData): void;
|
|
1569
|
+
/**
|
|
1570
|
+
* Mark a data a complete (fully loaded).
|
|
1571
|
+
*
|
|
1572
|
+
* @param {string} dataId The data id.
|
|
1573
|
+
* @returns {{imageHasChanged}} An object with an imageHasChanged property.
|
|
1574
|
+
*/
|
|
1575
|
+
markDataAsComplete(dataId: string): {
|
|
1576
|
+
imageHasChanged: any;
|
|
1577
|
+
};
|
|
1578
|
+
#private;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* @import {Tag} from './dicomTag.js';
|
|
1583
|
+
*/
|
|
1358
1584
|
/**
|
|
1359
1585
|
* DICOM data element.
|
|
1360
1586
|
*/
|
|
@@ -1416,23 +1642,21 @@ export declare class DataElement {
|
|
|
1416
1642
|
/**
|
|
1417
1643
|
* Default tool list.
|
|
1418
1644
|
*
|
|
1419
|
-
* @type {
|
|
1645
|
+
* @type {Record<string, any>}
|
|
1420
1646
|
*/
|
|
1421
|
-
export declare const defaultToolList:
|
|
1422
|
-
[x: string]: any;
|
|
1423
|
-
};
|
|
1647
|
+
export declare const defaultToolList: Record<string, any>;
|
|
1424
1648
|
|
|
1425
1649
|
/**
|
|
1426
1650
|
* Default tool options.
|
|
1427
1651
|
*
|
|
1428
|
-
* @type {
|
|
1652
|
+
* @type {Record<string, Record<string, any>>}
|
|
1429
1653
|
*/
|
|
1430
|
-
export declare const defaultToolOptions:
|
|
1431
|
-
[x: string]: {
|
|
1432
|
-
[x: string]: any;
|
|
1433
|
-
};
|
|
1434
|
-
};
|
|
1654
|
+
export declare const defaultToolOptions: Record<string, Record<string, any>>;
|
|
1435
1655
|
|
|
1656
|
+
/**
|
|
1657
|
+
* @import {Image} from '../image/image.js';
|
|
1658
|
+
* @import {MaskSegment} from '../dicom/dicomSegment.js';
|
|
1659
|
+
*/
|
|
1436
1660
|
/**
|
|
1437
1661
|
* Delete segment command.
|
|
1438
1662
|
*/
|
|
@@ -1464,6 +1688,10 @@ export declare class DeleteSegmentCommand extends Command {
|
|
|
1464
1688
|
#private;
|
|
1465
1689
|
}
|
|
1466
1690
|
|
|
1691
|
+
/**
|
|
1692
|
+
* @import {Point} from '../math/point.js';
|
|
1693
|
+
* @import {NumberValue} from '../math/number.js';
|
|
1694
|
+
*/
|
|
1467
1695
|
/**
|
|
1468
1696
|
* Diameter type.
|
|
1469
1697
|
*/
|
|
@@ -1471,9 +1699,9 @@ export declare class Diameter {
|
|
|
1471
1699
|
/**
|
|
1472
1700
|
* The scaled diameter value.
|
|
1473
1701
|
*
|
|
1474
|
-
* @type {
|
|
1702
|
+
* @type {NumberValue}
|
|
1475
1703
|
*/
|
|
1476
|
-
diameter:
|
|
1704
|
+
diameter: NumberValue;
|
|
1477
1705
|
/**
|
|
1478
1706
|
* The offset of the pixel at the start
|
|
1479
1707
|
* of the line used to calculate this diameter.
|
|
@@ -1561,19 +1789,15 @@ export declare class DicomCode {
|
|
|
1561
1789
|
*/
|
|
1562
1790
|
export declare class DicomData {
|
|
1563
1791
|
/**
|
|
1564
|
-
* @param {
|
|
1792
|
+
* @param {Record<string, DataElement>} meta The DICOM meta data.
|
|
1565
1793
|
*/
|
|
1566
|
-
constructor(meta:
|
|
1567
|
-
[x: string]: DataElement;
|
|
1568
|
-
});
|
|
1794
|
+
constructor(meta: Record<string, DataElement>);
|
|
1569
1795
|
/**
|
|
1570
1796
|
* DICOM meta data.
|
|
1571
1797
|
*
|
|
1572
|
-
* @type {
|
|
1798
|
+
* @type {Record<string, DataElement>}
|
|
1573
1799
|
*/
|
|
1574
|
-
meta:
|
|
1575
|
-
[x: string]: DataElement;
|
|
1576
|
-
};
|
|
1800
|
+
meta: Record<string, DataElement>;
|
|
1577
1801
|
/**
|
|
1578
1802
|
* Image extracted from meta data.
|
|
1579
1803
|
*
|
|
@@ -1680,11 +1904,9 @@ export declare class DicomParser {
|
|
|
1680
1904
|
/**
|
|
1681
1905
|
* Get the DICOM data elements.
|
|
1682
1906
|
*
|
|
1683
|
-
* @returns {
|
|
1907
|
+
* @returns {Record<string, DataElement>} The data elements.
|
|
1684
1908
|
*/
|
|
1685
|
-
getDicomElements():
|
|
1686
|
-
[x: string]: DataElement;
|
|
1687
|
-
};
|
|
1909
|
+
getDicomElements(): Record<string, DataElement>;
|
|
1688
1910
|
/**
|
|
1689
1911
|
* Safely get an elements' first value from the parsed elements.
|
|
1690
1912
|
*
|
|
@@ -1814,14 +2036,12 @@ export declare class DicomWriter {
|
|
|
1814
2036
|
* First checked by tagKey, tagName and then by groupName,
|
|
1815
2037
|
* if nothing is found the default rule is applied.
|
|
1816
2038
|
*
|
|
1817
|
-
* @param {
|
|
2039
|
+
* @param {Record<string, WriterRule>} rules The input rules.
|
|
1818
2040
|
* @param {boolean} [addMissingTags] If true, explicit tags that
|
|
1819
2041
|
* have replace rule and a value will be
|
|
1820
2042
|
* added if missing. Defaults to false.
|
|
1821
2043
|
*/
|
|
1822
|
-
setRules(rules:
|
|
1823
|
-
[x: string]: WriterRule;
|
|
1824
|
-
}, addMissingTags?: boolean): void;
|
|
2044
|
+
setRules(rules: Record<string, WriterRule>, addMissingTags?: boolean): void;
|
|
1825
2045
|
/**
|
|
1826
2046
|
* Use a TextEncoder instead of the default text decoder.
|
|
1827
2047
|
*/
|
|
@@ -1837,15 +2057,90 @@ export declare class DicomWriter {
|
|
|
1837
2057
|
/**
|
|
1838
2058
|
* Get the ArrayBuffer corresponding to input DICOM elements.
|
|
1839
2059
|
*
|
|
1840
|
-
* @param {
|
|
2060
|
+
* @param {Record<string, DataElement>} dataElements The elements to write.
|
|
1841
2061
|
* @returns {ArrayBuffer} The elements as a buffer.
|
|
1842
2062
|
*/
|
|
1843
|
-
getBuffer(dataElements:
|
|
1844
|
-
|
|
1845
|
-
|
|
2063
|
+
getBuffer(dataElements: Record<string, DataElement>): ArrayBuffer;
|
|
2064
|
+
#private;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Draw brush command.
|
|
2069
|
+
*/
|
|
2070
|
+
export declare class DrawBrushCommand extends Command {
|
|
2071
|
+
/**
|
|
2072
|
+
* @param {DrawBrushCommandProperties} properties The command properties.
|
|
2073
|
+
*/
|
|
2074
|
+
constructor(properties: DrawBrushCommandProperties);
|
|
2075
|
+
/**
|
|
2076
|
+
* Get the original values before applying brush.
|
|
2077
|
+
*
|
|
2078
|
+
* @returns {Array|undefined} Lists of original value iterators,
|
|
2079
|
+
* undefined when erasing.
|
|
2080
|
+
*/
|
|
2081
|
+
getOriginalValuesLists(): any[] | undefined;
|
|
2082
|
+
/**
|
|
2083
|
+
* Get the execute event.
|
|
2084
|
+
*
|
|
2085
|
+
* @returns {CustomEvent} The event.
|
|
2086
|
+
*/
|
|
2087
|
+
getExecuteEvent(): CustomEvent;
|
|
2088
|
+
/**
|
|
2089
|
+
* Handle an execute event.
|
|
2090
|
+
*
|
|
2091
|
+
* @param {CustomEvent} _event The execute event with type and id.
|
|
2092
|
+
*/
|
|
2093
|
+
onExecute(_event: CustomEvent): void;
|
|
2094
|
+
/**
|
|
2095
|
+
* Handle an undo event.
|
|
2096
|
+
*
|
|
2097
|
+
* @param {CustomEvent} _event The undo event with type and id.
|
|
2098
|
+
*/
|
|
2099
|
+
onUndo(_event: CustomEvent): void;
|
|
1846
2100
|
#private;
|
|
1847
2101
|
}
|
|
1848
2102
|
|
|
2103
|
+
/**
|
|
2104
|
+
* @import {Image} from '../image/image.js';
|
|
2105
|
+
*/
|
|
2106
|
+
export declare class DrawBrushCommandProperties {
|
|
2107
|
+
/**
|
|
2108
|
+
* @type {Image}
|
|
2109
|
+
*/
|
|
2110
|
+
mask: Image_2;
|
|
2111
|
+
/**
|
|
2112
|
+
* @type {string}
|
|
2113
|
+
*/
|
|
2114
|
+
dataId: string;
|
|
2115
|
+
/**
|
|
2116
|
+
* @type {number[][]}
|
|
2117
|
+
*/
|
|
2118
|
+
offsetsLists: number[][];
|
|
2119
|
+
/**
|
|
2120
|
+
* @type {string}
|
|
2121
|
+
*/
|
|
2122
|
+
mode: string;
|
|
2123
|
+
/**
|
|
2124
|
+
* @type {number}
|
|
2125
|
+
*/
|
|
2126
|
+
segmentNumber: number;
|
|
2127
|
+
/**
|
|
2128
|
+
* @type {string}
|
|
2129
|
+
*/
|
|
2130
|
+
srclayerid: string;
|
|
2131
|
+
/**
|
|
2132
|
+
* @type {Array}
|
|
2133
|
+
*/
|
|
2134
|
+
originalValuesLists: any[];
|
|
2135
|
+
/**
|
|
2136
|
+
* @type {boolean}
|
|
2137
|
+
*/
|
|
2138
|
+
isSilent: boolean;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
/**
|
|
2142
|
+
* @import {Annotation} from '../image/annotation.js';
|
|
2143
|
+
*/
|
|
1849
2144
|
/**
|
|
1850
2145
|
* Draw controller.
|
|
1851
2146
|
*/
|
|
@@ -1941,6 +2236,15 @@ export declare class DrawController {
|
|
|
1941
2236
|
#private;
|
|
1942
2237
|
}
|
|
1943
2238
|
|
|
2239
|
+
/**
|
|
2240
|
+
* @import {Point, Point3D} from '../math/point.js';
|
|
2241
|
+
* @import {Vector3D} from '../math/vector.js';
|
|
2242
|
+
* @import {Scalar2D, Scalar3D} from '../math/scalar.js';
|
|
2243
|
+
* @import {Image} from '../image/image.js';
|
|
2244
|
+
* @import {PlaneHelper} from '../image/planeHelper.js';
|
|
2245
|
+
* @import {AnnotationGroup} from '../image/annotationGroup.js';
|
|
2246
|
+
* @import {DrawShapeHandler} from '../tools/shapes/drawShapeHandler.js';
|
|
2247
|
+
*/
|
|
1944
2248
|
/**
|
|
1945
2249
|
* Debug function to output the layer hierarchy as text.
|
|
1946
2250
|
*
|
|
@@ -1950,6 +2254,9 @@ export declare class DrawController {
|
|
|
1950
2254
|
*/
|
|
1951
2255
|
/**
|
|
1952
2256
|
* Draw layer.
|
|
2257
|
+
*
|
|
2258
|
+
* Not an EventTarget in order to forward native DOM events while
|
|
2259
|
+
* preserving `preventDefault()` for tools (see '#fireDomEvent').
|
|
1953
2260
|
*/
|
|
1954
2261
|
export declare class DrawLayer {
|
|
1955
2262
|
/**
|
|
@@ -2215,16 +2522,11 @@ export declare class DrawLayer {
|
|
|
2215
2522
|
/**
|
|
2216
2523
|
* Draw shape handler: handle action on existing shapes.
|
|
2217
2524
|
*/
|
|
2218
|
-
export declare class DrawShapeHandler {
|
|
2219
|
-
/**
|
|
2220
|
-
* @callback eventFn@callback eventFn
|
|
2221
|
-
* @param {object} event The event.
|
|
2222
|
-
*/
|
|
2525
|
+
export declare class DrawShapeHandler extends EventTarget {
|
|
2223
2526
|
/**
|
|
2224
2527
|
* @param {App} app The associated application.
|
|
2225
|
-
* @param {Function} eventCallback Event callback.
|
|
2226
2528
|
*/
|
|
2227
|
-
constructor(app: App
|
|
2529
|
+
constructor(app: App);
|
|
2228
2530
|
/**
|
|
2229
2531
|
* Set the draw editor shape.
|
|
2230
2532
|
*
|
|
@@ -2351,11 +2653,9 @@ export declare class Ellipse {
|
|
|
2351
2653
|
* @param {Index} index The index at which to get the
|
|
2352
2654
|
* image values.
|
|
2353
2655
|
* @param {string[]} flags A list of stat values to calculate.
|
|
2354
|
-
* @returns {
|
|
2656
|
+
* @returns {Record<string, NumberValue>} A quantification object.
|
|
2355
2657
|
*/
|
|
2356
|
-
quantify(viewController: ViewController, index: Index, flags: string[]):
|
|
2357
|
-
[x: string]: Value;
|
|
2358
|
-
};
|
|
2658
|
+
quantify(viewController: ViewController, index: Index, flags: string[]): Record<string, NumberValue>;
|
|
2359
2659
|
#private;
|
|
2360
2660
|
}
|
|
2361
2661
|
|
|
@@ -2597,15 +2897,18 @@ export declare class Geometry {
|
|
|
2597
2897
|
* - indexed by tag names instead of tag keys,
|
|
2598
2898
|
* - no element object, just value if not sequence nor merged item.
|
|
2599
2899
|
*
|
|
2600
|
-
* @param {
|
|
2900
|
+
* @param {Record<string, DataElement>} metaData The meta data
|
|
2601
2901
|
* index by tag keys.
|
|
2602
|
-
* @returns {
|
|
2902
|
+
* @returns {Record<string, any>} The simple elements.
|
|
2903
|
+
*/
|
|
2904
|
+
export declare function getAsSimpleElements(metaData: Record<string, DataElement>): Record<string, any>;
|
|
2905
|
+
|
|
2906
|
+
/**
|
|
2907
|
+
* Get the default DICOM RT Structure Set tags as an object.
|
|
2908
|
+
*
|
|
2909
|
+
* @returns {object} The default tags.
|
|
2603
2910
|
*/
|
|
2604
|
-
export declare function
|
|
2605
|
-
[x: string]: DataElement;
|
|
2606
|
-
}): {
|
|
2607
|
-
[x: string]: any;
|
|
2608
|
-
};
|
|
2911
|
+
export declare function getDefaultDicomRTStructJson(): object;
|
|
2609
2912
|
|
|
2610
2913
|
/**
|
|
2611
2914
|
* Get the default DICOM seg tags as an object.
|
|
@@ -2618,17 +2921,15 @@ export declare function getDefaultDicomSegJson(): object;
|
|
|
2618
2921
|
* Get a simple dicom element item from a content item object.
|
|
2619
2922
|
*
|
|
2620
2923
|
* @param {DicomSRContent} content The content item object.
|
|
2621
|
-
* @returns {
|
|
2924
|
+
* @returns {Record<string, any>} The item as a list of (key, value) pairs.
|
|
2622
2925
|
*/
|
|
2623
|
-
export declare function getDicomSRContentItem(content: DicomSRContent):
|
|
2624
|
-
[x: string]: any;
|
|
2625
|
-
};
|
|
2926
|
+
export declare function getDicomSRContentItem(content: DicomSRContent): Record<string, any>;
|
|
2626
2927
|
|
|
2627
2928
|
/**
|
|
2628
2929
|
* List of DICOM data elements indexed via a 8 character string formed from
|
|
2629
2930
|
* the group and element numbers.
|
|
2630
2931
|
*
|
|
2631
|
-
* @typedef {
|
|
2932
|
+
* @typedef {Record<string, DataElement>} DataElements
|
|
2632
2933
|
*/
|
|
2633
2934
|
/**
|
|
2634
2935
|
* Get the version of the library.
|
|
@@ -2643,15 +2944,11 @@ export declare function getDwvVersion(): string;
|
|
|
2643
2944
|
* tag names instead of keys and direct values (no value property) for
|
|
2644
2945
|
* simple tags. See synthetic test data (in tests/dicom) for examples.
|
|
2645
2946
|
*
|
|
2646
|
-
* @param {
|
|
2947
|
+
* @param {Record<string, any>} simpleTags The 'simple' DICOM
|
|
2647
2948
|
* tags object.
|
|
2648
|
-
* @returns {
|
|
2949
|
+
* @returns {Record<string, DataElement>} The DICOM elements.
|
|
2649
2950
|
*/
|
|
2650
|
-
export declare function getElementsFromJSONTags(simpleTags:
|
|
2651
|
-
[x: string]: any;
|
|
2652
|
-
}): {
|
|
2653
|
-
[x: string]: DataElement;
|
|
2654
|
-
};
|
|
2951
|
+
export declare function getElementsFromJSONTags(simpleTags: Record<string, any>): Record<string, DataElement>;
|
|
2655
2952
|
|
|
2656
2953
|
/**
|
|
2657
2954
|
* Get the indices that form a ellpise.
|
|
@@ -2676,31 +2973,27 @@ export declare function getLayerDetailsFromEvent(event: object): object;
|
|
|
2676
2973
|
/**
|
|
2677
2974
|
* Get the manufacturer.
|
|
2678
2975
|
*
|
|
2679
|
-
* @param {
|
|
2976
|
+
* @param {Record<string, DataElement>} elements The DICOM tags.
|
|
2680
2977
|
* @returns {string|undefined} The manufacturer.
|
|
2681
2978
|
*/
|
|
2682
|
-
export declare function getManufacturer(elements:
|
|
2683
|
-
[x: string]: DataElement;
|
|
2684
|
-
}): string | undefined;
|
|
2979
|
+
export declare function getManufacturer(elements: Record<string, DataElement>): string | undefined;
|
|
2685
2980
|
|
|
2686
2981
|
/**
|
|
2687
2982
|
* Get the offset of an input mouse event.
|
|
2688
2983
|
*
|
|
2689
|
-
* @param {
|
|
2984
|
+
* @param {MouseEvent} event The event to get the offset from.
|
|
2690
2985
|
* @returns {Point2D} The 2D point.
|
|
2691
2986
|
*/
|
|
2692
|
-
export declare function getMousePoint(event:
|
|
2987
|
+
export declare function getMousePoint(event: MouseEvent): Point2D;
|
|
2693
2988
|
|
|
2694
2989
|
/**
|
|
2695
2990
|
* Get the normalised manufacturer.
|
|
2696
2991
|
*
|
|
2697
|
-
* @param {
|
|
2992
|
+
* @param {Record<string, DataElement>} elements The DICOM tags.
|
|
2698
2993
|
* @returns {string|undefined} The manufacturer as a unique
|
|
2699
2994
|
* all lower case string.
|
|
2700
2995
|
*/
|
|
2701
|
-
export declare function getNormalisedManufacturer(elements:
|
|
2702
|
-
[x: string]: DataElement;
|
|
2703
|
-
}): string | undefined;
|
|
2996
|
+
export declare function getNormalisedManufacturer(elements: Record<string, DataElement>): string | undefined;
|
|
2704
2997
|
|
|
2705
2998
|
/**
|
|
2706
2999
|
* Get the name of an image orientation patient.
|
|
@@ -2732,12 +3025,23 @@ export declare function getRectangleIndices(center: Index, size: number[], dir:
|
|
|
2732
3025
|
/**
|
|
2733
3026
|
* Get the referenced series UID from the data elements.
|
|
2734
3027
|
*
|
|
2735
|
-
* @param {
|
|
3028
|
+
* @param {Record<string, DataElement>} dataElements The data elements.
|
|
3029
|
+
* @returns {string|undefined} The referenced series UID.
|
|
3030
|
+
*/
|
|
3031
|
+
export declare function getReferencedSeriesUID(dataElements: Record<string, DataElement>): string | undefined;
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* Get the referenced series UID from an RT Structure Set.
|
|
3035
|
+
*
|
|
3036
|
+
* Path: ReferencedFrameOfReferenceSequence (3006,0010) →
|
|
3037
|
+
* RTReferencedStudySequence (3006,0012) →
|
|
3038
|
+
* RTReferencedSeriesSequence (3006,0014) →
|
|
3039
|
+
* SeriesInstanceUID (0020,000E).
|
|
3040
|
+
*
|
|
3041
|
+
* @param {Record<string, DataElement>} dataElements The data elements.
|
|
2736
3042
|
* @returns {string|undefined} The referenced series UID.
|
|
2737
3043
|
*/
|
|
2738
|
-
export declare function
|
|
2739
|
-
[x: string]: DataElement;
|
|
2740
|
-
}): string | undefined;
|
|
3044
|
+
export declare function getReferencedSeriesUIDFromRTStruct(dataElements: Record<string, DataElement>): string | undefined;
|
|
2741
3045
|
|
|
2742
3046
|
/**
|
|
2743
3047
|
* Get patient orientation label in the reverse direction.
|
|
@@ -2747,6 +3051,14 @@ export declare function getReferencedSeriesUID(dataElements: {
|
|
|
2747
3051
|
*/
|
|
2748
3052
|
export declare function getReverseOrientation(ori: string): string;
|
|
2749
3053
|
|
|
3054
|
+
/**
|
|
3055
|
+
* Get a list of {@link RTROI} objects from RTSTRUCT DICOM elements.
|
|
3056
|
+
*
|
|
3057
|
+
* @param {Record<string, DataElement>} dataElements The DICOM data elements.
|
|
3058
|
+
* @returns {RTROI[]} The list of RT ROIs.
|
|
3059
|
+
*/
|
|
3060
|
+
export declare function getRTStructFromElements(dataElements: Record<string, DataElement>): RTROI[];
|
|
3061
|
+
|
|
2750
3062
|
/**
|
|
2751
3063
|
* Get a segmentation DICOM code.
|
|
2752
3064
|
*
|
|
@@ -2757,12 +3069,10 @@ export declare function getSegmentationCode(): DicomCode;
|
|
|
2757
3069
|
/**
|
|
2758
3070
|
* Get a content item object from a dicom element.
|
|
2759
3071
|
*
|
|
2760
|
-
* @param {
|
|
3072
|
+
* @param {Record<string, DataElement>} dataElements The dicom element.
|
|
2761
3073
|
* @returns {DicomSRContent} A content item object.
|
|
2762
3074
|
*/
|
|
2763
|
-
export declare function getSRContent(dataElements:
|
|
2764
|
-
[x: string]: DataElement;
|
|
2765
|
-
}): DicomSRContent;
|
|
3075
|
+
export declare function getSRContent(dataElements: Record<string, DataElement>): DicomSRContent;
|
|
2766
3076
|
|
|
2767
3077
|
/**
|
|
2768
3078
|
* Split a group-element key used to store DICOM elements.
|
|
@@ -2775,10 +3085,10 @@ export declare function getTagFromKey(key: string): Tag;
|
|
|
2775
3085
|
/**
|
|
2776
3086
|
* Get the offsets of an input touch event.
|
|
2777
3087
|
*
|
|
2778
|
-
* @param {
|
|
3088
|
+
* @param {TouchEvent} event The event to get the offset from.
|
|
2779
3089
|
* @returns {Point2D[]} The array of points.
|
|
2780
3090
|
*/
|
|
2781
|
-
export declare function getTouchPoints(event:
|
|
3091
|
+
export declare function getTouchPoints(event: TouchEvent): Point2D[];
|
|
2782
3092
|
|
|
2783
3093
|
/**
|
|
2784
3094
|
* Get the appropriate TypedArray in function of arguments.
|
|
@@ -2895,7 +3205,7 @@ export declare namespace i18n {
|
|
|
2895
3205
|
* request.onload = onload;
|
|
2896
3206
|
* request.send();
|
|
2897
3207
|
*/
|
|
2898
|
-
declare class Image_2 {
|
|
3208
|
+
declare class Image_2 extends EventTarget {
|
|
2899
3209
|
/**
|
|
2900
3210
|
* @param {Geometry} geometry The geometry of the image.
|
|
2901
3211
|
* @param {TypedArray} buffer The image data as a one dimensional buffer.
|
|
@@ -2914,6 +3224,29 @@ declare class Image_2 {
|
|
|
2914
3224
|
* @returns {boolean} True if the data is complete.
|
|
2915
3225
|
*/
|
|
2916
3226
|
getComplete(): boolean;
|
|
3227
|
+
/**
|
|
3228
|
+
* Set up a segment collection from the existing image buffer.
|
|
3229
|
+
* Used for brush-painted masks (not created via MaskFactory).
|
|
3230
|
+
*/
|
|
3231
|
+
setupSegmentCollection(): void;
|
|
3232
|
+
/**
|
|
3233
|
+
* Set the segment collection.
|
|
3234
|
+
*
|
|
3235
|
+
* @param {SegmentCollection} collection The segment collection.
|
|
3236
|
+
*/
|
|
3237
|
+
setSegmentCollection(collection: SegmentCollection): void;
|
|
3238
|
+
/**
|
|
3239
|
+
* Get the segment collection.
|
|
3240
|
+
*
|
|
3241
|
+
* @returns {SegmentCollection|undefined} The segment collection.
|
|
3242
|
+
*/
|
|
3243
|
+
getSegmentCollection(): SegmentCollection | undefined;
|
|
3244
|
+
/**
|
|
3245
|
+
* Check whether the mask has overlapping segments.
|
|
3246
|
+
*
|
|
3247
|
+
* @returns {boolean} True if any two segments share at least one voxel.
|
|
3248
|
+
*/
|
|
3249
|
+
getHasOverlap(): boolean;
|
|
2917
3250
|
/**
|
|
2918
3251
|
* Get the image UID at a given index.
|
|
2919
3252
|
*
|
|
@@ -2974,6 +3307,18 @@ declare class Image_2 {
|
|
|
2974
3307
|
* @returns {boolean} True if the data is monochrome.
|
|
2975
3308
|
*/
|
|
2976
3309
|
isMonochrome(): boolean;
|
|
3310
|
+
/**
|
|
3311
|
+
* Check is the image is a mask.
|
|
3312
|
+
*
|
|
3313
|
+
* @returns {boolean} True if mask.
|
|
3314
|
+
*/
|
|
3315
|
+
isMask(): boolean;
|
|
3316
|
+
/**
|
|
3317
|
+
* Get the UID of the series referenced by the mask, if any.
|
|
3318
|
+
*
|
|
3319
|
+
* @returns {string|undefined} The UID.
|
|
3320
|
+
*/
|
|
3321
|
+
getMaskReferencedSeriesUID(): string | undefined;
|
|
2977
3322
|
/**
|
|
2978
3323
|
* Can the data be scrolled?
|
|
2979
3324
|
*
|
|
@@ -3069,19 +3414,15 @@ declare class Image_2 {
|
|
|
3069
3414
|
/**
|
|
3070
3415
|
* Get the meta information of the image.
|
|
3071
3416
|
*
|
|
3072
|
-
* @returns {
|
|
3417
|
+
* @returns {Record<string, any>} The meta information of the image.
|
|
3073
3418
|
*/
|
|
3074
|
-
getMeta():
|
|
3075
|
-
[x: string]: any;
|
|
3076
|
-
};
|
|
3419
|
+
getMeta(): Record<string, any>;
|
|
3077
3420
|
/**
|
|
3078
3421
|
* Set the meta information of the image.
|
|
3079
3422
|
*
|
|
3080
|
-
* @param {
|
|
3423
|
+
* @param {Record<string, any>} rhs The meta information of the image.
|
|
3081
3424
|
*/
|
|
3082
|
-
setMeta(rhs:
|
|
3083
|
-
[x: string]: any;
|
|
3084
|
-
}): void;
|
|
3425
|
+
setMeta(rhs: Record<string, any>): void;
|
|
3085
3426
|
/**
|
|
3086
3427
|
* Get value at offset. Warning: No size check...
|
|
3087
3428
|
*
|
|
@@ -3160,23 +3501,7 @@ declare class Image_2 {
|
|
|
3160
3501
|
*/
|
|
3161
3502
|
getHistogram(): any[];
|
|
3162
3503
|
/**
|
|
3163
|
-
*
|
|
3164
|
-
*
|
|
3165
|
-
* @param {string} type The event type.
|
|
3166
|
-
* @param {Function} callback The function associated with the provided
|
|
3167
|
-
* event type, will be called with the fired event.
|
|
3168
|
-
*/
|
|
3169
|
-
addEventListener(type: string, callback: Function): void;
|
|
3170
|
-
/**
|
|
3171
|
-
* Remove an event listener from this class.
|
|
3172
|
-
*
|
|
3173
|
-
* @param {string} type The event type.
|
|
3174
|
-
* @param {Function} callback The function associated with the provided
|
|
3175
|
-
* event type.
|
|
3176
|
-
*/
|
|
3177
|
-
removeEventListener(type: string, callback: Function): void;
|
|
3178
|
-
/**
|
|
3179
|
-
* Set the inner buffer values at given offsets.
|
|
3504
|
+
* Set the inner buffer values at given offsets.
|
|
3180
3505
|
*
|
|
3181
3506
|
* @param {number[]} offsets List of offsets where to set the data.
|
|
3182
3507
|
* @param {number|RGB} value The value to set at the given offsets.
|
|
@@ -3314,22 +3639,18 @@ declare class Image_2 {
|
|
|
3314
3639
|
*/
|
|
3315
3640
|
initializeContour(): void;
|
|
3316
3641
|
/**
|
|
3317
|
-
* Get
|
|
3318
|
-
*
|
|
3319
|
-
*
|
|
3320
|
-
*/
|
|
3321
|
-
countourIsInitialized(): boolean;
|
|
3322
|
-
/**
|
|
3323
|
-
* Calculate the distance to the nearest border pixel.
|
|
3324
|
-
* (or return the cached distance).
|
|
3642
|
+
* Get the image contour. Should only be available
|
|
3643
|
+
* for segmentation images, but can be initialized
|
|
3644
|
+
* for any Uint8Array image.
|
|
3325
3645
|
*
|
|
3326
|
-
* @
|
|
3327
|
-
* @param {Matrix33} viewOrientation The orientation of the view.
|
|
3328
|
-
* @returns {number} The distance to the nearest border pixel or 0.
|
|
3646
|
+
* @returns {ImageContour} The image contour.
|
|
3329
3647
|
*/
|
|
3330
|
-
|
|
3648
|
+
getContour(): ImageContour;
|
|
3331
3649
|
/**
|
|
3332
3650
|
* Recalculate labels.
|
|
3651
|
+
*
|
|
3652
|
+
* @fires Image#labelingstart
|
|
3653
|
+
* @fires Image#labelschanged
|
|
3333
3654
|
*/
|
|
3334
3655
|
recalculateLabels(): void;
|
|
3335
3656
|
/**
|
|
@@ -3355,6 +3676,64 @@ declare class Image_2 {
|
|
|
3355
3676
|
}
|
|
3356
3677
|
export { Image_2 as Image }
|
|
3357
3678
|
|
|
3679
|
+
/**
|
|
3680
|
+
* Image contour buffer manager.
|
|
3681
|
+
* Caches per-pixel distance-to-border values for contour rendering.
|
|
3682
|
+
* Stores 3 distance values per pixel (one per orientation: x, y, z).
|
|
3683
|
+
*/
|
|
3684
|
+
export declare class ImageContour {
|
|
3685
|
+
/**
|
|
3686
|
+
* Initialize the contour buffer.
|
|
3687
|
+
* Should be called on every segmentation image, or any image where
|
|
3688
|
+
* contour rendering needs to be supported.
|
|
3689
|
+
*
|
|
3690
|
+
* @param {Uint8Array} imageBuffer The image data buffer.
|
|
3691
|
+
* @param {Size} imageSize The image size.
|
|
3692
|
+
*/
|
|
3693
|
+
initialize(imageBuffer: Uint8Array, imageSize: Size): void;
|
|
3694
|
+
/**
|
|
3695
|
+
* Get whether or not the contour buffer has been initialized.
|
|
3696
|
+
*
|
|
3697
|
+
* @returns {boolean} True if buffer has been initialized.
|
|
3698
|
+
*/
|
|
3699
|
+
isInitialized(): boolean;
|
|
3700
|
+
/**
|
|
3701
|
+
* Re-allocate contour buffer memory after an image buffer resize.
|
|
3702
|
+
* Updates the stored image buffer and size references.
|
|
3703
|
+
*
|
|
3704
|
+
* @param {Uint8Array} imageBuffer The new image data buffer.
|
|
3705
|
+
* @param {Size} imageSize The new image size.
|
|
3706
|
+
*/
|
|
3707
|
+
realloc(imageBuffer: Uint8Array, imageSize: Size): void;
|
|
3708
|
+
/**
|
|
3709
|
+
* Shift contour buffer content to make room for an inserted slice.
|
|
3710
|
+
*
|
|
3711
|
+
* @param {number} contourIndexOffset Start offset of the slice to shift.
|
|
3712
|
+
* @param {number} contourSliceSize Size of one contour slice.
|
|
3713
|
+
* @param {number} contourMaxOffset End offset of content to shift.
|
|
3714
|
+
*/
|
|
3715
|
+
shiftSlice(contourIndexOffset: number, contourSliceSize: number, contourMaxOffset: number): void;
|
|
3716
|
+
/**
|
|
3717
|
+
* Reset contour buffer for the values around an offset.
|
|
3718
|
+
* Prevents certain artifacts, especially at small brush sizes
|
|
3719
|
+
* and when erasing.
|
|
3720
|
+
*
|
|
3721
|
+
* @param {number} offset The offset to reset.
|
|
3722
|
+
*/
|
|
3723
|
+
resetAroundOffset(offset: number): void;
|
|
3724
|
+
/**
|
|
3725
|
+
* Calculate the distance to the nearest border pixel
|
|
3726
|
+
* (or return the cached distance).
|
|
3727
|
+
* Returns 0 if the contour buffer is not initialized.
|
|
3728
|
+
*
|
|
3729
|
+
* @param {number} index Index/offset of the pixel to check.
|
|
3730
|
+
* @param {Matrix33} viewOrientation The orientation of the view.
|
|
3731
|
+
* @returns {number} The distance to the nearest border pixel or 0.
|
|
3732
|
+
*/
|
|
3733
|
+
getDistance(index: number, viewOrientation: Matrix33): number;
|
|
3734
|
+
#private;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3358
3737
|
/**
|
|
3359
3738
|
* Immutable index.
|
|
3360
3739
|
* Warning: the input array is NOT cloned, modifying it will
|
|
@@ -3450,15 +3829,13 @@ export declare class Index {
|
|
|
3450
3829
|
/**
|
|
3451
3830
|
* DICOM Header info data.
|
|
3452
3831
|
*/
|
|
3453
|
-
export declare class InfoData {
|
|
3832
|
+
export declare class InfoData extends EventTarget {
|
|
3454
3833
|
/**
|
|
3455
3834
|
* @param {App} app The associated application.
|
|
3456
3835
|
* @param {string} dataId The associated data id.
|
|
3457
|
-
* @param {
|
|
3836
|
+
* @param {Record<string, InfoDataItem[]>} configs The info data config.
|
|
3458
3837
|
*/
|
|
3459
|
-
constructor(app: App, dataId: string, configs:
|
|
3460
|
-
[x: string]: InfoDataItem[];
|
|
3461
|
-
});
|
|
3838
|
+
constructor(app: App, dataId: string, configs: Record<string, InfoDataItem[]>);
|
|
3462
3839
|
/**
|
|
3463
3840
|
* Reset the data.
|
|
3464
3841
|
*/
|
|
@@ -3466,17 +3843,15 @@ export declare class InfoData {
|
|
|
3466
3843
|
/**
|
|
3467
3844
|
* Handle a new loaded item event.
|
|
3468
3845
|
*
|
|
3469
|
-
* @param {
|
|
3846
|
+
* @param {Record<string, DataElement>} data The item meta data.
|
|
3470
3847
|
*/
|
|
3471
|
-
addItemMeta(data:
|
|
3472
|
-
[x: string]: DataElement;
|
|
3473
|
-
}): void;
|
|
3848
|
+
addItemMeta(data: Record<string, DataElement>): void;
|
|
3474
3849
|
/**
|
|
3475
3850
|
* Handle a changed slice event.
|
|
3476
3851
|
*
|
|
3477
|
-
* @param {
|
|
3852
|
+
* @param {CustomEvent} event The slicechange event.
|
|
3478
3853
|
*/
|
|
3479
|
-
onSliceChange: (event:
|
|
3854
|
+
onSliceChange: (event: CustomEvent) => void;
|
|
3480
3855
|
/**
|
|
3481
3856
|
* Is this class listening to app events.
|
|
3482
3857
|
*
|
|
@@ -3491,25 +3866,13 @@ export declare class InfoData {
|
|
|
3491
3866
|
* Toggle info listeners.
|
|
3492
3867
|
*/
|
|
3493
3868
|
removeAppListeners(): void;
|
|
3494
|
-
/**
|
|
3495
|
-
* Add an event listener to this class.
|
|
3496
|
-
*
|
|
3497
|
-
* @param {string} type The event type.
|
|
3498
|
-
* @param {object} callback The method associated with the provided
|
|
3499
|
-
* event type, will be called with the fired event.
|
|
3500
|
-
*/
|
|
3501
|
-
addEventListener(type: string, callback: object): void;
|
|
3502
|
-
/**
|
|
3503
|
-
* Remove an event listener from this class.
|
|
3504
|
-
*
|
|
3505
|
-
* @param {string} type The event type.
|
|
3506
|
-
* @param {object} callback The method associated with the provided
|
|
3507
|
-
* event type.
|
|
3508
|
-
*/
|
|
3509
|
-
removeEventListener(type: string, callback: object): void;
|
|
3510
3869
|
#private;
|
|
3511
3870
|
}
|
|
3512
3871
|
|
|
3872
|
+
/**
|
|
3873
|
+
* @import {App} from '../app/application.js';
|
|
3874
|
+
* @import {DataElement} from '../dicom/dataElement.js';
|
|
3875
|
+
*/
|
|
3513
3876
|
/**
|
|
3514
3877
|
* Info data item class.
|
|
3515
3878
|
*/
|
|
@@ -3570,9 +3933,9 @@ export declare class Label {
|
|
|
3570
3933
|
/**
|
|
3571
3934
|
* The volume of the labeled segment.
|
|
3572
3935
|
*
|
|
3573
|
-
* @type {
|
|
3936
|
+
* @type {NumberValue}
|
|
3574
3937
|
*/
|
|
3575
|
-
volume:
|
|
3938
|
+
volume: NumberValue;
|
|
3576
3939
|
/**
|
|
3577
3940
|
* The voxel count of the labeled segment.
|
|
3578
3941
|
*
|
|
@@ -3588,9 +3951,9 @@ export declare class Label {
|
|
|
3588
3951
|
/**
|
|
3589
3952
|
* The scaled height of the segment.
|
|
3590
3953
|
*
|
|
3591
|
-
* @type {
|
|
3954
|
+
* @type {NumberValue}
|
|
3592
3955
|
*/
|
|
3593
|
-
height:
|
|
3956
|
+
height: NumberValue;
|
|
3594
3957
|
/**
|
|
3595
3958
|
* The segment label id.
|
|
3596
3959
|
*
|
|
@@ -3630,7 +3993,7 @@ export declare function labToUintLab(triplet: object): object;
|
|
|
3630
3993
|
* - planePos = viewController.getOffset3DFromPlaneOffset(pos)
|
|
3631
3994
|
* no need yet for a planePos to displayPos...
|
|
3632
3995
|
*/
|
|
3633
|
-
export declare class LayerGroup {
|
|
3996
|
+
export declare class LayerGroup extends EventTarget {
|
|
3634
3997
|
/**
|
|
3635
3998
|
* @param {HTMLElement} containerDiv The associated HTML div.
|
|
3636
3999
|
* @param {boolean} [withInfoLayer] Optional with info layer flag,
|
|
@@ -3937,10 +4300,10 @@ export declare class LayerGroup {
|
|
|
3937
4300
|
/**
|
|
3938
4301
|
* Update layers (but not the event source layer) to a position change.
|
|
3939
4302
|
*
|
|
3940
|
-
* @param {
|
|
4303
|
+
* @param {CustomEvent} event The position change event.
|
|
3941
4304
|
* @function
|
|
3942
4305
|
*/
|
|
3943
|
-
updateLayersToPositionChange: (event:
|
|
4306
|
+
updateLayersToPositionChange: (event: CustomEvent) => void;
|
|
3944
4307
|
/**
|
|
3945
4308
|
* Calculate the div to world size ratio needed to fit
|
|
3946
4309
|
* the largest data.
|
|
@@ -4016,22 +4379,6 @@ export declare class LayerGroup {
|
|
|
4016
4379
|
* @param {boolean} flag Whether to display the layer or not.
|
|
4017
4380
|
*/
|
|
4018
4381
|
display(flag: boolean): void;
|
|
4019
|
-
/**
|
|
4020
|
-
* Add an event listener to this class.
|
|
4021
|
-
*
|
|
4022
|
-
* @param {string} type The event type.
|
|
4023
|
-
* @param {Function} callback The function associated with the provided
|
|
4024
|
-
* event type, will be called with the fired event.
|
|
4025
|
-
*/
|
|
4026
|
-
addEventListener(type: string, callback: Function): void;
|
|
4027
|
-
/**
|
|
4028
|
-
* Remove an event listener from this class.
|
|
4029
|
-
*
|
|
4030
|
-
* @param {string} type The event type.
|
|
4031
|
-
* @param {Function} callback The function associated with the provided
|
|
4032
|
-
* event type.
|
|
4033
|
-
*/
|
|
4034
|
-
removeEventListener(type: string, callback: Function): void;
|
|
4035
4382
|
#private;
|
|
4036
4383
|
}
|
|
4037
4384
|
|
|
@@ -4044,21 +4391,45 @@ export declare namespace logger {
|
|
|
4044
4391
|
let ERROR: number;
|
|
4045
4392
|
}
|
|
4046
4393
|
let level: number;
|
|
4394
|
+
/**
|
|
4395
|
+
* Log a trace message.
|
|
4396
|
+
*
|
|
4397
|
+
* @param {string} msg The message to log.
|
|
4398
|
+
*/
|
|
4047
4399
|
export function trace(msg: string): void;
|
|
4400
|
+
/**
|
|
4401
|
+
* Log a debug message.
|
|
4402
|
+
* Careful: depends on console settings.
|
|
4403
|
+
*
|
|
4404
|
+
* @param {string} msg The message to log.
|
|
4405
|
+
*/
|
|
4048
4406
|
export function debug(msg: string): void;
|
|
4407
|
+
/**
|
|
4408
|
+
* Log an info message.
|
|
4409
|
+
*
|
|
4410
|
+
* @param {string} msg The message to log.
|
|
4411
|
+
*/
|
|
4049
4412
|
export function info(msg: string): void;
|
|
4413
|
+
/**
|
|
4414
|
+
* Log a warn message.
|
|
4415
|
+
*
|
|
4416
|
+
* @param {string} msg The message to log.
|
|
4417
|
+
*/
|
|
4050
4418
|
export function warn(msg: string): void;
|
|
4419
|
+
/**
|
|
4420
|
+
* Log an error message.
|
|
4421
|
+
*
|
|
4422
|
+
* @param {string} msg The message to log.
|
|
4423
|
+
*/
|
|
4051
4424
|
export function error(msg: string): void;
|
|
4052
4425
|
}
|
|
4053
4426
|
|
|
4054
4427
|
/**
|
|
4055
4428
|
* List of available lookup tables (lut).
|
|
4056
4429
|
*
|
|
4057
|
-
* @type {
|
|
4430
|
+
* @type {Record<string, ColourMap>}
|
|
4058
4431
|
*/
|
|
4059
|
-
export declare const luts:
|
|
4060
|
-
[x: string]: ColourMap;
|
|
4061
|
-
};
|
|
4432
|
+
export declare const luts: Record<string, ColourMap>;
|
|
4062
4433
|
|
|
4063
4434
|
/**
|
|
4064
4435
|
* Mask {@link Image} factory.
|
|
@@ -4074,41 +4445,31 @@ export declare class MaskFactory {
|
|
|
4074
4445
|
/**
|
|
4075
4446
|
* Check dicom elements.
|
|
4076
4447
|
*
|
|
4077
|
-
* @param {
|
|
4448
|
+
* @param {Record<string, DataElement>} _dicomElements The DICOM tags.
|
|
4078
4449
|
* @returns {string|undefined} A possible warning.
|
|
4079
4450
|
*/
|
|
4080
|
-
checkElements(_dicomElements:
|
|
4081
|
-
[x: string]: DataElement;
|
|
4082
|
-
}): string | undefined;
|
|
4451
|
+
checkElements(_dicomElements: Record<string, DataElement>): string | undefined;
|
|
4083
4452
|
/**
|
|
4084
4453
|
* Get an {@link Image} object from the read DICOM file.
|
|
4085
4454
|
*
|
|
4086
|
-
* @param {
|
|
4087
|
-
* @param {Uint8Array
|
|
4088
|
-
* Uint16Array | Int16Array |
|
|
4089
|
-
* Uint32Array | Int32Array} pixelBuffer The pixel buffer.
|
|
4455
|
+
* @param {Record<string, DataElement>} dataElements The DICOM tags.
|
|
4456
|
+
* @param {Uint8Array} pixelBuffer The pixel buffer.
|
|
4090
4457
|
* @param {Image} [refImage] Reference image, code will use its
|
|
4091
4458
|
* origins if present (best) or try to calculate them.
|
|
4092
4459
|
* @returns {Image} A new Image.
|
|
4093
4460
|
* @throws {Error} Error for missing or wrong data.
|
|
4094
4461
|
*/
|
|
4095
|
-
create(dataElements:
|
|
4096
|
-
[x: string]: DataElement;
|
|
4097
|
-
}, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array, refImage?: Image_2): Image_2;
|
|
4462
|
+
create(dataElements: Record<string, DataElement>, pixelBuffer: Uint8Array, refImage?: Image_2): Image_2;
|
|
4098
4463
|
/**
|
|
4099
4464
|
* Convert a mask image into a DICOM segmentation object.
|
|
4100
4465
|
*
|
|
4101
4466
|
* @param {Image} image The mask image.
|
|
4102
4467
|
* @param {MaskSegment[]} segments The mask segments.
|
|
4103
4468
|
* @param {Image} sourceImage The source image.
|
|
4104
|
-
* @param {
|
|
4105
|
-
* @returns {
|
|
4469
|
+
* @param {Record<string, any>} [extraTags] Optional list of extra tags.
|
|
4470
|
+
* @returns {Record<string, DataElement>} A list of dicom elements.
|
|
4106
4471
|
*/
|
|
4107
|
-
toDicom(image: Image_2, segments: MaskSegment[], sourceImage: Image_2, extraTags?:
|
|
4108
|
-
[x: string]: any;
|
|
4109
|
-
}): {
|
|
4110
|
-
[x: string]: DataElement;
|
|
4111
|
-
};
|
|
4472
|
+
toDicom(image: Image_2, segments: MaskSegment[], sourceImage: Image_2, extraTags?: Record<string, any>): Record<string, DataElement>;
|
|
4112
4473
|
#private;
|
|
4113
4474
|
}
|
|
4114
4475
|
|
|
@@ -4188,6 +4549,10 @@ export declare class MaskSegment {
|
|
|
4188
4549
|
trackingId: string | undefined;
|
|
4189
4550
|
}
|
|
4190
4551
|
|
|
4552
|
+
/**
|
|
4553
|
+
* @import {Image} from './image.js';
|
|
4554
|
+
* @import {MaskSegment} from '../dicom/dicomSegment.js';
|
|
4555
|
+
*/
|
|
4191
4556
|
/**
|
|
4192
4557
|
* Mask segment helper: helps handling the segments list,
|
|
4193
4558
|
* but does *NOT* update the associated mask (use special commands
|
|
@@ -4264,7 +4629,7 @@ export declare class MaskSegmentHelper {
|
|
|
4264
4629
|
*
|
|
4265
4630
|
* @typedef Overlap@typedef Overlap
|
|
4266
4631
|
* @property {string} label The segment label.
|
|
4267
|
-
* @property {
|
|
4632
|
+
* @property {Record<number, OverlapCount>} overlap A Dictionary
|
|
4268
4633
|
* containing the counts. The key is the segment number of the overlapping
|
|
4269
4634
|
* segment.
|
|
4270
4635
|
* @property {number} count The voxel volume of this segment.
|
|
@@ -4276,7 +4641,7 @@ export declare class MaskSegmentHelper {
|
|
|
4276
4641
|
* The value is a Dictionary of all of the segments in the second set
|
|
4277
4642
|
* that overlap with the key segment.
|
|
4278
4643
|
*
|
|
4279
|
-
* @typedef {
|
|
4644
|
+
* @typedef {Record<number, Overlap>} OverlapMap
|
|
4280
4645
|
*/
|
|
4281
4646
|
/**
|
|
4282
4647
|
* Find the overlap for each segment between two segmentation masks.
|
|
@@ -4287,39 +4652,35 @@ export declare class MaskSegmentHelper {
|
|
|
4287
4652
|
* @returns {OverlapMap} The overlapping voxel counts. First level is the
|
|
4288
4653
|
* segments from this image, second level is the compare image segments.
|
|
4289
4654
|
*/
|
|
4290
|
-
findOverlap(rhs: MaskSegmentHelper): {
|
|
4291
|
-
|
|
4655
|
+
findOverlap(rhs: MaskSegmentHelper): Record<number, {
|
|
4656
|
+
/**
|
|
4657
|
+
* The segment label.
|
|
4658
|
+
*/
|
|
4659
|
+
label: string;
|
|
4660
|
+
/**
|
|
4661
|
+
* A Dictionary
|
|
4662
|
+
* containing the counts. The key is the segment number of the overlapping
|
|
4663
|
+
* segment.
|
|
4664
|
+
*/
|
|
4665
|
+
overlap: Record<number, {
|
|
4292
4666
|
/**
|
|
4293
4667
|
* The segment label.
|
|
4294
4668
|
*/
|
|
4295
4669
|
label: string;
|
|
4296
4670
|
/**
|
|
4297
|
-
*
|
|
4298
|
-
* containing the counts. The key is the segment number of the overlapping
|
|
4299
|
-
* segment.
|
|
4671
|
+
* The number of overlapping voxels.
|
|
4300
4672
|
*/
|
|
4301
|
-
|
|
4302
|
-
[x: number]: {
|
|
4303
|
-
/**
|
|
4304
|
-
* The segment label.
|
|
4305
|
-
*/
|
|
4306
|
-
label: string;
|
|
4307
|
-
/**
|
|
4308
|
-
* The number of overlapping voxels.
|
|
4309
|
-
*/
|
|
4310
|
-
count: number;
|
|
4311
|
-
/**
|
|
4312
|
-
* The overlap percentage between 0 and 100.
|
|
4313
|
-
*/
|
|
4314
|
-
percentage: number;
|
|
4315
|
-
};
|
|
4316
|
-
};
|
|
4673
|
+
count: number;
|
|
4317
4674
|
/**
|
|
4318
|
-
* The
|
|
4675
|
+
* The overlap percentage between 0 and 100.
|
|
4319
4676
|
*/
|
|
4320
|
-
|
|
4321
|
-
}
|
|
4322
|
-
|
|
4677
|
+
percentage: number;
|
|
4678
|
+
}>;
|
|
4679
|
+
/**
|
|
4680
|
+
* The voxel volume of this segment.
|
|
4681
|
+
*/
|
|
4682
|
+
count: number;
|
|
4683
|
+
}>;
|
|
4323
4684
|
#private;
|
|
4324
4685
|
}
|
|
4325
4686
|
|
|
@@ -4388,6 +4749,15 @@ export declare class Matrix33 {
|
|
|
4388
4749
|
* @returns {boolean} True if both matrices are similar.
|
|
4389
4750
|
*/
|
|
4390
4751
|
isSimilar(rhs: Matrix33, tol?: number): boolean;
|
|
4752
|
+
/**
|
|
4753
|
+
* Check for Matrix33 similarity with progressive tolerance (up to 10*tol).
|
|
4754
|
+
*
|
|
4755
|
+
* @param {Matrix33} rhs The other matrix to compare to.
|
|
4756
|
+
* @param {number} [tol] Optional number comparison tolerance,
|
|
4757
|
+
* defaults to Number.EPSILON.
|
|
4758
|
+
* @returns {boolean} True if both matrices are similar.
|
|
4759
|
+
*/
|
|
4760
|
+
isSimilarProgressive(rhs: Matrix33, tol?: number): boolean;
|
|
4391
4761
|
/**
|
|
4392
4762
|
* Get a string representation of the Matrix33.
|
|
4393
4763
|
*
|
|
@@ -4491,7 +4861,7 @@ export declare namespace NormalisedManufacturers {
|
|
|
4491
4861
|
}
|
|
4492
4862
|
|
|
4493
4863
|
/**
|
|
4494
|
-
* Number range.
|
|
4864
|
+
* Number range: [min, max].
|
|
4495
4865
|
*/
|
|
4496
4866
|
export declare class NumberRange {
|
|
4497
4867
|
/**
|
|
@@ -4509,12 +4879,34 @@ export declare class NumberRange {
|
|
|
4509
4879
|
max: number;
|
|
4510
4880
|
}
|
|
4511
4881
|
|
|
4882
|
+
/**
|
|
4883
|
+
* Class to store a number value and a unit.
|
|
4884
|
+
*/
|
|
4885
|
+
export declare class NumberValue {
|
|
4886
|
+
/**
|
|
4887
|
+
* @type {number}
|
|
4888
|
+
*/
|
|
4889
|
+
value: number;
|
|
4890
|
+
/**
|
|
4891
|
+
* @type {string|undefined}
|
|
4892
|
+
*/
|
|
4893
|
+
unit: string | undefined;
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4512
4896
|
export declare namespace Orientation {
|
|
4513
4897
|
let Axial: string;
|
|
4514
4898
|
let Coronal: string;
|
|
4515
4899
|
let Sagittal: string;
|
|
4516
4900
|
}
|
|
4517
4901
|
|
|
4902
|
+
/**
|
|
4903
|
+
* @import {Point} from '../math/point.js';
|
|
4904
|
+
* @import {Index} from '../math/index.js';
|
|
4905
|
+
* @import {Geometry} from '../image/geometry.js';
|
|
4906
|
+
* @import {Matrix33} from '../math/matrix.js';
|
|
4907
|
+
* @import {Spacing} from './spacing.js';
|
|
4908
|
+
* @import {Scalar2D, Scalar3D} from '../math/scalar.js';
|
|
4909
|
+
*/
|
|
4518
4910
|
/**
|
|
4519
4911
|
* Plane geometry helper.
|
|
4520
4912
|
*/
|
|
@@ -5055,6 +5447,11 @@ export declare class PositionHelper {
|
|
|
5055
5447
|
*/
|
|
5056
5448
|
export declare function precisionRound(number: number, precision: number): number;
|
|
5057
5449
|
|
|
5450
|
+
/**
|
|
5451
|
+
* @import {Point2D} from '../math/point.js';
|
|
5452
|
+
* @import {NumberValue} from './number.js';
|
|
5453
|
+
* @import {ViewController} from '../app/viewController.js';
|
|
5454
|
+
*/
|
|
5058
5455
|
/**
|
|
5059
5456
|
* Protractor shape: 3 points from which to calculate an angle.
|
|
5060
5457
|
*/
|
|
@@ -5089,11 +5486,9 @@ export declare class Protractor {
|
|
|
5089
5486
|
*
|
|
5090
5487
|
* @param {ViewController} _viewController The associated view controller.
|
|
5091
5488
|
* @param {string[]} _flags A list of stat values to calculate.
|
|
5092
|
-
* @returns {
|
|
5489
|
+
* @returns {Record<string, NumberValue>} A quantification object.
|
|
5093
5490
|
*/
|
|
5094
|
-
quantify(_viewController: ViewController, _flags: string[]):
|
|
5095
|
-
[x: string]: Value;
|
|
5096
|
-
};
|
|
5491
|
+
quantify(_viewController: ViewController, _flags: string[]): Record<string, NumberValue>;
|
|
5097
5492
|
#private;
|
|
5098
5493
|
}
|
|
5099
5494
|
|
|
@@ -5184,11 +5579,9 @@ export declare class Rectangle {
|
|
|
5184
5579
|
* @param {Index} index The index at which to get the
|
|
5185
5580
|
* image values.
|
|
5186
5581
|
* @param {string[]} flags A list of stat values to calculate.
|
|
5187
|
-
* @returns {
|
|
5582
|
+
* @returns {Record<string, NumberValue>} A quantification object.
|
|
5188
5583
|
*/
|
|
5189
|
-
quantify(viewController: ViewController, index: Index, flags: string[]):
|
|
5190
|
-
[x: string]: Value;
|
|
5191
|
-
};
|
|
5584
|
+
quantify(viewController: ViewController, index: Index, flags: string[]): Record<string, NumberValue>;
|
|
5192
5585
|
#private;
|
|
5193
5586
|
}
|
|
5194
5587
|
|
|
@@ -5254,6 +5647,9 @@ export declare class ResponseEvaluation {
|
|
|
5254
5647
|
measure: number;
|
|
5255
5648
|
}
|
|
5256
5649
|
|
|
5650
|
+
/**
|
|
5651
|
+
* @import {Scalar3D} from '../math/scalar.js';
|
|
5652
|
+
*/
|
|
5257
5653
|
/**
|
|
5258
5654
|
* RGB colour class.
|
|
5259
5655
|
*/
|
|
@@ -5344,6 +5740,140 @@ export declare class ROI {
|
|
|
5344
5740
|
#private;
|
|
5345
5741
|
}
|
|
5346
5742
|
|
|
5743
|
+
/**
|
|
5744
|
+
* An RT Region of Interest with its display colour and contours.
|
|
5745
|
+
*/
|
|
5746
|
+
export declare class RTROI {
|
|
5747
|
+
/**
|
|
5748
|
+
* ROI number as stored in the DICOM file.
|
|
5749
|
+
*
|
|
5750
|
+
* @type {number}
|
|
5751
|
+
*/
|
|
5752
|
+
number: number;
|
|
5753
|
+
/**
|
|
5754
|
+
* ROI name.
|
|
5755
|
+
*
|
|
5756
|
+
* @type {string}
|
|
5757
|
+
*/
|
|
5758
|
+
name: string;
|
|
5759
|
+
/**
|
|
5760
|
+
* Display colour as {r, g, b} values in [0, 255].
|
|
5761
|
+
*
|
|
5762
|
+
* @type {{r: number, g: number, b: number}}
|
|
5763
|
+
*/
|
|
5764
|
+
colour: {
|
|
5765
|
+
r: number;
|
|
5766
|
+
g: number;
|
|
5767
|
+
b: number;
|
|
5768
|
+
};
|
|
5769
|
+
/**
|
|
5770
|
+
* List of contours belonging to this ROI.
|
|
5771
|
+
*
|
|
5772
|
+
* @type {RTROIContour[]}
|
|
5773
|
+
*/
|
|
5774
|
+
contours: RTROIContour[];
|
|
5775
|
+
}
|
|
5776
|
+
|
|
5777
|
+
/**
|
|
5778
|
+
* A single planar contour of an RT ROI.
|
|
5779
|
+
*/
|
|
5780
|
+
export declare class RTROIContour {
|
|
5781
|
+
/**
|
|
5782
|
+
* Contour geometric type (e.g. 'CLOSED_PLANAR').
|
|
5783
|
+
*
|
|
5784
|
+
* @type {string}
|
|
5785
|
+
*/
|
|
5786
|
+
type: string;
|
|
5787
|
+
/**
|
|
5788
|
+
* Flat array of 3D patient-space coordinates in mm:
|
|
5789
|
+
* [x0,y0,z0, x1,y1,z1, ...].
|
|
5790
|
+
*
|
|
5791
|
+
* @type {number[]}
|
|
5792
|
+
*/
|
|
5793
|
+
points3D: number[];
|
|
5794
|
+
}
|
|
5795
|
+
|
|
5796
|
+
/**
|
|
5797
|
+
* {@link Image} factory for DICOM RT Structure Set (RTSTRUCT).
|
|
5798
|
+
*
|
|
5799
|
+
* Rasterizes ROI contour polygons into a PALETTE COLOR mask image using
|
|
5800
|
+
* the same geometry as the reference CT/MR image so that the result can
|
|
5801
|
+
* be rendered by the existing mask pipeline.
|
|
5802
|
+
*/
|
|
5803
|
+
export declare class RtStructFactory {
|
|
5804
|
+
/**
|
|
5805
|
+
* Get a warning string if elements are not as expected.
|
|
5806
|
+
*
|
|
5807
|
+
* @returns {string|undefined} The warning.
|
|
5808
|
+
*/
|
|
5809
|
+
getWarning(): string | undefined;
|
|
5810
|
+
/**
|
|
5811
|
+
* Check dicom elements.
|
|
5812
|
+
*
|
|
5813
|
+
* @param {Record<string, DataElement>} _dataElements The DICOM data elements.
|
|
5814
|
+
* @returns {string|undefined} A possible warning.
|
|
5815
|
+
*/
|
|
5816
|
+
checkElements(_dataElements: Record<string, DataElement>): string | undefined;
|
|
5817
|
+
/**
|
|
5818
|
+
* Get a mask {@link Image} from RTSTRUCT DICOM elements.
|
|
5819
|
+
*
|
|
5820
|
+
* Contours are rasterized into a Uint8Array whose voxel values are
|
|
5821
|
+
* segment numbers (0 = background, 1..N = ROI index).
|
|
5822
|
+
* A PALETTE COLOR colour map maps each segment number to the ROI's
|
|
5823
|
+
* display colour.
|
|
5824
|
+
*
|
|
5825
|
+
* @param {Record<string, DataElement>} dataElements The DICOM data elements.
|
|
5826
|
+
* @param {Image} refImage The reference image (CT/MR) that was loaded first.
|
|
5827
|
+
* @returns {Image} The mask image.
|
|
5828
|
+
* @throws {Error} If the reference image geometry cannot be used.
|
|
5829
|
+
*/
|
|
5830
|
+
create(dataElements: Record<string, DataElement>, refImage: Image_2): Image_2;
|
|
5831
|
+
/**
|
|
5832
|
+
* Convert a mask {@link Image} into DICOM RT Structure Set elements.
|
|
5833
|
+
*
|
|
5834
|
+
* Traces each segment's pixel regions per slice using Moore neighborhood
|
|
5835
|
+
* contour tracing, simplifies with Ramer-Douglas-Peucker, then maps the
|
|
5836
|
+
* 2D pixel coordinates back to 3D patient-space coordinates.
|
|
5837
|
+
*
|
|
5838
|
+
* @param {Image} image The mask image.
|
|
5839
|
+
* @param {MaskSegment[]} [segments] The mask segments; if omitted, taken
|
|
5840
|
+
* from image meta.
|
|
5841
|
+
* @param {Image} [sourceImage] Source image (provides StudyInstanceUID).
|
|
5842
|
+
* @param {Record<string, any>} [extraTags] Optional extra tags to merge.
|
|
5843
|
+
* @returns {Record<string, DataElement>} The DICOM data elements.
|
|
5844
|
+
*/
|
|
5845
|
+
toDicom(image: Image_2, segments?: MaskSegment[], sourceImage?: Image_2, extraTags?: Record<string, any>): Record<string, DataElement>;
|
|
5846
|
+
#private;
|
|
5847
|
+
}
|
|
5848
|
+
|
|
5849
|
+
/**
|
|
5850
|
+
* @import {App} from '../app/application.js';
|
|
5851
|
+
*/
|
|
5852
|
+
/**
|
|
5853
|
+
* Run filter command.
|
|
5854
|
+
*/
|
|
5855
|
+
export declare class RunFilterCommand extends Command {
|
|
5856
|
+
/**
|
|
5857
|
+
* @param {object} filter The filter to run.
|
|
5858
|
+
* @param {string} dataId The data to filter.
|
|
5859
|
+
* @param {App} app The associated application.
|
|
5860
|
+
*/
|
|
5861
|
+
constructor(filter: object, dataId: string, app: App);
|
|
5862
|
+
/**
|
|
5863
|
+
* Handle an execute event.
|
|
5864
|
+
*
|
|
5865
|
+
* @param {object} _event The execute event with type and id.
|
|
5866
|
+
*/
|
|
5867
|
+
onExecute(_event: object): void;
|
|
5868
|
+
/**
|
|
5869
|
+
* Handle an undo event.
|
|
5870
|
+
*
|
|
5871
|
+
* @param {object} _event The undo event with type and id.
|
|
5872
|
+
*/
|
|
5873
|
+
onUndo(_event: object): void;
|
|
5874
|
+
#private;
|
|
5875
|
+
}
|
|
5876
|
+
|
|
5347
5877
|
/**
|
|
5348
5878
|
* Mutable 2D scalar ({x,y}).
|
|
5349
5879
|
*/
|
|
@@ -5387,23 +5917,111 @@ export declare class Scalar3D {
|
|
|
5387
5917
|
}
|
|
5388
5918
|
|
|
5389
5919
|
/**
|
|
5390
|
-
*
|
|
5391
|
-
|
|
5920
|
+
* Slice / dimension scrolling on wheel ticks.
|
|
5921
|
+
*/
|
|
5922
|
+
export declare class ScrollWheelBehavior extends WheelBehavior {
|
|
5923
|
+
}
|
|
5924
|
+
|
|
5925
|
+
/**
|
|
5926
|
+
* Collection of mask segments: stores per-segment, per-slice pixel data
|
|
5927
|
+
* and segment metadata. Builds the combined label map on demand.
|
|
5928
|
+
* TODO: check if mergeable with MaskSegmentHelper.
|
|
5392
5929
|
*/
|
|
5393
|
-
export declare class
|
|
5930
|
+
export declare class SegmentCollection {
|
|
5394
5931
|
/**
|
|
5395
|
-
* @param {
|
|
5932
|
+
* @param {Geometry} geometry The mask geometry, used to size the label map.
|
|
5396
5933
|
*/
|
|
5397
|
-
constructor(
|
|
5934
|
+
constructor(geometry: Geometry);
|
|
5398
5935
|
/**
|
|
5399
|
-
*
|
|
5936
|
+
* Get all the segments.
|
|
5400
5937
|
*
|
|
5401
|
-
* @
|
|
5938
|
+
* @returns {Map<number, Map<number, Uint8Array>>} The segment buffers,
|
|
5939
|
+
* indexed by segment number and slice index.
|
|
5402
5940
|
*/
|
|
5403
|
-
|
|
5941
|
+
getAll(): Map<number, Map<number, Uint8Array>>;
|
|
5942
|
+
/**
|
|
5943
|
+
* Set the label map directly.
|
|
5944
|
+
* Used when the buffer already exists, for brush-painted masks.
|
|
5945
|
+
*
|
|
5946
|
+
* @param {Uint8Array} buffer The label map buffer.
|
|
5947
|
+
*/
|
|
5948
|
+
setLabelMap(buffer: Uint8Array): void;
|
|
5949
|
+
/**
|
|
5950
|
+
* Add pixel data for one DICOM frame to the appropriate segment and slice.
|
|
5951
|
+
* Allocates a Uint8Array(sliceSize) on first use for each
|
|
5952
|
+
* (segNumber, sliceIndex) pair; merges if the same pair appears again.
|
|
5953
|
+
*
|
|
5954
|
+
* @param {number} segNumber The segment number.
|
|
5955
|
+
* @param {Uint8Array} pixelBuffer The raw DICOM pixel buffer.
|
|
5956
|
+
* @param {number} frameOffset Offset of this frame within pixelBuffer.
|
|
5957
|
+
* @param {number} sliceIndex The slice index in the full label map geometry.
|
|
5958
|
+
* @param {number} sliceSize Number of pixels per slice (ncols * nrows).
|
|
5959
|
+
* @param {number} value The value to write for non-zero pixels.
|
|
5960
|
+
*/
|
|
5961
|
+
addFrame(segNumber: number, pixelBuffer: Uint8Array, frameOffset: number, sliceIndex: number, sliceSize: number, value: number): void;
|
|
5962
|
+
/**
|
|
5963
|
+
* Build and return the combined label map (lazy cached).
|
|
5964
|
+
* Iterates segments in insertion order so lower segment numbers win
|
|
5965
|
+
* at overlapping positions. Sets the hasOverlap flag if any voxel
|
|
5966
|
+
* already carries a different segment's value.
|
|
5967
|
+
*
|
|
5968
|
+
* @returns {Uint8Array} The full-volume label map.
|
|
5969
|
+
*/
|
|
5970
|
+
getLabelMap(): Uint8Array;
|
|
5971
|
+
/**
|
|
5972
|
+
* Check whether any two segments share at least one voxel.
|
|
5973
|
+
*
|
|
5974
|
+
* @returns {boolean} True if overlap was detected.
|
|
5975
|
+
*/
|
|
5976
|
+
getHasOverlap(): boolean;
|
|
5977
|
+
/**
|
|
5978
|
+
* Get the segment buffers. Using input image and segments since they
|
|
5979
|
+
* could have been modified (for example by brush).
|
|
5980
|
+
*
|
|
5981
|
+
* When per-segment data is available (MaskFactory path), builds ROI buffers
|
|
5982
|
+
* directly from #segments so that overlap pixels for every segment are
|
|
5983
|
+
* included. Falls back to label-map reconstruction for masks created via
|
|
5984
|
+
* setupSegmentCollection (brush path), where #segments is empty and the
|
|
5985
|
+
* label map is the only source of truth.
|
|
5986
|
+
*
|
|
5987
|
+
* @param {MaskSegment[]} segments The mask segments.
|
|
5988
|
+
* @returns {Record<string, Record<number, Uint8Array>>} The segment buffers,
|
|
5989
|
+
* indexed by segment index (segment.number - 1) and slice index.
|
|
5990
|
+
*/
|
|
5991
|
+
getSegmentBuffers(segments: MaskSegment[]): Record<string, Record<number, Uint8Array>>;
|
|
5992
|
+
/**
|
|
5993
|
+
* Get the union ImageContour for the current visibility state,
|
|
5994
|
+
* building it if the set of hidden segments has changed.
|
|
5995
|
+
*
|
|
5996
|
+
* @param {MaskSegmentViewHelper|undefined} segmentViewHelper
|
|
5997
|
+
* Hidden-segment tracker.
|
|
5998
|
+
* @param {Size} imageSize The image size.
|
|
5999
|
+
* @returns {ImageContour} The union ImageContour.
|
|
6000
|
+
*/
|
|
6001
|
+
getOrBuildUnionContour(segmentViewHelper: MaskSegmentViewHelper | undefined, imageSize: Size): ImageContour;
|
|
5404
6002
|
#private;
|
|
5405
6003
|
}
|
|
5406
6004
|
|
|
6005
|
+
/**
|
|
6006
|
+
* Simplify a polygon using the Ramer-Douglas-Peucker algorithm.
|
|
6007
|
+
* Ref: {@link https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm}.
|
|
6008
|
+
*
|
|
6009
|
+
* @param {Array.<{x: number, y: number}>} pts Input vertices.
|
|
6010
|
+
* @param {number} epsilon Max allowed deviation in pixels.
|
|
6011
|
+
* @returns {Array.<{x: number, y: number}>} Simplified vertices.
|
|
6012
|
+
*/
|
|
6013
|
+
export declare function simplifyPolygon(pts: Array<{
|
|
6014
|
+
x: number;
|
|
6015
|
+
y: number;
|
|
6016
|
+
}>, epsilon: number): Array<{
|
|
6017
|
+
x: number;
|
|
6018
|
+
y: number;
|
|
6019
|
+
}>;
|
|
6020
|
+
|
|
6021
|
+
/**
|
|
6022
|
+
* @import {Matrix33} from '../math/matrix.js';
|
|
6023
|
+
* @import {Scalar2D} from '../math/scalar.js';
|
|
6024
|
+
*/
|
|
5407
6025
|
/**
|
|
5408
6026
|
* Immutable Size class.
|
|
5409
6027
|
* Warning: the input array is NOT cloned, modifying it will
|
|
@@ -5531,6 +6149,9 @@ export declare class Size {
|
|
|
5531
6149
|
#private;
|
|
5532
6150
|
}
|
|
5533
6151
|
|
|
6152
|
+
/**
|
|
6153
|
+
* @import {Scalar2D} from '../math/scalar.js';
|
|
6154
|
+
*/
|
|
5534
6155
|
/**
|
|
5535
6156
|
* Immutable Spacing class.
|
|
5536
6157
|
* Warning: the input array is NOT cloned, modifying it will
|
|
@@ -5590,6 +6211,252 @@ export declare class Spacing {
|
|
|
5590
6211
|
*/
|
|
5591
6212
|
export declare function srgbToCielab(triplet: RGB): object;
|
|
5592
6213
|
|
|
6214
|
+
/**
|
|
6215
|
+
* Stage controller: manages the link between the data view configs
|
|
6216
|
+
* and the stage (layer groups, layers, rendering).
|
|
6217
|
+
*/
|
|
6218
|
+
export declare class StageController extends EventTarget {
|
|
6219
|
+
/**
|
|
6220
|
+
* @param {DataController} dataController The data controller.
|
|
6221
|
+
* @param {object} options The app options.
|
|
6222
|
+
*/
|
|
6223
|
+
constructor(dataController: DataController, options: object);
|
|
6224
|
+
/**
|
|
6225
|
+
* Set the toolbox controller.
|
|
6226
|
+
*
|
|
6227
|
+
* @param {ToolboxController} tc The toolbox controller.
|
|
6228
|
+
*/
|
|
6229
|
+
setToolboxController(tc: ToolboxController): void;
|
|
6230
|
+
/**
|
|
6231
|
+
* Set the add-to-undo-stack callback.
|
|
6232
|
+
*
|
|
6233
|
+
* @param {Function} fn The callback.
|
|
6234
|
+
*/
|
|
6235
|
+
setAddToUndoStack(fn: Function): void;
|
|
6236
|
+
/**
|
|
6237
|
+
* Set the info data getter callback.
|
|
6238
|
+
*
|
|
6239
|
+
* @param {Function} fn A function `(dataId) => InfoData`.
|
|
6240
|
+
*/
|
|
6241
|
+
setGetInfoData(fn: Function): void;
|
|
6242
|
+
/**
|
|
6243
|
+
* Get the layer group configuration from a data id.
|
|
6244
|
+
*
|
|
6245
|
+
* @param {string} dataId The data id.
|
|
6246
|
+
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
6247
|
+
* (default to false).
|
|
6248
|
+
* @returns {ViewConfig[]} The list of associated configs.
|
|
6249
|
+
*/
|
|
6250
|
+
getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[];
|
|
6251
|
+
/**
|
|
6252
|
+
* Get the layer group configuration for a data id and group div id.
|
|
6253
|
+
*
|
|
6254
|
+
* @param {string} dataId The data id.
|
|
6255
|
+
* @param {string} groupDivId The layer group div id.
|
|
6256
|
+
* @param {boolean} [excludeStarConfig] Exclude the star config
|
|
6257
|
+
* (default to false).
|
|
6258
|
+
* @returns {ViewConfig|undefined} The associated config.
|
|
6259
|
+
*/
|
|
6260
|
+
getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined;
|
|
6261
|
+
/**
|
|
6262
|
+
* Get the data view config.
|
|
6263
|
+
* Careful, returns a reference; do not modify without resetting.
|
|
6264
|
+
*
|
|
6265
|
+
* @returns {Record<string, ViewConfig[]>} The configuration list.
|
|
6266
|
+
*/
|
|
6267
|
+
getDataViewConfigs(): Record<string, ViewConfig[]>;
|
|
6268
|
+
/**
|
|
6269
|
+
* Set the data view configuration.
|
|
6270
|
+
* Resets the stage and recreates all the views.
|
|
6271
|
+
*
|
|
6272
|
+
* @param {Record<string, ViewConfig[]>} configs The configuration list.
|
|
6273
|
+
*/
|
|
6274
|
+
setDataViewConfigs(configs: Record<string, ViewConfig[]>): void;
|
|
6275
|
+
/**
|
|
6276
|
+
* Add a data view config.
|
|
6277
|
+
*
|
|
6278
|
+
* @param {string} dataId The data id.
|
|
6279
|
+
* @param {ViewConfig} config The view configuration.
|
|
6280
|
+
* @param {boolean} [doRender] Render data after configuration
|
|
6281
|
+
* add. Defaults to true.
|
|
6282
|
+
*/
|
|
6283
|
+
addDataViewConfig(dataId: string, config: ViewConfig, doRender?: boolean): void;
|
|
6284
|
+
/**
|
|
6285
|
+
* Remove a data view config.
|
|
6286
|
+
* Removes the associated layer if found, removes
|
|
6287
|
+
* the layer group if empty.
|
|
6288
|
+
*
|
|
6289
|
+
* @param {string} dataId The data id.
|
|
6290
|
+
* @param {string} divId The div id.
|
|
6291
|
+
*/
|
|
6292
|
+
removeDataViewConfig(dataId: string, divId: string): void;
|
|
6293
|
+
/**
|
|
6294
|
+
* Update an existing data view config.
|
|
6295
|
+
* Removes and re-creates the layer if found.
|
|
6296
|
+
*
|
|
6297
|
+
* @param {string} dataId The data id.
|
|
6298
|
+
* @param {string} divId The div id.
|
|
6299
|
+
* @param {ViewConfig} config The view configuration.
|
|
6300
|
+
*/
|
|
6301
|
+
updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void;
|
|
6302
|
+
/**
|
|
6303
|
+
* Get the active layer group.
|
|
6304
|
+
*
|
|
6305
|
+
* @returns {LayerGroup|undefined} The layer group.
|
|
6306
|
+
*/
|
|
6307
|
+
getActiveLayerGroup(): LayerGroup | undefined;
|
|
6308
|
+
/**
|
|
6309
|
+
* Set the active layer group.
|
|
6310
|
+
*
|
|
6311
|
+
* @param {number} index The layer group index.
|
|
6312
|
+
*/
|
|
6313
|
+
setActiveLayerGroup(index: number): void;
|
|
6314
|
+
/**
|
|
6315
|
+
* Get a layer group by index.
|
|
6316
|
+
*
|
|
6317
|
+
* @param {number} index The index.
|
|
6318
|
+
* @returns {LayerGroup} The layer group.
|
|
6319
|
+
*/
|
|
6320
|
+
getLayerGroup(index: number): LayerGroup;
|
|
6321
|
+
/**
|
|
6322
|
+
* Get the number of layer groups.
|
|
6323
|
+
*
|
|
6324
|
+
* @returns {number} The number of groups.
|
|
6325
|
+
*/
|
|
6326
|
+
getNumberOfLayerGroups(): number;
|
|
6327
|
+
/**
|
|
6328
|
+
* Get the view layers associated to a data id.
|
|
6329
|
+
*
|
|
6330
|
+
* @param {string} dataId The data id.
|
|
6331
|
+
* @returns {ViewLayer[]} The layers.
|
|
6332
|
+
*/
|
|
6333
|
+
getViewLayersByDataId(dataId: string): ViewLayer[];
|
|
6334
|
+
/**
|
|
6335
|
+
* Get a list of view layers according to an input callback function.
|
|
6336
|
+
*
|
|
6337
|
+
* @param {Function} [callbackFn] A function that takes
|
|
6338
|
+
* a ViewLayer as input and returns a boolean. If undefined,
|
|
6339
|
+
* returns all view layers.
|
|
6340
|
+
* @returns {ViewLayer[]} The layers that satisfy the callbackFn.
|
|
6341
|
+
*/
|
|
6342
|
+
getViewLayers(callbackFn?: Function): ViewLayer[];
|
|
6343
|
+
/**
|
|
6344
|
+
* Get the draw layers associated to a data id.
|
|
6345
|
+
*
|
|
6346
|
+
* @param {string} dataId The data id.
|
|
6347
|
+
* @returns {DrawLayer[]} The layers.
|
|
6348
|
+
*/
|
|
6349
|
+
getDrawLayersByDataId(dataId: string): DrawLayer[];
|
|
6350
|
+
/**
|
|
6351
|
+
* Get a list of draw layers according to an input callback function.
|
|
6352
|
+
*
|
|
6353
|
+
* @param {Function} [callbackFn] A function that takes
|
|
6354
|
+
* a DrawLayer as input and returns a boolean. If undefined,
|
|
6355
|
+
* returns all draw layers.
|
|
6356
|
+
* @returns {DrawLayer[]} The layers that satisfy the callbackFn.
|
|
6357
|
+
*/
|
|
6358
|
+
getDrawLayers(callbackFn?: Function): DrawLayer[];
|
|
6359
|
+
/**
|
|
6360
|
+
* Get a layer group by div id.
|
|
6361
|
+
*
|
|
6362
|
+
* @param {string} divId The div id.
|
|
6363
|
+
* @returns {LayerGroup|undefined} The layer group.
|
|
6364
|
+
*/
|
|
6365
|
+
getLayerGroupByDivId(divId: string): LayerGroup | undefined;
|
|
6366
|
+
/**
|
|
6367
|
+
* Get the active layer group scale on top of the base scale.
|
|
6368
|
+
*
|
|
6369
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
6370
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
6371
|
+
*/
|
|
6372
|
+
getAddedScale(): Scalar3D;
|
|
6373
|
+
/**
|
|
6374
|
+
* Get the base scale of the active layer group.
|
|
6375
|
+
*
|
|
6376
|
+
* @returns {Scalar3D} The scale as {x,y,z}.
|
|
6377
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
6378
|
+
*/
|
|
6379
|
+
getBaseScale(): Scalar3D;
|
|
6380
|
+
/**
|
|
6381
|
+
* Get the layer offset of the active layer group.
|
|
6382
|
+
*
|
|
6383
|
+
* @returns {Scalar3D} The offset as {x,y,z}.
|
|
6384
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
6385
|
+
*/
|
|
6386
|
+
getOffset(): Scalar3D;
|
|
6387
|
+
/**
|
|
6388
|
+
* Empty the stage (remove all layer groups).
|
|
6389
|
+
*/
|
|
6390
|
+
empty(): void;
|
|
6391
|
+
/**
|
|
6392
|
+
* Remove layers for a specific data id.
|
|
6393
|
+
*
|
|
6394
|
+
* @param {string} dataId The data id.
|
|
6395
|
+
*/
|
|
6396
|
+
removeLayersByDataId(dataId: string): void;
|
|
6397
|
+
/**
|
|
6398
|
+
* Set the layer groups binders.
|
|
6399
|
+
*
|
|
6400
|
+
* @param {object[]} instances Binder instances.
|
|
6401
|
+
*/
|
|
6402
|
+
setBinders(instances: object[]): void;
|
|
6403
|
+
/**
|
|
6404
|
+
* Fit the display to the data of each layer group.
|
|
6405
|
+
*/
|
|
6406
|
+
fitToContainer(): void;
|
|
6407
|
+
/**
|
|
6408
|
+
* Draw all layer groups.
|
|
6409
|
+
*/
|
|
6410
|
+
draw(): void;
|
|
6411
|
+
/**
|
|
6412
|
+
* Reset zoom and pan of the stage.
|
|
6413
|
+
*
|
|
6414
|
+
* @deprecated Since v0.35, prefer resetZoomPan.
|
|
6415
|
+
*/
|
|
6416
|
+
resetLayout(): void;
|
|
6417
|
+
/**
|
|
6418
|
+
* Reset the zoom and pan of the stage.
|
|
6419
|
+
*/
|
|
6420
|
+
resetZoomPan(): void;
|
|
6421
|
+
/**
|
|
6422
|
+
* Reset the position and window level of the stage.
|
|
6423
|
+
*/
|
|
6424
|
+
resetViews(): void;
|
|
6425
|
+
/**
|
|
6426
|
+
* Set the imageSmoothing flag value. Default is false.
|
|
6427
|
+
*
|
|
6428
|
+
* @param {boolean} flag True to enable smoothing.
|
|
6429
|
+
*/
|
|
6430
|
+
setImageSmoothing(flag: boolean): void;
|
|
6431
|
+
/**
|
|
6432
|
+
* Zoom the layers of the active layer group.
|
|
6433
|
+
*
|
|
6434
|
+
* @param {number} step The step to add to the current zoom.
|
|
6435
|
+
* @param {number} cx The zoom center X coordinate.
|
|
6436
|
+
* @param {number} cy The zoom center Y coordinate.
|
|
6437
|
+
* @deprecated Since v0.37, please access from the active layer group.
|
|
6438
|
+
*/
|
|
6439
|
+
zoom(step: number, cx: number, cy: number): void;
|
|
6440
|
+
/**
|
|
6441
|
+
* Apply a translation to the layers of the active layer group.
|
|
6442
|
+
*
|
|
6443
|
+
* @param {number} tx The translation along X.
|
|
6444
|
+
* @param {number} ty The translation along Y.
|
|
6445
|
+
*/
|
|
6446
|
+
translate(tx: number, ty: number): void;
|
|
6447
|
+
/**
|
|
6448
|
+
* Render the current data.
|
|
6449
|
+
*
|
|
6450
|
+
* @param {string} dataId The data id to render.
|
|
6451
|
+
* @param {ViewConfig[]} [viewConfigs] The list of configs to render.
|
|
6452
|
+
*/
|
|
6453
|
+
render(dataId: string, viewConfigs?: ViewConfig[]): void;
|
|
6454
|
+
#private;
|
|
6455
|
+
}
|
|
6456
|
+
|
|
6457
|
+
/**
|
|
6458
|
+
* @import {DataElement} from '../dicom/dataElement.js';
|
|
6459
|
+
*/
|
|
5593
6460
|
/**
|
|
5594
6461
|
* Immutable tag.
|
|
5595
6462
|
*/
|
|
@@ -5674,6 +6541,11 @@ export declare class Tag {
|
|
|
5674
6541
|
#private;
|
|
5675
6542
|
}
|
|
5676
6543
|
|
|
6544
|
+
/**
|
|
6545
|
+
* @import {LayerGroup} from '../gui/layerGroup.js';
|
|
6546
|
+
* @import {ViewLayer} from '../gui/viewLayer.js';
|
|
6547
|
+
* @import {DrawLayer} from '../gui/drawLayer.js';
|
|
6548
|
+
*/
|
|
5677
6549
|
/**
|
|
5678
6550
|
* Toolbox controller.
|
|
5679
6551
|
*/
|
|
@@ -5717,9 +6589,9 @@ export declare class ToolboxController {
|
|
|
5717
6589
|
*
|
|
5718
6590
|
* @param {string} eventType The event type, for example
|
|
5719
6591
|
* mousedown, touchstart...
|
|
5720
|
-
* @returns {
|
|
6592
|
+
* @returns {EventListener} The event handler.
|
|
5721
6593
|
*/
|
|
5722
|
-
getSelectedToolEventHandler(eventType: string):
|
|
6594
|
+
getSelectedToolEventHandler(eventType: string): EventListener;
|
|
5723
6595
|
/**
|
|
5724
6596
|
* Set the selected tool.
|
|
5725
6597
|
*
|
|
@@ -5791,11 +6663,9 @@ export declare class ToolConfig {
|
|
|
5791
6663
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
5792
6664
|
* ]);
|
|
5793
6665
|
*
|
|
5794
|
-
* @type {
|
|
6666
|
+
* @type {Record<string, any>}
|
|
5795
6667
|
*/
|
|
5796
|
-
export declare const toolList:
|
|
5797
|
-
[x: string]: any;
|
|
5798
|
-
};
|
|
6668
|
+
export declare const toolList: Record<string, any>;
|
|
5799
6669
|
|
|
5800
6670
|
/**
|
|
5801
6671
|
* List of client provided tool options to be added to
|
|
@@ -5809,7 +6679,6 @@ export declare const toolList: {
|
|
|
5809
6679
|
* getName() {return 'love';}
|
|
5810
6680
|
* static supports(mathShape) {return mathShape instanceof ROI;}
|
|
5811
6681
|
* getNPoints() {return 1;}
|
|
5812
|
-
* getTimeout() {return 0;}
|
|
5813
6682
|
* setAnnotationMathShape(annotation, points) {
|
|
5814
6683
|
* const px = points[0].getX();
|
|
5815
6684
|
* const py = points[0].getY();
|
|
@@ -5862,26 +6731,60 @@ export declare const toolList: {
|
|
|
5862
6731
|
* 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
|
|
5863
6732
|
* ]);
|
|
5864
6733
|
*
|
|
5865
|
-
* @type {
|
|
6734
|
+
* @type {Record<string, Record<string, any>>}
|
|
5866
6735
|
*/
|
|
5867
|
-
export declare const toolOptions:
|
|
5868
|
-
[x: string]: {
|
|
5869
|
-
[x: string]: any;
|
|
5870
|
-
};
|
|
5871
|
-
};
|
|
6736
|
+
export declare const toolOptions: Record<string, Record<string, any>>;
|
|
5872
6737
|
|
|
5873
6738
|
/**
|
|
5874
|
-
*
|
|
6739
|
+
* Undo controller.
|
|
5875
6740
|
*/
|
|
5876
|
-
export declare class
|
|
6741
|
+
export declare class UndoController extends EventTarget {
|
|
5877
6742
|
/**
|
|
5878
|
-
*
|
|
6743
|
+
* Add a command to the undo stack.
|
|
6744
|
+
*
|
|
6745
|
+
* @param {object} cmd The command to add.
|
|
6746
|
+
* @fires UndoStack#undoadd
|
|
6747
|
+
* @function
|
|
5879
6748
|
*/
|
|
5880
|
-
|
|
6749
|
+
addToUndoStack: (cmd: object) => void;
|
|
5881
6750
|
/**
|
|
5882
|
-
*
|
|
6751
|
+
* Remove a command from the undo stack.
|
|
6752
|
+
*
|
|
6753
|
+
* @param {string} name The name of the command to remove.
|
|
6754
|
+
* @returns {boolean} True if the command was found and removed.
|
|
6755
|
+
* @fires UndoStack#undoremove
|
|
6756
|
+
* @function
|
|
5883
6757
|
*/
|
|
5884
|
-
|
|
6758
|
+
removeFromUndoStack: (name: string) => boolean;
|
|
6759
|
+
/**
|
|
6760
|
+
* Undo the last command.
|
|
6761
|
+
*
|
|
6762
|
+
* @fires UndoStack#undo
|
|
6763
|
+
*/
|
|
6764
|
+
undo(): void;
|
|
6765
|
+
/**
|
|
6766
|
+
* Redo the next command.
|
|
6767
|
+
*
|
|
6768
|
+
* @fires UndoStack#redo
|
|
6769
|
+
*/
|
|
6770
|
+
redo(): void;
|
|
6771
|
+
/**
|
|
6772
|
+
* Get the undo stack size.
|
|
6773
|
+
*
|
|
6774
|
+
* @returns {number} The size of the stack.
|
|
6775
|
+
*/
|
|
6776
|
+
getStackSize(): number;
|
|
6777
|
+
/**
|
|
6778
|
+
* Get the current undo stack index.
|
|
6779
|
+
*
|
|
6780
|
+
* @returns {number} The stack index.
|
|
6781
|
+
*/
|
|
6782
|
+
getCurrentStackIndex(): number;
|
|
6783
|
+
/**
|
|
6784
|
+
* Reset the undo/redo history.
|
|
6785
|
+
*/
|
|
6786
|
+
reset(): void;
|
|
6787
|
+
#private;
|
|
5885
6788
|
}
|
|
5886
6789
|
|
|
5887
6790
|
/**
|
|
@@ -5999,7 +6902,7 @@ export declare class Vector3D {
|
|
|
5999
6902
|
* request.onload = onload;
|
|
6000
6903
|
* request.send();
|
|
6001
6904
|
*/
|
|
6002
|
-
export declare class View {
|
|
6905
|
+
export declare class View extends EventTarget {
|
|
6003
6906
|
/**
|
|
6004
6907
|
* @param {Image} image The associated image.
|
|
6005
6908
|
*/
|
|
@@ -6228,22 +7131,6 @@ export declare class View {
|
|
|
6228
7131
|
* @param {boolean} [silent] Flag to launch events with skipGenerate.
|
|
6229
7132
|
*/
|
|
6230
7133
|
setWindowLevelPresetById(id: number, silent?: boolean): void;
|
|
6231
|
-
/**
|
|
6232
|
-
* Add an event listener to this class.
|
|
6233
|
-
*
|
|
6234
|
-
* @param {string} type The event type.
|
|
6235
|
-
* @param {Function} callback The function associated with the provided
|
|
6236
|
-
* event type, will be called with the fired event.
|
|
6237
|
-
*/
|
|
6238
|
-
addEventListener(type: string, callback: Function): void;
|
|
6239
|
-
/**
|
|
6240
|
-
* Remove an event listener from this class.
|
|
6241
|
-
*
|
|
6242
|
-
* @param {string} type The event type.
|
|
6243
|
-
* @param {Function} callback The function associated with the provided
|
|
6244
|
-
* event type.
|
|
6245
|
-
*/
|
|
6246
|
-
removeEventListener(type: string, callback: Function): void;
|
|
6247
7134
|
/**
|
|
6248
7135
|
* Get the image window/level that covers the full data range.
|
|
6249
7136
|
* Warning: uses the latest set rescale LUT or the default linear one.
|
|
@@ -6279,6 +7166,16 @@ export declare class View {
|
|
|
6279
7166
|
#private;
|
|
6280
7167
|
}
|
|
6281
7168
|
|
|
7169
|
+
/**
|
|
7170
|
+
* @import {LayerGroup} from '../gui/layerGroup.js';
|
|
7171
|
+
* @import {ViewLayer} from '../gui/viewLayer.js';
|
|
7172
|
+
* @import {DrawLayer} from '../gui/drawLayer.js';
|
|
7173
|
+
* @import {Image} from '../image/image.js';
|
|
7174
|
+
* @import {Matrix33} from '../math/matrix.js';
|
|
7175
|
+
* @import {DataElement} from '../dicom/dataElement.js';
|
|
7176
|
+
* @import {Scalar3D} from '../math/scalar.js';
|
|
7177
|
+
* @import {Command} from '../command/undoStack.js';
|
|
7178
|
+
*/
|
|
6282
7179
|
/**
|
|
6283
7180
|
* View configuration: mainly defines the ´divId´
|
|
6284
7181
|
* of the associated HTML div.
|
|
@@ -6347,6 +7244,15 @@ export declare class ViewConfig {
|
|
|
6347
7244
|
windowWidth: number | undefined;
|
|
6348
7245
|
}
|
|
6349
7246
|
|
|
7247
|
+
/**
|
|
7248
|
+
* @import {View} from '../image/view.js';
|
|
7249
|
+
* @import {WindowLevel} from '../image/windowLevel.js';
|
|
7250
|
+
* @import {Point} from '../math/point.js';
|
|
7251
|
+
* @import {Scalar2D} from '../math/scalar.js';
|
|
7252
|
+
* @import {Matrix33} from '../math/matrix.js';
|
|
7253
|
+
* @import {ViewLayer} from '../gui/viewLayer.js';
|
|
7254
|
+
* @import {MaskSegmentViewHelper} from '../image/maskSegmentViewHelper.js';
|
|
7255
|
+
*/
|
|
6350
7256
|
/**
|
|
6351
7257
|
* View controller.
|
|
6352
7258
|
*/
|
|
@@ -6804,8 +7710,16 @@ export declare class ViewController {
|
|
|
6804
7710
|
#private;
|
|
6805
7711
|
}
|
|
6806
7712
|
|
|
7713
|
+
/**
|
|
7714
|
+
* @import {Vector3D} from '../math/vector.js';
|
|
7715
|
+
* @import {Point, Point3D} from '../math/point.js';
|
|
7716
|
+
* @import {Scalar2D, Scalar3D} from '../math/scalar.js';
|
|
7717
|
+
*/
|
|
6807
7718
|
/**
|
|
6808
7719
|
* View layer.
|
|
7720
|
+
*
|
|
7721
|
+
* Not an EventTarget in order to forward native DOM events while
|
|
7722
|
+
* preserving `preventDefault()` for tools (see '#fireDomEvent').
|
|
6809
7723
|
*/
|
|
6810
7724
|
export declare class ViewLayer {
|
|
6811
7725
|
/**
|
|
@@ -6859,10 +7773,10 @@ export declare class ViewLayer {
|
|
|
6859
7773
|
/**
|
|
6860
7774
|
* Handle an image set event.
|
|
6861
7775
|
*
|
|
6862
|
-
* @param {
|
|
7776
|
+
* @param {CustomEvent} event The event.
|
|
6863
7777
|
* @function
|
|
6864
7778
|
*/
|
|
6865
|
-
onimageset: (event:
|
|
7779
|
+
onimageset: (event: CustomEvent) => void;
|
|
6866
7780
|
/**
|
|
6867
7781
|
* Bind this layer to the view image.
|
|
6868
7782
|
*/
|
|
@@ -6874,24 +7788,24 @@ export declare class ViewLayer {
|
|
|
6874
7788
|
/**
|
|
6875
7789
|
* Handle an image content change event.
|
|
6876
7790
|
*
|
|
6877
|
-
* @param {
|
|
7791
|
+
* @param {CustomEvent} event The event.
|
|
6878
7792
|
* @function
|
|
6879
7793
|
*/
|
|
6880
|
-
onimagecontentchange: (event:
|
|
7794
|
+
onimagecontentchange: (event: CustomEvent) => void;
|
|
6881
7795
|
/**
|
|
6882
7796
|
* Handle an image change event.
|
|
6883
7797
|
*
|
|
6884
|
-
* @param {
|
|
7798
|
+
* @param {CustomEvent} event The event.
|
|
6885
7799
|
* @function
|
|
6886
7800
|
*/
|
|
6887
|
-
onimagegeometrychange: (event:
|
|
7801
|
+
onimagegeometrychange: (event: CustomEvent) => void;
|
|
6888
7802
|
/**
|
|
6889
7803
|
* Handle an image resampled event.
|
|
6890
7804
|
*
|
|
6891
|
-
* @param {
|
|
7805
|
+
* @param {CustomEvent} event The event.
|
|
6892
7806
|
* @function
|
|
6893
7807
|
*/
|
|
6894
|
-
onimageresampled: (event:
|
|
7808
|
+
onimageresampled: (event: CustomEvent) => void;
|
|
6895
7809
|
/**
|
|
6896
7810
|
* Get the id of the layer.
|
|
6897
7811
|
*
|
|
@@ -7122,6 +8036,32 @@ export declare class ViewLayer {
|
|
|
7122
8036
|
#private;
|
|
7123
8037
|
}
|
|
7124
8038
|
|
|
8039
|
+
/**
|
|
8040
|
+
* @import {LayerGroup} from '../../gui/layerGroup.js';
|
|
8041
|
+
*/
|
|
8042
|
+
/**
|
|
8043
|
+
* Mouse wheel handling: subclasses may override {@link WheelBehavior#onWheel}
|
|
8044
|
+
* (every event) and/or {@link WheelBehavior#onWheelTick}
|
|
8045
|
+
* (after tick threshold).
|
|
8046
|
+
*/
|
|
8047
|
+
export declare class WheelBehavior {
|
|
8048
|
+
/**
|
|
8049
|
+
* Raw wheel event (every `wheel`); use with continuous effects such as zoom.
|
|
8050
|
+
*
|
|
8051
|
+
* @param {WheelEvent} _event The wheel event.
|
|
8052
|
+
* @param {LayerGroup|undefined} _layerGroup Layer group under the wheel.
|
|
8053
|
+
*/
|
|
8054
|
+
onWheel(_event: WheelEvent, _layerGroup: LayerGroup | undefined): void;
|
|
8055
|
+
/**
|
|
8056
|
+
* Discrete wheel tick after accumulation; use for
|
|
8057
|
+
* slice scroll and similar stepped actions.
|
|
8058
|
+
*
|
|
8059
|
+
* @param {boolean} _up True when spin is in the positive direction.
|
|
8060
|
+
* @param {LayerGroup} _layerGroup Layer group under the wheel event.
|
|
8061
|
+
*/
|
|
8062
|
+
onWheelTick(_up: boolean, _layerGroup: LayerGroup): void;
|
|
8063
|
+
}
|
|
8064
|
+
|
|
7125
8065
|
/**
|
|
7126
8066
|
* Window and Level also known as window width and center.
|
|
7127
8067
|
*/
|