Skip to content

Commit 1ec4138

Browse files
committed
Minor improvements to example scripts
1 parent 7d22998 commit 1ec4138

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

examples/blend/index.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<script src="https://unpkg.com/@cornerstonejs/codec-libjpeg-turbo/dist/libjpegturbowasm.js"></script>
2020
<script src="https://unpkg.com/@cornerstonejs/codec-openjpeg/dist/openjpegwasm.js"></script>
2121
<script src="https://unpkg.com/@cornerstonejs/codec-charls/dist/charlsjs.js"></script>
22-
22+
2323
<script src="https://unpkg.com/dicomweb-client"></script>
2424
<script src="https://unpkg.com/dicom-microscopy-viewer"></script>
2525
<!-- enable for testing locally
@@ -48,29 +48,29 @@
4848
thresholdValues : thresholdValues,
4949
opticalPathID : `15`,
5050
};
51-
viewer.setBlendingInformation(blendingInformation);
51+
window.viewer.setBlendingInformation(blendingInformation);
5252
}
5353
}
5454

55-
function updateChannelColor(event) {
55+
function updateChannelColor(event) {
5656
const hexColor = event.target.value;
5757
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.];
6060
const blendingInformation = {
6161
color : color,
6262
opticalPathID : `15`,
6363
};
64-
viewer.setBlendingInformation(blendingInformation);
64+
window.viewer.setBlendingInformation(blendingInformation);
6565
}
66-
66+
6767
function updateChannelToggle() {
6868
const opticalPathID = `15`;
6969
if(channelToggle.checked) {
70-
viewer.activateOpticalPath(opticalPathID);
71-
viewer.showOpticalPath(opticalPathID);
70+
window.viewer.activateOpticalPath(opticalPathID);
71+
window.viewer.showOpticalPath(opticalPathID);
7272
} else {
73-
viewer.deactivateOpticalPath(opticalPathID);
73+
window.viewer.deactivateOpticalPath(opticalPathID);
7474
}
7575
}
7676

@@ -115,14 +115,14 @@
115115

116116
// Example of custom initialization of the channel visualization parameters (this is optional)
117117
const BIOne = new DICOMMicroscopyViewer.metadata.BlendingInformation(
118-
opticalPathIdentifier = `35`,
118+
opticalPathIdentifier = `35`,
119119
color = [0.,0.5,0.5],
120120
opacity = 1.0,
121121
thresholdValues = [125., 255.],
122122
visible = true,
123123
);
124124
const BITwo = new DICOMMicroscopyViewer.metadata.BlendingInformation(
125-
opticalPathIdentifier = `1`,
125+
opticalPathIdentifier = `1`,
126126
color = [0.5, 0.5, 0.],
127127
opacity = 1.0,
128128
thresholdValues = [0., 255.],
@@ -135,7 +135,7 @@
135135
thresholdValues = [30., 255.],
136136
visible = true,
137137
);
138-
138+
139139
const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({
140140
client,
141141
metadata,

examples/simple_viewer/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,20 @@
291291
seriesInstanceUID,
292292
sopInstanceUID,
293293
};
294-
294+
295295
const promise = client.retrieveInstanceMetadata(retrieveInstanceOptions).then(metadata => {
296296
const image = DICOMMicroscopyViewer.metadata.formatMetadata(metadata[0]);
297297
if (image.ImageType[2] === "VOLUME") {
298298
return(metadata[0]);
299299
}
300300
});
301-
301+
302302
promises.push(promise);
303303
}
304-
304+
305305
return(Promise.all(promises));
306306
}).then(metadata => {
307-
307+
308308
const controls = [];
309309
try {
310310
const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({

0 commit comments

Comments
 (0)