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/README.md CHANGED
@@ -25,58 +25,53 @@ Documentation of the JavaScript Application Programming Interface (API) is avail
25
25
  ## Getting started
26
26
 
27
27
  Note that the *dicom-microscopy-viewer* package is **not** a viewer application, it is a library to build viewer applications.
28
+
28
29
  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.
29
30
  For more advanced usage, take a look at the [Slim](https://github.com/herrmannlab/slim) viewer.
30
31
 
31
32
  ### Basic usage
32
33
 
33
- ```html
34
- <script type="text/javascript" src="https://unpkg.com/dicom-microscopy-viewer"></script>
35
- ```
36
-
37
34
  The viewer can be embedded in any website, one only needs to
38
35
 
39
- * Create an instance of the `viewer.VolumeViewer`. The constructor requires an instance of `DICOMwebClient` for retrieving frames from the archive as well as the metadata for each DICOM image instance formatted according to the [
40
- DICOM JSON Model](http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_F.2.html).
36
+ * Create an instance of [VolumeImageViewer](https://herrmannlab.github.io/dicom-microscopy-viewer/viewer.VolumeImageViewer.html). The constructor requires an instance of `DICOMwebClient` for retrieving frames from the archive as well as the metadata for each DICOM image as an instance of [VLWholeSlideMicroscopyImage](https://herrmannlab.github.io/dicom-microscopy-viewer/metadata.VLWholeSlideMicroscopyImage.html).
41
37
 
42
38
  * Call the `render()` method, passing it the HTML element (or the name of the element), which shall contain the viewport.
43
39
 
44
40
  ```js
45
- const url = 'http://localhost:8080/dicomweb';
46
- const client = new DICOMwebClient.api.DICOMwebClient({url});
47
- const studyInstanceUID = '1.2.3.4';
48
- const seriesInstanceUID = '1.2.3.5';
49
- const searchInstanceOptions = {
50
- studyInstanceUID,
51
- seriesInstanceUID
41
+ import * as DICOMMicroscopyViewer from 'dicom-microscopy-viewer';
42
+ import * as DICOMwebClient from 'dicomweb-client';
43
+
44
+ // Construct client instance
45
+ const client = new DICOMwebClient.api.DICOMwebClient({
46
+ url: 'http://localhost:8080/dicomweb'
47
+ });
48
+
49
+ // Retrieve metadata of a series of DICOM VL Whole Slide Microscopy Image instances
50
+ const retrieveOptions = {
51
+ studyInstanceUID: '1.2.3.4',
52
+ seriesInstanceUID: '1.2.3.5'
52
53
  };
53
- client.searchForInstances(searchInstanceOptions).then((instances) => {
54
- const promises = []
55
- for (let i = 0; i < instances.length; i++) {
56
- const sopInstanceUID = instances[i]["00080018"]["Value"][0];
57
- const retrieveInstanceOptions = {
58
- studyInstanceUID,
59
- seriesInstanceUID,
60
- sopInstanceUID,
61
- };
62
- const promise = client.retrieveInstanceMetadata(retrieveInstanceOptions).then(metadata => {
63
- const image = new DICOMMicroscopyViewer.metadata.VLWholeSlideMicroscopyViewer({
64
- metadata
65
- })
66
- if (image.imageType[2] === "VOLUME") {
67
- return(image);
68
- }
69
- });
70
- promises.push(promise);
71
- }
72
- return(Promise.all(promises));
73
- }).then(metadata => {
74
- metadata = metadata.filter(m => m);
54
+ client.retrieveSeriesMetadata(retrieveOptions).then((metadata) => {
55
+ // Parse, format, and filter metadata
56
+ const volumeImages = []
57
+ metadata.forEach(m => {
58
+ const image = new DICOMMicroscopyViewer.metadata.VLWholeSlideMicroscopyImage({
59
+ metadata: m
60
+ })
61
+ const imageFlavor = image.ImageType[2]
62
+ if (imageFlavor === 'VOLUME' || imageFlavor === 'THUMBNAIL') {
63
+ volumeImages.push(image)
64
+ }
65
+ })
66
+
67
+ // Construct viewer instance
75
68
  const viewer = new DICOMMicroscopyViewer.viewer.VolumeViewer({
76
69
  client,
77
- metadata
70
+ metadata: volumeImages
78
71
  });
79
- viewer.render({container: 'viewport'});
72
+
73
+ // Render viewer instance in the "viewport" HTML element
74
+ viewer.render({ container: 'viewport' });
80
75
  });
81
76
  ```
82
77
 
@@ -111,24 +106,31 @@ Install the [dicom-microscopy-viewer](https://www.npmjs.com/package/dicom-micros
111
106
  npm install dicom-microscopy-viewer
112
107
  ```
113
108
 
114
- ## Building & Testing
109
+ ## Development & Testing
110
+
111
+ We use [Babel](https://babeljs.io/) to compile (transpile), [webpack](https://webpack.js.org/) to bundle, and [Jest](https://github.com/facebook/jest) to test JavaScript code.
112
+
113
+ Get the source code by cloning the git repository:
115
114
 
116
- We use [webpack](https://webpack.js.org/) for bundling and [Jest](https://github.com/facebook/jest) for testing.
115
+ ```None
116
+ git clone https://github.com/herrmannlab/dicom-microscopy-viewer
117
+ cd dicom-microscopy-viewer
118
+ ```
117
119
 
118
- Build:
120
+ Install dependencies and build the package:
119
121
 
120
122
  ```None
121
123
  npm install
122
124
  npm run build
123
125
  ```
124
126
 
125
- Test:
127
+ Run tests:
126
128
 
127
129
  ```None
128
130
  npm run test
129
131
  ```
130
132
 
131
- Build the documentation:
133
+ Build the API documentation:
132
134
 
133
135
  ```None
134
136
  npm run generateDocs