dicom-microscopy-viewer 0.36.0 → 0.36.3

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 (107) hide show
  1. package/README.md +6 -1
  2. package/{build → dist}/08929516bda4c4fd2597.module.wasm +0 -0
  3. package/dist/4f2853de305c1b5afcac.module.wasm +0 -0
  4. package/{build → dist}/6ae9c6e051fd2bd70fad.module.wasm +0 -0
  5. package/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 +2 -2
  14. package/docs/annotation.html +4 -3
  15. package/docs/annotation.js.html +8 -8
  16. package/docs/annotations__AnnotationManager.js.html +5 -5
  17. package/docs/annotations_markups__MarkupManager.js.html +52 -7
  18. package/docs/api.html +3 -3
  19. package/docs/color.PaletteColorLookupTable.html +688 -0
  20. package/docs/color.html +671 -0
  21. package/docs/color.js.html +30 -5
  22. package/docs/dicom-microscopy-viewer.js.html +30 -13
  23. package/docs/events.html +3 -3
  24. package/docs/events.js.html +2 -2
  25. package/docs/index.html +23 -24
  26. package/docs/mapping.ParameterMapping.html +10 -10
  27. package/docs/mapping.Transformation.html +180 -0
  28. package/docs/mapping.html +7 -4
  29. package/docs/mapping.js.html +7 -3
  30. package/docs/metadata.Comprehensive3DSR.html +2 -2
  31. package/docs/metadata.MicroscopyBulkSimpleAnnotations.html +2 -2
  32. package/docs/metadata.ParametricMap.html +2 -2
  33. package/docs/metadata.Segmentation.html +2 -2
  34. package/docs/metadata.VLWholeSlideMicroscopyImage.html +2 -2
  35. package/docs/metadata.html +3 -3
  36. package/docs/metadata.js.html +2 -2
  37. package/docs/opticalPath.OpticalPath.html +2 -2
  38. package/docs/opticalPath.html +3 -3
  39. package/docs/opticalPath.js.html +2 -2
  40. package/docs/pyramid.js.html +6 -4
  41. package/docs/roi.ROI.html +2 -2
  42. package/docs/roi.html +4 -4
  43. package/docs/roi.js.html +4 -4
  44. package/docs/scoord3d.Ellipse.html +2 -2
  45. package/docs/scoord3d.Ellipsoid.html +2 -2
  46. package/docs/scoord3d.Multipoint.html +2 -2
  47. package/docs/scoord3d.Point.html +2 -2
  48. package/docs/scoord3d.Polygon.html +2 -2
  49. package/docs/scoord3d.Polyline.html +2 -2
  50. package/docs/scoord3d.html +3 -3
  51. package/docs/scoord3d.js.html +4 -4
  52. package/docs/segment.Segment.html +2 -2
  53. package/docs/segment.html +4 -4
  54. package/docs/segment.js.html +2 -2
  55. package/docs/utils.html +2812 -5
  56. package/docs/utils.js.html +77 -14
  57. package/docs/viewer.LabelImageViewer.html +3 -3
  58. package/docs/viewer.OverviewImageViewer.html +3 -3
  59. package/docs/viewer.VolumeImageViewer.html +87 -87
  60. package/docs/viewer.html +3 -3
  61. package/docs/viewer.js.html +45 -14
  62. package/package.json +8 -7
  63. package/src/annotation.js +6 -6
  64. package/src/annotations/_AnnotationManager.js +3 -3
  65. package/src/annotations/markers/arrow.js +11 -2
  66. package/src/annotations/markups/_MarkupManager.js +49 -4
  67. package/src/annotations/markups/measurement.js +14 -6
  68. package/src/annotations/markups/textEvaluation.js +23 -8
  69. package/src/color.js +28 -3
  70. package/src/dicom-microscopy-viewer.js +28 -11
  71. package/src/mapping.js +5 -1
  72. package/src/pyramid.js +4 -2
  73. package/src/roi.js +2 -2
  74. package/src/scoord3d.js +2 -2
  75. package/src/utils.js +75 -12
  76. package/src/viewer.js +37 -10
  77. package/webpack.config.js +11 -1
  78. package/build/33ef438573e49fde75eb.module.wasm +0 -0
  79. package/build/510fe8aff40dafc5b19b.module.wasm +0 -0
  80. package/build/713dba1fa973be4d97f4.module.wasm +0 -0
  81. package/build/86e23957894a6f373e11.module.wasm +0 -0
  82. package/build/c337ef929a626d7e5353.module.wasm +0 -0
  83. package/build/ce3907ececff7b46856f.wasm +0 -0
  84. package/build/dicom-microscopy-viewer.js +0 -2
  85. package/build/dicom-microscopy-viewer.js.map +0 -1
  86. package/docs/PaletteColorLookupTable.html +0 -364
  87. package/docs/Transformation.html +0 -179
  88. package/docs/annotations_markers_arrow.js.html +0 -224
  89. package/docs/annotations_markups_measurement.js.html +0 -136
  90. package/docs/annotations_markups_textEvaluation.js.html +0 -184
  91. package/docs/annotations_markups_utils_getShortestLineBetweenOverlayAndFeature.js.html +0 -96
  92. package/docs/global.html +0 -6062
  93. package/examples/basic/index.html +0 -77
  94. package/examples/blend/index.html +0 -209
  95. package/examples/events/index.html +0 -436
  96. package/examples/index.html +0 -32
  97. package/examples/js/FileSaver.min.js +0 -3
  98. package/examples/js/jquery.min.js +0 -4
  99. package/examples/js/jquery.min.map +0 -1
  100. package/examples/simple_viewer/index.html +0 -520
  101. package/examples/simple_viewer/scripts/dicomdict.js +0 -34030
  102. package/examples/simple_viewer/scripts/metadata.js +0 -79
  103. package/examples/simple_viewer/styles/main.css +0 -238
  104. package/examples/structured_report/index.html +0 -278
  105. package/examples/styles.js +0 -46
  106. package/src/annotations/markups/utils/getShortestLineBetweenOverlayAndFeature.js +0 -45
  107. package/src/annotations/markups/utils/index.js +0 -1
