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.
- package/README.md +44 -42
- package/{build → dist}/08929516bda4c4fd2597.module.wasm +0 -0
- package/{build → dist}/4f2853de305c1b5afcac.module.wasm +0 -0
- package/{build → dist}/6ae9c6e051fd2bd70fad.module.wasm +0 -0
- package/{build → dist}/6b62efd6c7f30afd4c78.module.wasm +0 -0
- package/{build → dist}/7e1d2da75b59525e1933.module.wasm +0 -0
- package/{build → dist}/d051f2d564fae150ce94.module.wasm +0 -0
- package/dist/dicom-microscopy-viewer.js +2 -0
- package/{build → dist}/dicom-microscopy-viewer.js.LICENSE.txt +0 -0
- package/dist/dicom-microscopy-viewer.js.map +1 -0
- package/{build → dist}/e6305f756142e57c92cd.module.wasm +0 -0
- package/{build → dist}/f3e0c999ad06a34a7f75.module.wasm +0 -0
- 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 +4 -3
- 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 +258 -207
- package/webpack.config.js +11 -1
- package/build/dicom-microscopy-viewer.js +0 -2
- package/build/dicom-microscopy-viewer.js.map +0 -1
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
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
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.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
115
|
+
```None
|
|
116
|
+
git clone https://github.com/herrmannlab/dicom-microscopy-viewer
|
|
117
|
+
cd dicom-microscopy-viewer
|
|
118
|
+
```
|
|
117
119
|
|
|
118
|
-
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|