@ohif/app 3.13.0-beta.23 → 3.13.0-beta.25

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 (41) hide show
  1. package/dist/{3081.bundle.4344a3bedb7e70eb5d78.js → 3081.bundle.abd1965b89abdae3e2cd.js} +2 -2
  2. package/dist/{4287.bundle.c6bd6cf991e2dae32044.js → 4287.bundle.d2d09ffd5cd8680fad8d.js} +4 -4
  3. package/dist/{6280.bundle.828ccda61aa5c83408a5.js → 6280.bundle.081861b7e685b28616c8.js} +406 -156
  4. package/dist/{6386.bundle.d1be64fd274877e918d9.js → 6386.bundle.c0618e49b65769ddf752.js} +30 -8
  5. package/dist/{7537.bundle.5a26371cf1368d0e5cf2.js → 7537.bundle.1a18959ceec98634bc48.js} +654 -30
  6. package/dist/{9195.bundle.e4457f0ed6c34993e3c6.js → 9195.bundle.19dc3a6e56eb68c798c6.js} +3 -3
  7. package/dist/{9205.bundle.a37976b4f3ded2cbb2ab.js → 9205.bundle.09c52845b43bd8513d50.js} +401 -155
  8. package/dist/{app.bundle.f8d7e7242f341be6acab.js → app.bundle.b7e36d423c4b82caec4a.js} +936 -70
  9. package/dist/{compute.bundle.0fa6bd11224eb79e7474.js → compute.bundle.6016de6e5f7c25749422.js} +1 -1
  10. package/dist/index.html +1 -1
  11. package/dist/{polySeg.bundle.f15c8d2cc2559db627cf.js → polySeg.bundle.cdcc2c3d11009ccf112c.js} +1 -1
  12. package/dist/sw.js +1 -1
  13. package/package.json +21 -21
  14. /package/dist/{1459.bundle.fdfad1e671918501e3d2.js → 1459.bundle.3bbccef88e50f594bd5c.js} +0 -0
  15. /package/dist/{147.bundle.15c3dffbc73dab1085f5.js → 147.bundle.9c245011849e09bd7904.js} +0 -0
  16. /package/dist/{1933.bundle.f89ae7ae7baa9a38128e.js → 1933.bundle.3bdfd1feac553d904453.js} +0 -0
  17. /package/dist/{2018.bundle.a517a2a8d4b076b2c684.js → 2018.bundle.432347c05a54b8bfe9ff.js} +0 -0
  18. /package/dist/{2075.bundle.a9783d07b48ca241486e.js → 2075.bundle.16215ba94d714a1c905f.js} +0 -0
  19. /package/dist/{213.bundle.df5bb838062f6a1aa79c.js → 213.bundle.1b08f3276e1f1f9a79d7.js} +0 -0
  20. /package/dist/{2424.bundle.c2786065ba1937631a79.js → 2424.bundle.a6dcd0e1f062af8b2d84.js} +0 -0
  21. /package/dist/{3138.bundle.a33cbe78017b1918c923.js → 3138.bundle.c57bafda58df0bfcd2b9.js} +0 -0
  22. /package/dist/{3461.bundle.7127d96c33ad3cd68c11.js → 3461.bundle.92c39628ef30d820e4f3.js} +0 -0
  23. /package/dist/{4507.bundle.895bc803df58395a221f.js → 4507.bundle.d247dc22e5be3bd7a6b6.js} +0 -0
  24. /package/dist/{4819.bundle.e97fa2fed6fb6e421f1a.js → 4819.bundle.bb901bc27b2651bb2429.js} +0 -0
  25. /package/dist/{5015.bundle.eff33bbbbd6ff055c742.js → 5015.bundle.50a79903b8013f8b4ec6.js} +0 -0
  26. /package/dist/{5028.bundle.5833a530fe9ade4dc787.js → 5028.bundle.7a49c4ed64c977ab1ce6.js} +0 -0
  27. /package/dist/{5457.bundle.4b2e1e0aaf4f54d8cd1e.js → 5457.bundle.ee1cf6cd2852c5774726.js} +0 -0
  28. /package/dist/{5485.bundle.70dbc4d41d1b5f299e6e.js → 5485.bundle.a8cf687e74934e05021a.js} +0 -0
  29. /package/dist/{5802.bundle.70600f8f701ac920b932.js → 5802.bundle.70d423c8b488cc56cc36.js} +0 -0
  30. /package/dist/{581.bundle.2bb402f7316b6e8c735b.js → 581.bundle.b70e5d2d0f3958df69f0.js} +0 -0
  31. /package/dist/{6027.bundle.77ed34c72d695295cc90.js → 6027.bundle.836b698603e6e57917ae.js} +0 -0
  32. /package/dist/{7431.bundle.8ddbd21f7b2b8528a14a.js → 7431.bundle.84b3d88ef94b97c84298.js} +0 -0
  33. /package/dist/{7639.bundle.9a1d8c0a3624fff53cb9.js → 7639.bundle.53c74ef4d1db97b0393f.js} +0 -0
  34. /package/dist/{8305.bundle.61e53a1298804bd4bc46.js → 8305.bundle.1d74b2eae866e8f436b3.js} +0 -0
  35. /package/dist/{8499.bundle.cca6ef54e2c475fc9f2b.js → 8499.bundle.806fe16811e4bc57f63e.js} +0 -0
  36. /package/dist/{85.bundle.aa4e9485c037e1bf2cbc.js → 85.bundle.4fabfcc733aa0507fe9b.js} +0 -0
  37. /package/dist/{8558.bundle.69bda0c8e9b438294401.js → 8558.bundle.48b5679c686fd0f333b3.js} +0 -0
  38. /package/dist/{8583.bundle.3bae324bc92e2a4f00e4.js → 8583.bundle.3ff3d34166d7cda943d7.js} +0 -0
  39. /package/dist/{933.bundle.a6220d057519db0b7651.js → 933.bundle.ea9db108b8a4e3d51904.js} +0 -0
  40. /package/dist/{9862.bundle.4704bce0c5b039dfdec3.js → 9862.bundle.126a8a8c84421a076527.js} +0 -0
  41. /package/dist/{9927.bundle.006b27903e0450ce2e94.js → 9927.bundle.1ef0031e2eb22d576bc6.js} +0 -0
