dicom-microscopy-viewer 0.36.2 → 0.36.5

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.
Files changed (78) hide show
  1. package/README.md +44 -42
  2. package/{build → dist}/08929516bda4c4fd2597.module.wasm +0 -0
  3. package/{build → dist}/4f2853de305c1b5afcac.module.wasm +0 -0
  4. package/{build → dist}/6ae9c6e051fd2bd70fad.module.wasm +0 -0
  5. package/{build → dist}/6b62efd6c7f30afd4c78.module.wasm +0 -0
  6. package/{build → dist}/7e1d2da75b59525e1933.module.wasm +0 -0
  7. package/{build → dist}/d051f2d564fae150ce94.module.wasm +0 -0
  8. package/dist/dicom-microscopy-viewer.js +2 -0
  9. package/{build → dist}/dicom-microscopy-viewer.js.LICENSE.txt +0 -0
  10. package/dist/dicom-microscopy-viewer.js.map +1 -0
  11. package/{build → dist}/e6305f756142e57c92cd.module.wasm +0 -0
  12. package/{build → dist}/f3e0c999ad06a34a7f75.module.wasm +0 -0
  13. package/docs/annotation.AnnotationGroup.html +142 -43
  14. package/docs/annotation.html +2 -2
  15. package/docs/annotation.js.html +47 -34
  16. package/docs/annotations__AnnotationManager.js.html +2 -2
  17. package/docs/annotations_markups__MarkupManager.js.html +2 -2
  18. package/docs/api.html +2 -2
  19. package/docs/color.PaletteColorLookupTable.html +42 -14
  20. package/docs/color.html +6 -6
  21. package/docs/color.js.html +14 -14
  22. package/docs/dicom-microscopy-viewer.js.html +2 -2
  23. package/docs/events.html +316 -2
  24. package/docs/events.js.html +13 -4
  25. package/docs/index.html +44 -44
  26. package/docs/mapping.ParameterMapping.html +342 -27
  27. package/docs/mapping.Transformation.html +221 -14
  28. package/docs/mapping.html +2 -2
  29. package/docs/mapping.js.html +41 -32
  30. package/docs/metadata.Comprehensive3DSR.html +254 -5
  31. package/docs/metadata.MicroscopyBulkSimpleAnnotations.html +254 -5
  32. package/docs/metadata.ParametricMap.html +254 -5
  33. package/docs/metadata.SOPClass.html +399 -0
  34. package/docs/metadata.Segmentation.html +254 -5
  35. package/docs/metadata.VLWholeSlideMicroscopyImage.html +255 -7
  36. package/docs/metadata.html +14 -32
  37. package/docs/metadata.js.html +55 -21
  38. package/docs/opticalPath.OpticalPath.html +453 -26
  39. package/docs/opticalPath.html +2 -2
  40. package/docs/opticalPath.js.html +16 -17
  41. package/docs/pyramid.js.html +2 -2
  42. package/docs/roi.ROI.html +317 -25
  43. package/docs/roi.html +2 -2
  44. package/docs/roi.js.html +26 -19
  45. package/docs/scoord3d.Ellipse.html +14 -18
  46. package/docs/scoord3d.Ellipsoid.html +14 -18
  47. package/docs/scoord3d.Multipoint.html +14 -18
  48. package/docs/scoord3d.Point.html +13 -17
  49. package/docs/scoord3d.Polygon.html +14 -18
  50. package/docs/scoord3d.Polyline.html +14 -18
  51. package/docs/scoord3d.Scoord3D.html +608 -0
  52. package/docs/scoord3d.html +5 -2
  53. package/docs/scoord3d.js.html +101 -54
  54. package/docs/segment.Segment.html +160 -48
  55. package/docs/segment.html +2 -2
  56. package/docs/segment.js.html +37 -33
  57. package/docs/utils.html +148 -4
  58. package/docs/utils.js.html +6 -6
  59. package/docs/viewer.LabelImageViewer.html +14 -15
  60. package/docs/viewer.OverviewImageViewer.html +15 -15
  61. package/docs/viewer.VolumeImageViewer.html +215 -282
  62. package/docs/viewer.html +2 -2
  63. package/docs/viewer.js.html +150 -133
  64. package/package.json +4 -3
  65. package/src/annotation.js +45 -32
  66. package/src/color.js +12 -12
  67. package/src/events.js +11 -2
  68. package/src/mapping.js +39 -30
  69. package/src/metadata.js +53 -19
  70. package/src/opticalPath.js +14 -15
  71. package/src/roi.js +24 -17
  72. package/src/scoord3d.js +99 -52
  73. package/src/segment.js +35 -31
  74. package/src/utils.js +4 -4
  75. package/src/viewer.js +258 -207
  76. package/webpack.config.js +11 -1
  77. package/build/dicom-microscopy-viewer.js +0 -2
  78. package/build/dicom-microscopy-viewer.js.map +0 -1
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 {object} metadata - Metadata of a DICOM VL Whole Slide Microscopy Image instance
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 {object} styleOptions - Style options
343
- * @param {object} styleOptions.stroke - Style options for the outline of the geometry
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 {object} styleOptions.fill - Style options for body the geometry
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 {object} styleOptions.image - Style options for image
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 {object} feature - The feature instance that represents the ROI
399
- * @param {object} properties -Valid ROI properties
400
- * @param {object} properties.measurements - ROI measurements
401
- * @param {object} properties.evaluations - ROI evaluations
402
- * @param {object} properties.label - ROI label
403
- * @param {object} properties.marker - ROI marker (this is used while we don't have presentation states)
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 {object} map - The map instance
433
- * @param {object} feature - The feature instance
434
- * @param {object} pyramid - The pyramid metadata
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 {object} map - The map instance
502
- * @param {object} feature - The feature instance
503
- * @param {object} pyramid - The pyramid metadata
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 {object} styleOptions - Style options
596
- * @param {object} styleOptions.stroke - Style options for the outline of the geometry
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 {object} styleOptions.fill - Style options for body the geometry
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 {object} styleOptions.image - Style options for image
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 {object} styleOptions - Style options
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 {object} color style expression and corresponding variables
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 {object} styleOptions - Style options
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 {object} color style expression
706
+ * @returns {Object} color style expression
706
707
  *
707
708
  * @private
708
709
  */
@@ -790,28 +791,37 @@ class VolumeImageViewer {
790
791
  /**
791
792
  * Create a viewer instance for displaying VOLUME images.
792
793
  *
793
- * @param {object} options
794
- * @param {object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP
795
- * @param {object[]} options.metadata - An array of DICOM JSON metadata objects
796
- * The array shall contain the metadata of all image instances that should be displayed.
797
- * @param {object} options.styleOptions - Default style options for annotations.
798
- * @param {string[]} [options.controls=[]] - Names of viewer control elements that should be included in the viewport
799
- * @param {boolean} [options.debug=false] - Whether debug features should be turned on (e.g., display of tile boundaries)
800
- * @param {number} [options.tilesCacheSize=512] - initial cache size for a TileImage
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 {Object} options.preload - Whether data should be preloaded
801
+ * @param {string[]} [options.controls=[]] - Names of viewer control elements
802
+ * that should be included in the viewport
803
+ * @param {boolean} [options.debug=false] - Whether debug features should be
804
+ * turned on (e.g., display of tile boundaries)
805
+ * @param {number} [options.tilesCacheSize=1000] - Number of tiles that should
806
+ * be cached to avoid repeated retrieval for the DICOMweb server
801
807
  */
802
808
  constructor (options) {
803
809
  this[_options] = options
804
810
 
805
811
  if (this[_options].debug == null) {
806
812
  this[_options].debug = false
813
+ } else {
814
+ this[_options].debug = true
807
815
  }
808
816
 
809
- if (this[_options].tilesCacheSize == null) {
810
- this[_options].tilesCacheSize = 1000
817
+ if (this[_options].preload == null) {
818
+ this[_options].preload = false
819
+ } else {
820
+ this[_options].preload = true
811
821
  }
812
822
 
813
- if (this[_options].overview == null) {
814
- this[_options].overview = {}
823
+ if (this[_options].tilesCacheSize == null) {
824
+ this[_options].tilesCacheSize = 1000
815
825
  }
816
826
 
817
827
  if (this[_options].controls == null) {
@@ -1144,7 +1154,7 @@ class VolumeImageViewer {
1144
1154
  opticalPath.layer = new TileLayer({
1145
1155
  source,
1146
1156
  extent: pyramid.extent,
1147
- preload: 1,
1157
+ preload: this[_options].preload ? 1 : 0,
1148
1158
  style: style,
1149
1159
  visible: false,
1150
1160
  useInterimTilesOnError: false,
@@ -1226,7 +1236,6 @@ class VolumeImageViewer {
1226
1236
  projection: this[_projection],
1227
1237
  wrapX: false,
1228
1238
  transition: 0,
1229
- preload: 1,
1230
1239
  bandCount: 3
1231
1240
  })
1232
1241
  source.on('tileloaderror', (event) => {
@@ -1247,7 +1256,7 @@ class VolumeImageViewer {
1247
1256
  opticalPath.layer = new TileLayer({
1248
1257
  source,
1249
1258
  extent: this[_tileGrid].extent,
1250
- preload: 1,
1259
+ preload: this[_options].preload ? 1 : 0,
1251
1260
  useInterimTilesOnError: false,
1252
1261
  cacheSize: this[_options].tilesCacheSize
1253
1262
  })
@@ -1287,24 +1296,28 @@ class VolumeImageViewer {
1287
1296
  layers.push(tileDebugLayer)
1288
1297
  }
1289
1298
 
1290
- const overviewView = new View({
1291
- projection: this[_projection],
1292
- rotation: this[_rotation],
1293
- constrainOnlyCenter: false,
1294
- smoothExtentConstraint: true,
1295
- smoothResolutionConstraint: true,
1296
- minZoom: 0,
1297
- maxZoom: 0,
1298
- extent: this[_pyramid].extent
1299
- })
1299
+ if (Math.max(...this[_pyramid].gridSizes[0]) <= 10) {
1300
+ const overviewView = new View({
1301
+ projection: this[_projection],
1302
+ rotation: this[_rotation],
1303
+ constrainOnlyCenter: false,
1304
+ smoothExtentConstraint: true,
1305
+ smoothResolutionConstraint: true,
1306
+ minZoom: 0,
1307
+ maxZoom: 0,
1308
+ extent: this[_pyramid].extent
1309
+ })
1300
1310
 
1301
- this[_overviewMap] = new OverviewMap({
1302
- view: overviewView,
1303
- layers: overviewLayers,
1304
- collapsed: false,
1305
- collapsible: false,
1306
- rotateWithView: true
1307
- })
1311
+ this[_overviewMap] = new OverviewMap({
1312
+ view: overviewView,
1313
+ layers: overviewLayers,
1314
+ collapsed: false,
1315
+ collapsible: true,
1316
+ rotateWithView: true
1317
+ })
1318
+ } else {
1319
+ this[_overviewMap] = null
1320
+ }
1308
1321
 
1309
1322
  this[_drawingSource] = new VectorSource({
1310
1323
  tileGrid: this[_tileGrid],
@@ -1345,6 +1358,7 @@ class VolumeImageViewer {
1345
1358
  * We need to reuse them here to avoid duplications.
1346
1359
  * Enabling or disabling interactions could cause side effects on
1347
1360
  * OverviewMap since it also uses the same interactions in the map
1361
+ * @private
1348
1362
  */
1349
1363
  this[_interactions] = {
1350
1364
  draw: undefined,
@@ -1374,7 +1388,9 @@ class VolumeImageViewer {
1374
1388
  }
1375
1389
 
1376
1390
  if (this[_options].controls.has('overview')) {
1377
- this[_controls].overview = this[_overviewMap]
1391
+ if (this[_overviewMap]) {
1392
+ this[_controls].overview = this[_overviewMap]
1393
+ }
1378
1394
  }
1379
1395
 
1380
1396
  for (const control in this[_controls]) {
@@ -1409,7 +1425,7 @@ class VolumeImageViewer {
1409
1425
  * linear interpolation.
1410
1426
  *
1411
1427
  * @param {string} opticalPathIdentifier - Optical Path Identifier
1412
- * @param {object} styleOptions
1428
+ * @param {Object} styleOptions
1413
1429
  * @param {number[]} styleOptions.color - RGB color triplet
1414
1430
  * @param {number} styleOptions.opacity - Opacity
1415
1431
  * @param {number[]} styleOptions.limitValues - Upper and lower windowing limits
@@ -1499,7 +1515,7 @@ class VolumeImageViewer {
1499
1515
  * Get the style of an optical path.
1500
1516
  *
1501
1517
  * @param {string} opticalPathIdentifier - Optical Path Identifier
1502
- * @return {object} Style of optical path
1518
+ * @return {Object} Style of optical path
1503
1519
  */
1504
1520
  getOpticalPathStyle (opticalPathIdentifier) {
1505
1521
  const opticalPath = this[_opticalPaths][opticalPathIdentifier]
@@ -1546,7 +1562,7 @@ class VolumeImageViewer {
1546
1562
  /**
1547
1563
  * Get all optical paths.
1548
1564
  *
1549
- * @return {OpticalPath[]}
1565
+ * @return {opticalPath.OpticalPath[]}
1550
1566
  */
1551
1567
  getAllOpticalPaths () {
1552
1568
  const opticalPaths = []
@@ -1576,10 +1592,12 @@ class VolumeImageViewer {
1576
1592
  0,
1577
1593
  opticalPath.layer
1578
1594
  )
1579
- this[_overviewMap].getOverviewMap().getLayers().insertAt(
1580
- 0,
1581
- opticalPath.overviewTileLayer
1582
- )
1595
+ if (this[_overviewMap]) {
1596
+ this[_overviewMap].getOverviewMap().getLayers().insertAt(
1597
+ 0,
1598
+ opticalPath.overviewTileLayer
1599
+ )
1600
+ }
1583
1601
  }
1584
1602
 
1585
1603
  /**
@@ -1599,9 +1617,11 @@ class VolumeImageViewer {
1599
1617
  return
1600
1618
  }
1601
1619
  this[_map].removeLayer(opticalPath.layer)
1602
- this[_overviewMap].getOverviewMap().removeLayer(
1603
- opticalPath.overviewTileLayer
1604
- )
1620
+ if (this[_overviewMap]) {
1621
+ this[_overviewMap].getOverviewMap().removeLayer(
1622
+ opticalPath.overviewTileLayer
1623
+ )
1624
+ }
1605
1625
  }
1606
1626
 
1607
1627
  /**
@@ -1624,7 +1644,7 @@ class VolumeImageViewer {
1624
1644
  * Show an optical path.
1625
1645
  *
1626
1646
  * @param {string} opticalPathIdentifier - Optical Path Identifier
1627
- * @param {object} styleOptions
1647
+ * @param {Object} styleOptions
1628
1648
  * @param {number[]} styleOptions.color - RGB color triplet
1629
1649
  * @param {number} styleOptions.opacity - Opacity
1630
1650
  * @param {number[]} styleOptions.limitValues - Upper and lower clipping values
@@ -1725,7 +1745,7 @@ class VolumeImageViewer {
1725
1745
  /**
1726
1746
  * Render the images in the specified viewport container.
1727
1747
  *
1728
- * @param {object} options - Rendering options.
1748
+ * @param {Object} options - Rendering options.
1729
1749
  * @param {(string|HTMLElement)} options.container - HTML Element in which the viewer should be injected.
1730
1750
  */
1731
1751
  render (options) {
@@ -1841,62 +1861,72 @@ class VolumeImageViewer {
1841
1861
  scaleInnerElement.style.margin = '1px'
1842
1862
  scaleInnerElement.style.willChange = 'contents,width'
1843
1863
 
1844
- const overviewElement = this[_overviewMap].element
1845
- const overviewmapElement = Object.values(overviewElement.children).find(
1846
- c => c.className === 'ol-overviewmap-map'
1847
- )
1848
- overviewmapElement.style.border = '1px solid black'
1849
- // Try to fit the overview map into the target control overlay container
1850
- const height = Math.abs(this[_pyramid].extent[1])
1851
- const width = Math.abs(this[_pyramid].extent[2])
1852
- const rotation = this[_rotation] / Math.PI * 180
1853
- const windowSize = _getWindowSize()
1854
- let targetHeight
1855
- let resizeFactor
1856
- let targetWidth
1857
- if (Math.abs(rotation - 180) < 0.01 || Math.abs(rotation - 0) < 0.01) {
1858
- if (windowSize[1] > windowSize[0]) {
1859
- targetHeight = Math.ceil(windowSize[1] * 0.2)
1860
- resizeFactor = targetHeight / height
1861
- targetWidth = width * resizeFactor
1862
- } else {
1863
- targetWidth = Math.ceil(windowSize[0] * 0.15)
1864
- resizeFactor = targetWidth / width
1865
- targetHeight = height * resizeFactor
1864
+ if (this[_overviewMap]) {
1865
+ const overviewElement = this[_overviewMap].element
1866
+ const overviewmapElement = Object.values(overviewElement.children).find(
1867
+ c => c.className === 'ol-overviewmap-map'
1868
+ )
1869
+ const buttonElement = Object.values(overviewElement.children).find(
1870
+ c => c.type === 'button'
1871
+ )
1872
+ if (buttonElement) {
1873
+ buttonElement.style.border = '0.25px solid black'
1874
+ buttonElement.style.backgroundColor = 'white'
1866
1875
  }
1867
- } else {
1868
- if (windowSize[1] > windowSize[0]) {
1869
- targetHeight = Math.ceil(windowSize[1] * 0.2)
1870
- resizeFactor = targetHeight / width
1871
- targetWidth = height * resizeFactor
1876
+ overviewmapElement.style.border = '1px solid black'
1877
+ overviewmapElement.style.color = 'black'
1878
+ // Try to fit the overview map into the target control overlay container
1879
+ const height = Math.abs(this[_pyramid].extent[1])
1880
+ const width = Math.abs(this[_pyramid].extent[2])
1881
+ const rotation = this[_rotation] / Math.PI * 180
1882
+ const windowSize = _getWindowSize()
1883
+ let targetHeight
1884
+ let resizeFactor
1885
+ let targetWidth
1886
+ if (Math.abs(rotation - 180) < 0.01 || Math.abs(rotation - 0) < 0.01) {
1887
+ if (windowSize[1] > windowSize[0]) {
1888
+ targetHeight = Math.ceil(windowSize[1] * 0.2)
1889
+ resizeFactor = targetHeight / height
1890
+ targetWidth = width * resizeFactor
1891
+ } else {
1892
+ targetWidth = Math.ceil(windowSize[0] * 0.15)
1893
+ resizeFactor = targetWidth / width
1894
+ targetHeight = height * resizeFactor
1895
+ }
1872
1896
  } else {
1873
- targetWidth = Math.ceil(windowSize[0] * 0.15)
1874
- resizeFactor = targetWidth / height
1875
- targetHeight = width * resizeFactor
1897
+ if (windowSize[1] > windowSize[0]) {
1898
+ targetHeight = Math.ceil(windowSize[1] * 0.2)
1899
+ resizeFactor = targetHeight / width
1900
+ targetWidth = height * resizeFactor
1901
+ } else {
1902
+ targetWidth = Math.ceil(windowSize[0] * 0.15)
1903
+ resizeFactor = targetWidth / height
1904
+ targetHeight = width * resizeFactor
1905
+ }
1876
1906
  }
1907
+ overviewmapElement.style.width = `${targetWidth}px`
1908
+ overviewmapElement.style.height = `${targetHeight}px`
1909
+ this[_overviewMap].getOverviewMap().updateSize()
1877
1910
  }
1878
- overviewmapElement.style.width = `${targetWidth}px`
1879
- overviewmapElement.style.height = `${targetHeight}px`
1880
- this[_overviewMap].getOverviewMap().updateSize()
1881
1911
  })
1882
1912
  }
1883
1913
 
1884
1914
  /**
1885
1915
  * Activate the draw interaction for graphic annotation of regions of interest.
1886
1916
  *
1887
- * @param {object} options - Drawing options
1917
+ * @param {Object} options - Drawing options
1888
1918
  * @param {string} options.geometryType - Name of the geometry type (point, circle, box, polygon, freehandpolygon, line, freehandline)
1889
1919
  * @param {string} options.marker - Marker
1890
1920
  * @param {string} options.markup - Markup
1891
1921
  * @param {number} options.maxPoints - Geometry max points
1892
1922
  * @param {number} options.minPoints - Geometry min points
1893
- * @param {object} options.styleOptions - Style options
1894
- * @param {object} options.styleOptions.stroke - Style options for the outline of the geometry
1923
+ * @param {Object} options.styleOptions - Style options
1924
+ * @param {Object} options.styleOptions.stroke - Style options for the outline of the geometry
1895
1925
  * @param {number[]} options.styleOptions.stroke.color - RGBA color of the outline
1896
1926
  * @param {number} options.styleOptions.stroke.width - Width of the outline
1897
- * @param {object} options.styleOptions.fill - Style options for body the geometry
1927
+ * @param {Object} options.styleOptions.fill - Style options for body the geometry
1898
1928
  * @param {number[]} options.styleOptions.fill.color - RGBA color of the body
1899
- * @param {object} options.styleOptions.image - Style options for image
1929
+ * @param {Object} options.styleOptions.image - Style options for image
1900
1930
  */
1901
1931
  activateDrawInteraction (options = {}) {
1902
1932
  this.deactivateDrawInteraction()
@@ -2029,25 +2059,25 @@ class VolumeImageViewer {
2029
2059
  /**
2030
2060
  * Whether draw interaction is active
2031
2061
  *
2032
- * @return {boolean}
2062
+ * @type boolean
2033
2063
  */
2034
2064
  get isDrawInteractionActive () {
2035
2065
  return this[_interactions].draw !== undefined
2036
2066
  }
2037
2067
 
2038
2068
  /**
2039
- * Whether dragPan interaction is active.
2069
+ * Whether drag pan interaction is active.
2040
2070
  *
2041
- * @type {boolean}
2071
+ * @type boolean
2042
2072
  */
2043
2073
  get isDragPanInteractionActive () {
2044
2074
  return this[_interactions].dragPan !== undefined
2045
2075
  }
2046
2076
 
2047
2077
  /**
2048
- * Whether dragZoom interaction is active.
2078
+ * Whether drag zoom interaction is active.
2049
2079
  *
2050
- * @type {boolean}
2080
+ * @type boolean
2051
2081
  */
2052
2082
  get isDragZoomInteractionActive () {
2053
2083
  return this[_interactions].dragZoom !== undefined
@@ -2056,7 +2086,7 @@ class VolumeImageViewer {
2056
2086
  /**
2057
2087
  * Whether translate interaction is active.
2058
2088
  *
2059
- * @type {boolean}
2089
+ * @type boolean
2060
2090
  */
2061
2091
  get isTranslateInteractionActive () {
2062
2092
  return this[_interactions].translate !== undefined
@@ -2092,10 +2122,10 @@ class VolumeImageViewer {
2092
2122
  /**
2093
2123
  * Extract and transform the region of interest (ROI).
2094
2124
  *
2095
- * @param {object} feature - Openlayers Feature
2125
+ * @param {Object} feature - Openlayers Feature
2096
2126
  * @param {Object[]} pyramid - Metadata for resolution levels of image pyramid
2097
2127
  * @param {Object} context - Context
2098
- * @returns {ROI} Region of interest
2128
+ * @returns {roi.ROI} Region of interest
2099
2129
  * @private
2100
2130
  */
2101
2131
  _getROIFromFeature (feature, pyramid) {
@@ -2126,17 +2156,19 @@ class VolumeImageViewer {
2126
2156
  * @returns {void}
2127
2157
  */
2128
2158
  toggleOverviewMap () {
2129
- const controls = this[_map].getControls()
2130
- const overview = controls.getArray().find((c) => c === this[_overviewMap])
2131
- if (overview) {
2132
- this[_map].removeControl(this[_overviewMap])
2133
- return
2159
+ if (this[_overviewMap]) {
2160
+ const controls = this[_map].getControls()
2161
+ const overview = controls.getArray().find((c) => c === this[_overviewMap])
2162
+ if (overview) {
2163
+ this[_map].removeControl(this[_overviewMap])
2164
+ return
2165
+ }
2166
+ this[_map].addControl(this[_overviewMap])
2167
+ const map = this[_overviewMap].getOverviewMap()
2168
+ const view = map.getView()
2169
+ const projection = view.getProjection()
2170
+ view.fit(projection.getExtent(), { size: map.getSize() })
2134
2171
  }
2135
- this[_map].addControl(this[_overviewMap])
2136
- const map = this[_overviewMap].getOverviewMap()
2137
- const view = map.getView()
2138
- const projection = view.getProjection()
2139
- view.fit(projection.getExtent(), { size: map.getSize() })
2140
2172
  }
2141
2173
 
2142
2174
  /**
@@ -2153,9 +2185,9 @@ class VolumeImageViewer {
2153
2185
  }
2154
2186
 
2155
2187
  /**
2156
- * Activate dragZoom interaction.
2188
+ * Activate drag zoom interaction.
2157
2189
  *
2158
- * @param {object} options - DragZoom options.
2190
+ * @param {Object} options - Options.
2159
2191
  */
2160
2192
  activateDragZoomInteraction (options = {}) {
2161
2193
  this.deactivateDragZoomInteraction()
@@ -2180,7 +2212,7 @@ class VolumeImageViewer {
2180
2212
  }
2181
2213
 
2182
2214
  /**
2183
- * Deactivate dragZoom interaction.
2215
+ * Deactivate drag zoom interaction.
2184
2216
  */
2185
2217
  deactivateDragZoomInteraction () {
2186
2218
  console.info('deactivate "dragZoom" interaction')
@@ -2193,7 +2225,7 @@ class VolumeImageViewer {
2193
2225
  /**
2194
2226
  * Activate select interaction.
2195
2227
  *
2196
- * @param {object} options selection options.
2228
+ * @param {Object} options selection options.
2197
2229
  */
2198
2230
  activateSelectInteraction (options = {}) {
2199
2231
  this.deactivateSelectInteraction()
@@ -2239,9 +2271,9 @@ class VolumeImageViewer {
2239
2271
  }
2240
2272
 
2241
2273
  /**
2242
- * Activate dragpan interaction.
2274
+ * Activate drag pan interaction.
2243
2275
  *
2244
- * @param {Object} options - DragPan options.
2276
+ * @param {Object} options - Options.
2245
2277
  */
2246
2278
  activateDragPanInteraction (options = {}) {
2247
2279
  this.deactivateDragPanInteraction()
@@ -2268,7 +2300,7 @@ class VolumeImageViewer {
2268
2300
  }
2269
2301
 
2270
2302
  /**
2271
- * Deactivate dragpan interaction.
2303
+ * Deactivate drag pan interaction.
2272
2304
  */
2273
2305
  deactivateDragPanInteraction () {
2274
2306
  console.info('deactivate "drag pan" interaction')
@@ -2307,7 +2339,7 @@ class VolumeImageViewer {
2307
2339
  /**
2308
2340
  * Whether select interaction is active.
2309
2341
  *
2310
- * @return {boolean}
2342
+ * @type boolean
2311
2343
  */
2312
2344
  get isSelectInteractionActive () {
2313
2345
  return this[_interactions].select !== undefined
@@ -2316,7 +2348,7 @@ class VolumeImageViewer {
2316
2348
  /**
2317
2349
  * Activate modify interaction.
2318
2350
  *
2319
- * @param {object} options - Modification options.
2351
+ * @param {Object} options - Modification options.
2320
2352
  */
2321
2353
  activateModifyInteraction (options = {}) {
2322
2354
  this.deactivateModifyInteraction()
@@ -2369,7 +2401,7 @@ class VolumeImageViewer {
2369
2401
  /**
2370
2402
  * Whether modify interaction is active.
2371
2403
  *
2372
- * @return {boolean}
2404
+ * @type boolean
2373
2405
  */
2374
2406
  get isModifyInteractionActive () {
2375
2407
  return this[_interactions].modify !== undefined
@@ -2378,7 +2410,7 @@ class VolumeImageViewer {
2378
2410
  /**
2379
2411
  * Get all annotated regions of interest.
2380
2412
  *
2381
- * @returns {ROI[]} Array of regions of interest.
2413
+ * @returns {roi.ROI[]} Array of regions of interest.
2382
2414
  */
2383
2415
  getAllROIs () {
2384
2416
  console.info('get all ROIs')
@@ -2390,11 +2422,15 @@ class VolumeImageViewer {
2390
2422
  }
2391
2423
 
2392
2424
  collapseOverviewMap () {
2393
- this[_overviewMap].setCollapsed(true)
2425
+ if (this[_overviewMap]) {
2426
+ this[_overviewMap].setCollapsed(true)
2427
+ }
2394
2428
  }
2395
2429
 
2396
2430
  expandOverviewMap () {
2397
- this[_overviewMap].setCollapsed(true)
2431
+ if (this[_overviewMap]) {
2432
+ this[_overviewMap].setCollapsed(true)
2433
+ }
2398
2434
  }
2399
2435
 
2400
2436
  /**
@@ -2410,7 +2446,7 @@ class VolumeImageViewer {
2410
2446
  * Get an individual annotated region of interest.
2411
2447
  *
2412
2448
  * @param {string} uid - Unique identifier of the region of interest
2413
- * @returns {ROI} Region of interest.
2449
+ * @returns {roi.ROI} Region of interest.
2414
2450
  */
2415
2451
  getROI (uid) {
2416
2452
  console.info(`get ROI ${uid}`)
@@ -2422,7 +2458,7 @@ class VolumeImageViewer {
2422
2458
  * Add a measurement to a region of interest.
2423
2459
  *
2424
2460
  * @param {string} uid - Unique identifier of the region of interest
2425
- * @param {object} item - NUM content item representing a measurement
2461
+ * @param {Object} item - NUM content item representing a measurement
2426
2462
  */
2427
2463
  addROIMeasurement (uid, item) {
2428
2464
  const meaning = item.ConceptNameCodeSequence[0].CodeMeaning
@@ -2445,7 +2481,7 @@ class VolumeImageViewer {
2445
2481
  * Add a qualitative evaluation to a region of interest.
2446
2482
  *
2447
2483
  * @param {string} uid - Unique identifier of the region of interest
2448
- * @param {object} item - CODE content item representing a qualitative evaluation
2484
+ * @param {Object} item - CODE content item representing a qualitative evaluation
2449
2485
  */
2450
2486
  addROIEvaluation (uid, item) {
2451
2487
  const meaning = item.ConceptNameCodeSequence[0].CodeMeaning
@@ -2467,7 +2503,7 @@ class VolumeImageViewer {
2467
2503
  /**
2468
2504
  * Pop the most recently annotated regions of interest.
2469
2505
  *
2470
- * @returns {ROI} Regions of interest.
2506
+ * @returns {roi.ROI} Regions of interest.
2471
2507
  */
2472
2508
  popROI () {
2473
2509
  console.info('pop ROI')
@@ -2478,14 +2514,14 @@ class VolumeImageViewer {
2478
2514
  /**
2479
2515
  * Add a regions of interest.
2480
2516
  *
2481
- * @param {ROI} roi - Regions of interest
2482
- * @param {object} styleOptions - Style options
2483
- * @param {object} styleOptions.stroke - Style options for the outline of the geometry
2517
+ * @param {roi.ROI} roi - Regions of interest
2518
+ * @param {Object} styleOptions - Style options
2519
+ * @param {Object} styleOptions.stroke - Style options for the outline of the geometry
2484
2520
  * @param {number[]} styleOptions.stroke.color - RGBA color of the outline
2485
2521
  * @param {number} styleOptions.stroke.width - Width of the outline
2486
- * @param {object} styleOptions.fill - Style options for body the geometry
2522
+ * @param {Object} styleOptions.fill - Style options for body the geometry
2487
2523
  * @param {number[]} styleOptions.fill.color - RGBA color of the body
2488
- * @param {object} styleOptions.image - Style options for image
2524
+ * @param {Object} styleOptions.image - Style options for image
2489
2525
  *
2490
2526
  */
2491
2527
  addROI (roi, styleOptions = {}) {
@@ -2522,13 +2558,13 @@ class VolumeImageViewer {
2522
2558
  /**
2523
2559
  * Update properties of a region of interest.
2524
2560
  *
2525
- * @param {object} roi - ROI to be updated
2561
+ * @param {Object} roi - ROI to be updated
2526
2562
  * @param {string} roi.uid - Unique identifier of the region of interest
2527
- * @param {object} roi.properties - ROI properties
2528
- * @param {object} roi.properties.measurements - ROI measurements
2529
- * @param {object} roi.properties.evaluations - ROI evaluations
2530
- * @param {object} roi.properties.label - ROI label
2531
- * @param {object} roi.properties.marker - ROI marker
2563
+ * @param {Object} roi.properties - ROI properties
2564
+ * @param {Object} roi.properties.measurements - ROI measurements
2565
+ * @param {Object} roi.properties.evaluations - ROI evaluations
2566
+ * @param {Object} roi.properties.label - ROI label
2567
+ * @param {Object} roi.properties.marker - ROI marker
2532
2568
  */
2533
2569
  updateROI ({ uid, properties = {} }) {
2534
2570
  if (!uid) return
@@ -2546,7 +2582,7 @@ class VolumeImageViewer {
2546
2582
  *
2547
2583
  * @param {string} uid - Unique identifier of the regions of interest
2548
2584
  *
2549
- * @returns {object} - Style settings
2585
+ * @returns {Object} - Style settings
2550
2586
  */
2551
2587
  getROIStyle (uid) {
2552
2588
  const feature = this[_features].getArray().find((feature) => {
@@ -2573,11 +2609,11 @@ class VolumeImageViewer {
2573
2609
  * Set the style of a region of interest.
2574
2610
  *
2575
2611
  * @param {string} uid - Unique identifier of the regions of interest
2576
- * @param {object} styleOptions - Style options
2577
- * @param {object} styleOptions.stroke - Style options for the outline of the geometry
2612
+ * @param {Object} styleOptions - Style options
2613
+ * @param {Object} styleOptions.stroke - Style options for the outline of the geometry
2578
2614
  * @param {number[]} styleOptions.stroke.color - RGBA color of the outline
2579
2615
  * @param {number} styleOptions.stroke.width - Width of the outline
2580
- * @param {object} styleOptions.fill - Style options for body the geometry
2616
+ * @param {Object} styleOptions.fill - Style options for body the geometry
2581
2617
  * @param {number[]} styleOptions.fill.color - RGBA color of the body
2582
2618
  *
2583
2619
  */
@@ -2595,8 +2631,8 @@ class VolumeImageViewer {
2595
2631
  /**
2596
2632
  * Add a new viewport overlay.
2597
2633
  *
2598
- * @param {object} options Overlay options
2599
- * @param {object} options.element The custom overlay HTML element
2634
+ * @param {Object} options Overlay options
2635
+ * @param {Object} options.element The custom overlay HTML element
2600
2636
  * @param {string} options.className Class to style the overlay container
2601
2637
  * @param {number[]} options.offset Horizontal and vertical offset of the overlay container in pixels
2602
2638
  */
@@ -2669,7 +2705,8 @@ class VolumeImageViewer {
2669
2705
  /**
2670
2706
  * Add annotation groups.
2671
2707
  *
2672
- * @param {MicroscopyBulkSimpleAnnotations} metadata - Metadata of a DICOM Microscopy Simple Bulk Annotations instance
2708
+ * @param {metadata.MicroscopyBulkSimpleAnnotations} metadata - Metadata of a
2709
+ * DICOM Microscopy Simple Bulk Annotations instance
2673
2710
  */
2674
2711
  addAnnotationGroups (metadata) {
2675
2712
  const refImage = this[_pyramid].metadata[0]
@@ -2827,7 +2864,7 @@ class VolumeImageViewer {
2827
2864
  const container = this[_map].getTargetElement()
2828
2865
  publish(container, EVENT.LOADING_ENDED)
2829
2866
  })
2830
- source.on('featureserror', (event) => {
2867
+ source.on('featuresloaderror', (event) => {
2831
2868
  const container = this[_map].getTargetElement()
2832
2869
  publish(container, EVENT.LOADING_ENDED)
2833
2870
  })
@@ -2897,7 +2934,7 @@ class VolumeImageViewer {
2897
2934
  * Show an annotation group.
2898
2935
  *
2899
2936
  * @param {string} annotationGroupUID - Unique identifier of an annotation group
2900
- * @param {object} styleOptions
2937
+ * @param {Object} styleOptions
2901
2938
  * @param {number} styleOptions.measurement - Selected measurement for colorizing annotations
2902
2939
  */
2903
2940
  showAnnotationGroup (annotationGroupUID, styleOptions = {}) {
@@ -3056,7 +3093,7 @@ class VolumeImageViewer {
3056
3093
  * Set style of an annotation group.
3057
3094
  *
3058
3095
  * @param {string} annotationGroupUID - Unique identifier of an annotation group
3059
- * @param {object} styleOptions - Style options
3096
+ * @param {Object} styleOptions - Style options
3060
3097
  * @param {number} styleOptions.opacity - Opacity
3061
3098
  * @param {number} styleOptions.measurement - Selected measurement for colorizing annotations
3062
3099
  */
@@ -3151,7 +3188,7 @@ class VolumeImageViewer {
3151
3188
  *
3152
3189
  * @param {string} annotationGroupUID - Unique identifier of an annotation group
3153
3190
  *
3154
- * @returns {object} - Style settings
3191
+ * @returns {Object} - Style settings
3155
3192
  */
3156
3193
  getAnnotationGroupStyle (annotationGroupUID) {
3157
3194
  if (!(annotationGroupUID in this[_annotationGroups])) {
@@ -3170,7 +3207,7 @@ class VolumeImageViewer {
3170
3207
  /**
3171
3208
  * Get all annotation groups.
3172
3209
  *
3173
- * @returns {AnnotationGroup[]} - Annotation groups
3210
+ * @returns {annotation.AnnotationGroup[]}
3174
3211
  */
3175
3212
  getAllAnnotationGroups () {
3176
3213
  const groups = []
@@ -3185,7 +3222,8 @@ class VolumeImageViewer {
3185
3222
  *
3186
3223
  * @param {string} annotationGroupUID - Unique identifier of an annotation group
3187
3224
  *
3188
- * @returns {MicroscopyBulkSimpleAnnotations[]} - Metadata of DICOM Microscopy Bulk Simple Annotations instances
3225
+ * @returns {metadata.MicroscopyBulkSimpleAnnotations} - Metadata of DICOM
3226
+ * Microscopy Bulk Simple Annotations instance
3189
3227
  */
3190
3228
  getAnnotationGroupMetadata (annotationGroupUID) {
3191
3229
  if (!(annotationGroupUID in this[_annotationGroups])) {
@@ -3201,7 +3239,7 @@ class VolumeImageViewer {
3201
3239
  /**
3202
3240
  * Add segments.
3203
3241
  *
3204
- * @param {Segmentation[]} metadata - Metadata of one or more DICOM Segmentation instances
3242
+ * @param {metadata.Segmentation[]} metadata - Metadata of one or more DICOM Segmentation instances
3205
3243
  */
3206
3244
  addSegments (metadata) {
3207
3245
  if (metadata.length === 0) {
@@ -3348,7 +3386,7 @@ class VolumeImageViewer {
3348
3386
  extent: this[_pyramid].extent,
3349
3387
  visible: false,
3350
3388
  opacity: 0.9,
3351
- preload: 0,
3389
+ preload: this[_options].preload ? 1 : 0,
3352
3390
  transition: 0,
3353
3391
  style: _getColorPaletteStyleForTileLayer({
3354
3392
  windowCenter,
@@ -3399,7 +3437,7 @@ class VolumeImageViewer {
3399
3437
  * Show a segment.
3400
3438
  *
3401
3439
  * @param {string} segmentUID - Unique tracking identifier of a segment
3402
- * @param {object} styleOptions
3440
+ * @param {Object} styleOptions
3403
3441
  * @param {number} styleOptions.opacity - Opacity
3404
3442
  */
3405
3443
  showSegment (segmentUID, styleOptions = {}) {
@@ -3452,7 +3490,7 @@ class VolumeImageViewer {
3452
3490
  * Set the style of a segment.
3453
3491
  *
3454
3492
  * @param {string} segmentUID - Unique tracking identifier of segment
3455
- * @param {object} styleOptions - Style options
3493
+ * @param {Object} styleOptions - Style options
3456
3494
  * @param {number} styleOptions.opacity - Opacity
3457
3495
  */
3458
3496
  setSegmentStyle (segmentUID, styleOptions = {}) {
@@ -3516,7 +3554,8 @@ class VolumeImageViewer {
3516
3554
  * Get the style of a segment.
3517
3555
  *
3518
3556
  * @param {string} segmentUID - Unique tracking identifier of segment
3519
- * @returns {object} Style settings
3557
+ *
3558
+ * @returns {Object} Style settings
3520
3559
  */
3521
3560
  getSegmentStyle (segmentUID) {
3522
3561
  if (!(segmentUID in this[_segments])) {
@@ -3537,7 +3576,8 @@ class VolumeImageViewer {
3537
3576
  * Get image metadata for a segment.
3538
3577
  *
3539
3578
  * @param {string} segmentUID - Unique tracking identifier of segment
3540
- * @returns {Segmentation[]} Segmentation image metadata
3579
+ *
3580
+ * @returns {metadata.Segmentation[]} Metadata of DICOM Segmentation instances
3541
3581
  */
3542
3582
  getSegmentMetadata (segmentUID) {
3543
3583
  if (!(segmentUID in this[_segments])) {
@@ -3553,7 +3593,7 @@ class VolumeImageViewer {
3553
3593
  /**
3554
3594
  * Get all segments.
3555
3595
  *
3556
- * @return {Segment[]}
3596
+ * @return {segment.Segment[]}
3557
3597
  */
3558
3598
  getAllSegments () {
3559
3599
  const segments = []
@@ -3777,7 +3817,7 @@ class VolumeImageViewer {
3777
3817
  projection: this[_projection],
3778
3818
  visible: false,
3779
3819
  opacity: 1,
3780
- preload: 1,
3820
+ preload: this[_options].preload ? 1 : 0,
3781
3821
  transition: 0,
3782
3822
  style: _getColorPaletteStyleForTileLayer({
3783
3823
  windowCenter,
@@ -3827,7 +3867,7 @@ class VolumeImageViewer {
3827
3867
  * Show a parameter mapping.
3828
3868
  *
3829
3869
  * @param {string} mappingUID - Unique tracking identifier of a mapping
3830
- * @param {object} styleOptions
3870
+ * @param {Object} styleOptions
3831
3871
  * @param {number} styleOptions.opacity - Opacity
3832
3872
  * @param {number} styleOptions.limitValues - Opacity
3833
3873
  */
@@ -3881,7 +3921,7 @@ class VolumeImageViewer {
3881
3921
  * Set the style of a parameter mapping.
3882
3922
  *
3883
3923
  * @param {string} mappingUID - Unique tracking identifier of mapping
3884
- * @param {object} styleOptions
3924
+ * @param {Object} styleOptions
3885
3925
  * @param {number} styleOptions.opacity - Opacity
3886
3926
  */
3887
3927
  setParameterMappingStyle (mappingUID, styleOptions = {}) {
@@ -3961,7 +4001,7 @@ class VolumeImageViewer {
3961
4001
  * Get the style of a parameter mapping.
3962
4002
  *
3963
4003
  * @param {string} mappingUID - Unique tracking identifier of mapping
3964
- * @returns {object} Style Options
4004
+ * @returns {Object} Style Options
3965
4005
  */
3966
4006
  getParameterMappingStyle (mappingUID) {
3967
4007
  if (!(mappingUID in this[_mappings])) {
@@ -3983,7 +4023,9 @@ class VolumeImageViewer {
3983
4023
  * Get image metadata for a parameter mapping.
3984
4024
  *
3985
4025
  * @param {string} mappingUID - Unique tracking identifier of mapping
3986
- * @returns {ParametricMap[]} Parametric Map image metadata
4026
+ *
4027
+ * @returns {metadata.ParametricMap[]} Metadata of DICOM Parametric Map
4028
+ * instances
3987
4029
  */
3988
4030
  getParameterMappingMetadata (mappingUID) {
3989
4031
  if (!(mappingUID in this[_mappings])) {
@@ -3999,7 +4041,7 @@ class VolumeImageViewer {
3999
4041
  /**
4000
4042
  * Get all parameter mappings.
4001
4043
  *
4002
- * @return {ParameterMapping[]}
4044
+ * @return {mapping.ParameterMapping[]}
4003
4045
  */
4004
4046
  getAllParameterMappings () {
4005
4047
  const mappings = []
@@ -4015,18 +4057,22 @@ class VolumeImageViewer {
4015
4057
  * with Image Type other than VOLUME.
4016
4058
  *
4017
4059
  * @class
4060
+ * @abstract
4018
4061
  * @private
4019
4062
  */
4020
4063
  class _NonVolumeImageViewer {
4021
4064
  /**
4022
- * Creates a viewer instance for displaying non-VOLUME images.
4023
- *
4024
- * @param {object} options
4025
- * @param {object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP.
4026
- * @param {object} options.metadata - DICOM JSON metadata object for a VL Whole Slide Microscopy Image instance.
4027
- * @param {string} options.orientation - Orientation of the slide (vertical: label on top, or horizontal: label on right side).
4028
- * @param {number} [options.resizeFactor=1] - To which extent image should be reduced in size (fraction).
4029
- * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile should be included for correction of image colors.
4065
+ * @param {Object} options
4066
+ * @param {Object} options.client - A DICOMwebClient instance for interacting
4067
+ * with an origin server over HTTP.
4068
+ * @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
4069
+ * Metadata of DICOM VL Whole Slide Microscopy Image instances
4070
+ * @param {string} options.orientation - Orientation of the slide (vertical:
4071
+ * label on top, or horizontal: label on right side).
4072
+ * @param {number} [options.resizeFactor=1] - To which extent image should be
4073
+ * reduced in size (fraction).
4074
+ * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
4075
+ * should be included for correction of image colors.
4030
4076
  */
4031
4077
  constructor (options) {
4032
4078
  // We also accept metadata in raw JSON format for backwards compatibility
@@ -4140,7 +4186,7 @@ class _NonVolumeImageViewer {
4140
4186
  /**
4141
4187
  * Render the image in the specified viewport container.
4142
4188
  *
4143
- * @param {object} options - Rendering options.
4189
+ * @param {Object} options - Rendering options.
4144
4190
  * @param {(string|HTMLElement)} options.container - HTML Element in which the viewer should be injected.
4145
4191
  */
4146
4192
  render (options) {
@@ -4198,15 +4244,18 @@ class _NonVolumeImageViewer {
4198
4244
  * @memberof viewer
4199
4245
  */
4200
4246
  class OverviewImageViewer extends _NonVolumeImageViewer {
4201
- /**
4202
- * Creates a viewer instance for displaying OVERVIEW images.
4203
- *
4204
- * @param {object} options
4205
- * @param {object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP.
4206
- * @param {object} options.metadata - DICOM JSON metadata object for a VL Whole Slide Microscopy Image instance.
4207
- * @param {string} [options.orientation='horizontal'] - Orientation of the slide (vertical: label on top, or horizontal: label on right side).
4208
- * @param {number} [options.resizeFactor=1] - To which extent image should be reduced in size (fraction).
4209
- * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile should be included for correction of image colors.
4247
+ /**
4248
+ * @param {Object} options
4249
+ * @param {Object} options.client - A DICOMwebClient instance for interacting
4250
+ * with an origin server over HTTP.
4251
+ * @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
4252
+ * Metadata of DICOM VL Whole Slide Microscopy Image instances
4253
+ * @param {string} [options.orientation='horizontal'] - Orientation of the
4254
+ * slide (vertical: label on top, or horizontal: label on right side).
4255
+ * @param {number} [options.resizeFactor=1] - To which extent image should be
4256
+ * reduced in size (fraction).
4257
+ * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
4258
+ * should be included for correction of image colors.
4210
4259
  */
4211
4260
  constructor (options) {
4212
4261
  if (options.orientation === undefined) {
@@ -4224,15 +4273,17 @@ class OverviewImageViewer extends _NonVolumeImageViewer {
4224
4273
  * @memberof viewer
4225
4274
  */
4226
4275
  class LabelImageViewer extends _NonVolumeImageViewer {
4227
- /**
4228
- * Creates a viewer instance for displaying LABEL images.
4229
- *
4230
- * @param {object} options
4231
- * @param {object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP
4232
- * @param {object} options.metadata - DICOM JSON metadata object for a VL Whole Slide Microscopy Image instance
4233
- * @param {string} [options.orientation='vertical'] - Orientation of the slide (vertical: label on top, or horizontal: label on right side)
4234
- * @param {number} [options.resizeFactor=1] - To which extent image should be reduced in size (fraction)
4235
- * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile should be included for correction of image colors
4276
+ /**
4277
+ * @param {Object} options - Options
4278
+ * @param {Object} options.client - A DICOMwebClient instance for interacting with an origin server over HTTP
4279
+ * @param {metadata.VLWholeSlideMicroscopyImage[]} options.metadata -
4280
+ * Metadata of DICOM VL Whole Slide Microscopy Image instances
4281
+ * @param {string} [options.orientation='vertical'] - Orientation of the
4282
+ * slide (vertical: label on top, or horizontal: label on right side)
4283
+ * @param {number} [options.resizeFactor=1] - To which extent image should be
4284
+ * reduced in size (fraction)
4285
+ * @param {boolean} [options.includeIccProfile=false] - Whether ICC Profile
4286
+ * should be included for correction of image colors
4236
4287
  */
4237
4288
  constructor (options) {
4238
4289
  if (options.orientation === undefined) {