dicom-microscopy-viewer 0.36.3 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +44 -42
  2. package/dist/dicom-microscopy-viewer.js +1 -1
  3. package/dist/dicom-microscopy-viewer.js.map +1 -1
  4. package/docs/annotation.AnnotationGroup.html +142 -43
  5. package/docs/annotation.html +2 -2
  6. package/docs/annotation.js.html +47 -34
  7. package/docs/annotations__AnnotationManager.js.html +2 -2
  8. package/docs/annotations_markups__MarkupManager.js.html +2 -2
  9. package/docs/api.html +2 -2
  10. package/docs/color.PaletteColorLookupTable.html +42 -14
  11. package/docs/color.html +6 -6
  12. package/docs/color.js.html +14 -14
  13. package/docs/dicom-microscopy-viewer.js.html +2 -2
  14. package/docs/events.html +316 -2
  15. package/docs/events.js.html +13 -4
  16. package/docs/index.html +44 -44
  17. package/docs/mapping.ParameterMapping.html +342 -27
  18. package/docs/mapping.Transformation.html +221 -14
  19. package/docs/mapping.html +2 -2
  20. package/docs/mapping.js.html +41 -32
  21. package/docs/metadata.Comprehensive3DSR.html +254 -5
  22. package/docs/metadata.MicroscopyBulkSimpleAnnotations.html +254 -5
  23. package/docs/metadata.ParametricMap.html +254 -5
  24. package/docs/metadata.SOPClass.html +399 -0
  25. package/docs/metadata.Segmentation.html +254 -5
  26. package/docs/metadata.VLWholeSlideMicroscopyImage.html +255 -7
  27. package/docs/metadata.html +14 -32
  28. package/docs/metadata.js.html +55 -21
  29. package/docs/opticalPath.OpticalPath.html +453 -26
  30. package/docs/opticalPath.html +2 -2
  31. package/docs/opticalPath.js.html +17 -18
  32. package/docs/pyramid.js.html +2 -2
  33. package/docs/roi.ROI.html +317 -25
  34. package/docs/roi.html +2 -2
  35. package/docs/roi.js.html +26 -19
  36. package/docs/scoord3d.Ellipse.html +14 -18
  37. package/docs/scoord3d.Ellipsoid.html +14 -18
  38. package/docs/scoord3d.Multipoint.html +14 -18
  39. package/docs/scoord3d.Point.html +13 -17
  40. package/docs/scoord3d.Polygon.html +14 -18
  41. package/docs/scoord3d.Polyline.html +14 -18
  42. package/docs/scoord3d.Scoord3D.html +608 -0
  43. package/docs/scoord3d.html +5 -2
  44. package/docs/scoord3d.js.html +101 -54
  45. package/docs/segment.Segment.html +160 -48
  46. package/docs/segment.html +2 -2
  47. package/docs/segment.js.html +37 -33
  48. package/docs/utils.html +148 -4
  49. package/docs/utils.js.html +6 -6
  50. package/docs/viewer.LabelImageViewer.html +14 -15
  51. package/docs/viewer.OverviewImageViewer.html +15 -15
  52. package/docs/viewer.VolumeImageViewer.html +722 -396
  53. package/docs/viewer.html +2 -2
  54. package/docs/viewer.js.html +416 -407
  55. package/package.json +1 -1
  56. package/src/annotation.js +45 -32
  57. package/src/color.js +12 -12
  58. package/src/events.js +11 -2
  59. package/src/mapping.js +39 -30
  60. package/src/metadata.js +53 -19
  61. package/src/opticalPath.js +15 -16
  62. package/src/roi.js +24 -17
  63. package/src/scoord3d.js +99 -52
  64. package/src/segment.js +35 -31
  65. package/src/utils.js +4 -4
  66. package/src/viewer.js +414 -405
package/docs/events.html CHANGED
@@ -101,6 +101,320 @@
101
101
 
102
102
 
103
103
 