@@ -2014,6 +2014,571 @@ function isCompatible(viewPlaneNormal, vector) {
2014
2014
  /* harmony default export */ const RenderingEngine_BaseVolumeViewport = (BaseVolumeViewport);
2015
2015
 
2016
2016
 
2017
+ /***/ },
2018
+
2019
+ /***/ 95307
2020
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2021
+
2022
+ "use strict";
2023
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2024
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
2025
+ /* harmony export */ });
2026
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71851);
2027
+ /* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45354);
2028
+ /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69372);
2029
+ /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10056);
2030
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(40661);
2031
+ /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74876);
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+
2038
+ const SECONDS_WIDTH = 150;
2039
+ const CHANNEL_SPACING = 5;
2040
+ const ECG_AMPLITUDE_INDEX_SIZE = 65536;
2041
+ const COLOR_GRID_MAJOR = '#7f0000';
2042
+ const COLOR_GRID_MINOR = '#3f0000';
2043
+ const COLOR_BASELINE = '#7F4C00';
2044
+ const COLOR_TRACE = '#ffffff';
2045
+ const COLOR_LABEL = '#ffff00';
2046
+ const COLOR_BACKGROUND = '#000000';
2047
+ function computeMinMax(data) {
2048
+ let min = 0;
2049
+ let max = 0;
2050
+ for (let i = 0; i < data.length; i++) {
2051
+ if (data[i] < min) {
2052
+ min = data[i];
2053
+ }
2054
+ if (data[i] > max) {
2055
+ max = data[i];
2056
+ }
2057
+ }
2058
+ return { min, max };
2059
+ }
2060
+ class ECGViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A {
2061
+ constructor(props) {
2062
+ super({
2063
+ ...props,
2064
+ canvas: props.canvas || (0,_helpers__WEBPACK_IMPORTED_MODULE_4__/* .getOrCreateCanvas */ .oI)(props.element),
2065
+ });
2066
+ this.imageId = null;
2067
+ this.channels = [];
2068
+ this.waveformData = null;
2069
+ this.ecgWidth = 0;
2070
+ this.ecgHeight = 0;
2071
+ this.channelScale = 0;
2072
+ this.ecgCamera = {
2073
+ panWorld: [0, 0],
2074
+ parallelScale: 1,
2075
+ };
2076
+ this.getProperties = () => {
2077
+ return {
2078
+ visibleChannels: this.channels
2079
+ .map((ch, i) => (ch.visible ? i : -1))
2080
+ .filter((i) => i >= 0),
2081
+ };
2082
+ };
2083
+ this.resetCamera = () => {
2084
+ this.refreshRenderValues();
2085
+ this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
2086
+ this.renderFrame();
2087
+ return true;
2088
+ };
2089
+ this.getFrameOfReferenceUID = () => {
2090
+ return `ecg-viewport-${this.id}`;
2091
+ };
2092
+ this.resize = () => {
2093
+ const canvas = this.canvas;
2094
+ const { clientWidth, clientHeight } = canvas;
2095
+ if (canvas.width !== clientWidth || canvas.height !== clientHeight) {
2096
+ canvas.width = clientWidth;
2097
+ canvas.height = clientHeight;
2098
+ }
2099
+ if (this.waveformData) {
2100
+ this.computeChannelScale();
2101
+ this.recalculateHeight();
2102
+ }
2103
+ this.refreshRenderValues();
2104
+ this.renderFrame();
2105
+ };
2106
+ this.canvasToWorld = (canvasPos, destPos = [0, 0, 0]) => {
2107
+ if (!this.waveformData) {
2108
+ destPos[0] = 0;
2109
+ destPos[1] = 0;
2110
+ destPos[2] = 0;
2111
+ return destPos;
2112
+ }
2113
+ const scale = this.getWorldToCanvasRatio();
2114
+ const pan = this.ecgCamera.panWorld;
2115
+ const layouts = this.computeChannelLayouts();
2116
+ const subCanvasPos = [
2117
+ canvasPos[0] / scale - pan[0],
2118
+ canvasPos[1] / scale - pan[1],
2119
+ ];
2120
+ let z = 0;
2121
+ for (let i = 0; i < layouts.length; i++) {
2122
+ const layout = layouts[i];
2123
+ if (subCanvasPos[1] <= layout.yOffset) {
2124
+ z = i;
2125
+ break;
2126
+ }
2127
+ if (i === layouts.length - 1) {
2128
+ z = i;
2129
+ }
2130
+ }
2131
+ const x = Math.max(0, Math.min(this.waveformData.numberOfSamples - 1, (subCanvasPos[0] * this.waveformData.numberOfSamples) / this.ecgWidth));
2132
+ const layout = layouts[z];
2133
+ const y = (layout.baseline - subCanvasPos[1]) / this.channelScale;
2134
+ destPos[0] = x;
2135
+ destPos[1] = y;
2136
+ destPos[2] = z;
2137
+ return destPos;
2138
+ };
2139
+ this.worldToCanvas = (worldPos) => {
2140
+ if (!this.waveformData) {
2141
+ return [0, 0];
2142
+ }
2143
+ const scale = this.getWorldToCanvasRatio();
2144
+ const pan = this.ecgCamera.panWorld;
2145
+ const layouts = this.computeChannelLayouts();
2146
+ const z = Math.round(worldPos[2]);
2147
+ if (z < 0 || z >= layouts.length) {
2148
+ return [0, 0];
2149
+ }
2150
+ const layout = layouts[z];
2151
+ const canvasX = (worldPos[0] / this.waveformData.numberOfSamples) *
2152
+ this.ecgWidth *
2153
+ scale +
2154
+ pan[0] * scale;
2155
+ const canvasY = (layout.baseline - worldPos[1] * this.channelScale) * scale +
2156
+ pan[1] * scale;
2157
+ return [canvasX, canvasY];
2158
+ };
2159
+ this.getRotation = () => 0;
2160
+ this.getNumberOfSlices = () => {
2161
+ return 1;
2162
+ };
2163
+ this.getCurrentImageIdIndex = () => {
2164
+ return 0;
2165
+ };
2166
+ this.getCurrentImageId = () => {
2167
+ return this.imageId;
2168
+ };
2169
+ this.getSliceIndex = () => {
2170
+ return 0;
2171
+ };
2172
+ this.getImageIds = () => {
2173
+ return this.imageId ? [this.imageId] : [];
2174
+ };
2175
+ this.scroll = () => {
2176
+ };
2177
+ this.customRenderViewportToCanvas = () => {
2178
+ this.renderFrame();
2179
+ };
2180
+ this.renderFrame = () => {
2181
+ if (!this.waveformData) {
2182
+ return;
2183
+ }
2184
+ const dpr = window.devicePixelRatio || 1;
2185
+ const transform = this.getTransform();
2186
+ const m = transform.getMatrix();
2187
+ const ctx = this.canvasContext;
2188
+ ctx.resetTransform();
2189
+ ctx.fillStyle = COLOR_BACKGROUND;
2190
+ ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
2191
+ ctx.setTransform(m[0] / dpr, m[1] / dpr, m[2] / dpr, m[3] / dpr, m[4] / dpr, m[5] / dpr);
2192
+ const layouts = this.computeChannelLayouts();
2193
+ this.drawGrid(ctx);
2194
+ this.drawTraces(ctx, layouts);
2195
+ this.drawLabels(ctx, layouts);
2196
+ ctx.resetTransform();
2197
+ (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(this.element, _enums__WEBPACK_IMPORTED_MODULE_0__.Events.IMAGE_RENDERED, {
2198
+ element: this.element,
2199
+ viewportId: this.id,
2200
+ viewport: this,
2201
+ renderingEngineId: this.renderingEngineId,
2202
+ });
2203
+ };
2204
+ this.getMiddleSliceData = () => {
2205
+ throw new Error('Method not implemented for ECG viewport.');
2206
+ };
2207
+ this.canvasContext = this.canvas.getContext('2d');
2208
+ this.renderingEngineId = props.renderingEngineId;
2209
+ this.element.setAttribute('data-viewport-uid', this.id);
2210
+ this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId);
2211
+ this.addEventListeners();
2212
+ this.resize();
2213
+ }
2214
+ static get useCustomRenderingPipeline() {
2215
+ return true;
2216
+ }
2217
+ addEventListeners() {
2218
+ this.canvas.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_0__.Events.ELEMENT_DISABLED, this.elementDisabledHandler);
2219
+ }
2220
+ removeEventListeners() {
2221
+ this.canvas.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_0__.Events.ELEMENT_DISABLED, this.elementDisabledHandler);
2222
+ }
2223
+ elementDisabledHandler() {
2224
+ this.removeEventListeners();
2225
+ }
2226
+ async setEcg(imageId) {
2227
+ this.imageId = imageId;
2228
+ const ecgModule = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_0__.MetadataModules.ECG, imageId);
2229
+ if (!ecgModule?.waveformData?.retrieveBulkData) {
2230
+ throw new Error(`[ECGViewport] No ECG waveform data for imageId: ${imageId}`);
2231
+ }
2232
+ const { numberOfWaveformChannels: numberOfChannels, numberOfWaveformSamples: numberOfSamples, samplingFrequency, waveformBitsAllocated: bitsAllocated = 16, waveformSampleInterpretation: sampleInterpretation = 'SS', multiplexGroupLabel, channelDefinitionSequence: channelDefinitions = [], } = ecgModule;
2233
+ const channelArrays = await ecgModule.waveformData.retrieveBulkData();
2234
+ this.channels = [];
2235
+ for (let i = 0; i < numberOfChannels; i++) {
2236
+ const channelDef = channelDefinitions[i] || {};
2237
+ const name = channelDef.channelSourceSequence?.codeMeaning ||
2238
+ channelDef.ChannelSourceSequence?.CodeMeaning ||
2239
+ `Channel ${i + 1}`;
2240
+ const data = channelArrays[i] || new Int16Array(0);
2241
+ const { min, max } = computeMinMax(data);
2242
+ this.channels.push({ name, data, visible: true, min, max });
2243
+ }
2244
+ this.waveformData = {
2245
+ channels: this.channels,
2246
+ numberOfChannels,
2247
+ numberOfSamples,
2248
+ samplingFrequency,
2249
+ bitsAllocated,
2250
+ sampleInterpretation,
2251
+ multiplexGroupLabel,
2252
+ };
2253
+ this.calibration = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_0__.MetadataModules.CALIBRATION, imageId);
2254
+ this.ecgWidth = Math.ceil((numberOfSamples * SECONDS_WIDTH) / samplingFrequency);
2255
+ this.computeChannelScale();
2256
+ this.recalculateHeight();
2257
+ this.refreshRenderValues();
2258
+ this.renderFrame();
2259
+ }
2260
+ setChannelVisibility(index, visible) {
2261
+ if (index >= 0 && index < this.channels.length) {
2262
+ this.channels[index].visible = visible;
2263
+ this.computeChannelScale();
2264
+ this.recalculateHeight();
2265
+ this.refreshRenderValues();
2266
+ this.renderFrame();
2267
+ }
2268
+ }
2269
+ getVisibleChannels() {
2270
+ return this.channels.map((ch) => ({
2271
+ name: ch.name,
2272
+ visible: ch.visible,
2273
+ }));
2274
+ }
2275
+ getWaveformData() {
2276
+ return this.waveformData;
2277
+ }
2278
+ getContentDimensions() {
2279
+ return { width: this.ecgWidth, height: this.ecgHeight };
2280
+ }
2281
+ computeChannelScale() {
2282
+ const visibleChannels = this.channels.filter((c) => c.visible && c.data.length > 0);
2283
+ if (visibleChannels.length === 0 || this.ecgWidth === 0) {
2284
+ this.channelScale = 0;
2285
+ return;
2286
+ }
2287
+ let maxRange = 1;
2288
+ for (const channel of visibleChannels) {
2289
+ const range = channel.max - channel.min;
2290
+ maxRange = Math.max(maxRange, range);
2291
+ }
2292
+ const canvasAspect = this.canvas.offsetHeight && this.canvas.offsetWidth
2293
+ ? this.canvas.offsetHeight / this.canvas.offsetWidth
2294
+ : 2 / 3;
2295
+ const targetTotalHeight = this.ecgWidth * canvasAspect;
2296
+ const totalSpacing = CHANNEL_SPACING * visibleChannels.length;
2297
+ const heightPerChannel = (targetTotalHeight - totalSpacing) / visibleChannels.length;
2298
+ this.channelScale = heightPerChannel / (maxRange * 1.25);
2299
+ }
2300
+ recalculateHeight() {
2301
+ const scale = this.channelScale;
2302
+ let totalHeight = 0;
2303
+ for (const channel of this.channels) {
2304
+ if (!channel.visible || channel.data.length === 0) {
2305
+ continue;
2306
+ }
2307
+ const itemHeight = (channel.max - channel.min) * scale * 1.25;
2308
+ totalHeight += itemHeight + CHANNEL_SPACING;
2309
+ }
2310
+ this.ecgHeight = totalHeight;
2311
+ }
2312
+ computeChannelLayouts() {
2313
+ const scale = this.channelScale;
2314
+ const layouts = [];
2315
+ let yOffset = 0;
2316
+ for (const channel of this.channels) {
2317
+ if (!channel.visible || channel.data.length === 0) {
2318
+ continue;
2319
+ }
2320
+ const itemHeight = (channel.max - channel.min) * scale * 1.25;
2321
+ yOffset += itemHeight + CHANNEL_SPACING;
2322
+ const baseline = yOffset + channel.min * scale;
2323
+ layouts.push({ channel, itemHeight, yOffset, baseline });
2324
+ }
2325
+ return layouts;
2326
+ }
2327
+ setProperties(props) {
2328
+ if (props.visibleChannels !== undefined) {
2329
+ for (let i = 0; i < this.channels.length; i++) {
2330
+ this.channels[i].visible = props.visibleChannels.includes(i);
2331
+ }
2332
+ this.computeChannelScale();
2333
+ this.recalculateHeight();
2334
+ this.refreshRenderValues();
2335
+ this.renderFrame();
2336
+ }
2337
+ }
2338
+ resetProperties() {
2339
+ for (const channel of this.channels) {
2340
+ channel.visible = true;
2341
+ }
2342
+ this.computeChannelScale();
2343
+ this.recalculateHeight();
2344
+ this.refreshRenderValues();
2345
+ this.renderFrame();
2346
+ }
2347
+ setCamera(camera) {
2348
+ const { parallelScale, focalPoint } = camera;
2349
+ if (parallelScale) {
2350
+ this.ecgCamera.parallelScale =
2351
+ this.element.clientHeight / 2 / parallelScale;
2352
+ }
2353
+ if (focalPoint !== undefined) {
2354
+ const focalPointCanvas = this.worldToCanvas(focalPoint);
2355
+ const canvasCenter = [
2356
+ this.element.clientWidth / 2,
2357
+ this.element.clientHeight / 2,
2358
+ ];
2359
+ const panWorldDelta = [
2360
+ (focalPointCanvas[0] - canvasCenter[0]) / this.ecgCamera.parallelScale,
2361
+ (focalPointCanvas[1] - canvasCenter[1]) / this.ecgCamera.parallelScale,
2362
+ ];
2363
+ this.ecgCamera.panWorld = [
2364
+ this.ecgCamera.panWorld[0] - panWorldDelta[0],
2365
+ this.ecgCamera.panWorld[1] - panWorldDelta[1],
2366
+ ];
2367
+ }
2368
+ this.canvasContext.fillStyle = COLOR_BACKGROUND;
2369
+ this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
2370
+ this.renderFrame();
2371
+ }
2372
+ getCamera() {
2373
+ const { parallelScale } = this.ecgCamera;
2374
+ const canvasCenter = [
2375
+ this.element.clientWidth / 2,
2376
+ this.element.clientHeight / 2,
2377
+ ];
2378
+ const canvasCenterWorld = this.canvasToWorld(canvasCenter);
2379
+ return {
2380
+ parallelProjection: true,
2381
+ focalPoint: canvasCenterWorld,
2382
+ position: [0, 0, 0],
2383
+ viewUp: [0, -1, 0],
2384
+ parallelScale: this.element.clientHeight / 2 / parallelScale,
2385
+ viewPlaneNormal: [0, 0, 1],
2386
+ };
2387
+ }
2388
+ getPan() {
2389
+ const panWorld = this.ecgCamera.panWorld;
2390
+ return [panWorld[0], panWorld[1]];
2391
+ }
2392
+ getViewReferenceId(_specifier) {
2393
+ return `imageId:${this.imageId}`;
2394
+ }
2395
+ hasImageURI(imageURI) {
2396
+ return this.imageId?.includes(imageURI) ?? false;
2397
+ }
2398
+ isReferenceViewable(viewRef) {
2399
+ if (viewRef.FrameOfReferenceUID &&
2400
+ viewRef.FrameOfReferenceUID !== this.getFrameOfReferenceUID()) {
2401
+ return false;
2402
+ }
2403
+ return true;
2404
+ }
2405
+ updateCameraClippingPlanesAndRange() {
2406
+ }
2407
+ refreshRenderValues() {
2408
+ if (!this.ecgWidth || !this.ecgHeight) {
2409
+ return;
2410
+ }
2411
+ let worldToCanvasRatio = this.canvas.offsetWidth / this.ecgWidth;
2412
+ if (this.ecgHeight * worldToCanvasRatio > this.canvas.offsetHeight) {
2413
+ worldToCanvasRatio = this.canvas.offsetHeight / this.ecgHeight;
2414
+ }
2415
+ const drawWidth = Math.floor(this.ecgWidth * worldToCanvasRatio);
2416
+ const drawHeight = Math.floor(this.ecgHeight * worldToCanvasRatio);
2417
+ const xOffsetCanvas = (this.canvas.offsetWidth - drawWidth) / 2;
2418
+ const yOffsetCanvas = (this.canvas.offsetHeight - drawHeight) / 2;
2419
+ const xOffsetWorld = xOffsetCanvas / worldToCanvasRatio;
2420
+ const yOffsetWorld = yOffsetCanvas / worldToCanvasRatio;
2421
+ this.ecgCamera.panWorld = [xOffsetWorld, yOffsetWorld];
2422
+ this.ecgCamera.parallelScale = worldToCanvasRatio;
2423
+ }
2424
+ getWorldToCanvasRatio() {
2425
+ return this.ecgCamera.parallelScale;
2426
+ }
2427
+ getTransform() {
2428
+ const panWorld = this.ecgCamera.panWorld;
2429
+ const dpr = window.devicePixelRatio || 1;
2430
+ const worldToCanvasRatio = this.getWorldToCanvasRatio();
2431
+ const canvasToWorldRatio = 1.0 / worldToCanvasRatio;
2432
+ const halfCanvas = [
2433
+ this.canvas.offsetWidth / 2,
2434
+ this.canvas.offsetHeight / 2,
2435
+ ];
2436
+ const halfCanvasWorldCoordinates = [
2437
+ halfCanvas[0] * canvasToWorldRatio,
2438
+ halfCanvas[1] * canvasToWorldRatio,
2439
+ ];
2440
+ const transform = new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_1__/* .Transform */ .d();
2441
+ transform.scale(dpr, dpr);
2442
+ transform.translate(halfCanvas[0], halfCanvas[1]);
2443
+ transform.scale(worldToCanvasRatio, worldToCanvasRatio);
2444
+ transform.translate(panWorld[0], panWorld[1]);
2445
+ transform.translate(-halfCanvasWorldCoordinates[0], -halfCanvasWorldCoordinates[1]);
2446
+ return transform;
2447
+ }
2448
+ drawGrid(ctx) {
2449
+ const scale = this.channelScale;
2450
+ const pxWidth = this.ecgWidth;
2451
+ const pxHeight = this.ecgHeight;
2452
+ if (scale <= 0) {
2453
+ return;
2454
+ }
2455
+ const MIN_LINE_SPACING = 8;
2456
+ let hGridUnit = 100;
2457
+ while (hGridUnit * scale < MIN_LINE_SPACING) {
2458
+ hGridUnit *= 2;
2459
+ }
2460
+ const minorH = hGridUnit * scale;
2461
+ const majorH = minorH * 5;
2462
+ const minorV = SECONDS_WIDTH / 25;
2463
+ const majorV = SECONDS_WIDTH / 5;
2464
+ ctx.strokeStyle = COLOR_GRID_MINOR;
2465
+ ctx.lineWidth = 0.5;
2466
+ ctx.beginPath();
2467
+ const hLines = Math.floor(pxHeight / minorH);
2468
+ for (let h = 1; h <= hLines; h++) {
2469
+ if (h % 5 !== 0) {
2470
+ const y = h * minorH;
2471
+ ctx.moveTo(0, y);
2472
+ ctx.lineTo(pxWidth, y);
2473
+ }
2474
+ }
2475
+ const vLines = Math.floor(pxWidth / minorV);
2476
+ for (let v = 1; v <= vLines; v++) {
2477
+ if (v % 5 !== 0) {
2478
+ const x = v * minorV;
2479
+ ctx.moveTo(x, 0);
2480
+ ctx.lineTo(x, pxHeight);
2481
+ }
2482
+ }
2483
+ ctx.stroke();
2484
+ ctx.strokeStyle = COLOR_GRID_MAJOR;
2485
+ ctx.lineWidth = 1;
2486
+ ctx.beginPath();
2487
+ const hMajorLines = Math.floor(pxHeight / majorH);
2488
+ for (let h = 1; h <= hMajorLines; h++) {
2489
+ const y = h * majorH;
2490
+ ctx.moveTo(0, y);
2491
+ ctx.lineTo(pxWidth, y);
2492
+ }
2493
+ const vMajorLines = Math.floor(pxWidth / majorV);
2494
+ for (let v = 1; v <= vMajorLines; v++) {
2495
+ const x = v * majorV;
2496
+ ctx.moveTo(x, 0);
2497
+ ctx.lineTo(x, pxHeight);
2498
+ }
2499
+ ctx.stroke();
2500
+ }
2501
+ drawTraces(ctx, layouts) {
2502
+ const scale = this.channelScale;
2503
+ const pxWidth = this.ecgWidth;
2504
+ for (const { channel, baseline } of layouts) {
2505
+ ctx.strokeStyle = COLOR_BASELINE;
2506
+ ctx.lineWidth = 2;
2507
+ ctx.beginPath();
2508
+ ctx.moveTo(0, baseline);
2509
+ ctx.lineTo(pxWidth, baseline);
2510
+ ctx.stroke();
2511
+ ctx.strokeStyle = COLOR_TRACE;
2512
+ ctx.lineWidth = 1;
2513
+ ctx.beginPath();
2514
+ for (let i = 0; i < channel.data.length; i++) {
2515
+ const x = (i * pxWidth) / channel.data.length;
2516
+ const y = baseline - channel.data[i] * scale;
2517
+ if (i === 0) {
2518
+ ctx.moveTo(x, y);
2519
+ }
2520
+ else {
2521
+ ctx.lineTo(x, y);
2522
+ }
2523
+ }
2524
+ ctx.stroke();
2525
+ }
2526
+ }
2527
+ drawLabels(ctx, layouts) {
2528
+ const worldToCanvas = this.getWorldToCanvasRatio();
2529
+ const fontSize = 14 / worldToCanvas;
2530
+ for (const { channel, itemHeight, yOffset } of layouts) {
2531
+ const labelY = yOffset - itemHeight + fontSize;
2532
+ ctx.font = `${fontSize}px monospace`;
2533
+ const textWidth = ctx.measureText(channel.name).width;
2534
+ ctx.fillStyle = COLOR_BACKGROUND;
2535
+ ctx.fillRect(5, labelY - fontSize, textWidth + 4, fontSize + 4);
2536
+ ctx.fillStyle = COLOR_LABEL;
2537
+ ctx.fillText(channel.name, 5, labelY);
2538
+ }
2539
+ }
2540
+ getImageData() {
2541
+ if (!this.waveformData) {
2542
+ return null;
2543
+ }
2544
+ const nSamples = this.waveformData.numberOfSamples;
2545
+ const nChannels = this.waveformData.numberOfChannels;
2546
+ const dimensions = [nSamples, ECG_AMPLITUDE_INDEX_SIZE, nChannels];
2547
+ const spacing = [1, 1, 1];
2548
+ const origin = [0, 0, 0];
2549
+ const direction = [1, 0, 0, 0, 1, 0, 0, 0, 1];
2550
+ const amplitudeOffset = ECG_AMPLITUDE_INDEX_SIZE / 2;
2551
+ const imageData = {
2552
+ getDirection: () => direction,
2553
+ getDimensions: () => dimensions,
2554
+ getRange: () => [0, 1],
2555
+ getSpacing: () => spacing,
2556
+ worldToIndex: (point) => {
2557
+ return [point[0], point[1] + amplitudeOffset, point[2]];
2558
+ },
2559
+ indexToWorld: (point) => {
2560
+ return [point[0], point[1] - amplitudeOffset, point[2]];
2561
+ },
2562
+ };
2563
+ return {
2564
+ dimensions,
2565
+ spacing,
2566
+ origin,
2567
+ direction,
2568
+ imageData,
2569
+ hasPixelSpacing: false,
2570
+ calibration: this.calibration,
2571
+ preScale: { scaled: false },
2572
+ metadata: { Modality: 'ECG' },
2573
+ };
2574
+ }
2575
+ getSliceViewInfo() {
2576
+ throw new Error('Method not implemented for ECG viewport.');
2577
+ }
2578
+ }
2579
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ECGViewport);
2580
+
2581
+
2017
2582
  /***/ },
