|
19 | 19 | <script src="https://unpkg.com/@cornerstonejs/codec-libjpeg-turbo/dist/libjpegturbowasm.js"></script> |
20 | 20 | <script src="https://unpkg.com/@cornerstonejs/codec-openjpeg/dist/openjpegwasm.js"></script> |
21 | 21 | <script src="https://unpkg.com/@cornerstonejs/codec-charls/dist/charlsjs.js"></script> |
22 | | - |
| 22 | + |
23 | 23 | <script src="https://unpkg.com/dicomweb-client"></script> |
24 | 24 | <script src="https://unpkg.com/dicom-microscopy-viewer"></script> |
25 | 25 | <!-- enable for testing locally |
|
48 | 48 | thresholdValues : thresholdValues, |
49 | 49 | opticalPathID : `15`, |
50 | 50 | }; |
51 | | - viewer.setBlendingInformation(blendingInformation); |
| 51 | + window.viewer.setBlendingInformation(blendingInformation); |
52 | 52 | } |
53 | 53 | } |
54 | 54 |
|
55 | | - function updateChannelColor(event) { |
| 55 | + function updateChannelColor(event) { |
56 | 56 | const hexColor = event.target.value; |
57 | 57 | const color = [parseInt(hexColor.substr(1, 2), 16) / 255., |
58 | | - parseInt(hexColor.substr(3, 2), 16) / 255., |
59 | | - parseInt(hexColor.substr(5, 2), 16) / 255.]; |
| 58 | + parseInt(hexColor.substr(3, 2), 16) / 255., |
| 59 | + parseInt(hexColor.substr(5, 2), 16) / 255.]; |
60 | 60 | const blendingInformation = { |
61 | 61 | color : color, |
62 | 62 | opticalPathID : `15`, |
63 | 63 | }; |
64 | | - viewer.setBlendingInformation(blendingInformation); |
| 64 | + window.viewer.setBlendingInformation(blendingInformation); |
65 | 65 | } |
66 | | - |
| 66 | + |
67 | 67 | function updateChannelToggle() { |
68 | 68 | const opticalPathID = `15`; |
69 | 69 | if(channelToggle.checked) { |
70 | | - viewer.activateOpticalPath(opticalPathID); |
71 | | - viewer.showOpticalPath(opticalPathID); |
| 70 | + window.viewer.activateOpticalPath(opticalPathID); |
| 71 | + window.viewer.showOpticalPath(opticalPathID); |
72 | 72 | } else { |
73 | | - viewer.deactivateOpticalPath(opticalPathID); |
| 73 | + window.viewer.deactivateOpticalPath(opticalPathID); |
74 | 74 | } |
75 | 75 | } |
76 | 76 |
|
|
115 | 115 |
|
116 | 116 | // Example of custom initialization of the channel visualization parameters (this is optional) |
117 | 117 | const BIOne = new DICOMMicroscopyViewer.metadata.BlendingInformation( |
118 | | - opticalPathIdentifier = `35`, |
| 118 | + opticalPathIdentifier = `35`, |
119 | 119 | color = [0.,0.5,0.5], |
120 | 120 | opacity = 1.0, |
121 | 121 | thresholdValues = [125., 255.], |
122 | 122 | visible = true, |
123 | 123 | ); |
124 | 124 | const BITwo = new DICOMMicroscopyViewer.metadata.BlendingInformation( |
125 | | - opticalPathIdentifier = `1`, |
| 125 | + opticalPathIdentifier = `1`, |
126 | 126 | color = [0.5, 0.5, 0.], |
127 | 127 | opacity = 1.0, |
128 | 128 | thresholdValues = [0., 255.], |
|
135 | 135 | thresholdValues = [30., 255.], |
136 | 136 | visible = true, |
137 | 137 | ); |
138 | | - |
| 138 | + |
139 | 139 | const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({ |
140 | 140 | client, |
141 | 141 | metadata, |
|
0 commit comments