@@ -1,79 +0,0 @@
1
-
2
- function formatSpecimenMetadata(metadata) {
3
-
4
- let containerIdentifier = metadata['00400512']['Value'][0];
5
- let specimenDescriptions = metadata['00400560']['Value'].map(item => {
6
- let specimenUID = item['00400554']['Value'][0];
7
- var specimenIdentifier = '';
8
- if ('00400551' in item) {
9
- specimenIdentifier = item['00400551']['Value'][0];
10
- }
11
- var specimenShortDescription = '';
12
- if ('00400600' in item) {
13
- if (item['00400600']['Value']) {
14
- specimenShortDescription = item['00400600']['Value'][0];
15
- }
16
- }
17
-
18
- var anatomicStructure = [];
19
- if ('00082228' in item) {
20
- if (item['00082228']['Value']) {
21
- anatomicStructure = item['00082228']['Value'].map(struct => {
22
- return(struct['00080104']['Value'][0]);
23
- });
24
- }
25
- }
26
-
27
- var specimenLocalization = [];
28
- if ('00400620' in item) {
29
- if (item['00400620']['Value']) {
30
- specimenLocalization = item['00400620']['Value'].map(loc => {
31
- let name = loc['0040A043']['Value'][0]['00080104']['Value'][0];
32
- let value = loc['0040A160']['Value'][0];
33
- return({name: name, value: value});
34
- });
35
- }
36
- }
37
-
38
- var specimenPreparationSteps = [];
39
- if ('00400610' in item) {
40
- if (item['00400610']['Value']) {
41
- specimenPreparationSteps = item['00400610']['Value'].map(step => {
42
- const stepDescription = [];
43
- for (let contentItem of step['00400612']['Value']) {
44
- let conceptName = contentItem['0040A043']['Value'][0];
45
- const conceptNameCode = conceptName['00080100']['Value'][0];
46
- const conceptNameMeaning = conceptName['00080104']['Value'][0];
47
- const contentItemType = contentItem['0040A040']['Value'][0];
48
- if (contentItemType == 'CODE') {
49
- var conceptValue = contentItem['0040A168']['Value'][0]['00080104']['Value'][0];
50
- } else if (contentItemType == 'TEXT') {
51
- var conceptValue = contentItem['0040A160']['Value'][0];
52
- } else if (contentItemType == 'DATETIME') {
53
- var conceptValue = contentItem['0040A120']['Value'][0];
54
- } else {
55
- console.error('content type not supported: ' + contentItemType);
56
- }
57
- stepDescription.push({name: conceptNameMeaning, value: conceptValue});
58
- }
59
- return(stepDescription);
60
- });
61
- }
62
- }
63
-
64
- return({
65
- uid: specimenUID,
66
- id: specimenIdentifier,
67
- description: specimenShortDescription,
68
- anatomicStructures: anatomicStructure,
69
- localization: specimenLocalization,
70
- preparationSteps: specimenPreparationSteps
71
- });
72
-
73
- });
74
-
75
- return({
76
- container: containerIdentifier,
77
- specimens: specimenDescriptions
78
- });
79
- }
@@ -1,238 +0,0 @@
1
- :root {
2
- --main-bg-color: #618685;
3
- --main-fg-color: white;
4
- --menu-item-body-bg-color: #F5F5F5;
5
- --menu-subitem-body-bg-color: white;
6
- --main-border-color: #303030;
7
- --menu-item-header-bg-color: #D0D0D0;
8
- --menu-item-border-radius: 5px;
9
- --menu-item-border-color: var(--main-border-color);
10
- --menu-subitem-border-color: #A9A9A9;
11
- --active-border-color: var(--main-border-color);
12
- --active-bg-color: #c4d4d4;
13
- --header-font-size: 12px;
14
- --header-height: calc(var(--header-font-size) * 2.5);
15
- --footer-font-size: 10px;
16
- --footer-height: calc(var(--footer-font-size) * 2.2);
17
- --container-header-font-size: 14px;
18
- --container-header-height: calc(var(--container-header-font-size) * 1.5);
19
- --menu-header-font-size: 14px;
20
- --menu-header-height: calc(var(--menu-header-font-size) * 1.5);
21
- --menu-body-font-size: 12px;
22
- --menu-body-bg-color: white;
23
- --padding: 5px;
24
- --hover-border-color: var(--main-border-color);
25
- --hover-bg-color: #d3dfde;
26
- }
27
-
28
- ul {
29
- margin-top: 0;
30
- margin-bottom: 5px;
31
- }
32
- li {
33
- list-style-type: none;
34
- margin-left: -20px;
35
- }
36
- table {
37
- border-spacing: var(--padding) 0;
38
- margin-left: -7px;
39
- }
40
- td, th {
41
- text-align: left;
42
- padding: calc(var(--padding) / 2);
43
- }
44
- dt {
45
- font-weight: 600;
46
- margin-top: calc(var(--padding));
47
- }
48
- dd {
49
- margin-left: calc(var(--padding) * 2);
50
- margin-top: calc(var(--padding) / 2);
51
- }
52
-
53
- body {
54
- height: 100vh;
55
- width: 100vw;
56
- margin: 0px;
57
- padding: 0px;
58
- border-color: var(--main-border-color);
59
- box-sizing: border-box;
60
- border-width: thin;
61
- font-family: sans-serif;
62
- }
63
- header, footer {
64
- padding-left: var(--padding);
65
- padding-right: var(--padding);
66
- background-color: var(--main-bg-color);
67
- border-color: var(--main-border-color);
68
- box-sizing: border-box;
69
- border-width: thin;
70
- color: var(--main-fg-color);
71
- width: 100vw;
72
- }
73
- header {
74
- text-align: left;
75
- border-bottom-style: solid;
76
- height: var(--header-height);
77
- line-height: var(--header-height);
78
- }
79
- footer {
80
- position: fixed;
81
- text-align: right;
82
- height: var(--footer-height);
83
- line-height: var(--footer-height);
84
- font-size: var(--footer-font-size);
85
- top: calc(100vh - (var(--header-height) + var(--header-width)));
86
- box-sizing: border-box;
87
- border-top-style: solid;
88
- }
89
- header span {
90
- display: inline-block;
91
- vertical-align: middle;
92
- line-height: var(--header-height);
93
- }
94
- footer span {
95
- display: inline-block;
96
- vertical-align: middle;
97
- line-height: var(--footer-height);
98
- }
99
- nav, aside {
100
- box-sizing: border-box;
101
- border-width: thin;
102
- border-color: var(--main-border-color);
103
- }
104
- nav {
105
- border-right-style: solid;
106
- }
107
- aside {
108
- border-left-style: solid;
109
- }
110
-
111
- .main {
112
- top: 30px;
113
- bottom: 30px;
114
- display: flex;
115
- flex-direction: row;
116
- align-content: stretch;
117
- display: -webkit-flex;
118
- -webkit-flex-direction: row;
119
- -webkit-align-content: stretch;
120
- height: calc(100vh - (var(--header-height) + var(--footer-height)));
121
- }
122
- .sidebar {
123
- text-align: left;
124
- flex-basis: 20vw;
125
- display: flex;
126
- flex-direction: column;
127
- align-content: stretch;
128
- display: -webkit-flex;
129
- -webkit-flex-direction: column;
130
- -webkit-align-content: stretch;
131
- background-color: var(--menu-body-bg-color);
132
- }
133
-
134
- .content {
135
- flex-basis: 60vw;
136
- }
137
- .viewport {
138
- height: calc(100vh - (var(--header-height) + var(--container-header-height) + var(--menu-header-height)));
139
- background-color: white;
140
- }
141
-
142
- .container {
143
- }
144
- .container-header {
145
- padding-left: var(--padding);
146
- padding-top: calc(var(--padding) / 2);
147
- background-color: var(--main-bg-color);
148
- color: var(--main-fg-color);
149
- vertical-align: middle;
150
- height: var(--container-header-height);
151
- line-height: var(--container-header-height);
152
- font-size: var(--container-header-font-size);
153
- border-width: thin;
154
- border-bottom-style: solid;
155
- border-color: var(--main-border-color);
156
-
157
- }
158
- .container-body {
159
- background-color: var(--menu-body-bg-color);
160
- }
161
- .menu {
162
- padding: var(--padding);
163
- vertical-align: top;
164
- }
165
- .menu-item {
166
- background-color: var(--menu-item-body-bg-color);
167
- margin: 0 0 var(--padding) 0;
168
- border-width: thin;
169
- border-color: var(--menu-item-border-color);
170
- border-style: solid;
171
- border-radius: var(--menu-item-border-radius);
172
- }
173
- .menu-subitem {
174
- background-color: var(--menu-subitem-body-bg-color);
175
- border-width: thin;
176
- border-color: var(--menu-subitem-border-color);
177
- border-style: solid;
178
- border-radius: var(--menu-item-border-radius);
179
- padding: var(--padding);
180
- margin: 0 0 var(--padding) -5px;
181
- }
182
- .menu-item-header {
183
- padding-left: var(--padding);
184
- padding-top: calc(var(--padding) / 2);
185
- height: var(--menu-header-height);
186
- line-height: var(--menu-header-height);
187
- vertical-align: middle;
188
- color: black;
189
- font-weight: 600;
190
- font-size: var(--menu-header-font-size);
191
- background-color: var(--menu-item-header-bg-color);
192
- border-radius: calc(var(--menu-item-border-radius) / 1.5) calc(var(--menu-item-border-radius) / 1.5) 0 0;
193
- border-width: thin;
194
- border-color: var(--menu-item-border-color);
195
- border-style: none none solid none;
196
- }
197
- .menu-subitem-header {
198
- font-size: var(--menu-body-font-size);
199
- text-decoration: underline;
200
- }
201
- .menu-item-body {
202
- padding: var(--padding);
203
- font-size: var(--menu-body-font-size);
204
- }
205
- .menu-subitem-body {
206
- font-size: var(--menu-body-font-size);
207
- background-color: var(--menu-bg-color);
208
- }
209
-
210
- .container#studies-container {
211
- background-color: var(--menu-body-bg-color);
212
- flex-basis: 66%;
213
- border-bottom-style: solid;
214
- border-width: thin;
215
- }
216
- .container#series-container {
217
- background-color: var(--menu-body-bg-color);
218
- flex: 1;
219
- }
220
- .container#specimens-container {
221
- background-color: var(--menu-body-bg-color);
222
- }
223
-
224
- .sticky {
225
- overflow: hidden;
226
- }
227
- .scrollable {
228
- height: 100%;
229
- overflow: scroll;
230
- }
231
- .selectable:hover {
232
- border-color: var(--hover-border-color);
233
- background-color: var(--hover-bg-color);
234
- }
235
- .selectable.active, .selectable:active, .selectable:focus {
236
- border-color: var(--active-border-color);
237
- background-color: var(--active-bg-color);
238
- }
@@ -1,278 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta
6
- name="viewport"
7
- content="width=device-width, initial-scale=1, shrink-to-fit=no"
8
- />
9
- <meta name="theme-color" content="#000000" />
10
-
11
- <title>dicom-microscopy-viewer example</title>
12
-
13
- <link
14
- rel="stylesheet"
15
- href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
16
- integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
17
- crossorigin="anonymous"
18
- />
19
- <link
20
- rel="stylesheet"
21
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
22
- integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0="
23
- crossorigin="anonymous"
24
- />
25
- </head>
26
-
27
- <body>
28
- <noscript>
29
- You need to enable JavaScript to run this app.
30
- </noscript>
31
-
32
- <script src="https://unpkg.com/dcmjs@latest"
33
- type="application/javascript"
34
- charset="utf-8">
35
- </script>
36
- <script src="https://unpkg.com/dicomweb-client"></script>
37
- <!-- <script src="https://unpkg.com/dicom-microscopy-viewer"></script> -->
38
- <script src="build/dicom-microscopy-viewer.js"></script>
39
- <script src="../js/FileSaver.min.js"></script>
40
-
41
- <script>
42
-
43
- document.addEventListener("DOMContentLoaded", () => {
44
-
45
- document.getElementById("tools-list").addEventListener("click", (event) => {
46
- const geometryType = event.target.id;
47
- disableToolList();
48
- window.viewer.activateDrawInteraction({ geometryType });
49
- document.getElementById(`${geometryType}`).parentNode.setAttribute("class", "active");
50
- });
51
-
52
- document.getElementById("downloadReport").addEventListener("click", (event) => {
53
- const rois = window.viewer.getAllROIs();
54
- if(rois.length === 0){
55
- alert('Please, draw an region of interest first.');
56
- return;
57
- }
58
-
59
- // Metadata of image at highest resolution level
60
- const imageMetadata = window.viewer.imageMetadata[window.viewer.imageMetadata.length-1];
61
- const observationContext = new dcmjs.sr.templates.ObservationContext({
62
- observerPersonContext: new dcmjs.sr.templates.ObserverContext({
63
- observerType: new dcmjs.sr.coding.CodedConcept({
64
- value: "121006",
65
- schemeDesignator: "DCM",
66
- meaning: "Person",
67
- }),
68
- observerIdentifyingAttributes: new dcmjs.sr.templates.PersonObserverIdentifyingAttributes({
69
- name: "Robo^Doc"
70
- })
71
- }),
72
- observerDeviceContext: new dcmjs.sr.templates.ObserverContext({
73
- observerType: new dcmjs.sr.coding.CodedConcept({
74
- value: "121007",
75
- schemeDesignator: "DCM",
76
- meaning: "Device",
77
- }),
78
- observerIdentifyingAttributes: new dcmjs.sr.templates.DeviceObserverIdentifyingAttributes({
79
- uid: dcmjs.data.DicomMetaDictionary.uid() // FIXME
80
- })
81
- }),
82
- subjectContext: new dcmjs.sr.templates.SubjectContext({
83
- subjectClass: new dcmjs.sr.coding.CodedConcept({
84
- value: "121027",
85
- schemeDesignator: "DCM",
86
- meaning: "Specimen",
87
- }),
88
- subjectClassSpecificContext: new dcmjs.sr.templates.SubjectContextSpecimen({
89
- uid: imageMetadata.SpecimenDescriptionSequence[0].SpecimenUID,
90
- identifier: imageMetadata.SpecimenDescriptionSequence[0].SpecimenIdentifier,
91
- containerIdentifier: imageMetadata.ContainerIdentifier
92
- })
93
- })
94
- });
95
-
96
- const imagingMeasurements = [];
97
- for (let i = 0; i < rois.length; i++) {
98
- const roi = rois[i];
99
- const group = new dcmjs.sr.templates.PlanarROIMeasurementsAndQualitativeEvaluations({
100
- trackingIdentifier: new dcmjs.sr.templates.TrackingIdentifier({
101
- uid: roi.uid,
102
- identifier: `Measurements of ROI #${i+1}`
103
- }),
104
- referencedRegion: new dcmjs.sr.contentItems.ImageRegion3D({
105
- graphicType: roi.scoord3d.graphicType,
106
- graphicData: roi.scoord3d.graphicData,
107
- frameOfReferenceUID: roi.scoord3d.frameOfReferenceUID
108
- }),
109
- findingType: new dcmjs.sr.coding.CodedConcept({
110
- value: "108369006",
111
- schemeDesignator: "SCT",
112
- meaning: "Tumor",
113
- })
114
- });
115
- imagingMeasurements.push(...group);
116
- }
117
-
118
- const measurementReport = new dcmjs.sr.templates.MeasurementReport({
119
- languageOfContentItemAndDescendants: new dcmjs.sr.templates.LanguageOfContentItemAndDescendants({}),
120
- observationContext: observationContext,
121
- procedureReported: new dcmjs.sr.coding.CodedConcept({
122
- value: "112703",
123
- schemeDesignator: "DCM",
124
- meaning: "Whole Slide Imaging",
125
- }),
126
- imagingMeasurements: imagingMeasurements
127
- });
128
-
129
- const dataset = new dcmjs.sr.documents.Comprehensive3DSR({
130
- content: measurementReport[0],
131
- evidence: [imageMetadata],
132
- seriesInstanceUID: dcmjs.data.DicomMetaDictionary.uid(),
133
- seriesNumber: 1,
134
- seriesDescription: "Whole slide imaging structured report example",
135
- sopInstanceUID: dcmjs.data.DicomMetaDictionary.uid(),
136
- instanceNumber: 1,
137
- manufacturer: "dcmjs-org",
138
- });
139
- console.log(dataset)
140
- const fileMetaInformationVersionArray = new Uint8Array(2);
141
- fileMetaInformationVersionArray[1] = 1;
142
- dataset._meta = {
143
- FileMetaInformationVersion: {
144
- Value: [fileMetaInformationVersionArray.buffer], // TODO
145
- vr: "OB"
146
- },
147
- MediaStorageSOPClassUID: dataset.sopClassUID,
148
- MediaStorageSOPInstanceUID: dataset.sopInstanceUID,
149
- TransferSyntaxUID: {
150
- Value: ["1.2.840.10008.1.2.1"],
151
- vr: "UI"
152
- },
153
- ImplementationClassUID: {
154
- Value: [dcmjs.data.DicomMetaDictionary.uid()],
155
- vr: "UI"
156
- },
157
- ImplementationVersionName: {
158
- Value: ["dicom-microscopy-viewer-example"],
159
- vr: "SH"
160
- }
161
- };
162
- const blob = dcmjs.data.datasetToBlob(dataset);
163
- saveAs(blob, `${dataset.SOPInstanceUID}.dcm`, true);
164
- });
165
-
166
- });
167
-
168
- function disableToolList(){
169
- const toolList = document.getElementById("tools-list").querySelector("li.active")
170
- if(toolList !== null){
171
- toolList.classList.remove("active");
172
- }
173
- }
174
-
175
- const url = "https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs";
176
- const client = new DICOMwebClient.api.DICOMwebClient({ url });
177
- const studyInstanceUID = '1.2.392.200140.2.1.1.1.2.799008771.2156.1519721160.421';
178
- const seriesInstanceUID = '1.2.392.200140.2.1.1.1.3.799008771.2156.1519721160.422';
179
-
180
- const searchInstanceOptions = {
181
- studyInstanceUID,
182
- seriesInstanceUID
183
- };
184
-
185
- client.searchForInstances(searchInstanceOptions).then((instances) => {
186
- const promises = []
187
- for (let i = 0; i < instances.length; i++) {
188
- const seriesInstanceUID = instances[i]["0020000E"]["Value"][0];
189
- const sopInstanceUID = instances[i]["00080018"]["Value"][0];
190
- const retrieveInstanceOptions = {
191
- studyInstanceUID,
192
- seriesInstanceUID,
193
- sopInstanceUID,
194
- };
195
-
196
- const promise = client.retrieveInstanceMetadata(retrieveInstanceOptions).then(metadata => {
197
- const image = DICOMMicroscopyViewer.metadata.formatMetadata(metadata[0]);
198
- if (image.ImageType[2] === "VOLUME") {
199
- return(metadata[0]);
200
- }
201
- });
202
-
203
- promises.push(promise);
204
- }
205
-
206
- return(Promise.all(promises));
207
- }).then(metadata => {
208
- const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({
209
- client,
210
- metadata,
211
- retrieveRendered: true
212
- });
213
-
214
- const container = document.getElementById("dicomImage");
215
- viewer.render({ container });
216
-
217
- viewer.activateDrawInteraction({ geometryType: "polygon" });
218
- window.viewer = viewer;
219
-
220
- });
221
-
222
- window.dcmjs = dcmjs;
223
-
224
- </script>
225
- </body>
226
- <body>
227
- <div class="container">
228
- <div class="page-header">
229
- <h1>
230
- Example for Slide Microscopy Image Annotation
231
- </h1>
232
- <p>
233
- This example demonstrates how to annotate regions of interest (ROIs) on a digital slide represented by DICOM <a href="http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.32.8.html" target="_blank">VL Whole Slide Microscopy Image</a> instances and to store the graphic annotations as SCOORD3D content items using the <a href="http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.18.9.html" target="_blank">3D Spatial Coordinates Macro</a> in a
234
- DICOM <a href="http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.35.13.html" target="_blank">Comprehensive 3D SR</a> document based on the DICOM Structured Reporting template <a href="http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_A.html#sect_TID_1500" target="_blank">TID 1500 "Measurement Report"</a>.
235
- </p>
236
- <a href="../index.html">Go back to the Examples page</a>
237
- </div>
238
-
239
- <div class="bs-example" data-example-id="simple-thumbnails">
240
- <div class="row">
241
-
242
- <div class="col-xs-12 col-md-9" >
243
- <div class="alert alert-warning text-center" role="alert">Select below the tool you want to use to draw</div>
244
- <ul class="nav nav-pills" id="tools-list">
245
- <li role="presentation" class="active"><a id="polygon">Polygon</a></li>
246
- <li role="presentation"><a id="point">Point</a></li>
247
- <li role="presentation"><a id="circle">Circle</a></li>
248
- <li role="presentation"><a id="box">Box</a></li>
249
- <li role="presentation"><a id="freehandpolygon">Freehand Polygon</a></li>
250
- <li role="presentation"><a id="line">Line</a></li>
251
- <li role="presentation"><a id="freehandline">Freehand Line</a></li>
252
- </ul>
253
- <br/>
254
-
255
- </div>
256
- <div class="col-xs-12 col-md-3">
257
- <div class="alert alert-warning text-center" role="alert">Structured Report</div>
258
- <div class="list-group">
259
- <input
260
- type="button" class="btn btn-primary center-block" id="downloadReport"
261
- value="Download"
262
- />
263
- </div>
264
- </div>
265
- <div class="col-xs-12 col-md-12">
266
- <div style="width:100%;height:550px;position:relative;display:inline-block;">
267
- <div id="dicomImage"
268
- style="width:100%;height:550px;top:0px;left:0px; position:absolute; border: 1px solid black;">
269
- </div>
270
-
271
- </div>
272
- </div>
273
- </div>
274
- </div>
275
- </div>
276
-
277
- </body>
278
- </html>
@@ -1,46 +0,0 @@
1
- const defaultFill = {
2
- color: 'rgba(255,255,255,0.4)'
3
- }
4
-
5
- const emptyFill = {
6
- color: 'rgba(255,255,255,0.0)'
7
- }
8
-
9
- const defaultStroke = {
10
- color: '#adff2f',
11
- width: 3
12
- }
13
-
14
- const activeStroke = {
15
- color: 'white',
16
- width: 3
17
- }
18
-
19
- const defaultStyle = {
20
- image: {
21
- circle: {
22
- fill: defaultFill,
23
- stroke: activeStroke,
24
- radius: 5
25
- }
26
- },
27
- fill: defaultFill,
28
- stroke: activeStroke
29
- }
30
-
31
- const emptyStyle = {
32
- image: {
33
- circle: {
34
- fill: emptyFill,
35
- stroke: defaultStroke,
36
- radius: 5
37
- }
38
- },
39
- fill: emptyFill,
40
- stroke: defaultStroke
41
- }
42
-
43
- window.openLayersStyles = {
44
- active: defaultStyle,
45
- default: emptyStyle
46
- }
@@ -1,45 +0,0 @@
1
- import LineString from 'ol/geom/LineString'
2
- import Circle from 'ol/geom/Circle'
3
- import { fromCircle } from 'ol/geom/Polygon'
4
-
5
- /**
6
- * Builds a new LineString instance with the shortest
7
- * distance between a given overlay and a feature.
8
- *
9
- * @param {object} feature The feature
10
- * @param {object} overlay The overlay instance
11
- * @returns {LineString} The smallest line between the overlay and feature
12
- */
13
- const getShortestLineBetweenOverlayAndFeature = (feature, overlay) => {
14
- let result
15
- let distanceSq = Infinity
16
-
17
- let featureGeometry = feature.getGeometry()
18
-
19
- if (featureGeometry instanceof Circle) {
20
- featureGeometry = fromCircle(featureGeometry).clone()
21
- }
22
-
23
- const geometry = featureGeometry.getLinearRing ? featureGeometry.getLinearRing(0) : featureGeometry;
24
-
25
- (geometry.getCoordinates() || geometry.getExtent()).forEach(coordinates => {
26
- const closest = overlay.getPosition()
27
- const distanceNew = Math.pow(closest[0] - coordinates[0], 2) + Math.pow(closest[1] - coordinates[1], 2)
28
- if (distanceNew < distanceSq) {
29
- distanceSq = distanceNew
30
- result = [coordinates, closest]
31
- }
32
- })
33
-
34
- const coordinates = overlay.getPosition()
35
- const closest = geometry.getClosestPoint(coordinates)
36
- const distanceNew = Math.pow(closest[0] - coordinates[0], 2) + Math.pow(closest[1] - coordinates[1], 2)
37
- if (distanceNew < distanceSq) {
38
- distanceSq = distanceNew
39
- result = [closest, coordinates]
40
- }
41
-
42
- return new LineString(result)
43
- }
44
-
45
- export default getShortestLineBetweenOverlayAndFeature
@@ -1 +0,0 @@
1
- export { default as getShortestLineBetweenOverlayAndFeature } from './getShortestLineBetweenOverlayAndFeature'