2018
2583
 
2019
2584
  /***/ 4785
@@ -11695,7 +12260,8 @@ function getAcquisitionPlaneReformatOrientation(imageOrientationPatient) {
11695
12260
  /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__),
11696
12261
  /* harmony export */ Nw: () => (/* binding */ createCanvas),
11697
12262
  /* harmony export */ oI: () => (/* binding */ getOrCreateCanvas),
11698
- /* harmony export */ p8: () => (/* binding */ EPSILON)
12263
+ /* harmony export */ p8: () => (/* binding */ EPSILON),
12264
+ /* harmony export */ zV: () => (/* binding */ updateCanvasSizeAndAspectRatio)
11699
12265
  /* harmony export */ });
11700
12266
  /* unused harmony exports createViewportElement, setCanvasCreator */
11701
12267
  const VIEWPORT_ELEMENT = 'viewport-element';
@@ -11730,6 +12296,32 @@ function createViewportElement(element) {
11730
12296
  function setCanvasCreator(canvasCreatorArg) {
11731
12297
  canvasCreator = canvasCreatorArg;
11732
12298
  }
12299
+ function updateCanvasSizeAndAspectRatio(canvas, extentOrOffscreen) {
12300
+ if (extentOrOffscreen === undefined) {
12301
+ const devicePixelRatio = window.devicePixelRatio || 1;
12302
+ const rect = canvas.getBoundingClientRect();
12303
+ const w = Math.round(rect.width * devicePixelRatio);
12304
+ const h = Math.round(rect.height * devicePixelRatio);
12305
+ if (w > 0 && h > 0) {
12306
+ canvas.width = w;
12307
+ canvas.height = h;
12308
+ canvas.style.aspectRatio = `${w} / ${h}`;
12309
+ }
12310
+ return undefined;
12311
+ }
12312
+ const { width: targetW, height: targetH } = extentOrOffscreen;
12313
+ if (targetW < 1 || targetH < 1) {
12314
+ return false;
12315
+ }
12316
+ const needsUpdate = canvas.width !== targetW || canvas.height !== targetH;
12317
+ if (needsUpdate) {
12318
+ canvas.width = targetW;
12319
+ canvas.height = targetH;
12320
+ canvas.style.aspectRatio = `${targetW} / ${targetH}`;
12321
+ return true;
12322
+ }
12323
+ return false;
12324
+ }
11733
12325
  function getOrCreateCanvas(element) {
11734
12326
  const canvasSelector = `canvas.${CANVAS_CSS_CLASS}`;
11735
12327
  const viewportElement = `div.${VIEWPORT_ELEMENT}`;
@@ -11743,8 +12335,11 @@ function getOrCreateCanvas(element) {
11743
12335
  const devicePixelRatio = window.devicePixelRatio || 1;
11744
12336
  const width = Math.ceil(rect.width * devicePixelRatio);
11745
12337
  const height = Math.ceil(rect.height * devicePixelRatio);
11746
- canvas.width = width;
11747
- canvas.height = height;
12338
+ if (width > 0 && height > 0) {
12339
+ canvas.width = width;
12340
+ canvas.height = height;
12341
+ canvas.style.aspectRatio = `${width} / ${height}`;
12342
+ }
11748
12343
  return canvas;
11749
12344
  }
11750
12345
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getOrCreateCanvas);
@@ -11765,7 +12360,7 @@ __webpack_require__.d(__webpack_exports__, {
11765
12360
  A7: () => (/* reexport */ helpers_setVolumesForViewports)
11766
12361
  });
11767
12362
 
11768
- // UNUSED EXPORTS: EPSILON, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, setCanvasCreator, volumeNewImageEventDispatcher
12363
+ // UNUSED EXPORTS: EPSILON, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, setCanvasCreator, updateCanvasSizeAndAspectRatio, volumeNewImageEventDispatcher
11769
12364
 
11770
12365
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeActor.js + 2 modules
11771
12366
  var createVolumeActor = __webpack_require__(11836);
@@ -12024,6 +12619,8 @@ function _isCurrentImagePTPrescaled(modality, imageVolume) {
12024
12619
  /* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(40893);
12025
12620
  /* harmony import */ var _VideoViewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32501);
12026
12621
  /* harmony import */ var _WSIViewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81466);
