Skip to content

Commit 3b6b5af

Browse files
authored
fixes (#54)
* Set large initial cacheSize to tile sources * Improve performance by removing unnecessary offscreen coloring rendering * Add min/max color function for offscreen rendering/coloring * Improve performance by handling the channels opacity change at OpenLayer level * Add FrameOfReferenceUID and ContainerIdentifier checks
1 parent 1b55567 commit 3b6b5af

File tree

11 files changed

+486
-17306
lines changed

11 files changed

+486
-17306
lines changed

docs/channel.js.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ <h1 class="page-title">Source: channel.js</h1>
282282
rows
283283
}
284284

285-
const rendered = renderingEngine.colorMonochomeImageFrame(frameData)
285+
const rendered = renderingEngine.colorMonochromeImageFrame(frameData)
286286
tile.needToRerender = !rendered
287287
}
288288
)
@@ -343,7 +343,7 @@ <h1 class="page-title">Source: channel.js</h1>
343343
rows
344344
}
345345

346-
const rendered = renderingEngine.colorMonochomeImageFrame(frameData)
346+
const rendered = renderingEngine.colorMonochromeImageFrame(frameData)
347347
tile.needToRerender = !rendered
348348
}
349349
).catch(
@@ -380,7 +380,7 @@ <h1 class="page-title">Source: channel.js</h1>
380380
rows
381381
}
382382

383-
const rendered = renderingEngine.colorMonochomeImageFrame(frameData)
383+
const rendered = renderingEngine.colorMonochromeImageFrame(frameData)
384384
tile.needToRerender = !rendered
385385
}
386386
)
@@ -715,7 +715,7 @@ <h1 class="page-title">Source: channel.js</h1>
715715
rows
716716
}
717717

718-
const rendered = this.renderingEngine.colorMonochomeImageFrame(frameData)
718+
const rendered = this.renderingEngine.colorMonochromeImageFrame(frameData)
719719
if (rendered) {
720720
mapRerender = true
721721
tile.needToRerender = !rendered

examples/basic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({
6161
client,
6262
metadata,
63-
controls: ['fullscreen', 'overview', 'zoom'],
63+
controls: ['overview'],
6464
retrieveRendered: true
6565
});
6666

examples/blend/index.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
<script src="https://unpkg.com/@cornerstonejs/codec-charls/dist/charlsjs.js"></script>
2222

2323
<script src="https://unpkg.com/dicomweb-client"></script>
24-
<script src="https://unpkg.com/dicom-microscopy-viewer"></script>
24+
<script src="https://unpkg.com/dicom-microscopy-viewer"></script>
25+
2526
<!-- enable for testing locally
2627
<script src="../../node_modules/dicomweb-client/build/dicomweb-client.js"></script>
2728
<script src="../../build/dicom-microscopy-viewer.js"></script>
2829
!-->
30+
2931
<script>
3032
var colorPicker;
3133
var channelToggle;
@@ -46,7 +48,7 @@
4648
const thresholdValues = [minValue, 255.];
4749
const blendingInformation = {
4850
thresholdValues : thresholdValues,
49-
opticalPathID : `15`,
51+
opticalPathIdentifier : `15`,
5052
};
5153
viewer.setBlendingInformation(blendingInformation);
5254
}
@@ -59,24 +61,24 @@
5961
parseInt(hexColor.substr(5, 2), 16) / 255.];
6062
const blendingInformation = {
6163
color : color,
62-
opticalPathID : `15`,
64+
opticalPathIdentifier : `15`,
6365
};
6466
viewer.setBlendingInformation(blendingInformation);
6567
}
6668

6769
function updateChannelToggle() {
68-
const opticalPathID = `15`;
70+
const OpticalPathIdentifier = `15`;
6971
if(channelToggle.checked) {
70-
viewer.activateOpticalPath(opticalPathID);
71-
viewer.showOpticalPath(opticalPathID);
72+
viewer.activateOpticalPath(OpticalPathIdentifier);
73+
viewer.showOpticalPath(OpticalPathIdentifier);
7274
} else {
73-
viewer.deactivateOpticalPath(opticalPathID);
75+
viewer.deactivateOpticalPath(OpticalPathIdentifier);
7476
}
7577
}
7678

77-
const url = 'http://34.68.90.36/';
79+
const url = 'http://34.68.90.36/';
7880
const client = new DICOMwebClient.api.DICOMwebClient({url});
79-
const studyInstanceUID = '1.3.6.1.4.1.5962.99.1.2103930081.1286074986.1595536829665.3.0';
81+
const studyInstanceUID = '1.3.6.1.4.1.5962.99.1.3456320082.756362073.1622659023442.3.0';
8082
const seriesInstanceUIDOne = '1.3.6.1.4.1.5962.1.1.0.0.0.1595262375.18986.1';
8183
const seriesInstanceUIDTwo = '1.3.6.1.4.1.5962.1.1.0.0.0.1595262375.18986.15';
8284
const seriesInstanceUIDThree = '1.3.6.1.4.1.5962.1.1.0.0.0.1595262375.18986.35';
@@ -119,28 +121,31 @@
119121
color: [0.,0.5,0.5],
120122
opacity: 1.0,
121123
thresholdValues: [125., 255.],
124+
limitValues:[0, 255.],
122125
visible: true,
123126
});
124127
const BITwo = new DICOMMicroscopyViewer.metadata.BlendingInformation({
125128
opticalPathIdentifier: `1`,
126129
color: [0.5, 0.5, 0.],
127130
opacity: 1.0,
128131
thresholdValues: [0., 255.],
132+
limitValues:[0, 255.],
129133
visible: true,
130134
});
131135
const BIThree = new DICOMMicroscopyViewer.metadata.BlendingInformation({
132136
opticalPathIdentifier: `15`,
133137
color: [1, 0., 0.],
134138
opacity: 1.0,
135139
thresholdValues: [30., 255.],
140+
limitValues:[0, 255.],
136141
visible: true,
137142
});
138143

139144
const viewer = new DICOMMicroscopyViewer.api.VLWholeSlideMicroscopyImageViewer({
140145
client,
141146
metadata,
142147
blendingInformation: [BIOne, BITwo, BIThree],
143-
controls: ['fullscreen', 'zoom']
148+
controls: ['fullscreen', 'overview', 'zoom']
144149
});
145150

146151
const container = document.getElementById("dicomImage");

0 commit comments

Comments
 (0)