104
+ <h3 class="subsection-title">Members</h3>
105
+
106
+
107
+
108
+ <h4 class="name" id=".EVENTS"><span class="type-signature">(static, constant) </span>EVENTS<span class="type-signature"> :string</span></h4>
109
+
110
+
111
+
112
+
113
+ <div class="description">
114
+ Enumerates custom events for dicom-microscopy-viewer. Events are captured,
115
+ normalized, and re-triggered with a `dicommicroscopyviewer` prefix.
116
+ This allows handling of events consistently across different browsers.
117
+ </div>
118
+
119
+
120
+
121
+ <h5>Type:</h5>
122
+ <ul>
123
+ <li>
124
+
125
+ <span class="param-type">string</span>
126
+
127
+
128
+ </li>
129
+ </ul>
130
+
131
+
132
+
133
+
134
+
135
+ <h5 class="subsection-title">Properties:</h5>
136
+
137
+
138
+
139
+ <table class="props">
140
+ <thead>
141
+ <tr>
142
+
143
+ <th>Name</th>
144
+
145
+
146
+ <th>Type</th>
147
+
148
+
149
+
150
+
151
+
152
+ <th class="last">Description</th>
153
+ </tr>
154
+ </thead>
155
+
156
+ <tbody>
157
+
158
+
159
+ <tr>
160
+
161
+ <td class="name"><code>ROI_ADDED</code></td>
162
+
163
+
164
+ <td class="type">
165
+
166
+
167
+ <span class="param-type">string</span>
168
+
169
+
170
+
171
+ </td>
172
+
173
+
174
+
175
+
176
+
177
+ <td class="description last">Triggered when a ROI was added.</td>
178
+ </tr>
179
+
180
+
181
+
182
+ <tr>
183
+
184
+ <td class="name"><code>ROI_REMOVED</code></td>
185
+
186
+
187
+ <td class="type">
188
+
189
+
190
+ <span class="param-type">string</span>
191
+
192
+
193
+
194
+ </td>
195
+
196
+
197
+
198
+
199
+
200
+ <td class="description last">Triggered when a ROI was removed.</td>
201
+ </tr>
202
+
203
+
204
+
205
+ <tr>
206
+
207
+ <td class="name"><code>ROI_DRAWN</code></td>
208
+
209
+
210
+ <td class="type">
211
+
212
+
213
+ <span class="param-type">string</span>
214
+
215
+
216
+
217
+ </td>
218
+
219
+
220
+
221
+
222
+
223
+ <td class="description last">Triggered when a ROI was drawn.</td>
224
+ </tr>
225
+
226
+
227
+
228
+ <tr>
229
+
230
+ <td class="name"><code>ROI_SELECTED</code></td>
231
+
232
+
233
+ <td class="type">
234
+
235
+
236
+ <span class="param-type">string</span>
237
+
238
+
239
+
240
+ </td>
241
+
242
+
243
+
244
+
245
+
246
+ <td class="description last">Triggered when a ROI was selected.</td>
247
+ </tr>
248
+
249
+
250
+
251
+ <tr>
252
+
253
+ <td class="name"><code>ROI_MODIFIED</code></td>
254
+
255
+
256
+ <td class="type">
257
+
258
+
259
+ <span class="param-type">string</span>
260
+
261
+
262
+
263
+ </td>
264
+
265
+
266
+
267
+
268
+
269
+ <td class="description last">Triggered when a ROI was modified.</td>
270
+ </tr>
271
+
272
+
273
+
274
+ <tr>
275
+
276
+ <td class="name"><code>MOVE_STARTED</code></td>
277
+
278
+
279
+ <td class="type">
280
+
281
+
282
+ <span class="param-type">string</span>
283
+
284
+
285
+
286
+ </td>
287
+
288
+
289
+
290
+
291
+
292
+ <td class="description last">Triggered when a viewport move has started.</td>
293
+ </tr>
294
+
295
+
296
+
297
+ <tr>
298
+
299
+ <td class="name"><code>MOVE_ENDED</code></td>
300
+
301
+
302
+ <td class="type">
303
+
304
+
305
+ <span class="param-type">string</span>
306
+
307
+
308
+
309
+ </td>
310
+
311
+
312
+
313
+
314
+
315
+ <td class="description last">Triggered when a viewport move has ended.</td>
316
+ </tr>
317
+
318
+
319
+
320
+ <tr>
321
+
322
+ <td class="name"><code>LOADING_STARTED</code></td>
323
+
324
+
325
+ <td class="type">
326
+
327
+
328
+ <span class="param-type">string</span>
329
+
330
+
331
+
332
+ </td>
333
+
334
+
335
+
336
+
337
+
338
+ <td class="description last">Triggered when a loading of data has started.</td>
339
+ </tr>
340
+
341
+
342
+
343
+ <tr>
344
+
345
+ <td class="name"><code>LOADING_ENDED</code></td>
346
+
347
+
348
+ <td class="type">
349
+
350
+
351
+ <span class="param-type">string</span>
352
+
353
+
354
+
355
+ </td>
356
+
357
+
358
+
359
+
360
+
361
+ <td class="description last">Triggered when a loading of data has ended.</td>
362
+ </tr>
363
+
364
+
365
+ </tbody>
366
+ </table>
367
+
368
+
369
+
370
+
371
+ <dl class="details">
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ <dt class="tag-source">Source:</dt>
399
+ <dd class="tag-source"><ul class="dummy"><li>
400
+ <a href="events.js.html">events.js</a>, <a href="events.js.html#line12">line 12</a>
401
+ </li></ul></dd>
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+ </dl>
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
104
418
 