12622
+ /* harmony import */ var _ECGViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95307);
12623
+
12027
12624
 
12028
12625
 
12029
12626
 
@@ -12037,6 +12634,7 @@ const viewportTypeToViewportClass = {
12037
12634
  [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.VOLUME_3D]: _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A,
12038
12635
  [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.VIDEO]: _VideoViewport__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A,
12039
12636
  [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.WHOLE_SLIDE]: _WSIViewport__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A,
12637
+ [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ECG]: _ECGViewport__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A,
12040
12638
  };
12041
12639
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (viewportTypeToViewportClass);
12042
12640
 
@@ -12125,7 +12723,7 @@ __webpack_require__.d(__webpack_exports__, {
12125
12723
  PX: () => (/* reexport */ VolumeViewport/* default */.A)
12126
12724
  });
12127
12725
 
12128
- // UNUSED EXPORTS: BaseRenderingEngine, ContextPoolRenderingEngine, EPSILON, RenderingEngine, TiledRenderingEngine, VolumeViewport3D, addImageSlicesToViewports, addVolumesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, default, getOrCreateCanvas, getRenderingEngine, setCanvasCreator, setVolumesForViewports, volumeNewImageEventDispatcher
12726
+ // UNUSED EXPORTS: BaseRenderingEngine, ContextPoolRenderingEngine, EPSILON, RenderingEngine, TiledRenderingEngine, VolumeViewport3D, addImageSlicesToViewports, addVolumesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, default, getOrCreateCanvas, getRenderingEngine, setCanvasCreator, setVolumesForViewports, updateCanvasSizeAndAspectRatio, volumeNewImageEventDispatcher
12129
12727
 
