dicom-microscopy-viewer 0.36.3 → 0.36.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/README.md +44 -42
- package/dist/dicom-microscopy-viewer.js +1 -1
- package/docs/annotation.AnnotationGroup.html +142 -43
- package/docs/annotation.html +2 -2
- package/docs/annotation.js.html +47 -34
- package/docs/annotations__AnnotationManager.js.html +2 -2
- package/docs/annotations_markups__MarkupManager.js.html +2 -2
- package/docs/api.html +2 -2
- package/docs/color.PaletteColorLookupTable.html +42 -14
- package/docs/color.html +6 -6
- package/docs/color.js.html +14 -14
- package/docs/dicom-microscopy-viewer.js.html +2 -2
- package/docs/events.html +316 -2
- package/docs/events.js.html +13 -4
- package/docs/index.html +44 -44
- package/docs/mapping.ParameterMapping.html +342 -27
- package/docs/mapping.Transformation.html +221 -14
- package/docs/mapping.html +2 -2
- package/docs/mapping.js.html +41 -32
- package/docs/metadata.Comprehensive3DSR.html +254 -5
- package/docs/metadata.MicroscopyBulkSimpleAnnotations.html +254 -5
- package/docs/metadata.ParametricMap.html +254 -5
- package/docs/metadata.SOPClass.html +399 -0
- package/docs/metadata.Segmentation.html +254 -5
- package/docs/metadata.VLWholeSlideMicroscopyImage.html +255 -7
- package/docs/metadata.html +14 -32
- package/docs/metadata.js.html +55 -21
- package/docs/opticalPath.OpticalPath.html +453 -26
- package/docs/opticalPath.html +2 -2
- package/docs/opticalPath.js.html +16 -17
- package/docs/pyramid.js.html +2 -2
- package/docs/roi.ROI.html +317 -25
- package/docs/roi.html +2 -2
- package/docs/roi.js.html +26 -19
- package/docs/scoord3d.Ellipse.html +14 -18
- package/docs/scoord3d.Ellipsoid.html +14 -18
- package/docs/scoord3d.Multipoint.html +14 -18
- package/docs/scoord3d.Point.html +13 -17
- package/docs/scoord3d.Polygon.html +14 -18
- package/docs/scoord3d.Polyline.html +14 -18
- package/docs/scoord3d.Scoord3D.html +608 -0
- package/docs/scoord3d.html +5 -2
- package/docs/scoord3d.js.html +101 -54
- package/docs/segment.Segment.html +160 -48
- package/docs/segment.html +2 -2
- package/docs/segment.js.html +37 -33
- package/docs/utils.html +148 -4
- package/docs/utils.js.html +6 -6
- package/docs/viewer.LabelImageViewer.html +14 -15
- package/docs/viewer.OverviewImageViewer.html +15 -15
- package/docs/viewer.VolumeImageViewer.html +215 -282
- package/docs/viewer.html +2 -2
- package/docs/viewer.js.html +150 -133
- package/package.json +1 -1
- package/src/annotation.js +45 -32
- package/src/color.js +12 -12
- package/src/events.js +11 -2
- package/src/mapping.js +39 -30
- package/src/metadata.js +53 -19
- package/src/opticalPath.js +14 -15
- package/src/roi.js +24 -17
- package/src/scoord3d.js +99 -52
- package/src/segment.js +35 -31
- package/src/utils.js +4 -4
- package/src/viewer.js +148 -131
package/src/viewer.js
CHANGED
|
@@ -286,7 +286,8 @@ function _getInteractionBindingCondition (bindings) {
|
|
|
286
286
|
* slide coordinate system (X, Y, Z), i.e. it express in which direction one
|
|
287
287
|
* is moving in the slide coordinate system when the ROW index changes.
|
|
288
288
|
*
|
|
289
|
-
* @param {
|
|
289
|
+
* @param {metadata.VLWholeSlideMicroscopyImage} metadata - Metadata of a DICOM
|
|
290
|
+
* VL Whole Slide Microscopy Image instance
|
|
290
291
|
*
|
|
291
292
|
* @returns {number} Rotation in radians
|
|
292
293
|
*
|
|
@@ -339,13 +340,13 @@ function _getWindowSize () {
|
|
|
339
340
|
/**
|
|
340
341
|
* Map style options to OpenLayers style.
|
|
341
342
|
*
|
|
342
|
-
* @param {
|
|
343
|
-
* @param {
|
|
343
|
+
* @param {Object} styleOptions - Style options
|
|
344
|
+
* @param {Object} styleOptions.stroke - Style options for the outline of the geometry
|
|
344
345
|
* @param {number[]} styleOptions.stroke.color - RGBA color of the outline
|
|
345
346
|
* @param {number} styleOptions.stroke.width - Width of the outline
|
|
346
|
-
* @param {
|
|
347
|
+
* @param {Object} styleOptions.fill - Style options for body the geometry
|
|
347
348
|
* @param {number[]} styleOptions.fill.color - RGBA color of the body
|
|
348
|
-
* @param {
|
|
349
|
+
* @param {Object} styleOptions.image - Style options for image
|
|
349
350
|
* @return {Style} OpenLayers style
|
|
350
351
|
*
|
|
351
352
|
* @private
|
|
@@ -395,12 +396,12 @@ function _getOpenLayersStyle (styleOptions) {
|
|
|
395
396
|
/**
|
|
396
397
|
* Add ROI properties to feature in a safe way
|
|
397
398
|
*
|
|
398
|
-
* @param {
|
|
399
|
-
* @param {
|
|
400
|
-
* @param {
|
|
401
|
-
* @param {
|
|
402
|
-
* @param {
|
|
403
|
-
* @param {
|
|
399
|
+
* @param {Object} feature - The feature instance that represents the ROI
|
|
400
|
+
* @param {Object} properties -Valid ROI properties
|
|
401
|
+
* @param {Object} properties.measurements - ROI measurements
|
|
402
|
+
* @param {Object} properties.evaluations - ROI evaluations
|
|
403
|
+
* @param {Object} properties.label - ROI label
|
|
404
|
+
* @param {Object} properties.marker - ROI marker (this is used while we don't have presentation states)
|
|
404
405
|
* @param {boolean} optSilent - Opt silent update
|
|
405
406
|
*
|
|
406
407
|
* @private
|
|
@@ -429,9 +430,9 @@ function _addROIPropertiesToFeature (feature, properties, optSilent) {
|
|
|
429
430
|
* Wire measurements and qualitative evaluations to generate content items
|
|
430
431
|
* based on OpenLayers feature properties and geometry.
|
|
431
432
|
*
|
|
432
|
-
* @param {
|
|
433
|
-
* @param {
|
|
434
|
-
* @param {
|
|
433
|
+
* @param {Object} map - The map instance
|
|
434
|
+
* @param {Object} feature - The feature instance
|
|
435
|
+
* @param {Object} pyramid - The pyramid metadata
|
|
435
436
|
* @returns {void}
|
|
436
437
|
*
|
|
437
438
|
* @private
|
|
@@ -498,9 +499,9 @@ function _updateFeatureEvaluations (feature) {
|
|
|
498
499
|
/**
|
|
499
500
|
* Generate feature measurements from its measurement properties
|
|
500
501
|
*
|
|
501
|
-
* @param {
|
|
502
|
-
* @param {
|
|
503
|
-
* @param {
|
|
502
|
+
* @param {Object} map - The map instance
|
|
503
|
+
* @param {Object} feature - The feature instance
|
|
504
|
+
* @param {Object} pyramid - The pyramid metadata
|
|
504
505
|
* @returns {void}
|
|
505
506
|
*
|
|
506
507
|
* @private
|
|
@@ -592,13 +593,13 @@ function _updateFeatureMeasurements (map, feature, pyramid) {
|
|
|
592
593
|
/**
|
|
593
594
|
* Updates the style of a feature.
|
|
594
595
|
*
|
|
595
|
-
* @param {
|
|
596
|
-
* @param {
|
|
596
|
+
* @param {Object} styleOptions - Style options
|
|
597
|
+
* @param {Object} styleOptions.stroke - Style options for the outline of the geometry
|
|
597
598
|
* @param {number[]} styleOptions.stroke.color - RGBA color of the outline
|
|
598
599
|
* @param {number} styleOptions.stroke.width - Width of the outline
|
|
599
|
-
* @param {
|
|
600
|
+
* @param {Object} styleOptions.fill - Style options for body the geometry
|
|
600
601
|
* @param {number[]} styleOptions.fill.color - RGBA color of the body
|
|
601
|
-
* @param {
|
|
602
|
+
* @param {Object} styleOptions.image - Style options for image
|
|
602
603
|
*
|
|
603
604
|
* @private
|
|
604
605
|
*/
|
|
@@ -619,12 +620,12 @@ function _setFeatureStyle (feature, styleOptions) {
|
|
|
619
620
|
/**
|
|
620
621
|
* Build OpenLayers style expression for coloring a WebGL TileLayer.
|
|
621
622
|
*
|
|
622
|
-
* @param {
|
|
623
|
+
* @param {Object} styleOptions - Style options
|
|
623
624
|
* @param {number} styleOptions.windowCenter - Center of the window used for contrast stretching
|
|
624
625
|
* @param {number} styleOptions.windowWidth - Width of the window used for contrast stretching
|
|
625
626
|
* @param {number[][]} styleOptions.colormap - RGB color triplets
|
|
626
627
|
*
|
|
627
|
-
* @returns {
|
|
628
|
+
* @returns {Object} color style expression and corresponding variables
|
|
628
629
|
*
|
|
629
630
|
* @private
|
|
630
631
|
*/
|
|
@@ -696,13 +697,13 @@ function _getColorPaletteStyleForTileLayer ({
|
|
|
696
697
|
/**
|
|
697
698
|
* Build OpenLayers style expression for coloring a WebGL PointLayer.
|
|
698
699
|
*
|
|
699
|
-
* @param {
|
|
700
|
+
* @param {Object} styleOptions - Style options
|
|
700
701
|
* @param {string} styleOptions.name - Name of a property for which values should be colorized
|
|
701
702
|
* @param {number} styleOptions.minValue - Mininum value of the output range
|
|
702
703
|
* @param {number} styleOptions.maxValue - Maxinum value of the output range
|
|
703
704
|
* @param {number[][]} styleOptions.colormap - RGB color triplets
|
|
704
705
|
*
|
|
705
|
-
* @returns {
|
|
706
|
+
* @returns {Object} color style expression
|
|
706
707
|
*
|
|
707
708
|
* @private
|
|
708
709
|
*/
|
|
@@ -790,14 +791,18 @@ class VolumeImageViewer {
|
|
|
790
791
|
/**
|
|
791
792
|
* Create a viewer instance for displaying VOLUME images.
|
|
792
793
|
*
|
|
793
|
-
* @param {
|
|
794
|
-
* @param {
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
* @param {
|
|
800
|
-
*
|
|
794
|
+
* @param {Object} options
|
|
795
|
+
* @param {Object} options.client - A DICOMwebClient instance for interacting
|
|
796
|
+
* with an origin server over HTTP
|
|
797
|
+
* @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
|
|
798
|
+
* Metadata of DICOM VL Whole Slide Microscopy Image instances that should be
|
|
799
|
+
* diplayed.
|
|
800
|
+
* @param {string[]} [options.controls=[]] - Names of viewer control elements
|
|
801
|
+
* that should be included in the viewport
|
|
802
|
+
* @param {boolean} [options.debug=false] - Whether debug features should be
|
|
803
|
+
* turned on (e.g., display of tile boundaries)
|
|
804
|
+
* @param {number} [options.tilesCacheSize=1000] - Number of tiles that should
|
|
805
|
+
* be cached to avoid repeated retrieval for the DICOMweb server
|
|
801
806
|
*/
|
|
802
807
|
constructor (options) {
|
|
803
808
|
this[_options] = options
|
|
@@ -810,10 +815,6 @@ class VolumeImageViewer {
|
|
|
810
815
|
this[_options].tilesCacheSize = 1000
|
|
811
816
|
}
|
|
812
817
|
|
|
813
|
-
if (this[_options].overview == null) {
|
|
814
|
-
this[_options].overview = {}
|
|
815
|
-
}
|
|
816
|
-
|
|
817
818
|
if (this[_options].controls == null) {
|
|
818
819
|
this[_options].controls = []
|
|
819
820
|
}
|
|
@@ -1345,6 +1346,7 @@ class VolumeImageViewer {
|
|
|
1345
1346
|
* We need to reuse them here to avoid duplications.
|
|
1346
1347
|
* Enabling or disabling interactions could cause side effects on
|
|
1347
1348
|
* OverviewMap since it also uses the same interactions in the map
|
|
1349
|
+
* @private
|
|
1348
1350
|
*/
|
|
1349
1351
|
this[_interactions] = {
|
|
1350
1352
|
draw: undefined,
|
|
@@ -1409,7 +1411,7 @@ class VolumeImageViewer {
|
|
|
1409
1411
|
* linear interpolation.
|
|
1410
1412
|
*
|
|
1411
1413
|
* @param {string} opticalPathIdentifier - Optical Path Identifier
|
|
1412
|
-
* @param {
|
|
1414
|
+
* @param {Object} styleOptions
|
|
1413
1415
|
* @param {number[]} styleOptions.color - RGB color triplet
|
|
1414
1416
|
* @param {number} styleOptions.opacity - Opacity
|
|
1415
1417
|
* @param {number[]} styleOptions.limitValues - Upper and lower windowing limits
|
|
@@ -1499,7 +1501,7 @@ class VolumeImageViewer {
|
|
|
1499
1501
|
* Get the style of an optical path.
|
|
1500
1502
|
*
|
|
1501
1503
|
* @param {string} opticalPathIdentifier - Optical Path Identifier
|
|
1502
|
-
* @return {
|
|
1504
|
+
* @return {Object} Style of optical path
|
|
1503
1505
|
*/
|
|
1504
1506
|
getOpticalPathStyle (opticalPathIdentifier) {
|
|
1505
1507
|
const opticalPath = this[_opticalPaths][opticalPathIdentifier]
|
|
@@ -1546,7 +1548,7 @@ class VolumeImageViewer {
|
|
|
1546
1548
|
/**
|
|
1547
1549
|
* Get all optical paths.
|
|
1548
1550
|
*
|
|
1549
|
-
* @return {OpticalPath[]}
|
|
1551
|
+
* @return {opticalPath.OpticalPath[]}
|
|
1550
1552
|
*/
|
|
1551
1553
|
getAllOpticalPaths () {
|
|
1552
1554
|
const opticalPaths = []
|
|
@@ -1624,7 +1626,7 @@ class VolumeImageViewer {
|
|
|
1624
1626
|
* Show an optical path.
|
|
1625
1627
|
*
|
|
1626
1628
|
* @param {string} opticalPathIdentifier - Optical Path Identifier
|
|
1627
|
-
* @param {
|
|
1629
|
+
* @param {Object} styleOptions
|
|
1628
1630
|
* @param {number[]} styleOptions.color - RGB color triplet
|
|
1629
1631
|
* @param {number} styleOptions.opacity - Opacity
|
|
1630
1632
|
* @param {number[]} styleOptions.limitValues - Upper and lower clipping values
|
|
@@ -1725,7 +1727,7 @@ class VolumeImageViewer {
|
|
|
1725
1727
|
/**
|
|
1726
1728
|
* Render the images in the specified viewport container.
|
|
1727
1729
|
*
|
|
1728
|
-
* @param {
|
|
1730
|
+
* @param {Object} options - Rendering options.
|
|
1729
1731
|
* @param {(string|HTMLElement)} options.container - HTML Element in which the viewer should be injected.
|
|
1730
1732
|
*/
|
|
1731
1733
|
render (options) {
|
|
@@ -1884,19 +1886,19 @@ class VolumeImageViewer {
|
|
|
1884
1886
|
/**
|
|
1885
1887
|
* Activate the draw interaction for graphic annotation of regions of interest.
|
|
1886
1888
|
*
|
|
1887
|
-
* @param {
|
|
1889
|
+
* @param {Object} options - Drawing options
|
|
1888
1890
|
* @param {string} options.geometryType - Name of the geometry type (point, circle, box, polygon, freehandpolygon, line, freehandline)
|
|
1889
1891
|
* @param {string} options.marker - Marker
|
|
1890
1892
|
* @param {string} options.markup - Markup
|
|
1891
1893
|
* @param {number} options.maxPoints - Geometry max points
|
|
1892
1894
|
* @param {number} options.minPoints - Geometry min points
|
|
1893
|
-
* @param {
|
|
1894
|
-
* @param {
|
|
1895
|
+
* @param {Object} options.styleOptions - Style options
|
|
1896
|
+
* @param {Object} options.styleOptions.stroke - Style options for the outline of the geometry
|
|
1895
1897
|
* @param {number[]} options.styleOptions.stroke.color - RGBA color of the outline
|
|
1896
1898
|
* @param {number} options.styleOptions.stroke.width - Width of the outline
|
|
1897
|
-
* @param {
|
|
1899
|
+
* @param {Object} options.styleOptions.fill - Style options for body the geometry
|
|
1898
1900
|
* @param {number[]} options.styleOptions.fill.color - RGBA color of the body
|
|
1899
|
-
* @param {
|
|
1901
|
+
* @param {Object} options.styleOptions.image - Style options for image
|
|
1900
1902
|
*/
|
|
1901
1903
|
activateDrawInteraction (options = {}) {
|
|
1902
1904
|
this.deactivateDrawInteraction()
|
|
@@ -2029,25 +2031,25 @@ class VolumeImageViewer {
|
|
|
2029
2031
|
/**
|
|
2030
2032
|
* Whether draw interaction is active
|
|
2031
2033
|
*
|
|
2032
|
-
* @
|
|
2034
|
+
* @type boolean
|
|
2033
2035
|
*/
|
|
2034
2036
|
get isDrawInteractionActive () {
|
|
2035
2037
|
return this[_interactions].draw !== undefined
|
|
2036
2038
|
}
|
|
2037
2039
|
|
|
2038
2040
|
/**
|
|
2039
|
-
* Whether
|
|
2041
|
+
* Whether drag pan interaction is active.
|
|
2040
2042
|
*
|
|
2041
|
-
* @type
|
|
2043
|
+
* @type boolean
|
|
2042
2044
|
*/
|
|
2043
2045
|
get isDragPanInteractionActive () {
|
|
2044
2046
|
return this[_interactions].dragPan !== undefined
|
|
2045
2047
|
}
|
|
2046
2048
|
|
|
2047
2049
|
/**
|
|
2048
|
-
* Whether
|
|
2050
|
+
* Whether drag zoom interaction is active.
|
|
2049
2051
|
*
|
|
2050
|
-
* @type
|
|
2052
|
+
* @type boolean
|
|
2051
2053
|
*/
|
|
2052
2054
|
get isDragZoomInteractionActive () {
|
|
2053
2055
|
return this[_interactions].dragZoom !== undefined
|
|
@@ -2056,7 +2058,7 @@ class VolumeImageViewer {
|
|
|
2056
2058
|
/**
|
|
2057
2059
|
* Whether translate interaction is active.
|
|
2058
2060
|
*
|
|
2059
|
-
* @type
|
|
2061
|
+
* @type boolean
|
|
2060
2062
|
*/
|
|
2061
2063
|
get isTranslateInteractionActive () {
|
|
2062
2064
|
return this[_interactions].translate !== undefined
|
|
@@ -2092,10 +2094,10 @@ class VolumeImageViewer {
|
|
|
2092
2094
|
/**
|
|
2093
2095
|
* Extract and transform the region of interest (ROI).
|
|
2094
2096
|
*
|
|
2095
|
-
* @param {
|
|
2097
|
+
* @param {Object} feature - Openlayers Feature
|
|
2096
2098
|
* @param {Object[]} pyramid - Metadata for resolution levels of image pyramid
|
|
2097
2099
|
* @param {Object} context - Context
|
|
2098
|
-
* @returns {ROI} Region of interest
|
|
2100
|
+
* @returns {roi.ROI} Region of interest
|
|
2099
2101
|
* @private
|
|
2100
2102
|
*/
|
|
2101
2103
|
_getROIFromFeature (feature, pyramid) {
|
|
@@ -2153,9 +2155,9 @@ class VolumeImageViewer {
|
|
|
2153
2155
|
}
|
|
2154
2156
|
|
|
2155
2157
|
/**
|
|
2156
|
-
* Activate
|
|
2158
|
+
* Activate drag zoom interaction.
|
|
2157
2159
|
*
|
|
2158
|
-
* @param {
|
|
2160
|
+
* @param {Object} options - Options.
|
|
2159
2161
|
*/
|
|
2160
2162
|
activateDragZoomInteraction (options = {}) {
|
|
2161
2163
|
this.deactivateDragZoomInteraction()
|
|
@@ -2180,7 +2182,7 @@ class VolumeImageViewer {
|
|
|
2180
2182
|
}
|
|
2181
2183
|
|
|
2182
2184
|
/**
|
|
2183
|
-
* Deactivate
|
|
2185
|
+
* Deactivate drag zoom interaction.
|
|
2184
2186
|
*/
|
|
2185
2187
|
deactivateDragZoomInteraction () {
|
|
2186
2188
|
console.info('deactivate "dragZoom" interaction')
|
|
@@ -2193,7 +2195,7 @@ class VolumeImageViewer {
|
|
|
2193
2195
|
/**
|
|
2194
2196
|
* Activate select interaction.
|
|
2195
2197
|
*
|
|
2196
|
-
* @param {
|
|
2198
|
+
* @param {Object} options selection options.
|
|
2197
2199
|
*/
|
|
2198
2200
|
activateSelectInteraction (options = {}) {
|
|
2199
2201
|
this.deactivateSelectInteraction()
|
|
@@ -2239,9 +2241,9 @@ class VolumeImageViewer {
|
|
|
2239
2241
|
}
|
|
2240
2242
|
|
|
2241
2243
|
/**
|
|
2242
|
-
* Activate
|
|
2244
|
+
* Activate drag pan interaction.
|
|
2243
2245
|
*
|
|
2244
|
-
* @param {Object} options -
|
|
2246
|
+
* @param {Object} options - Options.
|
|
2245
2247
|
*/
|
|
2246
2248
|
activateDragPanInteraction (options = {}) {
|
|
2247
2249
|
this.deactivateDragPanInteraction()
|
|
@@ -2268,7 +2270,7 @@ class VolumeImageViewer {
|
|
|
2268
2270
|
}
|
|
2269
2271
|
|
|
2270
2272
|
/**
|
|
2271
|
-
* Deactivate
|
|
2273
|
+
* Deactivate drag pan interaction.
|
|
2272
2274
|
*/
|
|
2273
2275
|
deactivateDragPanInteraction () {
|
|
2274
2276
|
console.info('deactivate "drag pan" interaction')
|
|
@@ -2307,7 +2309,7 @@ class VolumeImageViewer {
|
|
|
2307
2309
|
/**
|
|
2308
2310
|
* Whether select interaction is active.
|
|
2309
2311
|
*
|
|
2310
|
-
* @
|
|
2312
|
+
* @type boolean
|
|
2311
2313
|
*/
|
|
2312
2314
|
get isSelectInteractionActive () {
|
|
2313
2315
|
return this[_interactions].select !== undefined
|
|
@@ -2316,7 +2318,7 @@ class VolumeImageViewer {
|
|
|
2316
2318
|
/**
|
|
2317
2319
|
* Activate modify interaction.
|
|
2318
2320
|
*
|
|
2319
|
-
* @param {
|
|
2321
|
+
* @param {Object} options - Modification options.
|
|
2320
2322
|
*/
|
|
2321
2323
|
activateModifyInteraction (options = {}) {
|
|
2322
2324
|
this.deactivateModifyInteraction()
|
|
@@ -2369,7 +2371,7 @@ class VolumeImageViewer {
|
|
|
2369
2371
|
/**
|
|
2370
2372
|
* Whether modify interaction is active.
|
|
2371
2373
|
*
|
|
2372
|
-
* @
|
|
2374
|
+
* @type boolean
|
|
2373
2375
|
*/
|
|
2374
2376
|
get isModifyInteractionActive () {
|
|
2375
2377
|
return this[_interactions].modify !== undefined
|
|
@@ -2378,7 +2380,7 @@ class VolumeImageViewer {
|
|
|
2378
2380
|
/**
|
|
2379
2381
|
* Get all annotated regions of interest.
|
|
2380
2382
|
*
|
|
2381
|
-
* @returns {ROI[]} Array of regions of interest.
|
|
2383
|
+
* @returns {roi.ROI[]} Array of regions of interest.
|
|
2382
2384
|
*/
|
|
2383
2385
|
getAllROIs () {
|
|
2384
2386
|
console.info('get all ROIs')
|
|
@@ -2410,7 +2412,7 @@ class VolumeImageViewer {
|
|
|
2410
2412
|
* Get an individual annotated region of interest.
|
|
2411
2413
|
*
|
|
2412
2414
|
* @param {string} uid - Unique identifier of the region of interest
|
|
2413
|
-
* @returns {ROI} Region of interest.
|
|
2415
|
+
* @returns {roi.ROI} Region of interest.
|
|
2414
2416
|
*/
|
|
2415
2417
|
getROI (uid) {
|
|
2416
2418
|
console.info(`get ROI ${uid}`)
|
|
@@ -2422,7 +2424,7 @@ class VolumeImageViewer {
|
|
|
2422
2424
|
* Add a measurement to a region of interest.
|
|
2423
2425
|
*
|
|
2424
2426
|
* @param {string} uid - Unique identifier of the region of interest
|
|
2425
|
-
* @param {
|
|
2427
|
+
* @param {Object} item - NUM content item representing a measurement
|
|
2426
2428
|
*/
|
|
2427
2429
|
addROIMeasurement (uid, item) {
|
|
2428
2430
|
const meaning = item.ConceptNameCodeSequence[0].CodeMeaning
|
|
@@ -2445,7 +2447,7 @@ class VolumeImageViewer {
|
|
|
2445
2447
|
* Add a qualitative evaluation to a region of interest.
|
|
2446
2448
|
*
|
|
2447
2449
|
* @param {string} uid - Unique identifier of the region of interest
|
|
2448
|
-
* @param {
|
|
2450
|
+
* @param {Object} item - CODE content item representing a qualitative evaluation
|
|
2449
2451
|
*/
|
|
2450
2452
|
addROIEvaluation (uid, item) {
|
|
2451
2453
|
const meaning = item.ConceptNameCodeSequence[0].CodeMeaning
|
|
@@ -2467,7 +2469,7 @@ class VolumeImageViewer {
|
|
|
2467
2469
|
/**
|
|
2468
2470
|
* Pop the most recently annotated regions of interest.
|
|
2469
2471
|
*
|
|
2470
|
-
* @returns {ROI} Regions of interest.
|
|
2472
|
+
* @returns {roi.ROI} Regions of interest.
|
|
2471
2473
|
*/
|
|
2472
2474
|
popROI () {
|
|
2473
2475
|
console.info('pop ROI')
|
|
@@ -2478,14 +2480,14 @@ class VolumeImageViewer {
|
|
|
2478
2480
|
/**
|
|
2479
2481
|
* Add a regions of interest.
|
|
2480
2482
|
*
|
|
2481
|
-
* @param {ROI} roi - Regions of interest
|
|
2482
|
-
* @param {
|
|
2483
|
-
* @param {
|
|
2483
|
+
* @param {roi.ROI} roi - Regions of interest
|
|
2484
|
+
* @param {Object} styleOptions - Style options
|
|
2485
|
+
* @param {Object} styleOptions.stroke - Style options for the outline of the geometry
|
|
2484
2486
|
* @param {number[]} styleOptions.stroke.color - RGBA color of the outline
|
|
2485
2487
|
* @param {number} styleOptions.stroke.width - Width of the outline
|
|
2486
|
-
* @param {
|
|
2488
|
+
* @param {Object} styleOptions.fill - Style options for body the geometry
|
|
2487
2489
|
* @param {number[]} styleOptions.fill.color - RGBA color of the body
|
|
2488
|
-
* @param {
|
|
2490
|
+
* @param {Object} styleOptions.image - Style options for image
|
|
2489
2491
|
*
|
|
2490
2492
|
*/
|
|
2491
2493
|
addROI (roi, styleOptions = {}) {
|
|
@@ -2522,13 +2524,13 @@ class VolumeImageViewer {
|
|
|
2522
2524
|
/**
|
|
2523
2525
|
* Update properties of a region of interest.
|
|
2524
2526
|
*
|
|
2525
|
-
* @param {
|
|
2527
|
+
* @param {Object} roi - ROI to be updated
|
|
2526
2528
|
* @param {string} roi.uid - Unique identifier of the region of interest
|
|
2527
|
-
* @param {
|
|
2528
|
-
* @param {
|
|
2529
|
-
* @param {
|
|
2530
|
-
* @param {
|
|
2531
|
-
* @param {
|
|
2529
|
+
* @param {Object} roi.properties - ROI properties
|
|
2530
|
+
* @param {Object} roi.properties.measurements - ROI measurements
|
|
2531
|
+
* @param {Object} roi.properties.evaluations - ROI evaluations
|
|
2532
|
+
* @param {Object} roi.properties.label - ROI label
|
|
2533
|
+
* @param {Object} roi.properties.marker - ROI marker
|
|
2532
2534
|
*/
|
|
2533
2535
|
updateROI ({ uid, properties = {} }) {
|
|
2534
2536
|
if (!uid) return
|
|
@@ -2546,7 +2548,7 @@ class VolumeImageViewer {
|
|
|
2546
2548
|
*
|
|
2547
2549
|
* @param {string} uid - Unique identifier of the regions of interest
|
|
2548
2550
|
*
|
|
2549
|
-
* @returns {
|
|
2551
|
+
* @returns {Object} - Style settings
|
|
2550
2552
|
*/
|
|
2551
2553
|
getROIStyle (uid) {
|
|
2552
2554
|
const feature = this[_features].getArray().find((feature) => {
|
|
@@ -2573,11 +2575,11 @@ class VolumeImageViewer {
|
|
|
2573
2575
|
* Set the style of a region of interest.
|
|
2574
2576
|
*
|
|
2575
2577
|
* @param {string} uid - Unique identifier of the regions of interest
|
|
2576
|
-
* @param {
|
|
2577
|
-
* @param {
|
|
2578
|
+
* @param {Object} styleOptions - Style options
|
|
2579
|
+
* @param {Object} styleOptions.stroke - Style options for the outline of the geometry
|
|
2578
2580
|
* @param {number[]} styleOptions.stroke.color - RGBA color of the outline
|
|
2579
2581
|
* @param {number} styleOptions.stroke.width - Width of the outline
|
|
2580
|
-
* @param {
|
|
2582
|
+
* @param {Object} styleOptions.fill - Style options for body the geometry
|
|
2581
2583
|
* @param {number[]} styleOptions.fill.color - RGBA color of the body
|
|
2582
2584
|
*
|
|
2583
2585
|
*/
|
|
@@ -2595,8 +2597,8 @@ class VolumeImageViewer {
|
|
|
2595
2597
|
/**
|
|
2596
2598
|
* Add a new viewport overlay.
|
|
2597
2599
|
*
|
|
2598
|
-
* @param {
|
|
2599
|
-
* @param {
|
|
2600
|
+
* @param {Object} options Overlay options
|
|
2601
|
+
* @param {Object} options.element The custom overlay HTML element
|
|
2600
2602
|
* @param {string} options.className Class to style the overlay container
|
|
2601
2603
|
* @param {number[]} options.offset Horizontal and vertical offset of the overlay container in pixels
|
|
2602
2604
|
*/
|
|
@@ -2669,7 +2671,8 @@ class VolumeImageViewer {
|
|
|
2669
2671
|
/**
|
|
2670
2672
|
* Add annotation groups.
|
|
2671
2673
|
*
|
|
2672
|
-
* @param {MicroscopyBulkSimpleAnnotations} metadata - Metadata of a
|
|
2674
|
+
* @param {metadata.MicroscopyBulkSimpleAnnotations} metadata - Metadata of a
|
|
2675
|
+
* DICOM Microscopy Simple Bulk Annotations instance
|
|
2673
2676
|
*/
|
|
2674
2677
|
addAnnotationGroups (metadata) {
|
|
2675
2678
|
const refImage = this[_pyramid].metadata[0]
|
|
@@ -2897,7 +2900,7 @@ class VolumeImageViewer {
|
|
|
2897
2900
|
* Show an annotation group.
|
|
2898
2901
|
*
|
|
2899
2902
|
* @param {string} annotationGroupUID - Unique identifier of an annotation group
|
|
2900
|
-
* @param {
|
|
2903
|
+
* @param {Object} styleOptions
|
|
2901
2904
|
* @param {number} styleOptions.measurement - Selected measurement for colorizing annotations
|
|
2902
2905
|
*/
|
|
2903
2906
|
showAnnotationGroup (annotationGroupUID, styleOptions = {}) {
|
|
@@ -3056,7 +3059,7 @@ class VolumeImageViewer {
|
|
|
3056
3059
|
* Set style of an annotation group.
|
|
3057
3060
|
*
|
|
3058
3061
|
* @param {string} annotationGroupUID - Unique identifier of an annotation group
|
|
3059
|
-
* @param {
|
|
3062
|
+
* @param {Object} styleOptions - Style options
|
|
3060
3063
|
* @param {number} styleOptions.opacity - Opacity
|
|
3061
3064
|
* @param {number} styleOptions.measurement - Selected measurement for colorizing annotations
|
|
3062
3065
|
*/
|
|
@@ -3151,7 +3154,7 @@ class VolumeImageViewer {
|
|
|
3151
3154
|
*
|
|
3152
3155
|
* @param {string} annotationGroupUID - Unique identifier of an annotation group
|
|
3153
3156
|
*
|
|
3154
|
-
* @returns {
|
|
3157
|
+
* @returns {Object} - Style settings
|
|
3155
3158
|
*/
|
|
3156
3159
|
getAnnotationGroupStyle (annotationGroupUID) {
|
|
3157
3160
|
if (!(annotationGroupUID in this[_annotationGroups])) {
|
|
@@ -3170,7 +3173,7 @@ class VolumeImageViewer {
|
|
|
3170
3173
|
/**
|
|
3171
3174
|
* Get all annotation groups.
|
|
3172
3175
|
*
|
|
3173
|
-
* @returns {AnnotationGroup[]}
|
|
3176
|
+
* @returns {annotation.AnnotationGroup[]}
|
|
3174
3177
|
*/
|
|
3175
3178
|
getAllAnnotationGroups () {
|
|
3176
3179
|
const groups = []
|
|
@@ -3185,7 +3188,8 @@ class VolumeImageViewer {
|
|
|
3185
3188
|
*
|
|
3186
3189
|
* @param {string} annotationGroupUID - Unique identifier of an annotation group
|
|
3187
3190
|
*
|
|
3188
|
-
* @returns {MicroscopyBulkSimpleAnnotations
|
|
3191
|
+
* @returns {metadata.MicroscopyBulkSimpleAnnotations} - Metadata of DICOM
|
|
3192
|
+
* Microscopy Bulk Simple Annotations instance
|
|
3189
3193
|
*/
|
|
3190
3194
|
getAnnotationGroupMetadata (annotationGroupUID) {
|
|
3191
3195
|
if (!(annotationGroupUID in this[_annotationGroups])) {
|
|
@@ -3201,7 +3205,7 @@ class VolumeImageViewer {
|
|
|
3201
3205
|
/**
|
|
3202
3206
|
* Add segments.
|
|
3203
3207
|
*
|
|
3204
|
-
* @param {Segmentation[]} metadata - Metadata of one or more DICOM Segmentation instances
|
|
3208
|
+
* @param {metadata.Segmentation[]} metadata - Metadata of one or more DICOM Segmentation instances
|
|
3205
3209
|
*/
|
|
3206
3210
|
addSegments (metadata) {
|
|
3207
3211
|
if (metadata.length === 0) {
|
|
@@ -3399,7 +3403,7 @@ class VolumeImageViewer {
|
|
|
3399
3403
|
* Show a segment.
|
|
3400
3404
|
*
|
|
3401
3405
|
* @param {string} segmentUID - Unique tracking identifier of a segment
|
|
3402
|
-
* @param {
|
|
3406
|
+
* @param {Object} styleOptions
|
|
3403
3407
|
* @param {number} styleOptions.opacity - Opacity
|
|
3404
3408
|
*/
|
|
3405
3409
|
showSegment (segmentUID, styleOptions = {}) {
|
|
@@ -3452,7 +3456,7 @@ class VolumeImageViewer {
|
|
|
3452
3456
|
* Set the style of a segment.
|
|
3453
3457
|
*
|
|
3454
3458
|
* @param {string} segmentUID - Unique tracking identifier of segment
|
|
3455
|
-
* @param {
|
|
3459
|
+
* @param {Object} styleOptions - Style options
|
|
3456
3460
|
* @param {number} styleOptions.opacity - Opacity
|
|
3457
3461
|
*/
|
|
3458
3462
|
setSegmentStyle (segmentUID, styleOptions = {}) {
|
|
@@ -3516,7 +3520,8 @@ class VolumeImageViewer {
|
|
|
3516
3520
|
* Get the style of a segment.
|
|
3517
3521
|
*
|
|
3518
3522
|
* @param {string} segmentUID - Unique tracking identifier of segment
|
|
3519
|
-
*
|
|
3523
|
+
*
|
|
3524
|
+
* @returns {Object} Style settings
|
|
3520
3525
|
*/
|
|
3521
3526
|
getSegmentStyle (segmentUID) {
|
|
3522
3527
|
if (!(segmentUID in this[_segments])) {
|
|
@@ -3537,7 +3542,8 @@ class VolumeImageViewer {
|
|
|
3537
3542
|
* Get image metadata for a segment.
|
|
3538
3543
|
*
|
|
3539
3544
|
* @param {string} segmentUID - Unique tracking identifier of segment
|
|
3540
|
-
*
|
|
3545
|
+
*
|
|
3546
|
+
* @returns {metadata.Segmentation[]} Metadata of DICOM Segmentation instances
|
|
3541
3547
|
*/
|
|
3542
3548
|
getSegmentMetadata (segmentUID) {
|
|
3543
3549
|
if (!(segmentUID in this[_segments])) {
|
|
@@ -3553,7 +3559,7 @@ class VolumeImageViewer {
|
|
|
3553
3559
|
/**
|
|
3554
3560
|
* Get all segments.
|
|
3555
3561
|
*
|
|
3556
|
-
* @return {Segment[]}
|
|
3562
|
+
* @return {segment.Segment[]}
|
|
3557
3563
|
*/
|
|
3558
3564
|
getAllSegments () {
|
|
3559
3565
|
const segments = []
|
|
@@ -3827,7 +3833,7 @@ class VolumeImageViewer {
|
|
|
3827
3833
|
* Show a parameter mapping.
|
|
3828
3834
|
*
|
|
3829
3835
|
* @param {string} mappingUID - Unique tracking identifier of a mapping
|
|
3830
|
-
* @param {
|
|
3836
|
+
* @param {Object} styleOptions
|
|
3831
3837
|
* @param {number} styleOptions.opacity - Opacity
|
|
3832
3838
|
* @param {number} styleOptions.limitValues - Opacity
|
|
3833
3839
|
*/
|
|
@@ -3881,7 +3887,7 @@ class VolumeImageViewer {
|
|
|
3881
3887
|
* Set the style of a parameter mapping.
|
|
3882
3888
|
*
|
|
3883
3889
|
* @param {string} mappingUID - Unique tracking identifier of mapping
|
|
3884
|
-
* @param {
|
|
3890
|
+
* @param {Object} styleOptions
|
|
3885
3891
|
* @param {number} styleOptions.opacity - Opacity
|
|
3886
3892
|
*/
|
|
3887
3893
|
setParameterMappingStyle (mappingUID, styleOptions = {}) {
|
|
@@ -3961,7 +3967,7 @@ class VolumeImageViewer {
|
|
|
3961
3967
|
* Get the style of a parameter mapping.
|
|
3962
3968
|
*
|
|
3963
3969
|
* @param {string} mappingUID - Unique tracking identifier of mapping
|
|
3964
|
-
* @returns {
|
|
3970
|
+
* @returns {Object} Style Options
|
|
3965
3971
|
*/
|
|
3966
3972
|
getParameterMappingStyle (mappingUID) {
|
|
3967
3973
|
if (!(mappingUID in this[_mappings])) {
|
|
@@ -3983,7 +3989,9 @@ class VolumeImageViewer {
|
|
|
3983
3989
|
* Get image metadata for a parameter mapping.
|
|
3984
3990
|
*
|
|
3985
3991
|
* @param {string} mappingUID - Unique tracking identifier of mapping
|
|
3986
|
-
*
|
|
3992
|
+
*
|
|
3993
|
+
* @returns {metadata.ParametricMap[]} Metadata of DICOM Parametric Map
|
|
3994
|
+
* instances
|
|
3987
3995
|
*/
|
|
3988
3996
|
getParameterMappingMetadata (mappingUID) {
|
|
3989
3997
|
if (!(mappingUID in this[_mappings])) {
|
|
@@ -3999,7 +4007,7 @@ class VolumeImageViewer {
|
|
|
3999
4007
|
/**
|
|
4000
4008
|
* Get all parameter mappings.
|
|
4001
4009
|
*
|
|
4002
|
-
* @return {ParameterMapping[]}
|
|
4010
|
+
* @return {mapping.ParameterMapping[]}
|
|
4003
4011
|
*/
|
|
4004
4012
|
getAllParameterMappings () {
|
|
4005
4013
|
const mappings = []
|
|
@@ -4015,18 +4023,22 @@ class VolumeImageViewer {
|
|
|
4015
4023
|
* with Image Type other than VOLUME.
|
|
4016
4024
|
*
|
|
4017
4025
|
* @class
|
|
4026
|
+
* @abstract
|
|
4018
4027
|
* @private
|
|
4019
4028
|
*/
|
|
4020
4029
|
class _NonVolumeImageViewer {
|
|
4021
4030
|
/**
|
|
4022
|
-
*
|
|
4023
|
-
*
|
|
4024
|
-
*
|
|
4025
|
-
* @param {
|
|
4026
|
-
*
|
|
4027
|
-
* @param {string} options.orientation - Orientation of the slide (vertical:
|
|
4028
|
-
*
|
|
4029
|
-
* @param {
|
|
4031
|
+
* @param {Object} options
|
|
4032
|
+
* @param {Object} options.client - A DICOMwebClient instance for interacting
|
|
4033
|
+
* with an origin server over HTTP.
|
|
4034
|
+
* @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
|
|
4035
|
+
* Metadata of DICOM VL Whole Slide Microscopy Image instances
|
|
4036
|
+
* @param {string} options.orientation - Orientation of the slide (vertical:
|
|
4037
|
+
* label on top, or horizontal: label on right side).
|
|
4038
|
+
* @param {number} [options.resizeFactor=1] - To which extent image should be
|
|
4039
|
+
* reduced in size (fraction).
|
|
4040
|
+
* @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
|
|
4041
|
+
* should be included for correction of image colors.
|
|
4030
4042
|
*/
|
|
4031
4043
|
constructor (options) {
|
|
4032
4044
|
// We also accept metadata in raw JSON format for backwards compatibility
|
|
@@ -4140,7 +4152,7 @@ class _NonVolumeImageViewer {
|
|
|
4140
4152
|
/**
|
|
4141
4153
|
* Render the image in the specified viewport container.
|
|
4142
4154
|
*
|
|
4143
|
-
* @param {
|
|
4155
|
+
* @param {Object} options - Rendering options.
|
|
4144
4156
|
* @param {(string|HTMLElement)} options.container - HTML Element in which the viewer should be injected.
|
|
4145
4157
|
*/
|
|
4146
4158
|
render (options) {
|
|
@@ -4198,15 +4210,18 @@ class _NonVolumeImageViewer {
|
|
|
4198
4210
|
* @memberof viewer
|
|
4199
4211
|
*/
|
|
4200
4212
|
class OverviewImageViewer extends _NonVolumeImageViewer {
|
|
4201
|
-
/**
|
|
4202
|
-
*
|
|
4203
|
-
*
|
|
4204
|
-
*
|
|
4205
|
-
* @param {
|
|
4206
|
-
*
|
|
4207
|
-
* @param {string} [options.orientation='horizontal'] - Orientation of the
|
|
4208
|
-
*
|
|
4209
|
-
* @param {
|
|
4213
|
+
/**
|
|
4214
|
+
* @param {Object} options
|
|
4215
|
+
* @param {Object} options.client - A DICOMwebClient instance for interacting
|
|
4216
|
+
* with an origin server over HTTP.
|
|
4217
|
+
* @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
|
|
4218
|
+
* Metadata of DICOM VL Whole Slide Microscopy Image instances
|
|
4219
|
+
* @param {string} [options.orientation='horizontal'] - Orientation of the
|
|
4220
|
+
* slide (vertical: label on top, or horizontal: label on right side).
|
|
4221
|
+
* @param {number} [options.resizeFactor=1] - To which extent image should be
|
|
4222
|
+
* reduced in size (fraction).
|
|
4223
|
+
* @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
|
|
4224
|
+
* should be included for correction of image colors.
|
|
4210
4225
|
*/
|
|
4211
4226
|
constructor (options) {
|
|
4212
4227
|
if (options.orientation === undefined) {
|
|
@@ -4224,15 +4239,17 @@ class OverviewImageViewer extends _NonVolumeImageViewer {
|
|
|
4224
4239
|
* @memberof viewer
|
|
4225
4240
|
*/
|
|
4226
4241
|
class LabelImageViewer extends _NonVolumeImageViewer {
|
|
4227
|
-
/**
|
|
4228
|
-
*
|
|
4229
|
-
*
|
|
4230
|
-
* @param {
|
|
4231
|
-
*
|
|
4232
|
-
* @param {
|
|
4233
|
-
*
|
|
4234
|
-
* @param {number} [options.resizeFactor=1] - To which extent image should be
|
|
4235
|
-
*
|
|
4242
|
+
/**
|
|
4243
|
+
* @param {Object} options - Options
|
|
4244
|
+
* @param {Object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP
|
|
4245
|
+
* @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
|
|
4246
|
+
* Metadata of DICOM VL Whole Slide Microscopy Image instances
|
|
4247
|
+
* @param {string} [options.orientation='vertical'] - Orientation of the
|
|
4248
|
+
* slide (vertical: label on top, or horizontal: label on right side)
|
|
4249
|
+
* @param {number} [options.resizeFactor=1] - To which extent image should be
|
|
4250
|
+
* reduced in size (fraction)
|
|
4251
|
+
* @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
|
|
4252
|
+
* should be included for correction of image colors
|
|
4236
4253
|
*/
|
|
4237
4254
|
constructor (options) {
|
|
4238
4255
|
if (options.orientation === undefined) {
|