dwv 0.37.0 → 0.38.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dwv.d.ts CHANGED
@@ -10,12 +10,6 @@ import Konva from 'konva';
10
10
  */
11
11
  export declare function addTagsToDictionary(group: string, tags: Record<string, string[]>): void;
12
12
 
13
- /**
14
- * @import {NumberValue} from '../math/types.js';
15
- * @import {ViewController} from '../app/viewController.js';
16
- * @import {PlaneHelper} from './planeHelper.js';
17
- * @import {DicomCode} from '../dicom/dicomCode.js';
18
- */
19
13
  /**
20
14
  * Image annotation.
21
15
  */
@@ -102,6 +96,18 @@ export declare class Annotation {
102
96
  * @type {Point3D[]|undefined}
103
97
  */
104
98
  planePoints: Point3D[] | undefined;
99
+ /**
100
+ * Geometry in patient coordinates, for annotations read from
101
+ * a SCOORD3D: the math shape, plane points and referenced image
102
+ * are set from it when a view with a matching plane is set.
103
+ * The referenced image and plane points written with it by dwv are
104
+ * read with it, they are available before a view is set and are
105
+ * kept: the annotation is only set on a view that includes its
106
+ * referenced image, with its plane orientation.
107
+ *
108
+ * @type {PatientGeometry|undefined}
109
+ */
110
+ patientGeometry: PatientGeometry | undefined;
105
111
  /**
106
112
  * Get the concepts ids of the annotation meta data.
107
113
  *
@@ -136,6 +142,24 @@ export declare class Annotation {
136
142
  * undefined if same as reference data.
137
143
  */
138
144
  getOrientationName(): string | undefined;
145
+ /**
146
+ * Get the patient positions (mm) of points of the annotation plane.
147
+ * Only for annotations on a non acquisition plane (that have plane
148
+ * points) and an associated view controller.
149
+ *
150
+ * @param {Point2D[]} points The plane points, in the same coordinates
151
+ * as the annotation math shape.
152
+ * @returns {Point3D[]|undefined} The patient positions, undefined if
153
+ * not possible.
154
+ */
155
+ getPlanePositions(points: Point2D[]): Point3D[] | undefined;
156
+ /**
157
+ * Get the frame of reference UID of the referenced image.
158
+ *
159
+ * @returns {string|undefined} The UID, undefined if there is no
160
+ * associated view controller.
161
+ */
162
+ getFrameOfReferenceUID(): string | undefined;
139
163
  /**
140
164
  * Initialise the annotation.
141
165
  *
@@ -355,6 +379,12 @@ export declare class AnnotationGroupFactory {
355
379
  * Convert an annotation group into a DICOM SR object using the
356
380
  * TID 1500 template.
357
381
  *
382
+ * The SOP class is Comprehensive SR, or Comprehensive 3D SR if some
383
+ * annotations are on a non acquisition plane (SCOORD3D content).
384
+ * Missing mandatory attributes (instance and series UID and number,
385
+ * manufacturer...) get default values, all can be overwritten via
386
+ * the extra tags.
387
+ *
358
388
  * @param {AnnotationGroup} annotationGroup The annotation group.
359
389
  * @param {SimpleTagValues} [extraTags] Optional list of extra tags.
360
390
  * @returns {Record<string, DataElement>} A list of dicom elements.
@@ -696,7 +726,7 @@ export declare class App extends EventTarget {
696
726
  * @event App#loadstart
697
727
  * @type {CustomEvent}
698
728
  * @property {object} detail The event detail.
699
- * @property {string} detail.dataid The data id.
729
+ * @property {string} detail.loadid The load id.
700
730
  * @property {*} detail.source The load source: string for an url,
701
731
  * File for a file.
702
732
  */
@@ -706,7 +736,7 @@ export declare class App extends EventTarget {
706
736
  * @event App#loadprogress
707
737
  * @type {CustomEvent}
708
738
  * @property {object} detail The event detail.
709
- * @property {string} detail.dataid The data id.
739
+ * @property {string} detail.loadid The load id.
710
740
  * @property {*} detail.source The load source: string for an url,
711
741
  * File for a file.
712
742
  * @property {number} detail.loaded The loaded percentage.
@@ -718,20 +748,39 @@ export declare class App extends EventTarget {
718
748
  * @event App#loaditem
719
749
  * @type {CustomEvent}
720
750
  * @property {object} detail The event detail.
721
- * @property {string} detail.dataid The data id.
751
+ * @property {string} detail.loadid The load id.
722
752
  * @property {*} detail.source The load source: string for an url,
723
753
  * File for a file.
754
+ * @property {string} detail.dataid The id of the data the item
755
+ * was added to.
724
756
  * @property {object} detail.data The loaded meta data.
725
757
  * @property {boolean} detail.isfirstitem True if the item is the first
726
758
  * one loaded for the data id.
727
759
  */
760
+ /**
761
+ * Load data event: fired when a load item starts a new data, before
762
+ * its load item event. A load can create several data: for example
763
+ * one per series, and one per derived object (SR, SEG...).
764
+ *
765
+ * @event App#loaddata
766
+ * @type {CustomEvent}
767
+ * @property {object} detail The event detail.
768
+ * @property {string} detail.loadid The load id.
769
+ * @property {string} detail.dataid The new data id.
770
+ * @property {string} [detail.refdataid] The id of the data that the
771
+ * new data refers to, for example the series of a SEG
772
+ * (see {@link DataController#getReferencedDataId}).
773
+ * @property {*} detail.source The load source: string for an url,
774
+ * File for a file.
775
+ */
728
776
  /**
729
777
  * Load event: fired when a load finishes successfully.
730
778
  *
731
779
  * @event App#load
732
780
  * @type {CustomEvent}
733
781
  * @property {object} detail The event detail.
734
- * @property {string} detail.dataid The data id.
782
+ * @property {string} detail.loadid The load id.
783
+ * @property {string[]} detail.dataids The ids of the loaded data.
735
784
  * @property {*} detail.source The load source: string for an url,
736
785
  * File for a file.
737
786
  */
@@ -742,7 +791,8 @@ export declare class App extends EventTarget {
742
791
  * @event App#loadend
743
792
  * @type {CustomEvent}
744
793
  * @property {object} detail The event detail.
745
- * @property {string} detail.dataid The data id.
794
+ * @property {string} detail.loadid The load id.
795
+ * @property {string[]} detail.dataids The ids of the loaded data.
746
796
  * @property {*} detail.source The load source: string for an url,
747
797
  * File for a file.
748
798
  */
@@ -752,7 +802,10 @@ export declare class App extends EventTarget {
752
802
  * @event App#error
753
803
  * @type {CustomEvent}
754
804
  * @property {object} detail The event detail.
755
- * @property {string} detail.dataid The data id.
805
+ * @property {string} detail.loadid The load id.
806
+ * @property {string} [detail.dataid] For an error on a loaded item,
807
+ * the id of its data: the data is removed and the next items
808
+ * of the data are ignored.
756
809
  * @property {*} detail.source The load source: string for an url,
757
810
  * File for a file.
758
811
  * @property {object} detail.error The error.
@@ -764,7 +817,7 @@ export declare class App extends EventTarget {
764
817
  * @event App#timeout
765
818
  * @type {CustomEvent}
766
819
  * @property {object} detail The event detail.
767
- * @property {string} detail.dataid The data id.
820
+ * @property {string} detail.loadid The load id.
768
821
  * @property {*} detail.source The load source: an url as a string.
769
822
  * @property {object} detail.target The event target.
770
823
  */
@@ -774,17 +827,23 @@ export declare class App extends EventTarget {
774
827
  * @event App#abort
775
828
  * @type {CustomEvent}
776
829
  * @property {object} detail The event detail.
777
- * @property {string} detail.dataid The data id.
830
+ * @property {string} detail.loadid The load id.
778
831
  * @property {*} detail.source The load source: string for an url,
779
832
  * File for a file.
780
833
  */
781
834
  /**
782
835
  * Load a list of image files.
783
836
  *
837
+ * Each data of a load is created with room for all the items of
838
+ * the load: to avoid allocating more memory than needed, load
839
+ * different image series with separate loads when possible.
840
+ *
784
841
  * @param {File[]} files The list of files to load.
785
- * @returns {string} The data ID, '-1' if problem.
842
+ * @returns {string} The load id, '-1' if problem. The ids of the
843
+ * loaded data are given by the loaddata and load events.
786
844
  * @fires App#loadstart
787
845
  * @fires App#loadprogress
846
+ * @fires App#loaddata
788
847
  * @fires App#loaditem
789
848
  * @fires App#loadend
790
849
  * @fires App#error
@@ -795,14 +854,20 @@ export declare class App extends EventTarget {
795
854
  /**
796
855
  * Load a list of image URLs.
797
856
  *
857
+ * Each data of a load is created with room for all the items of
858
+ * the load: to avoid allocating more memory than needed, load
859
+ * different image series with separate loads when possible.
860
+ *
798
861
  * @param {string[]} urls The list of urls to load.
799
862
  * @param {object} [options] The options object, can contain:
800
863
  * - requestHeaders: an array of {name, value} to use as request headers,
801
864
  * - withCredentials: boolean xhr.withCredentials flag to pass to the request,
802
865
  * - batchSize: the size of the request url batch.
803
- * @returns {string} The data ID, '-1' if problem.
866
+ * @returns {string} The load id, '-1' if problem. The ids of the
867
+ * loaded data are given by the loaddata and load events.
804
868
  * @fires App#loadstart
805
869
  * @fires App#loadprogress
870
+ * @fires App#loaddata
806
871
  * @fires App#loaditem
807
872
  * @fires App#loadend
808
873
  * @fires App#error
@@ -823,11 +888,17 @@ export declare class App extends EventTarget {
823
888
  /**
824
889
  * Load a list of ArrayBuffers.
825
890
  *
891
+ * Each data of a load is created with room for all the items of
892
+ * the load: to avoid allocating more memory than needed, load
893
+ * different image series with separate loads when possible.
894
+ *
826
895
  * @param {Array} data The list of ArrayBuffers to load
827
896
  * in the form of [{name: "", filename: "", data: data}].
828
- * @returns {string} The data ID.
897
+ * @returns {string} The load id. The ids of the loaded data are
898
+ * given by the loaddata and load events.
829
899
  * @fires App#loadstart
830
900
  * @fires App#loadprogress
901
+ * @fires App#loaddata
831
902
  * @fires App#loaditem
832
903
  * @fires App#loadend
833
904
  * @fires App#error
@@ -840,11 +911,16 @@ export declare class App extends EventTarget {
840
911
  */
841
912
  abortAllLoads(): void;
842
913
  /**
843
- * Abort an individual data load.
914
+ * Abort an individual load: stops the load and removes the
915
+ * data it created. With a data id, only removes this data:
916
+ * the load continues and its other data are kept.
844
917
  *
845
- * @param {string} dataId The data to stop loading.
918
+ * @param {string} loadId The load to stop, as returned by
919
+ * the load methods.
920
+ * @param {string} [dataId] The id of the data of the load
921
+ * to remove.
846
922
  */
847
- abortLoad(dataId: string): void;
923
+ abortLoad(loadId: string, dataId?: string): void;
848
924
  /**
849
925
  * Fit the display to the data of each layer group.
850
926
  * To be called once the image is loaded.
@@ -1210,8 +1286,13 @@ export declare class BooleanResult {
1210
1286
  }
1211
1287
 
1212
1288
  /**
1213
- * Extract polygon contours from a mask slice using Moore neighborhood tracing.
1214
- * Returns one polygon per connected region with the given segment value.
1289
+ * Extract polygon contours from a mask slice by tracing the pixel edges
1290
+ * of each connected region (8-connectivity).
1291
+ *
1292
+ * Returns one polygon per connected region with the given segment value:
1293
+ * its outer boundary, holes are not included. The polygons go around the
1294
+ * region pixels: their vertices are at pixel corners, in pixel coordinates
1295
+ * (pixel centres at integer values).
1215
1296
  *
1216
1297
  * @param {Uint8Array} buffer The mask buffer (all slices).
1217
1298
  * @param {number} sliceOffset Byte offset of the slice in buffer.
@@ -1484,6 +1565,67 @@ export declare class DataController extends EventTarget {
1484
1565
  * Reset the class: empty the data storage.
1485
1566
  */
1486
1567
  reset(): void;
1568
+ /**
1569
+ * Add a loaded item: the item is added to the data of the load
1570
+ * with the same key (see getDataGroupKey), or to a new data.
1571
+ * Items that need their referenced data (SEG, RTSTRUCT) are kept
1572
+ * until {@link DataController#getPendingLoadItems} is called, at
1573
+ * the end of the load.
1574
+ *
1575
+ * @param {string} loadId The load id.
1576
+ * @param {DicomData} data The loaded item.
1577
+ * @param {boolean} [canWait] False to add an item that needs its
1578
+ * referenced data now, defaults to true.
1579
+ * @returns {{dataId: string, isNew: boolean}|undefined} The data id
1580
+ * and true if it was created for this item, undefined if the item
1581
+ * is kept for later or if its data was removed from the load
1582
+ * (see {@link DataController#removeLoadData}).
1583
+ */
1584
+ addLoadItem(loadId: string, data: DicomData, canWait?: boolean): {
1585
+ dataId: string;
1586
+ isNew: boolean;
1587
+ } | undefined;
1588
+ /**
1589
+ * Get the items of a load that were kept until the end of the load,
1590
+ * see {@link DataController#addLoadItem}. The list is emptied.
1591
+ *
1592
+ * @param {string} loadId The load id.
1593
+ * @returns {DicomData[]} The kept items.
1594
+ */
1595
+ getPendingLoadItems(loadId: string): DicomData[];
1596
+ /**
1597
+ * Get the ids of the data created by a load, in creation order.
1598
+ *
1599
+ * @param {string} loadId The load id.
1600
+ * @returns {string[]} The data ids.
1601
+ */
1602
+ getLoadDataIds(loadId: string): string[];
1603
+ /**
1604
+ * Get the id of the data of a load that an item belongs to.
1605
+ *
1606
+ * @param {string} loadId The load id.
1607
+ * @param {DicomData} data The loaded item.
1608
+ * @returns {string|undefined} The data id, also given for a data
1609
+ * that was removed, undefined if the load has no data for
1610
+ * this item.
1611
+ */
1612
+ getLoadItemDataId(loadId: string, data: DicomData): string | undefined;
1613
+ /**
1614
+ * Remove a data created by a load: the next items of the load
1615
+ * that belong to it are ignored, the other data of the load
1616
+ * are kept.
1617
+ *
1618
+ * @param {string} loadId The load id.
1619
+ * @param {string} dataId The data id.
1620
+ */
1621
+ removeLoadData(loadId: string, dataId: string): void;
1622
+ /**
1623
+ * End a load: forget its data keys, so that a new load creates
1624
+ * new data.
1625
+ *
1626
+ * @param {string} loadId The load id.
1627
+ */
1628
+ endLoad(loadId: string): void;
1487
1629
  /**
1488
1630
  * Get a data at a given index.
1489
1631
  *
@@ -1505,6 +1647,17 @@ export declare class DataController extends EventTarget {
1505
1647
  * @returns {string} The data id.
1506
1648
  */
1507
1649
  getDataIdFromSeriesUid(uid: string): string;
1650
+ /**
1651
+ * Get the id of the data that a derived data refers to: the image
1652
+ * series of a segmentation (SEG), of an RT structure set (RTSTRUCT)
1653
+ * or of the annotations of a structured report (SR).
1654
+ *
1655
+ * @param {string} dataId The data id.
1656
+ * @returns {string|undefined} The referenced data id, undefined if
1657
+ * the data does not refer to another data or if that data is not
1658
+ * loaded.
1659
+ */
1660
+ getReferencedDataId(dataId: string): string | undefined;
1508
1661
  /**
1509
1662
  * Set the image at a given index.
1510
1663
  *
@@ -1846,6 +1999,12 @@ export declare class DicomCode {
1846
1999
  * @type {string|undefined}
1847
2000
  */
1848
2001
  schemeDesignator: string | undefined;
2002
+ /**
2003
+ * Coding scheme version, only used with a coding scheme designator.
2004
+ *
2005
+ * @type {string|undefined}
2006
+ */
2007
+ schemeVersion: string | undefined;
1849
2008
  /**
1850
2009
  * Get a string representation of this object.
1851
2010
  *
@@ -2186,6 +2345,15 @@ export declare class DrawBrushCommand extends Command {
2186
2345
  * undefined when erasing.
2187
2346
  */
2188
2347
  getOriginalValuesLists(): any[] | undefined;
2348
+ /**
2349
+ * Update the algorithm type of the segments edited by this command:
2350
+ * an AUTOMATIC segment edited by the user becomes SEMIAUTOMATIC
2351
+ * (its algorithm name is kept). The change is reverted by undo.
2352
+ *
2353
+ * Called by execute; call it directly for a command whose
2354
+ * brush values were already applied to the mask.
2355
+ */
2356
+ updateSegmentTypes(): void;
2189
2357
  /**
2190
2358
  * Get the execute event.
2191
2359
  *
@@ -3069,6 +3237,21 @@ export declare class Geometry {
3069
3237
  * @returns {boolean} True if both objects are equal.
3070
3238
  */
3071
3239
  isSimilar(rhs: Geometry, tol?: number): boolean;
3240
+ /**
3241
+ * Check if this geometry and the input one have common points,
3242
+ * ie if the volumes covered by their voxels overlap.
3243
+ * The test is done on the bounds of both geometries expressed in
3244
+ * the frame of this geometry orientation: it is exact when both
3245
+ * orientations are similar, and an approximation otherwise.
3246
+ * Geometries that only touch (ie overlap by less than the tolerance)
3247
+ * are not considered as intersecting.
3248
+ *
3249
+ * @param {Geometry} rhs The geometry to check.
3250
+ * @param {number} [tol] Optional overlap tolerance (in mm),
3251
+ * defaults to REAL_WORLD_EPSILON.
3252
+ * @returns {boolean} True if both geometries intersect.
3253
+ */
3254
+ intersects(rhs: Geometry, tol?: number): boolean;
3072
3255
  /**
3073
3256
  * Check that a point is within bounds.
3074
3257
  *
@@ -3365,19 +3548,23 @@ export declare function getTouchPoints(event: TouchEvent): Point2D[];
3365
3548
  export declare function getTypedArray(bitsAllocated: number, pixelRepresentation: number, size: number): IntTypedArray;
3366
3549
 
3367
3550
  /**
3368
- * Get a UID for a DICOM tag.
3551
+ * Get a new unique UID.
3369
3552
  *
3370
- * Note: Use {@link https://github.com/uuidjs/uuid}?
3553
+ * The UID is a UUID derived UID: the '2.25' root followed by a
3554
+ * 39 digits random number (without leading zero), 44 characters
3555
+ * in total. As for a UUID, the size of the random part makes
3556
+ * the chance of a collision negligible, even across sessions.
3557
+ * The random digits are generated with `Math.random`: a UID needs
3558
+ * to be unique, not unpredictable, and `Math.random` is available
3559
+ * in any context (browser, secure or not, worker, node).
3371
3560
  *
3372
3561
  * Ref:
3373
- * - {@link http://dicom.nema.org/medical/dicom/2024a/output/chtml/part05/chapter_9.html},
3374
- * - {@link http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html},
3375
- * - {@link https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid}.
3562
+ * - {@link https://dicom.nema.org/medical/dicom/2024a/output/chtml/part05/chapter_9.html},
3563
+ * - {@link https://dicom.nema.org/medical/dicom/2024a/output/chtml/part05/sect_B.2.html}.
3376
3564
  *
3377
- * @param {string} tagName The input tag.
3378
- * @returns {string} The corresponding UID.
3565
+ * @returns {string} The UID.
3379
3566
  */
3380
- export declare function getUID(tagName: string): string;
3567
+ export declare function getUID(): string;
3381
3568
 
3382
3569
  /**
3383
3570
  * Get a list of URLs from a uri containing key-value pairs as in:
@@ -3605,6 +3792,15 @@ declare class Image_2 extends EventTarget {
3605
3792
  * @returns {Point3D|undefined} The origin.
3606
3793
  */
3607
3794
  getOriginForImageUid(uid: string): Point3D | undefined;
3795
+ /**
3796
+ * Get the volume index (4th dimension) of the image with the input UID.
3797
+ * An image with a single UID for all its slices returns 0.
3798
+ *
3799
+ * @param {string} uid The image UID (SOP Instance UID).
3800
+ * @returns {number|undefined} The volume index, undefined if the
3801
+ * UID is not part of this image.
3802
+ */
3803
+ getVolumeIndexForImageUid(uid: string): number | undefined;
3608
3804
  /**
3609
3805
  * Check if the image includes an UID.
3610
3806
  *
@@ -4885,13 +5081,20 @@ export declare class MaskFactory {
4885
5081
  /**
4886
5082
  * Convert a mask image into a DICOM segmentation object.
4887
5083
  *
5084
+ * The image meta is not modified.
5085
+ *
4888
5086
  * @param {MaskImage} image The mask image.
4889
- * @param {MaskSegment[]} segments The mask segments.
4890
- * @param {Image} sourceImage The source image.
4891
- * @param {SimpleTagValues} [extraTags] Optional list of extra tags.
5087
+ * @param {MaskSegment[]|undefined} segments The mask segments, defaults
5088
+ * to the image meta segments if undefined.
5089
+ * @param {Image} sourceImage The source image, used for the references
5090
+ * to the segmented series and images.
5091
+ * @param {SimpleTagValues} [extraTags] Optional list of extra tags,
5092
+ * for example the equipment tags (Manufacturer, ManufacturerModelName,
5093
+ * DeviceSerialNumber, SoftwareVersions) of the embedding application,
5094
+ * they default to dwv ones.
4892
5095
  * @returns {Record<string, DataElement>} A list of dicom elements.
4893
5096
  */
4894
- toDicom(image: MaskImage, segments: MaskSegment[], sourceImage: Image_2, extraTags?: SimpleTagValues): Record<string, DataElement>;
5097
+ toDicom(image: MaskImage, segments: MaskSegment[] | undefined, sourceImage: Image_2, extraTags?: SimpleTagValues): Record<string, DataElement>;
4895
5098
  #private;
4896
5099
  }
4897
5100
 
@@ -5096,6 +5299,22 @@ export declare class MaskSegment {
5096
5299
  * @type {DicomCode|undefined}
5097
5300
  */
5098
5301
  propertyTypeCode: DicomCode | undefined;
5302
+ /**
5303
+ * Segment property type modifier codes: modifiers of the property
5304
+ * type (0062,0011), stored in the property type code item.
5305
+ *
5306
+ * @type {DicomCode[]|undefined}
5307
+ */
5308
+ propertyTypeModifierCodes: DicomCode[] | undefined;
5309
+ /**
5310
+ * Segment anatomic region codes: anatomic regions of interest
5311
+ * of the segment (0008,2218).
5312
+ *
5313
+ * Ref: {@link https://dicom.nema.org/medical/dicom/2024a/output/chtml/part03/sect_10.5.html#table_10-7b}.
5314
+ *
5315
+ * @type {DicomCode[]|undefined}
5316
+ */
5317
+ anatomicRegionCodes: DicomCode[] | undefined;
5099
5318
  /**
5100
5319
  * Segment property category code: general category
5101
5320
  * of the property the segment represents (0062,0003).
@@ -5497,6 +5716,51 @@ export declare namespace Orientation {
5497
5716
  let Sagittal: string;
5498
5717
  }
5499
5718
 
5719
+ /**
5720
+ * Coordinates in the patient coordinate system, as read from
5721
+ * a DICOM SR SCOORD3D.
5722
+ */
5723
+ export declare type PatientCoordinates = {
5724
+ /**
5725
+ * The SCOORD3D graphic type, for ex
5726
+ * 'POLYLINE'.
5727
+ */
5728
+ graphicType: string;
5729
+ /**
5730
+ * The points (mm).
5731
+ */
5732
+ points: Point3D[];
5733
+ /**
5734
+ * The frame of reference UID.
5735
+ */
5736
+ frameOfReferenceUID: string;
5737
+ };
5738
+
5739
+ /**
5740
+ * Geometry of an annotation in the patient coordinate system: used
5741
+ * to set its plane shape once a view with a matching plane is set.
5742
+ */
5743
+ export declare type PatientGeometry = {
5744
+ /**
5745
+ * The shape, the long axis
5746
+ * for a bidimensional line.
5747
+ */
5748
+ shape: PatientCoordinates;
5749
+ /**
5750
+ * The short axis of a
5751
+ * bidimensional line.
5752
+ */
5753
+ shortAxis?: PatientCoordinates;
5754
+ /**
5755
+ * The label position.
5756
+ */
5757
+ labelPosition?: PatientCoordinates;
5758
+ /**
5759
+ * The reference points.
5760
+ */
5761
+ referencePoints?: PatientCoordinates;
5762
+ };
5763
+
5500
5764
  /**
5501
5765
  * @import {Point} from '../math/point.js';
5502
5766
  * @import {Index} from '../math/index.js';
@@ -6510,18 +6774,25 @@ export declare class RtStructFactory {
6510
6774
  /**
6511
6775
  * Convert a {@link MaskImage} into DICOM RT Structure Set elements.
6512
6776
  *
6513
- * Traces each segment's pixel regions per slice using Moore neighborhood
6514
- * contour tracing, simplifies with Ramer-Douglas-Peucker, then maps the
6515
- * 2D pixel coordinates back to 3D patient-space coordinates.
6777
+ * Traces each segment's pixel regions (and their holes) per slice along
6778
+ * the pixel edges, then maps the 2D pixel coordinates back to 3D
6779
+ * patient-space coordinates. The contours go around the pixels: loading
6780
+ * the result gives back the same mask.
6781
+ *
6782
+ * The image meta is not modified.
6516
6783
  *
6517
6784
  * @param {MaskImage} image The mask image.
6518
- * @param {MaskSegment[]} [segments] The mask segments; if omitted, taken
6519
- * from image meta.
6520
- * @param {Image} [sourceImage] Source image (provides StudyInstanceUID).
6521
- * @param {SimpleTagValues} [extraTags] Optional extra tags to merge.
6785
+ * @param {MaskSegment[]|undefined} segments The mask segments, defaults
6786
+ * to the image meta segments if undefined.
6787
+ * @param {Image} sourceImage The source image, used for the references
6788
+ * to the contoured study, series and images.
6789
+ * @param {SimpleTagValues} [extraTags] Optional list of extra tags,
6790
+ * for example the equipment tags (Manufacturer, ManufacturerModelName,
6791
+ * DeviceSerialNumber, SoftwareVersions) of the embedding application,
6792
+ * they default to dwv ones.
6522
6793
  * @returns {Record<string, DataElement>} The DICOM data elements.
6523
6794
  */
6524
- toDicom(image: MaskImage, segments?: MaskSegment[], sourceImage?: Image_2, extraTags?: SimpleTagValues): Record<string, DataElement>;
6795
+ toDicom(image: MaskImage, segments: MaskSegment[] | undefined, sourceImage: Image_2, extraTags?: SimpleTagValues): Record<string, DataElement>;
6525
6796
  #private;
6526
6797
  }
6527
6798
 
@@ -6767,9 +7038,10 @@ export declare type SimpleSequenceValue = {
6767
7038
 
6768
7039
  /**
6769
7040
  * A simple (non sequence) tag value: either a single primitive
6770
- * or, for multi-valued VRs, an array of primitives.
7041
+ * or, for multi-valued VRs, an array of primitives, or a typed
7042
+ * array (for ex for 'O*' VRs).
6771
7043
  */
6772
- export declare type SimpleTagValue = string | number | string[] | number[];
7044
+ export declare type SimpleTagValue = string | number | string[] | number[] | TypedArray;
6773
7045
 
6774
7046
  /**
6775
7047
  * The meta data as simple tag values: indexed by tag name instead of
@@ -8213,6 +8485,19 @@ export declare class ViewController {
8213
8485
  * @returns {string|undefined} The uid.
8214
8486
  */
8215
8487
  getSopClassUid(): string | undefined;
8488
+ /**
8489
+ * Get the image UID at a position.
8490
+ *
8491
+ * @param {Point} position The position.
8492
+ * @returns {string} The UID.
8493
+ */
8494
+ getImageUidFromPosition(position: Point): string;
8495
+ /**
8496
+ * Get the image frame of reference UID.
8497
+ *
8498
+ * @returns {string|undefined} The uid.
8499
+ */
8500
+ getFrameOfReferenceUID(): string | undefined;
8216
8501
  /**
8217
8502
  * Get the window/level presets names.
8218
8503
  *