12130
12728
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/init.js + 2 modules
12131
12729
  var init = __webpack_require__(26896);
@@ -12296,6 +12894,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12296
12894
  const viewportsDrivenByVtkJs = viewports.filter((vp) => (0,viewportTypeUsesCustomRenderingPipeline/* default */.A)(vp.type) === false);
12297
12895
  const canvasesDrivenByVtkJs = viewportsDrivenByVtkJs.map((vp) => vp.canvas);
12298
12896
  const canvas = (0,getOrCreateCanvas/* default */.Ay)(viewportInputEntry.element);
12897
+ (0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas);
12299
12898
  canvasesDrivenByVtkJs.push(canvas);
12300
12899
  const internalViewportEntry = { ...viewportInputEntry, canvas };
12301
12900
  this.addVtkjsDrivenViewport(internalViewportEntry);
@@ -12362,12 +12961,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12362
12961
  setVtkjsDrivenViewports(viewportInputEntries) {
12363
12962
  if (viewportInputEntries.length) {
12364
12963
  const vtkDrivenCanvases = viewportInputEntries.map((vp) => (0,getOrCreateCanvas/* default */.Ay)(vp.element));
12365
- vtkDrivenCanvases.forEach((canvas) => {
12366
- const devicePixelRatio = window.devicePixelRatio || 1;
12367
- const rect = canvas.getBoundingClientRect();
12368
- canvas.width = rect.width * devicePixelRatio;
12369
- canvas.height = rect.height * devicePixelRatio;
12370
- });
12964
+ vtkDrivenCanvases.forEach((canvas) => (0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas));
12371
12965
  for (let i = 0; i < viewportInputEntries.length; i++) {
12372
12966
  const vtkDrivenViewportInputEntry = viewportInputEntries[i];
12373
12967
  const canvas = vtkDrivenCanvases[i];
@@ -12380,15 +12974,39 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12380
12974
  }
12381
12975
  }
12382
12976
  _resizeVTKViewports(vtkDrivenViewports, keepCamera = true, immediate = true) {
12383
- const canvasesDrivenByVtkJs = vtkDrivenViewports.map((vp) => {
12384
- return (0,getOrCreateCanvas/* default */.Ay)(vp.element);
12385
- });
12386
- canvasesDrivenByVtkJs.forEach((canvas) => {
12387
- const devicePixelRatio = window.devicePixelRatio || 1;
12388
- canvas.width = canvas.clientWidth * devicePixelRatio;
12389
- canvas.height = canvas.clientHeight * devicePixelRatio;
12390
- });
12391
- if (canvasesDrivenByVtkJs.length) {
12977
+ const devicePixelRatio = window.devicePixelRatio || 1;
12978
+ const viewportsNeedingResize = [];
12979
+ for (const vp of vtkDrivenViewports) {
12980
+ const canvas = (0,getOrCreateCanvas/* default */.Ay)(vp.element);
12981
+ const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio);
12982
+ const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio);
12983
+ if (displayedWidth === 0 || displayedHeight === 0) {
12984
+ continue;
12985
+ }
12986
+ const renderedWidth = canvas.width;
12987
+ const renderedHeight = canvas.height;
12988
+ if (displayedWidth === renderedWidth &&
12989
+ displayedHeight === renderedHeight) {
12990
+ continue;
12991
+ }
12992
+ viewportsNeedingResize.push(vp);
12993
+ }
12994
+ if (viewportsNeedingResize.length === 0) {
12995
+ return;
12996
+ }
12997
+ if (this._animationFrameSet) {
12998
+ return;
12999
+ }
13000
+ for (const vp of viewportsNeedingResize) {
13001
+ const canvas = (0,getOrCreateCanvas/* default */.Ay)(vp.element);
13002
+ const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio);
13003
+ const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio);
13004
+ const targetWidth = Math.max(BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i, displayedWidth);
13005
+ const targetHeight = Math.max(BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i, displayedHeight);
13006
+ vp.sWidth = targetWidth;
13007
+ vp.sHeight = targetHeight;
13008
+ }
13009
+ if (vtkDrivenViewports.length) {
12392
13010
  this._resize(vtkDrivenViewports);
12393
13011
  }