105
419
 
106
420
 
@@ -117,13 +431,13 @@
117
431
  </div>
118
432
 
119
433
  <nav>
120
- <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
434
+ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.SOPClass.html">SOPClass</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="scoord3d.Scoord3D.html">Scoord3D</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
121
435
  </nav>
122
436
 
123
437
  <br class="clear">
124
438
 
125
439
  <footer>
126
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Mar 11 2022 17:11:29 GMT-0500 (Eastern Standard Time)
440
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon May 16 2022 08:28:05 GMT-0400 (Eastern Daylight Time)
127
441
  </footer>
128
442
 
129
443
  <script> prettyPrint(); </script>
@@ -33,19 +33,28 @@
33
33
  * normalized, and re-triggered with a `dicommicroscopyviewer` prefix.
34
34
  * This allows handling of events consistently across different browsers.
35
35
  *
36
- * @enum {String}
37
- * @memberof dicom-microscopy-viewer
36
+ * @enum {string}
37
+ * @memberof events
38
38
  * @readonly
39
39
  */
40
40
  const EVENTS = {
41
+ /** Triggered when a ROI was added. */
41
42
  ROI_ADDED: `${PROJECT_NAME}_roi_added`,
43
+ /** Triggered when a ROI was removed. */
42
44
  ROI_REMOVED: `${PROJECT_NAME}_roi_removed`,
45
+ /** Triggered when a ROI was drawn. */
43
46
  ROI_DRAWN: `${PROJECT_NAME}_roi_drawn`,
47
+ /** Triggered when a ROI was selected. */
44
48
  ROI_SELECTED: `${PROJECT_NAME}_roi_selected`,
49
+ /** Triggered when a ROI was modified. */
45
50
  ROI_MODIFIED: `${PROJECT_NAME}_roi_modified`,
51
+ /** Triggered when a viewport move has started. */
46
52
  MOVE_STARTED: `${PROJECT_NAME}_move_started`,
53
+ /** Triggered when a viewport move has ended. */
47
54
  MOVE_ENDED: `${PROJECT_NAME}_move_ended`,
55
+ /** Triggered when a loading of data has started. */
48
56
  LOADING_STARTED: `${PROJECT_NAME}_loading_started`,
57
+ /** Triggered when a loading of data has ended. */
49
58
  LOADING_ENDED: `${PROJECT_NAME}_loading_ended`
50
59
  }
51
60
 
@@ -60,13 +69,13 @@ export default EVENTS
60
69
  </div>
61
70
 
62
71
  <nav>
63
- <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
72
+ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.SOPClass.html">SOPClass</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="scoord3d.Scoord3D.html">Scoord3D</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
64
73
  </nav>
65
74
 
66
75
  <br class="clear">
67
76
 
68
77
  <footer>
69
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Mar 11 2022 17:11:29 GMT-0500 (Eastern Standard Time)
78
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon May 16 2022 08:28:05 GMT-0400 (Eastern Daylight Time)
70
79
  </footer>
71
80
 
72
81
  <script> prettyPrint(); </script>
package/docs/index.html CHANGED
@@ -62,57 +62,53 @@ It leverages the <a href="https://github.com/dcmjs-org/dicomweb-client">dicomweb
62
62
  <h2>Documentation</h2>
63
63
  <p>Documentation of the JavaScript Application Programming Interface (API) is available online at <a href="https://herrmannlab.github.io/dicom-microscopy-viewer/">herrmannlab.github.io/dicom-microscopy-viewer</a>.</p>
64
64
  <h2>Getting started</h2>
65
- <p>Note that the <em>dicom-microscopy-viewer</em> package is <strong>not</strong> a viewer application, it is a library to build viewer applications.
66
- Below is an example for the most basic usage: a web page that displays a collection of DICOM VL Whole Slide Microscopy Image instances of a digital slide.
65
+ <p>Note that the <em>dicom-microscopy-viewer</em> package is <strong>not</strong> a viewer application, it is a library to build viewer applications.</p>
66
+ <p>Below is an example for the most basic usage: a web page that displays a collection of DICOM VL Whole Slide Microscopy Image instances of a digital slide.
67
67
  For more advanced usage, take a look at the <a href="https://github.com/herrmannlab/slim">Slim</a> viewer.</p>
68
68
  <h3>Basic usage</h3>