12394
13012
  vtkDrivenViewports.forEach((vp) => {
@@ -12430,6 +13048,10 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12430
13048
  return eventDetail;
12431
13049
  }
12432
13050
  _renderViewportWithContext(viewport, offscreenMultiRenderWindow, offScreenCanvasContainer) {
13051
+ if (viewport.canvas.clientWidth === 0 ||
13052
+ viewport.canvas.clientHeight === 0) {
13053
+ return;
13054
+ }
12433
13055
  if (viewport.sWidth < BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i ||
12434
13056
  viewport.sHeight < BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i) {
12435
13057
  console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
@@ -12459,8 +13081,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12459
13081
  const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id);
12460
13082
  const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id);
12461
13083
  const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
12462
- const viewportWidth = viewport.canvas.width;
12463
- const viewportHeight = viewport.canvas.height;
13084
+ const viewportWidth = viewport.sWidth;
13085
+ const viewportHeight = viewport.sHeight;
12464
13086
  const xEnd = Math.min(1, viewportWidth / maxSize.width);
12465
13087
  const yEnd = Math.min(1, viewportHeight / maxSize.height);
12466
13088
  renderer.setViewport(0, 0, xEnd, yEnd);
@@ -12494,7 +13116,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12494
13116
  if (contextIndex === undefined) {
12495
13117
  return;
12496
13118
  }
12497
- const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.canvas.width, viewport.canvas.height);
13119
+ const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight);
12498
13120
  if (!maxSizeChanged) {
12499
13121
  return;
12500
13122
  }