69
- <pre class="prettyprint source lang-html"><code>&lt;script type=&quot;text/javascript&quot; src=&quot;https://unpkg.com/dicom-microscopy-viewer&quot;>&lt;/script>
70
- </code></pre>
71
69
  <p>The viewer can be embedded in any website, one only needs to</p>
72
70
  <ul>
73
71
  <li>
74
- <p>Create an instance of the <code>viewer.VolumeViewer</code>. The constructor requires an instance of <code>DICOMwebClient</code> for retrieving frames from the archive as well as the metadata for each DICOM image instance formatted according to the <a href="http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_F.2.html">
75
- DICOM JSON Model</a>.</p>
72
+ <p>Create an instance of <a href="https://herrmannlab.github.io/dicom-microscopy-viewer/viewer.VolumeImageViewer.html">VolumeImageViewer</a>. The constructor requires an instance of <code>DICOMwebClient</code> for retrieving frames from the archive as well as the metadata for each DICOM image as an instance of <a href="https://herrmannlab.github.io/dicom-microscopy-viewer/metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a>.</p>
76
73
  </li>
77
74
  <li>
78
75
  <p>Call the <code>render()</code> method, passing it the HTML element (or the name of the element), which shall contain the viewport.</p>
79
76
  </li>
80
77
  </ul>