@@ -12509,7 +13131,9 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12509
13131
  }
12510
13132
  _copyToOnscreenCanvas(viewport, offScreenCanvas) {
12511
13133
  const { element, canvas, id: viewportId, renderingEngineId, suppressEvents, } = viewport;
12512
- const { width: dWidth, height: dHeight } = canvas;
13134
+ const dWidth = viewport.sWidth;
13135
+ const dHeight = viewport.sHeight;
13136
+ (0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas, { width: dWidth, height: dHeight });
12513
13137
  const onScreenContext = canvas.getContext('2d');
12514
13138
  const contextIndex = this.contextPool.getContextIndexForViewport(viewportId);
12515
13139
  const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
@@ -12528,10 +13152,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12528
13152
  for (const viewport of viewportsDrivenByVtkJs) {
12529
13153
  viewport.sx = 0;
12530
13154
  viewport.sy = 0;
12531
- viewport.sWidth = viewport.canvas.width;
12532
- viewport.sHeight = viewport.canvas.height;
12533
13155
  const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id);
12534
- const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.canvas.width, viewport.canvas.height);
13156
+ const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight);
12535
13157
  if (maxSizeChanged) {
12536
13158
  contextsToResize.add(contextIndex);
12537
13159
  }
@@ -12539,8 +13161,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
12539
13161
  const { context: offscreenMultiRenderWindow } = contextData;