81
- <pre class="prettyprint source lang-js"><code>const url = 'http://localhost:8080/dicomweb';
82
- const client = new DICOMwebClient.api.DICOMwebClient({url});
83
- const studyInstanceUID = '1.2.3.4';
84
- const seriesInstanceUID = '1.2.3.5';
85
- const searchInstanceOptions = {
86
- studyInstanceUID,
87
- seriesInstanceUID
78
+ <pre class="prettyprint source lang-js"><code>import * as DICOMMicroscopyViewer from 'dicom-microscopy-viewer';
79
+ import * as DICOMwebClient from 'dicomweb-client';
80
+
81
+ // Construct client instance
82
+ const client = new DICOMwebClient.api.DICOMwebClient({
83
+ url: 'http://localhost:8080/dicomweb'
84
+ });
85
+
86
+ // Retrieve metadata of a series of DICOM VL Whole Slide Microscopy Image instances
87
+ const retrieveOptions = {
88
+ studyInstanceUID: '1.2.3.4',
89
+ seriesInstanceUID: '1.2.3.5'
88
90
  };
89
- client.searchForInstances(searchInstanceOptions).then((instances) => {
90
- const promises = []
91
- for (let i = 0; i &lt; instances.length; i++) {
92
- const sopInstanceUID = instances[i][&quot;00080018&quot;][&quot;Value&quot;][0];
93
- const retrieveInstanceOptions = {
94
- studyInstanceUID,
95
- seriesInstanceUID,
96
- sopInstanceUID,
97
- };
98
- const promise = client.retrieveInstanceMetadata(retrieveInstanceOptions).then(metadata => {
99
- const image = new DICOMMicroscopyViewer.metadata.VLWholeSlideMicroscopyViewer({
100
- metadata
101
- })
102
- if (image.imageType[2] === &quot;VOLUME&quot;) {
103
- return(image);
104
- }
105
- });
106
- promises.push(promise);
107
- }
108
- return(Promise.all(promises));
109
- }).then(metadata => {
110
- metadata = metadata.filter(m => m);
91
+ client.retrieveSeriesMetadata(retrieveOptions).then((metadata) => {
92
+ // Parse, format, and filter metadata
93
+ const volumeImages = []
94
+ metadata.forEach(m => {
95
+ const image = new DICOMMicroscopyViewer.metadata.VLWholeSlideMicroscopyImage({
96
+ metadata: m
97
+ })
98
+ const imageFlavor = image.ImageType[2]
99
+ if (imageFlavor === 'VOLUME' || imageFlavor === 'THUMBNAIL') {
100
+ volumeImages.push(image)
101
+ }
102
+ })
103
+
104
+ // Construct viewer instance
111
105
  const viewer = new DICOMMicroscopyViewer.viewer.VolumeViewer({
112
106
  client,
113
- metadata
107
+ metadata: volumeImages
114
108
  });
115
- viewer.render({container: 'viewport'});
109
+
110
+ // Render viewer instance in the &quot;viewport&quot; HTML element
111
+ viewer.render({ container: 'viewport' });
116
112
  });
117
113
  </code></pre>
118
114
  <h2>Citation</h2>
@@ -137,16 +133,20 @@ client.searchForInstances(searchInstanceOptions).then((instances) => {
137
133
  <p>Install the <a href="https://www.npmjs.com/package/dicom-microscopy-viewer">dicom-microscopy-viewer</a> package using the <code>npm</code> package manager:</p>
138
134
  <pre class="prettyprint source lang-None"><code>npm install dicom-microscopy-viewer
139
135
  </code></pre>
140
- <h2>Building &amp; Testing</h2>
141
- <p>We use <a href="https://webpack.js.org/">webpack</a> for bundling and <a href="https://github.com/facebook/jest">Jest</a> for testing.</p>
142
- <p>Build:</p>
136
+ <h2>Development &amp; Testing</h2>
137
+ <p>We use <a href="https://babeljs.io/">Babel</a> to compile (transpile), <a href="https://webpack.js.org/">webpack</a> to bundle, and <a href="https://github.com/facebook/jest">Jest</a> to test JavaScript code.</p>
138
+ <p>Get the source code by cloning the git repository:</p>
139
+ <pre class="prettyprint source lang-None"><code>git clone https://github.com/herrmannlab/dicom-microscopy-viewer
140
+ cd dicom-microscopy-viewer
141
+ </code></pre>
142
+ <p>Install dependencies and build the package:</p>
143
143
  <pre class="prettyprint source lang-None"><code>npm install
144
144
  npm run build
145
145
  </code></pre>
146
- <p>Test:</p>
146
+ <p>Run tests:</p>
147
147
  <pre class="prettyprint source lang-None"><code>npm run test
148
148
  </code></pre>
149
- <p>Build the documentation:</p>
149
+ <p>Build the API documentation:</p>
150
150
  <pre class="prettyprint source lang-None"><code>npm run generateDocs
151
151
  </code></pre>
152
152
  <h2>Support</h2>
@@ -170,13 +170,13 @@ npm run build
170
170
  </div>
171
171
 
172
172
  <nav>
173
- <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
173
+ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="annotation.html">annotation</a></li><li><a href="api.html">api</a></li><li><a href="color.html">color</a></li><li><a href="events.html">events</a></li><li><a href="mapping.html">mapping</a></li><li><a href="metadata.html">metadata</a></li><li><a href="opticalPath.html">opticalPath</a></li><li><a href="roi.html">roi</a></li><li><a href="scoord3d.html">scoord3d</a></li><li><a href="segment.html">segment</a></li><li><a href="utils.html">utils</a></li><li><a href="viewer.html">viewer</a></li></ul><h3>Classes</h3><ul><li><a href="annotation.AnnotationGroup.html">AnnotationGroup</a></li><li><a href="color.PaletteColorLookupTable.html">PaletteColorLookupTable</a></li><li><a href="mapping.ParameterMapping.html">ParameterMapping</a></li><li><a href="mapping.Transformation.html">Transformation</a></li><li><a href="metadata.Comprehensive3DSR.html">Comprehensive3DSR</a></li><li><a href="metadata.MicroscopyBulkSimpleAnnotations.html">MicroscopyBulkSimpleAnnotations</a></li><li><a href="metadata.ParametricMap.html">ParametricMap</a></li><li><a href="metadata.Segmentation.html">Segmentation</a></li><li><a href="metadata.SOPClass.html">SOPClass</a></li><li><a href="metadata.VLWholeSlideMicroscopyImage.html">VLWholeSlideMicroscopyImage</a></li><li><a href="opticalPath.OpticalPath.html">OpticalPath</a></li><li><a href="roi.ROI.html">ROI</a></li><li><a href="scoord3d.Ellipse.html">Ellipse</a></li><li><a href="scoord3d.Ellipsoid.html">Ellipsoid</a></li><li><a href="scoord3d.Multipoint.html">Multipoint</a></li><li><a href="scoord3d.Point.html">Point</a></li><li><a href="scoord3d.Polygon.html">Polygon</a></li><li><a href="scoord3d.Polyline.html">Polyline</a></li><li><a href="scoord3d.Scoord3D.html">Scoord3D</a></li><li><a href="segment.Segment.html">Segment</a></li><li><a href="viewer.LabelImageViewer.html">LabelImageViewer</a></li><li><a href="viewer.OverviewImageViewer.html">OverviewImageViewer</a></li><li><a href="viewer.VolumeImageViewer.html">VolumeImageViewer</a></li></ul>
174
174
  </nav>
175
175
 
176
176
  <br class="clear">
177
177
 
178
178
  <footer>
179
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Mar 11 2022 17:11:29 GMT-0500 (Eastern Standard Time)
179
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon May 16 2022 08:28:05 GMT-0400 (Eastern Daylight Time)
180
180
  </footer>
181
181
 
182
182
  <script> prettyPrint(); </script>