12540
13162
  const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id);
12541
13163
  const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
12542
- const xEnd = Math.min(1, viewport.canvas.width / maxSize.width);
12543
- const yEnd = Math.min(1, viewport.canvas.height / maxSize.height);
13164
+ const xEnd = Math.min(1, viewport.sWidth / maxSize.width);
13165
+ const yEnd = Math.min(1, viewport.sHeight / maxSize.height);
12544
13166
  renderer.setViewport(0, 0, xEnd, yEnd);
12545
13167
  }
12546
13168
  contextsToResize.forEach((contextIndex) => {
@@ -24251,6 +24873,7 @@ var MetadataModules;
24251
24873
  MetadataModules["PET_SERIES"] = "petSeriesModule";
24252
24874
  MetadataModules["SOP_COMMON"] = "sopCommonModule";
24253
24875
  MetadataModules["ULTRASOUND_ENHANCED_REGION"] = "ultrasoundEnhancedRegionModule";
24876
+ MetadataModules["ECG"] = "ecgModule";
24254
24877
  MetadataModules["VOI_LUT"] = "voiLutModule";
24255
24878
  MetadataModules["FRAME_MODULE"] = "frameModule";
24256
24879
  MetadataModules["WADO_WEB_CLIENT"] = "wadoWebClient";
@@ -24401,6 +25024,7 @@ var ViewportType;
24401
25024
  ViewportType["VOLUME_3D"] = "volume3d";
24402
25025
  ViewportType["VIDEO"] = "video";
24403
25026
  ViewportType["WHOLE_SLIDE"] = "wholeSlide";
25027
+ ViewportType["ECG"] = "ecg";
24404
25028
  })(ViewportType || (ViewportType = {}));
24405
25029
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewportType);
24406
25030
 
@@ -35684,7 +36308,7 @@ function uuidv4() {
35684
36308
 
35685
36309
  "use strict";
35686
36310
  /* unused harmony export version */
35687
- const version = '4.17.2';
36311
+ const version = '4.18.2';
35688
36312
 
35689
36313
 
35690
36314
  /***/ },