@ohif/app 3.13.0-beta.24 → 3.13.0-beta.26
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.
- package/dist/{3081.bundle.9342d2003030eb3c9541.js → 3081.bundle.3d1e707778f5869e8872.js} +23 -5
- package/dist/{4287.bundle.c6bd6cf991e2dae32044.js → 4287.bundle.d2d09ffd5cd8680fad8d.js} +4 -4
- package/dist/{6280.bundle.828ccda61aa5c83408a5.js → 6280.bundle.081861b7e685b28616c8.js} +406 -156
- package/dist/{6386.bundle.d1be64fd274877e918d9.js → 6386.bundle.c0618e49b65769ddf752.js} +30 -8
- package/dist/{7537.bundle.5a26371cf1368d0e5cf2.js → 7537.bundle.1a18959ceec98634bc48.js} +654 -30
- package/dist/{9195.bundle.a49c44d839f09c1190c1.js → 9195.bundle.5a1973df57059bc8dc68.js} +2 -2
- package/dist/{9205.bundle.a37976b4f3ded2cbb2ab.js → 9205.bundle.09c52845b43bd8513d50.js} +401 -155
- package/dist/{app.bundle.000d2cfe6893ffbe84b7.js → app.bundle.62a1aba454cfbd708929.js} +895 -35
- package/dist/{compute.bundle.0fa6bd11224eb79e7474.js → compute.bundle.6016de6e5f7c25749422.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.f15c8d2cc2559db627cf.js → polySeg.bundle.cdcc2c3d11009ccf112c.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +21 -21
- /package/dist/{1459.bundle.5b7a328ae89a35622205.js → 1459.bundle.78c0d3f68c7bf270e668.js} +0 -0
- /package/dist/{147.bundle.15c3dffbc73dab1085f5.js → 147.bundle.9c245011849e09bd7904.js} +0 -0
- /package/dist/{1933.bundle.1d1345d08f29ad45a14b.js → 1933.bundle.ff45b34115749da319d2.js} +0 -0
- /package/dist/{2018.bundle.d6cdff8149ad69a965cc.js → 2018.bundle.b9d2ac618c23377cb6cd.js} +0 -0
- /package/dist/{2075.bundle.a9783d07b48ca241486e.js → 2075.bundle.16215ba94d714a1c905f.js} +0 -0
- /package/dist/{213.bundle.393be8a0d3a201634ac1.js → 213.bundle.39a9594920f69cf117c6.js} +0 -0
- /package/dist/{2424.bundle.f18df7bc54510ab32a35.js → 2424.bundle.d867beac3dc2f248ff98.js} +0 -0
- /package/dist/{3138.bundle.79170d908a4106874093.js → 3138.bundle.e25464a30fe01479228a.js} +0 -0
- /package/dist/{3461.bundle.9502d3707ecc5d0323c1.js → 3461.bundle.2aa5281a8cc683555852.js} +0 -0
- /package/dist/{4507.bundle.8969b09dd3f576cddfcf.js → 4507.bundle.601f253b00068ad2f069.js} +0 -0
- /package/dist/{4819.bundle.e581d194b62f08c4eb77.js → 4819.bundle.c4b011e10d490b51636c.js} +0 -0
- /package/dist/{5015.bundle.81781390053c546e29be.js → 5015.bundle.cb3361fcdff254ae2cb7.js} +0 -0
- /package/dist/{5028.bundle.9e63b5082d8856ee41d3.js → 5028.bundle.ffc3a7161b888b6fd0b0.js} +0 -0
- /package/dist/{5457.bundle.7bd5092726bacbd503aa.js → 5457.bundle.83e615e3bd63f68a3c5c.js} +0 -0
- /package/dist/{5485.bundle.334868b4aca965dfacf5.js → 5485.bundle.392fae4541d15edf92cf.js} +0 -0
- /package/dist/{5802.bundle.70600f8f701ac920b932.js → 5802.bundle.70d423c8b488cc56cc36.js} +0 -0
- /package/dist/{581.bundle.2bb402f7316b6e8c735b.js → 581.bundle.b70e5d2d0f3958df69f0.js} +0 -0
- /package/dist/{6027.bundle.ac07b32905cbdd321fb5.js → 6027.bundle.de9008a750326fb298b5.js} +0 -0
- /package/dist/{7431.bundle.8ddbd21f7b2b8528a14a.js → 7431.bundle.84b3d88ef94b97c84298.js} +0 -0
- /package/dist/{7639.bundle.78557dd05ae0f5511807.js → 7639.bundle.4b2f5183bb9f9eac3214.js} +0 -0
- /package/dist/{8305.bundle.301fbc7d0a3183da4f42.js → 8305.bundle.a1c83d47b477b2d67008.js} +0 -0
- /package/dist/{8499.bundle.f8ea964333994b9ff842.js → 8499.bundle.9398ee8f733b93220248.js} +0 -0
- /package/dist/{85.bundle.058fe8907052935c7ff9.js → 85.bundle.d5ec46ba8fc649b50106.js} +0 -0
- /package/dist/{8558.bundle.7be97925dbf90ed792f9.js → 8558.bundle.26dd566d92fc189baa48.js} +0 -0
- /package/dist/{8583.bundle.93f05da9435c53fa229b.js → 8583.bundle.82a7c9293ae0b8e396d9.js} +0 -0
- /package/dist/{933.bundle.a6220d057519db0b7651.js → 933.bundle.ea9db108b8a4e3d51904.js} +0 -0
- /package/dist/{9862.bundle.4704bce0c5b039dfdec3.js → 9862.bundle.126a8a8c84421a076527.js} +0 -0
- /package/dist/{9927.bundle.9e5cecd52ac87d90649e.js → 9927.bundle.2d2dd3bd5ee63121a527.js} +0 -0
|
@@ -5700,6 +5700,571 @@ function isCompatible(viewPlaneNormal, vector) {
|
|
|
5700
5700
|
/* harmony default export */ const RenderingEngine_BaseVolumeViewport = (BaseVolumeViewport);
|
|
5701
5701
|
|
|
5702
5702
|
|
|
5703
|
+
/***/ },
|
|
5704
|
+
|
|
5705
|
+
/***/ 95307
|
|
5706
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5707
|
+
|
|
5708
|
+
"use strict";
|
|
5709
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5710
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
5711
|
+
/* harmony export */ });
|
|
5712
|
+
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71851);
|
|
5713
|
+
/* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45354);
|
|
5714
|
+
/* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69372);
|
|
5715
|
+
/* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10056);
|
|
5716
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(40661);
|
|
5717
|
+
/* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74876);
|
|
5718
|
+
|
|
5719
|
+
|
|
5720
|
+
|
|
5721
|
+
|
|
5722
|
+
|
|
5723
|
+
|
|
5724
|
+
const SECONDS_WIDTH = 150;
|
|
5725
|
+
const CHANNEL_SPACING = 5;
|
|
5726
|
+
const ECG_AMPLITUDE_INDEX_SIZE = 65536;
|
|
5727
|
+
const COLOR_GRID_MAJOR = '#7f0000';
|
|
5728
|
+
const COLOR_GRID_MINOR = '#3f0000';
|
|
5729
|
+
const COLOR_BASELINE = '#7F4C00';
|
|
5730
|
+
const COLOR_TRACE = '#ffffff';
|
|
5731
|
+
const COLOR_LABEL = '#ffff00';
|
|
5732
|
+
const COLOR_BACKGROUND = '#000000';
|
|
5733
|
+
function computeMinMax(data) {
|
|
5734
|
+
let min = 0;
|
|
5735
|
+
let max = 0;
|
|
5736
|
+
for (let i = 0; i < data.length; i++) {
|
|
5737
|
+
if (data[i] < min) {
|
|
5738
|
+
min = data[i];
|
|
5739
|
+
}
|
|
5740
|
+
if (data[i] > max) {
|
|
5741
|
+
max = data[i];
|
|
5742
|
+
}
|
|
5743
|
+
}
|
|
5744
|
+
return { min, max };
|
|
5745
|
+
}
|
|
5746
|
+
class ECGViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A {
|
|
5747
|
+
constructor(props) {
|
|
5748
|
+
super({
|
|
5749
|
+
...props,
|
|
5750
|
+
canvas: props.canvas || (0,_helpers__WEBPACK_IMPORTED_MODULE_4__/* .getOrCreateCanvas */ .oI)(props.element),
|
|
5751
|
+
});
|
|
5752
|
+
this.imageId = null;
|
|
5753
|
+
this.channels = [];
|
|
5754
|
+
this.waveformData = null;
|
|
5755
|
+
this.ecgWidth = 0;
|
|
5756
|
+
this.ecgHeight = 0;
|
|
5757
|
+
this.channelScale = 0;
|
|
5758
|
+
this.ecgCamera = {
|
|
5759
|
+
panWorld: [0, 0],
|
|
5760
|
+
parallelScale: 1,
|
|
5761
|
+
};
|
|
5762
|
+
this.getProperties = () => {
|
|
5763
|
+
return {
|
|
5764
|
+
visibleChannels: this.channels
|
|
5765
|
+
.map((ch, i) => (ch.visible ? i : -1))
|
|
5766
|
+
.filter((i) => i >= 0),
|
|
5767
|
+
};
|
|
5768
|
+
};
|
|
5769
|
+
this.resetCamera = () => {
|
|
5770
|
+
this.refreshRenderValues();
|
|
5771
|
+
this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
5772
|
+
this.renderFrame();
|
|
5773
|
+
return true;
|
|
5774
|
+
};
|
|
5775
|
+
this.getFrameOfReferenceUID = () => {
|
|
5776
|
+
return `ecg-viewport-${this.id}`;
|
|
5777
|
+
};
|
|
5778
|
+
this.resize = () => {
|
|
5779
|
+
const canvas = this.canvas;
|
|
5780
|
+
const { clientWidth, clientHeight } = canvas;
|
|
5781
|
+
if (canvas.width !== clientWidth || canvas.height !== clientHeight) {
|
|
5782
|
+
canvas.width = clientWidth;
|
|
5783
|
+
canvas.height = clientHeight;
|
|
5784
|
+
}
|
|
5785
|
+
if (this.waveformData) {
|
|
5786
|
+
this.computeChannelScale();
|
|
5787
|
+
this.recalculateHeight();
|
|
5788
|
+
}
|
|
5789
|
+
this.refreshRenderValues();
|
|
5790
|
+
this.renderFrame();
|
|
5791
|
+
};
|
|
5792
|
+
this.canvasToWorld = (canvasPos, destPos = [0, 0, 0]) => {
|
|
5793
|
+
if (!this.waveformData) {
|
|
5794
|
+
destPos[0] = 0;
|
|
5795
|
+
destPos[1] = 0;
|
|
5796
|
+
destPos[2] = 0;
|
|
5797
|
+
return destPos;
|
|
5798
|
+
}
|
|
5799
|
+
const scale = this.getWorldToCanvasRatio();
|
|
5800
|
+
const pan = this.ecgCamera.panWorld;
|
|
5801
|
+
const layouts = this.computeChannelLayouts();
|
|
5802
|
+
const subCanvasPos = [
|
|
5803
|
+
canvasPos[0] / scale - pan[0],
|
|
5804
|
+
canvasPos[1] / scale - pan[1],
|
|
5805
|
+
];
|
|
5806
|
+
let z = 0;
|
|
5807
|
+
for (let i = 0; i < layouts.length; i++) {
|
|
5808
|
+
const layout = layouts[i];
|
|
5809
|
+
if (subCanvasPos[1] <= layout.yOffset) {
|
|
5810
|
+
z = i;
|
|
5811
|
+
break;
|
|
5812
|
+
}
|
|
5813
|
+
if (i === layouts.length - 1) {
|
|
5814
|
+
z = i;
|
|
5815
|
+
}
|
|
5816
|
+
}
|
|
5817
|
+
const x = Math.max(0, Math.min(this.waveformData.numberOfSamples - 1, (subCanvasPos[0] * this.waveformData.numberOfSamples) / this.ecgWidth));
|
|
5818
|
+
const layout = layouts[z];
|
|
5819
|
+
const y = (layout.baseline - subCanvasPos[1]) / this.channelScale;
|
|
5820
|
+
destPos[0] = x;
|
|
5821
|
+
destPos[1] = y;
|
|
5822
|
+
destPos[2] = z;
|
|
5823
|
+
return destPos;
|
|
5824
|
+
};
|
|
5825
|
+
this.worldToCanvas = (worldPos) => {
|
|
5826
|
+
if (!this.waveformData) {
|
|
5827
|
+
return [0, 0];
|
|
5828
|
+
}
|
|
5829
|
+
const scale = this.getWorldToCanvasRatio();
|
|
5830
|
+
const pan = this.ecgCamera.panWorld;
|
|
5831
|
+
const layouts = this.computeChannelLayouts();
|
|
5832
|
+
const z = Math.round(worldPos[2]);
|
|
5833
|
+
if (z < 0 || z >= layouts.length) {
|
|
5834
|
+
return [0, 0];
|
|
5835
|
+
}
|
|
5836
|
+
const layout = layouts[z];
|
|
5837
|
+
const canvasX = (worldPos[0] / this.waveformData.numberOfSamples) *
|
|
5838
|
+
this.ecgWidth *
|
|
5839
|
+
scale +
|
|
5840
|
+
pan[0] * scale;
|
|
5841
|
+
const canvasY = (layout.baseline - worldPos[1] * this.channelScale) * scale +
|
|
5842
|
+
pan[1] * scale;
|
|
5843
|
+
return [canvasX, canvasY];
|
|
5844
|
+
};
|
|
5845
|
+
this.getRotation = () => 0;
|
|
5846
|
+
this.getNumberOfSlices = () => {
|
|
5847
|
+
return 1;
|
|
5848
|
+
};
|
|
5849
|
+
this.getCurrentImageIdIndex = () => {
|
|
5850
|
+
return 0;
|
|
5851
|
+
};
|
|
5852
|
+
this.getCurrentImageId = () => {
|
|
5853
|
+
return this.imageId;
|
|
5854
|
+
};
|
|
5855
|
+
this.getSliceIndex = () => {
|
|
5856
|
+
return 0;
|
|
5857
|
+
};
|
|
5858
|
+
this.getImageIds = () => {
|
|
5859
|
+
return this.imageId ? [this.imageId] : [];
|
|
5860
|
+
};
|
|
5861
|
+
this.scroll = () => {
|
|
5862
|
+
};
|
|
5863
|
+
this.customRenderViewportToCanvas = () => {
|
|
5864
|
+
this.renderFrame();
|
|
5865
|
+
};
|
|
5866
|
+
this.renderFrame = () => {
|
|
5867
|
+
if (!this.waveformData) {
|
|
5868
|
+
return;
|
|
5869
|
+
}
|
|
5870
|
+
const dpr = window.devicePixelRatio || 1;
|
|
5871
|
+
const transform = this.getTransform();
|
|
5872
|
+
const m = transform.getMatrix();
|
|
5873
|
+
const ctx = this.canvasContext;
|
|
5874
|
+
ctx.resetTransform();
|
|
5875
|
+
ctx.fillStyle = COLOR_BACKGROUND;
|
|
5876
|
+
ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
5877
|
+
ctx.setTransform(m[0] / dpr, m[1] / dpr, m[2] / dpr, m[3] / dpr, m[4] / dpr, m[5] / dpr);
|
|
5878
|
+
const layouts = this.computeChannelLayouts();
|
|
5879
|
+
this.drawGrid(ctx);
|
|
5880
|
+
this.drawTraces(ctx, layouts);
|
|
5881
|
+
this.drawLabels(ctx, layouts);
|
|
5882
|
+
ctx.resetTransform();
|
|
5883
|
+
(0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(this.element, _enums__WEBPACK_IMPORTED_MODULE_0__.Events.IMAGE_RENDERED, {
|
|
5884
|
+
element: this.element,
|
|
5885
|
+
viewportId: this.id,
|
|
5886
|
+
viewport: this,
|
|
5887
|
+
renderingEngineId: this.renderingEngineId,
|
|
5888
|
+
});
|
|
5889
|
+
};
|
|
5890
|
+
this.getMiddleSliceData = () => {
|
|
5891
|
+
throw new Error('Method not implemented for ECG viewport.');
|
|
5892
|
+
};
|
|
5893
|
+
this.canvasContext = this.canvas.getContext('2d');
|
|
5894
|
+
this.renderingEngineId = props.renderingEngineId;
|
|
5895
|
+
this.element.setAttribute('data-viewport-uid', this.id);
|
|
5896
|
+
this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId);
|
|
5897
|
+
this.addEventListeners();
|
|
5898
|
+
this.resize();
|
|
5899
|
+
}
|
|
5900
|
+
static get useCustomRenderingPipeline() {
|
|
5901
|
+
return true;
|
|
5902
|
+
}
|
|
5903
|
+
addEventListeners() {
|
|
5904
|
+
this.canvas.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_0__.Events.ELEMENT_DISABLED, this.elementDisabledHandler);
|
|
5905
|
+
}
|
|
5906
|
+
removeEventListeners() {
|
|
5907
|
+
this.canvas.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_0__.Events.ELEMENT_DISABLED, this.elementDisabledHandler);
|
|
5908
|
+
}
|
|
5909
|
+
elementDisabledHandler() {
|
|
5910
|
+
this.removeEventListeners();
|
|
5911
|
+
}
|
|
5912
|
+
async setEcg(imageId) {
|
|
5913
|
+
this.imageId = imageId;
|
|
5914
|
+
const ecgModule = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_0__.MetadataModules.ECG, imageId);
|
|
5915
|
+
if (!ecgModule?.waveformData?.retrieveBulkData) {
|
|
5916
|
+
throw new Error(`[ECGViewport] No ECG waveform data for imageId: ${imageId}`);
|
|
5917
|
+
}
|
|
5918
|
+
const { numberOfWaveformChannels: numberOfChannels, numberOfWaveformSamples: numberOfSamples, samplingFrequency, waveformBitsAllocated: bitsAllocated = 16, waveformSampleInterpretation: sampleInterpretation = 'SS', multiplexGroupLabel, channelDefinitionSequence: channelDefinitions = [], } = ecgModule;
|
|
5919
|
+
const channelArrays = await ecgModule.waveformData.retrieveBulkData();
|
|
5920
|
+
this.channels = [];
|
|
5921
|
+
for (let i = 0; i < numberOfChannels; i++) {
|
|
5922
|
+
const channelDef = channelDefinitions[i] || {};
|
|
5923
|
+
const name = channelDef.channelSourceSequence?.codeMeaning ||
|
|
5924
|
+
channelDef.ChannelSourceSequence?.CodeMeaning ||
|
|
5925
|
+
`Channel ${i + 1}`;
|
|
5926
|
+
const data = channelArrays[i] || new Int16Array(0);
|
|
5927
|
+
const { min, max } = computeMinMax(data);
|
|
5928
|
+
this.channels.push({ name, data, visible: true, min, max });
|
|
5929
|
+
}
|
|
5930
|
+
this.waveformData = {
|
|
5931
|
+
channels: this.channels,
|
|
5932
|
+
numberOfChannels,
|
|
5933
|
+
numberOfSamples,
|
|
5934
|
+
samplingFrequency,
|
|
5935
|
+
bitsAllocated,
|
|
5936
|
+
sampleInterpretation,
|
|
5937
|
+
multiplexGroupLabel,
|
|
5938
|
+
};
|
|
5939
|
+
this.calibration = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_0__.MetadataModules.CALIBRATION, imageId);
|
|
5940
|
+
this.ecgWidth = Math.ceil((numberOfSamples * SECONDS_WIDTH) / samplingFrequency);
|
|
5941
|
+
this.computeChannelScale();
|
|
5942
|
+
this.recalculateHeight();
|
|
5943
|
+
this.refreshRenderValues();
|
|
5944
|
+
this.renderFrame();
|
|
5945
|
+
}
|
|
5946
|
+
setChannelVisibility(index, visible) {
|
|
5947
|
+
if (index >= 0 && index < this.channels.length) {
|
|
5948
|
+
this.channels[index].visible = visible;
|
|
5949
|
+
this.computeChannelScale();
|
|
5950
|
+
this.recalculateHeight();
|
|
5951
|
+
this.refreshRenderValues();
|
|
5952
|
+
this.renderFrame();
|
|
5953
|
+
}
|
|
5954
|
+
}
|
|
5955
|
+
getVisibleChannels() {
|
|
5956
|
+
return this.channels.map((ch) => ({
|
|
5957
|
+
name: ch.name,
|
|
5958
|
+
visible: ch.visible,
|
|
5959
|
+
}));
|
|
5960
|
+
}
|
|
5961
|
+
getWaveformData() {
|
|
5962
|
+
return this.waveformData;
|
|
5963
|
+
}
|
|
5964
|
+
getContentDimensions() {
|
|
5965
|
+
return { width: this.ecgWidth, height: this.ecgHeight };
|
|
5966
|
+
}
|
|
5967
|
+
computeChannelScale() {
|
|
5968
|
+
const visibleChannels = this.channels.filter((c) => c.visible && c.data.length > 0);
|
|
5969
|
+
if (visibleChannels.length === 0 || this.ecgWidth === 0) {
|
|
5970
|
+
this.channelScale = 0;
|
|
5971
|
+
return;
|
|
5972
|
+
}
|
|
5973
|
+
let maxRange = 1;
|
|
5974
|
+
for (const channel of visibleChannels) {
|
|
5975
|
+
const range = channel.max - channel.min;
|
|
5976
|
+
maxRange = Math.max(maxRange, range);
|
|
5977
|
+
}
|
|
5978
|
+
const canvasAspect = this.canvas.offsetHeight && this.canvas.offsetWidth
|
|
5979
|
+
? this.canvas.offsetHeight / this.canvas.offsetWidth
|
|
5980
|
+
: 2 / 3;
|
|
5981
|
+
const targetTotalHeight = this.ecgWidth * canvasAspect;
|
|
5982
|
+
const totalSpacing = CHANNEL_SPACING * visibleChannels.length;
|
|
5983
|
+
const heightPerChannel = (targetTotalHeight - totalSpacing) / visibleChannels.length;
|
|
5984
|
+
this.channelScale = heightPerChannel / (maxRange * 1.25);
|
|
5985
|
+
}
|
|
5986
|
+
recalculateHeight() {
|
|
5987
|
+
const scale = this.channelScale;
|
|
5988
|
+
let totalHeight = 0;
|
|
5989
|
+
for (const channel of this.channels) {
|
|
5990
|
+
if (!channel.visible || channel.data.length === 0) {
|
|
5991
|
+
continue;
|
|
5992
|
+
}
|
|
5993
|
+
const itemHeight = (channel.max - channel.min) * scale * 1.25;
|
|
5994
|
+
totalHeight += itemHeight + CHANNEL_SPACING;
|
|
5995
|
+
}
|
|
5996
|
+
this.ecgHeight = totalHeight;
|
|
5997
|
+
}
|
|
5998
|
+
computeChannelLayouts() {
|
|
5999
|
+
const scale = this.channelScale;
|
|
6000
|
+
const layouts = [];
|
|
6001
|
+
let yOffset = 0;
|
|
6002
|
+
for (const channel of this.channels) {
|
|
6003
|
+
if (!channel.visible || channel.data.length === 0) {
|
|
6004
|
+
continue;
|
|
6005
|
+
}
|
|
6006
|
+
const itemHeight = (channel.max - channel.min) * scale * 1.25;
|
|
6007
|
+
yOffset += itemHeight + CHANNEL_SPACING;
|
|
6008
|
+
const baseline = yOffset + channel.min * scale;
|
|
6009
|
+
layouts.push({ channel, itemHeight, yOffset, baseline });
|
|
6010
|
+
}
|
|
6011
|
+
return layouts;
|
|
6012
|
+
}
|
|
6013
|
+
setProperties(props) {
|
|
6014
|
+
if (props.visibleChannels !== undefined) {
|
|
6015
|
+
for (let i = 0; i < this.channels.length; i++) {
|
|
6016
|
+
this.channels[i].visible = props.visibleChannels.includes(i);
|
|
6017
|
+
}
|
|
6018
|
+
this.computeChannelScale();
|
|
6019
|
+
this.recalculateHeight();
|
|
6020
|
+
this.refreshRenderValues();
|
|
6021
|
+
this.renderFrame();
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
6024
|
+
resetProperties() {
|
|
6025
|
+
for (const channel of this.channels) {
|
|
6026
|
+
channel.visible = true;
|
|
6027
|
+
}
|
|
6028
|
+
this.computeChannelScale();
|
|
6029
|
+
this.recalculateHeight();
|
|
6030
|
+
this.refreshRenderValues();
|
|
6031
|
+
this.renderFrame();
|
|
6032
|
+
}
|
|
6033
|
+
setCamera(camera) {
|
|
6034
|
+
const { parallelScale, focalPoint } = camera;
|
|
6035
|
+
if (parallelScale) {
|
|
6036
|
+
this.ecgCamera.parallelScale =
|
|
6037
|
+
this.element.clientHeight / 2 / parallelScale;
|
|
6038
|
+
}
|
|
6039
|
+
if (focalPoint !== undefined) {
|
|
6040
|
+
const focalPointCanvas = this.worldToCanvas(focalPoint);
|
|
6041
|
+
const canvasCenter = [
|
|
6042
|
+
this.element.clientWidth / 2,
|
|
6043
|
+
this.element.clientHeight / 2,
|
|
6044
|
+
];
|
|
6045
|
+
const panWorldDelta = [
|
|
6046
|
+
(focalPointCanvas[0] - canvasCenter[0]) / this.ecgCamera.parallelScale,
|
|
6047
|
+
(focalPointCanvas[1] - canvasCenter[1]) / this.ecgCamera.parallelScale,
|
|
6048
|
+
];
|
|
6049
|
+
this.ecgCamera.panWorld = [
|
|
6050
|
+
this.ecgCamera.panWorld[0] - panWorldDelta[0],
|
|
6051
|
+
this.ecgCamera.panWorld[1] - panWorldDelta[1],
|
|
6052
|
+
];
|
|
6053
|
+
}
|
|
6054
|
+
this.canvasContext.fillStyle = COLOR_BACKGROUND;
|
|
6055
|
+
this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
6056
|
+
this.renderFrame();
|
|
6057
|
+
}
|
|
6058
|
+
getCamera() {
|
|
6059
|
+
const { parallelScale } = this.ecgCamera;
|
|
6060
|
+
const canvasCenter = [
|
|
6061
|
+
this.element.clientWidth / 2,
|
|
6062
|
+
this.element.clientHeight / 2,
|
|
6063
|
+
];
|
|
6064
|
+
const canvasCenterWorld = this.canvasToWorld(canvasCenter);
|
|
6065
|
+
return {
|
|
6066
|
+
parallelProjection: true,
|
|
6067
|
+
focalPoint: canvasCenterWorld,
|
|
6068
|
+
position: [0, 0, 0],
|
|
6069
|
+
viewUp: [0, -1, 0],
|
|
6070
|
+
parallelScale: this.element.clientHeight / 2 / parallelScale,
|
|
6071
|
+
viewPlaneNormal: [0, 0, 1],
|
|
6072
|
+
};
|
|
6073
|
+
}
|
|
6074
|
+
getPan() {
|
|
6075
|
+
const panWorld = this.ecgCamera.panWorld;
|
|
6076
|
+
return [panWorld[0], panWorld[1]];
|
|
6077
|
+
}
|
|
6078
|
+
getViewReferenceId(_specifier) {
|
|
6079
|
+
return `imageId:${this.imageId}`;
|
|
6080
|
+
}
|
|
6081
|
+
hasImageURI(imageURI) {
|
|
6082
|
+
return this.imageId?.includes(imageURI) ?? false;
|
|
6083
|
+
}
|
|
6084
|
+
isReferenceViewable(viewRef) {
|
|
6085
|
+
if (viewRef.FrameOfReferenceUID &&
|
|
6086
|
+
viewRef.FrameOfReferenceUID !== this.getFrameOfReferenceUID()) {
|
|
6087
|
+
return false;
|
|
6088
|
+
}
|
|
6089
|
+
return true;
|
|
6090
|
+
}
|
|
6091
|
+
updateCameraClippingPlanesAndRange() {
|
|
6092
|
+
}
|
|
6093
|
+
refreshRenderValues() {
|
|
6094
|
+
if (!this.ecgWidth || !this.ecgHeight) {
|
|
6095
|
+
return;
|
|
6096
|
+
}
|
|
6097
|
+
let worldToCanvasRatio = this.canvas.offsetWidth / this.ecgWidth;
|
|
6098
|
+
if (this.ecgHeight * worldToCanvasRatio > this.canvas.offsetHeight) {
|
|
6099
|
+
worldToCanvasRatio = this.canvas.offsetHeight / this.ecgHeight;
|
|
6100
|
+
}
|
|
6101
|
+
const drawWidth = Math.floor(this.ecgWidth * worldToCanvasRatio);
|
|
6102
|
+
const drawHeight = Math.floor(this.ecgHeight * worldToCanvasRatio);
|
|
6103
|
+
const xOffsetCanvas = (this.canvas.offsetWidth - drawWidth) / 2;
|
|
6104
|
+
const yOffsetCanvas = (this.canvas.offsetHeight - drawHeight) / 2;
|
|
6105
|
+
const xOffsetWorld = xOffsetCanvas / worldToCanvasRatio;
|
|
6106
|
+
const yOffsetWorld = yOffsetCanvas / worldToCanvasRatio;
|
|
6107
|
+
this.ecgCamera.panWorld = [xOffsetWorld, yOffsetWorld];
|
|
6108
|
+
this.ecgCamera.parallelScale = worldToCanvasRatio;
|
|
6109
|
+
}
|
|
6110
|
+
getWorldToCanvasRatio() {
|
|
6111
|
+
return this.ecgCamera.parallelScale;
|
|
6112
|
+
}
|
|
6113
|
+
getTransform() {
|
|
6114
|
+
const panWorld = this.ecgCamera.panWorld;
|
|
6115
|
+
const dpr = window.devicePixelRatio || 1;
|
|
6116
|
+
const worldToCanvasRatio = this.getWorldToCanvasRatio();
|
|
6117
|
+
const canvasToWorldRatio = 1.0 / worldToCanvasRatio;
|
|
6118
|
+
const halfCanvas = [
|
|
6119
|
+
this.canvas.offsetWidth / 2,
|
|
6120
|
+
this.canvas.offsetHeight / 2,
|
|
6121
|
+
];
|
|
6122
|
+
const halfCanvasWorldCoordinates = [
|
|
6123
|
+
halfCanvas[0] * canvasToWorldRatio,
|
|
6124
|
+
halfCanvas[1] * canvasToWorldRatio,
|
|
6125
|
+
];
|
|
6126
|
+
const transform = new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_1__/* .Transform */ .d();
|
|
6127
|
+
transform.scale(dpr, dpr);
|
|
6128
|
+
transform.translate(halfCanvas[0], halfCanvas[1]);
|
|
6129
|
+
transform.scale(worldToCanvasRatio, worldToCanvasRatio);
|
|
6130
|
+
transform.translate(panWorld[0], panWorld[1]);
|
|
6131
|
+
transform.translate(-halfCanvasWorldCoordinates[0], -halfCanvasWorldCoordinates[1]);
|
|
6132
|
+
return transform;
|
|
6133
|
+
}
|
|
6134
|
+
drawGrid(ctx) {
|
|
6135
|
+
const scale = this.channelScale;
|
|
6136
|
+
const pxWidth = this.ecgWidth;
|
|
6137
|
+
const pxHeight = this.ecgHeight;
|
|
6138
|
+
if (scale <= 0) {
|
|
6139
|
+
return;
|
|
6140
|
+
}
|
|
6141
|
+
const MIN_LINE_SPACING = 8;
|
|
6142
|
+
let hGridUnit = 100;
|
|
6143
|
+
while (hGridUnit * scale < MIN_LINE_SPACING) {
|
|
6144
|
+
hGridUnit *= 2;
|
|
6145
|
+
}
|
|
6146
|
+
const minorH = hGridUnit * scale;
|
|
6147
|
+
const majorH = minorH * 5;
|
|
6148
|
+
const minorV = SECONDS_WIDTH / 25;
|
|
6149
|
+
const majorV = SECONDS_WIDTH / 5;
|
|
6150
|
+
ctx.strokeStyle = COLOR_GRID_MINOR;
|
|
6151
|
+
ctx.lineWidth = 0.5;
|
|
6152
|
+
ctx.beginPath();
|
|
6153
|
+
const hLines = Math.floor(pxHeight / minorH);
|
|
6154
|
+
for (let h = 1; h <= hLines; h++) {
|
|
6155
|
+
if (h % 5 !== 0) {
|
|
6156
|
+
const y = h * minorH;
|
|
6157
|
+
ctx.moveTo(0, y);
|
|
6158
|
+
ctx.lineTo(pxWidth, y);
|
|
6159
|
+
}
|
|
6160
|
+
}
|
|
6161
|
+
const vLines = Math.floor(pxWidth / minorV);
|
|
6162
|
+
for (let v = 1; v <= vLines; v++) {
|
|
6163
|
+
if (v % 5 !== 0) {
|
|
6164
|
+
const x = v * minorV;
|
|
6165
|
+
ctx.moveTo(x, 0);
|
|
6166
|
+
ctx.lineTo(x, pxHeight);
|
|
6167
|
+
}
|
|
6168
|
+
}
|
|
6169
|
+
ctx.stroke();
|
|
6170
|
+
ctx.strokeStyle = COLOR_GRID_MAJOR;
|
|
6171
|
+
ctx.lineWidth = 1;
|
|
6172
|
+
ctx.beginPath();
|
|
6173
|
+
const hMajorLines = Math.floor(pxHeight / majorH);
|
|
6174
|
+
for (let h = 1; h <= hMajorLines; h++) {
|
|
6175
|
+
const y = h * majorH;
|
|
6176
|
+
ctx.moveTo(0, y);
|
|
6177
|
+
ctx.lineTo(pxWidth, y);
|
|
6178
|
+
}
|
|
6179
|
+
const vMajorLines = Math.floor(pxWidth / majorV);
|
|
6180
|
+
for (let v = 1; v <= vMajorLines; v++) {
|
|
6181
|
+
const x = v * majorV;
|
|
6182
|
+
ctx.moveTo(x, 0);
|
|
6183
|
+
ctx.lineTo(x, pxHeight);
|
|
6184
|
+
}
|
|
6185
|
+
ctx.stroke();
|
|
6186
|
+
}
|
|
6187
|
+
drawTraces(ctx, layouts) {
|
|
6188
|
+
const scale = this.channelScale;
|
|
6189
|
+
const pxWidth = this.ecgWidth;
|
|
6190
|
+
for (const { channel, baseline } of layouts) {
|
|
6191
|
+
ctx.strokeStyle = COLOR_BASELINE;
|
|
6192
|
+
ctx.lineWidth = 2;
|
|
6193
|
+
ctx.beginPath();
|
|
6194
|
+
ctx.moveTo(0, baseline);
|
|
6195
|
+
ctx.lineTo(pxWidth, baseline);
|
|
6196
|
+
ctx.stroke();
|
|
6197
|
+
ctx.strokeStyle = COLOR_TRACE;
|
|
6198
|
+
ctx.lineWidth = 1;
|
|
6199
|
+
ctx.beginPath();
|
|
6200
|
+
for (let i = 0; i < channel.data.length; i++) {
|
|
6201
|
+
const x = (i * pxWidth) / channel.data.length;
|
|
6202
|
+
const y = baseline - channel.data[i] * scale;
|
|
6203
|
+
if (i === 0) {
|
|
6204
|
+
ctx.moveTo(x, y);
|
|
6205
|
+
}
|
|
6206
|
+
else {
|
|
6207
|
+
ctx.lineTo(x, y);
|
|
6208
|
+
}
|
|
6209
|
+
}
|
|
6210
|
+
ctx.stroke();
|
|
6211
|
+
}
|
|
6212
|
+
}
|
|
6213
|
+
drawLabels(ctx, layouts) {
|
|
6214
|
+
const worldToCanvas = this.getWorldToCanvasRatio();
|
|
6215
|
+
const fontSize = 14 / worldToCanvas;
|
|
6216
|
+
for (const { channel, itemHeight, yOffset } of layouts) {
|
|
6217
|
+
const labelY = yOffset - itemHeight + fontSize;
|
|
6218
|
+
ctx.font = `${fontSize}px monospace`;
|
|
6219
|
+
const textWidth = ctx.measureText(channel.name).width;
|
|
6220
|
+
ctx.fillStyle = COLOR_BACKGROUND;
|
|
6221
|
+
ctx.fillRect(5, labelY - fontSize, textWidth + 4, fontSize + 4);
|
|
6222
|
+
ctx.fillStyle = COLOR_LABEL;
|
|
6223
|
+
ctx.fillText(channel.name, 5, labelY);
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
getImageData() {
|
|
6227
|
+
if (!this.waveformData) {
|
|
6228
|
+
return null;
|
|
6229
|
+
}
|
|
6230
|
+
const nSamples = this.waveformData.numberOfSamples;
|
|
6231
|
+
const nChannels = this.waveformData.numberOfChannels;
|
|
6232
|
+
const dimensions = [nSamples, ECG_AMPLITUDE_INDEX_SIZE, nChannels];
|
|
6233
|
+
const spacing = [1, 1, 1];
|
|
6234
|
+
const origin = [0, 0, 0];
|
|
6235
|
+
const direction = [1, 0, 0, 0, 1, 0, 0, 0, 1];
|
|
6236
|
+
const amplitudeOffset = ECG_AMPLITUDE_INDEX_SIZE / 2;
|
|
6237
|
+
const imageData = {
|
|
6238
|
+
getDirection: () => direction,
|
|
6239
|
+
getDimensions: () => dimensions,
|
|
6240
|
+
getRange: () => [0, 1],
|
|
6241
|
+
getSpacing: () => spacing,
|
|
6242
|
+
worldToIndex: (point) => {
|
|
6243
|
+
return [point[0], point[1] + amplitudeOffset, point[2]];
|
|
6244
|
+
},
|
|
6245
|
+
indexToWorld: (point) => {
|
|
6246
|
+
return [point[0], point[1] - amplitudeOffset, point[2]];
|
|
6247
|
+
},
|
|
6248
|
+
};
|
|
6249
|
+
return {
|
|
6250
|
+
dimensions,
|
|
6251
|
+
spacing,
|
|
6252
|
+
origin,
|
|
6253
|
+
direction,
|
|
6254
|
+
imageData,
|
|
6255
|
+
hasPixelSpacing: false,
|
|
6256
|
+
calibration: this.calibration,
|
|
6257
|
+
preScale: { scaled: false },
|
|
6258
|
+
metadata: { Modality: 'ECG' },
|
|
6259
|
+
};
|
|
6260
|
+
}
|
|
6261
|
+
getSliceViewInfo() {
|
|
6262
|
+
throw new Error('Method not implemented for ECG viewport.');
|
|
6263
|
+
}
|
|
6264
|
+
}
|
|
6265
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ECGViewport);
|
|
6266
|
+
|
|
6267
|
+
|
|
5703
6268
|
/***/ },
|
|
5704
6269
|
|
|
5705
6270
|
/***/ 4785
|
|
@@ -15592,7 +16157,8 @@ function getAcquisitionPlaneReformatOrientation(imageOrientationPatient) {
|
|
|
15592
16157
|
/* harmony export */ V0: () => (/* binding */ createViewportElement),
|
|
15593
16158
|
/* harmony export */ oI: () => (/* binding */ getOrCreateCanvas),
|
|
15594
16159
|
/* harmony export */ p8: () => (/* binding */ EPSILON),
|
|
15595
|
-
/* harmony export */ vV: () => (/* binding */ setCanvasCreator)
|
|
16160
|
+
/* harmony export */ vV: () => (/* binding */ setCanvasCreator),
|
|
16161
|
+
/* harmony export */ zV: () => (/* binding */ updateCanvasSizeAndAspectRatio)
|
|
15596
16162
|
/* harmony export */ });
|
|
15597
16163
|
const VIEWPORT_ELEMENT = 'viewport-element';
|
|
15598
16164
|
const CANVAS_CSS_CLASS = 'cornerstone-canvas';
|
|
@@ -15626,6 +16192,32 @@ function createViewportElement(element) {
|
|
|
15626
16192
|
function setCanvasCreator(canvasCreatorArg) {
|
|
15627
16193
|
canvasCreator = canvasCreatorArg;
|
|
15628
16194
|
}
|
|
16195
|
+
function updateCanvasSizeAndAspectRatio(canvas, extentOrOffscreen) {
|
|
16196
|
+
if (extentOrOffscreen === undefined) {
|
|
16197
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
16198
|
+
const rect = canvas.getBoundingClientRect();
|
|
16199
|
+
const w = Math.round(rect.width * devicePixelRatio);
|
|
16200
|
+
const h = Math.round(rect.height * devicePixelRatio);
|
|
16201
|
+
if (w > 0 && h > 0) {
|
|
16202
|
+
canvas.width = w;
|
|
16203
|
+
canvas.height = h;
|
|
16204
|
+
canvas.style.aspectRatio = `${w} / ${h}`;
|
|
16205
|
+
}
|
|
16206
|
+
return undefined;
|
|
16207
|
+
}
|
|
16208
|
+
const { width: targetW, height: targetH } = extentOrOffscreen;
|
|
16209
|
+
if (targetW < 1 || targetH < 1) {
|
|
16210
|
+
return false;
|
|
16211
|
+
}
|
|
16212
|
+
const needsUpdate = canvas.width !== targetW || canvas.height !== targetH;
|
|
16213
|
+
if (needsUpdate) {
|
|
16214
|
+
canvas.width = targetW;
|
|
16215
|
+
canvas.height = targetH;
|
|
16216
|
+
canvas.style.aspectRatio = `${targetW} / ${targetH}`;
|
|
16217
|
+
return true;
|
|
16218
|
+
}
|
|
16219
|
+
return false;
|
|
16220
|
+
}
|
|
15629
16221
|
function getOrCreateCanvas(element) {
|
|
15630
16222
|
const canvasSelector = `canvas.${CANVAS_CSS_CLASS}`;
|
|
15631
16223
|
const viewportElement = `div.${VIEWPORT_ELEMENT}`;
|
|
@@ -15639,8 +16231,11 @@ function getOrCreateCanvas(element) {
|
|
|
15639
16231
|
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
15640
16232
|
const width = Math.ceil(rect.width * devicePixelRatio);
|
|
15641
16233
|
const height = Math.ceil(rect.height * devicePixelRatio);
|
|
15642
|
-
|
|
15643
|
-
|
|
16234
|
+
if (width > 0 && height > 0) {
|
|
16235
|
+
canvas.width = width;
|
|
16236
|
+
canvas.height = height;
|
|
16237
|
+
canvas.style.aspectRatio = `${width} / ${height}`;
|
|
16238
|
+
}
|
|
15644
16239
|
return canvas;
|
|
15645
16240
|
}
|
|
15646
16241
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getOrCreateCanvas);
|
|
@@ -15661,7 +16256,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15661
16256
|
A7: () => (/* reexport */ helpers_setVolumesForViewports)
|
|
15662
16257
|
});
|
|
15663
16258
|
|
|
15664
|
-
// UNUSED EXPORTS: EPSILON, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, setCanvasCreator, volumeNewImageEventDispatcher
|
|
16259
|
+
// UNUSED EXPORTS: EPSILON, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, setCanvasCreator, updateCanvasSizeAndAspectRatio, volumeNewImageEventDispatcher
|
|
15665
16260
|
|
|
15666
16261
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeActor.js + 2 modules
|
|
15667
16262
|
var createVolumeActor = __webpack_require__(11836);
|
|
@@ -15920,6 +16515,8 @@ function _isCurrentImagePTPrescaled(modality, imageVolume) {
|
|
|
15920
16515
|
/* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(40893);
|
|
15921
16516
|
/* harmony import */ var _VideoViewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32501);
|
|
15922
16517
|
/* harmony import */ var _WSIViewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81466);
|
|
16518
|
+
/* harmony import */ var _ECGViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95307);
|
|
16519
|
+
|
|
15923
16520
|
|
|
15924
16521
|
|
|
15925
16522
|
|
|
@@ -15933,6 +16530,7 @@ const viewportTypeToViewportClass = {
|
|
|
15933
16530
|
[_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.VOLUME_3D]: _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A,
|
|
15934
16531
|
[_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.VIDEO]: _VideoViewport__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A,
|
|
15935
16532
|
[_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.WHOLE_SLIDE]: _WSIViewport__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A,
|
|
16533
|
+
[_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.ECG]: _ECGViewport__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A,
|
|
15936
16534
|
};
|
|
15937
16535
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (viewportTypeToViewportClass);
|
|
15938
16536
|
|
|
@@ -16025,7 +16623,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
16025
16623
|
Ay: () => (/* binding */ esm_RenderingEngine)
|
|
16026
16624
|
});
|
|
16027
16625
|
|
|
16028
|
-
// UNUSED EXPORTS: EPSILON, RenderingEngine, VolumeViewport3D, addImageSlicesToViewports, addVolumesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, getOrCreateCanvas, getRenderingEngine, setCanvasCreator, setVolumesForViewports, volumeNewImageEventDispatcher
|
|
16626
|
+
// UNUSED EXPORTS: EPSILON, RenderingEngine, VolumeViewport3D, addImageSlicesToViewports, addVolumesToViewports, createCanvas, createViewportElement, createVolumeActor, createVolumeMapper, getOrCreateCanvas, getRenderingEngine, setCanvasCreator, setVolumesForViewports, updateCanvasSizeAndAspectRatio, volumeNewImageEventDispatcher
|
|
16029
16627
|
|
|
16030
16628
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/init.js + 2 modules
|
|
16031
16629
|
var init = __webpack_require__(26896);
|
|
@@ -16196,6 +16794,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16196
16794
|
const viewportsDrivenByVtkJs = viewports.filter((vp) => (0,viewportTypeUsesCustomRenderingPipeline/* default */.A)(vp.type) === false);
|
|
16197
16795
|
const canvasesDrivenByVtkJs = viewportsDrivenByVtkJs.map((vp) => vp.canvas);
|
|
16198
16796
|
const canvas = (0,getOrCreateCanvas/* default */.Ay)(viewportInputEntry.element);
|
|
16797
|
+
(0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas);
|
|
16199
16798
|
canvasesDrivenByVtkJs.push(canvas);
|
|
16200
16799
|
const internalViewportEntry = { ...viewportInputEntry, canvas };
|
|
16201
16800
|
this.addVtkjsDrivenViewport(internalViewportEntry);
|
|
@@ -16262,12 +16861,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16262
16861
|
setVtkjsDrivenViewports(viewportInputEntries) {
|
|
16263
16862
|
if (viewportInputEntries.length) {
|
|
16264
16863
|
const vtkDrivenCanvases = viewportInputEntries.map((vp) => (0,getOrCreateCanvas/* default */.Ay)(vp.element));
|
|
16265
|
-
vtkDrivenCanvases.forEach((canvas) =>
|
|
16266
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
16267
|
-
const rect = canvas.getBoundingClientRect();
|
|
16268
|
-
canvas.width = rect.width * devicePixelRatio;
|
|
16269
|
-
canvas.height = rect.height * devicePixelRatio;
|
|
16270
|
-
});
|
|
16864
|
+
vtkDrivenCanvases.forEach((canvas) => (0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas));
|
|
16271
16865
|
for (let i = 0; i < viewportInputEntries.length; i++) {
|
|
16272
16866
|
const vtkDrivenViewportInputEntry = viewportInputEntries[i];
|
|
16273
16867
|
const canvas = vtkDrivenCanvases[i];
|
|
@@ -16280,15 +16874,39 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16280
16874
|
}
|
|
16281
16875
|
}
|
|
16282
16876
|
_resizeVTKViewports(vtkDrivenViewports, keepCamera = true, immediate = true) {
|
|
16283
|
-
const
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
const
|
|
16288
|
-
|
|
16289
|
-
|
|
16290
|
-
|
|
16291
|
-
|
|
16877
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
16878
|
+
const viewportsNeedingResize = [];
|
|
16879
|
+
for (const vp of vtkDrivenViewports) {
|
|
16880
|
+
const canvas = (0,getOrCreateCanvas/* default */.Ay)(vp.element);
|
|
16881
|
+
const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio);
|
|
16882
|
+
const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio);
|
|
16883
|
+
if (displayedWidth === 0 || displayedHeight === 0) {
|
|
16884
|
+
continue;
|
|
16885
|
+
}
|
|
16886
|
+
const renderedWidth = canvas.width;
|
|
16887
|
+
const renderedHeight = canvas.height;
|
|
16888
|
+
if (displayedWidth === renderedWidth &&
|
|
16889
|
+
displayedHeight === renderedHeight) {
|
|
16890
|
+
continue;
|
|
16891
|
+
}
|
|
16892
|
+
viewportsNeedingResize.push(vp);
|
|
16893
|
+
}
|
|
16894
|
+
if (viewportsNeedingResize.length === 0) {
|
|
16895
|
+
return;
|
|
16896
|
+
}
|
|
16897
|
+
if (this._animationFrameSet) {
|
|
16898
|
+
return;
|
|
16899
|
+
}
|
|
16900
|
+
for (const vp of viewportsNeedingResize) {
|
|
16901
|
+
const canvas = (0,getOrCreateCanvas/* default */.Ay)(vp.element);
|
|
16902
|
+
const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio);
|
|
16903
|
+
const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio);
|
|
16904
|
+
const targetWidth = Math.max(BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i, displayedWidth);
|
|
16905
|
+
const targetHeight = Math.max(BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i, displayedHeight);
|
|
16906
|
+
vp.sWidth = targetWidth;
|
|
16907
|
+
vp.sHeight = targetHeight;
|
|
16908
|
+
}
|
|
16909
|
+
if (vtkDrivenViewports.length) {
|
|
16292
16910
|
this._resize(vtkDrivenViewports);
|
|
16293
16911
|
}
|
|
16294
16912
|
vtkDrivenViewports.forEach((vp) => {
|
|
@@ -16330,6 +16948,10 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16330
16948
|
return eventDetail;
|
|
16331
16949
|
}
|
|
16332
16950
|
_renderViewportWithContext(viewport, offscreenMultiRenderWindow, offScreenCanvasContainer) {
|
|
16951
|
+
if (viewport.canvas.clientWidth === 0 ||
|
|
16952
|
+
viewport.canvas.clientHeight === 0) {
|
|
16953
|
+
return;
|
|
16954
|
+
}
|
|
16333
16955
|
if (viewport.sWidth < BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i ||
|
|
16334
16956
|
viewport.sHeight < BaseRenderingEngine/* VIEWPORT_MIN_SIZE */.i) {
|
|
16335
16957
|
console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight);
|
|
@@ -16359,8 +16981,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16359
16981
|
const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id);
|
|
16360
16982
|
const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id);
|
|
16361
16983
|
const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
|
|
16362
|
-
const viewportWidth = viewport.
|
|
16363
|
-
const viewportHeight = viewport.
|
|
16984
|
+
const viewportWidth = viewport.sWidth;
|
|
16985
|
+
const viewportHeight = viewport.sHeight;
|
|
16364
16986
|
const xEnd = Math.min(1, viewportWidth / maxSize.width);
|
|
16365
16987
|
const yEnd = Math.min(1, viewportHeight / maxSize.height);
|
|
16366
16988
|
renderer.setViewport(0, 0, xEnd, yEnd);
|
|
@@ -16394,7 +17016,7 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16394
17016
|
if (contextIndex === undefined) {
|
|
16395
17017
|
return;
|
|
16396
17018
|
}
|
|
16397
|
-
const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.
|
|
17019
|
+
const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight);
|
|
16398
17020
|
if (!maxSizeChanged) {
|
|
16399
17021
|
return;
|
|
16400
17022
|
}
|
|
@@ -16409,7 +17031,9 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16409
17031
|
}
|
|
16410
17032
|
_copyToOnscreenCanvas(viewport, offScreenCanvas) {
|
|
16411
17033
|
const { element, canvas, id: viewportId, renderingEngineId, suppressEvents, } = viewport;
|
|
16412
|
-
const
|
|
17034
|
+
const dWidth = viewport.sWidth;
|
|
17035
|
+
const dHeight = viewport.sHeight;
|
|
17036
|
+
(0,getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV)(canvas, { width: dWidth, height: dHeight });
|
|
16413
17037
|
const onScreenContext = canvas.getContext('2d');
|
|
16414
17038
|
const contextIndex = this.contextPool.getContextIndexForViewport(viewportId);
|
|
16415
17039
|
const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
|
|
@@ -16428,10 +17052,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16428
17052
|
for (const viewport of viewportsDrivenByVtkJs) {
|
|
16429
17053
|
viewport.sx = 0;
|
|
16430
17054
|
viewport.sy = 0;
|
|
16431
|
-
viewport.sWidth = viewport.canvas.width;
|
|
16432
|
-
viewport.sHeight = viewport.canvas.height;
|
|
16433
17055
|
const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id);
|
|
16434
|
-
const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.
|
|
17056
|
+
const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight);
|
|
16435
17057
|
if (maxSizeChanged) {
|
|
16436
17058
|
contextsToResize.add(contextIndex);
|
|
16437
17059
|
}
|
|
@@ -16439,8 +17061,8 @@ class ContextPoolRenderingEngine extends BaseRenderingEngine/* default */.A {
|
|
|
16439
17061
|
const { context: offscreenMultiRenderWindow } = contextData;
|
|
16440
17062
|
const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id);
|
|
16441
17063
|
const maxSize = this.contextPool.getMaxSizeForContext(contextIndex);
|
|
16442
|
-
const xEnd = Math.min(1, viewport.
|
|
16443
|
-
const yEnd = Math.min(1, viewport.
|
|
17064
|
+
const xEnd = Math.min(1, viewport.sWidth / maxSize.width);
|
|
17065
|
+
const yEnd = Math.min(1, viewport.sHeight / maxSize.height);
|
|
16444
17066
|
renderer.setViewport(0, 0, xEnd, yEnd);
|
|
16445
17067
|
}
|
|
16446
17068
|
contextsToResize.forEach((contextIndex) => {
|
|
@@ -28185,6 +28807,7 @@ var MetadataModules;
|
|
|
28185
28807
|
MetadataModules["PET_SERIES"] = "petSeriesModule";
|
|
28186
28808
|
MetadataModules["SOP_COMMON"] = "sopCommonModule";
|
|
28187
28809
|
MetadataModules["ULTRASOUND_ENHANCED_REGION"] = "ultrasoundEnhancedRegionModule";
|
|
28810
|
+
MetadataModules["ECG"] = "ecgModule";
|
|
28188
28811
|
MetadataModules["VOI_LUT"] = "voiLutModule";
|
|
28189
28812
|
MetadataModules["FRAME_MODULE"] = "frameModule";
|
|
28190
28813
|
MetadataModules["WADO_WEB_CLIENT"] = "wadoWebClient";
|
|
@@ -28336,6 +28959,7 @@ var ViewportType;
|
|
|
28336
28959
|
ViewportType["VOLUME_3D"] = "volume3d";
|
|
28337
28960
|
ViewportType["VIDEO"] = "video";
|
|
28338
28961
|
ViewportType["WHOLE_SLIDE"] = "wholeSlide";
|
|
28962
|
+
ViewportType["ECG"] = "ecg";
|
|
28339
28963
|
})(ViewportType || (ViewportType = {}));
|
|
28340
28964
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewportType);
|
|
28341
28965
|
|
|
@@ -28632,6 +29256,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28632
29256
|
BaseVolumeViewport: () => (/* reexport */ BaseVolumeViewport/* default */.A),
|
|
28633
29257
|
CONSTANTS: () => (/* reexport */ constants),
|
|
28634
29258
|
ContextPoolRenderingEngine: () => (/* reexport */ RenderingEngine/* ContextPoolRenderingEngine */.Ou),
|
|
29259
|
+
ECGViewport: () => (/* reexport */ ECGViewport/* default */.A),
|
|
28635
29260
|
EPSILON: () => (/* reexport */ getOrCreateCanvas/* EPSILON */.p8),
|
|
28636
29261
|
EVENTS: () => (/* reexport */ enums.Events),
|
|
28637
29262
|
Enums: () => (/* reexport */ enums),
|
|
@@ -28691,6 +29316,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28691
29316
|
setUseCPURendering: () => (/* reexport */ init/* setUseCPURendering */.qc),
|
|
28692
29317
|
setVolumesForViewports: () => (/* reexport */ helpers/* setVolumesForViewports */.A7),
|
|
28693
29318
|
triggerEvent: () => (/* reexport */ triggerEvent/* default */.A),
|
|
29319
|
+
updateCanvasSizeAndAspectRatio: () => (/* reexport */ getOrCreateCanvas/* updateCanvasSizeAndAspectRatio */.zV),
|
|
28694
29320
|
utilities: () => (/* reexport */ utilities),
|
|
28695
29321
|
version: () => (/* reexport */ version/* version */.r),
|
|
28696
29322
|
volumeLoader: () => (/* reexport */ volumeLoader)
|
|
@@ -28720,6 +29346,8 @@ var StackViewport = __webpack_require__(4785);
|
|
|
28720
29346
|
var VideoViewport = __webpack_require__(32501);
|
|
28721
29347
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/WSIViewport.js + 1 modules
|
|
28722
29348
|
var WSIViewport = __webpack_require__(81466);
|
|
29349
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/ECGViewport.js
|
|
29350
|
+
var ECGViewport = __webpack_require__(95307);
|
|
28723
29351
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/Viewport.js
|
|
28724
29352
|
var Viewport = __webpack_require__(10056);
|
|
28725
29353
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
@@ -29000,6 +29628,7 @@ var helpers = __webpack_require__(40661);
|
|
|
29000
29628
|
|
|
29001
29629
|
|
|
29002
29630
|
|
|
29631
|
+
|
|
29003
29632
|
|
|
29004
29633
|
|
|
29005
29634
|
/***/ },
|
|
@@ -45768,7 +46397,7 @@ function toLowHighRange(windowWidth, windowCenter, voiLUTFunction = _enums_VOILU
|
|
|
45768
46397
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45769
46398
|
/* harmony export */ r: () => (/* binding */ version)
|
|
45770
46399
|
/* harmony export */ });
|
|
45771
|
-
const version = '4.
|
|
46400
|
+
const version = '4.18.2';
|
|
45772
46401
|
|
|
45773
46402
|
|
|
45774
46403
|
/***/ },
|
|
@@ -46191,7 +46820,7 @@ const obj = {
|
|
|
46191
46820
|
|
|
46192
46821
|
/***/ },
|
|
46193
46822
|
|
|
46194
|
-
/***/
|
|
46823
|
+
/***/ 76318
|
|
46195
46824
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
46196
46825
|
|
|
46197
46826
|
"use strict";
|
|
@@ -49072,6 +49701,187 @@ function USHelpers_getUSEnhancedRegions(metadata) {
|
|
|
49072
49701
|
}
|
|
49073
49702
|
|
|
49074
49703
|
|
|
49704
|
+
;// ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/esm/imageLoader/wadors/metaData/ECGHelpers.js
|
|
49705
|
+
|
|
49706
|
+
|
|
49707
|
+
|
|
49708
|
+
const TAG = {
|
|
49709
|
+
WaveformSequence: '54000100',
|
|
49710
|
+
NumberOfWaveformChannels: '003A0005',
|
|
49711
|
+
NumberOfWaveformSamples: '003A0010',
|
|
49712
|
+
SamplingFrequency: '003A001A',
|
|
49713
|
+
MultiplexGroupLabel: '003A0020',
|
|
49714
|
+
ChannelDefinitionSequence: '003A0200',
|
|
49715
|
+
ChannelSourceSequence: '003A0208',
|
|
49716
|
+
CodeMeaning: '00080104',
|
|
49717
|
+
WaveformBitsAllocated: '54001004',
|
|
49718
|
+
WaveformSampleInterpretation: '54001006',
|
|
49719
|
+
WaveformData: '54001010',
|
|
49720
|
+
};
|
|
49721
|
+
function base64ToUint8Array(base64) {
|
|
49722
|
+
const binaryString = atob(base64);
|
|
49723
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
49724
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
49725
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
49726
|
+
}
|
|
49727
|
+
return bytes;
|
|
49728
|
+
}
|
|
49729
|
+
function convertBuffer(dataSrc, numberOfChannels, numberOfSamples, bits, type) {
|
|
49730
|
+
const data = new Uint8Array(dataSrc);
|
|
49731
|
+
if (bits === 16 && type === 'SS') {
|
|
49732
|
+
const ret = [];
|
|
49733
|
+
const bytesPerSample = 2;
|
|
49734
|
+
const totalBytes = bytesPerSample * numberOfChannels * numberOfSamples;
|
|
49735
|
+
const length = Math.min(data.length, totalBytes);
|
|
49736
|
+
for (let channel = 0; channel < numberOfChannels; channel++) {
|
|
49737
|
+
const buffer = new Int16Array(numberOfSamples);
|
|
49738
|
+
ret.push(buffer);
|
|
49739
|
+
let sampleI = 0;
|
|
49740
|
+
for (let sample = 2 * channel; sample < length; sample += 2 * numberOfChannels) {
|
|
49741
|
+
const highByte = data[sample + 1];
|
|
49742
|
+
const lowByte = data[sample];
|
|
49743
|
+
const sign = highByte & 0x80;
|
|
49744
|
+
buffer[sampleI++] = sign
|
|
49745
|
+
? 0xffff0000 | (highByte << 8) | lowByte
|
|
49746
|
+
: (highByte << 8) | lowByte;
|
|
49747
|
+
}
|
|
49748
|
+
}
|
|
49749
|
+
return ret;
|
|
49750
|
+
}
|
|
49751
|
+
console.warn(`[ECGHelpers] Unsupported waveform format: ${bits}-bit ${type}. Only 16-bit SS is supported.`);
|
|
49752
|
+
return [];
|
|
49753
|
+
}
|
|
49754
|
+
function multipartDecode(response) {
|
|
49755
|
+
const message = new Uint8Array(response);
|
|
49756
|
+
const separator = new TextEncoder().encode('\r\n\r\n');
|
|
49757
|
+
const headerIndex = findToken(message, separator, 0, 1000);
|
|
49758
|
+
if (headerIndex === -1) {
|
|
49759
|
+
return [response];
|
|
49760
|
+
}
|
|
49761
|
+
const headerStr = new TextDecoder().decode(message.slice(0, headerIndex));
|
|
49762
|
+
const boundaryString = identifyBoundary(headerStr);
|
|
49763
|
+
if (!boundaryString) {
|
|
49764
|
+
return [response];
|
|
49765
|
+
}
|
|
49766
|
+
const boundary = new TextEncoder().encode(boundaryString);
|
|
49767
|
+
const components = [];
|
|
49768
|
+
let offset = headerIndex + separator.length;
|
|
49769
|
+
let boundaryIndex = findToken(message, boundary, offset);
|
|
49770
|
+
while (boundaryIndex !== -1) {
|
|
49771
|
+
const contentStart = findToken(message, separator, boundaryIndex, 1000);
|
|
49772
|
+
if (contentStart === -1) {
|
|
49773
|
+
break;
|
|
49774
|
+
}
|
|
49775
|
+
const dataStart = contentStart + separator.length;
|
|
49776
|
+
const nextBoundary = findToken(message, boundary, dataStart);
|
|
49777
|
+
const dataEnd = nextBoundary === -1 ? message.length : nextBoundary - 2;
|
|
49778
|
+
components.push(response.slice(dataStart, dataEnd));
|
|
49779
|
+
if (nextBoundary === -1) {
|
|
49780
|
+
break;
|
|
49781
|
+
}
|
|
49782
|
+
offset = nextBoundary;
|
|
49783
|
+
boundaryIndex = findToken(message, boundary, offset + boundary.length);
|
|
49784
|
+
if (boundaryIndex === -1) {
|
|
49785
|
+
break;
|
|
49786
|
+
}
|
|
49787
|
+
}
|
|
49788
|
+
return components.length > 0 ? components : [response];
|
|
49789
|
+
}
|
|
49790
|
+
function findToken(message, token, startIndex, maxLength) {
|
|
49791
|
+
const end = maxLength
|
|
49792
|
+
? Math.min(message.length, startIndex + maxLength)
|
|
49793
|
+
: message.length;
|
|
49794
|
+
for (let i = startIndex; i < end - token.length + 1; i++) {
|
|
49795
|
+
let found = true;
|
|
49796
|
+
for (let j = 0; j < token.length; j++) {
|
|
49797
|
+
if (message[i + j] !== token[j]) {
|
|
49798
|
+
found = false;
|
|
49799
|
+
break;
|
|
49800
|
+
}
|
|
49801
|
+
}
|
|
49802
|
+
if (found) {
|
|
49803
|
+
return i;
|
|
49804
|
+
}
|
|
49805
|
+
}
|
|
49806
|
+
return -1;
|
|
49807
|
+
}
|
|
49808
|
+
function identifyBoundary(header) {
|
|
49809
|
+
const match = header.match(/boundary=([^\s;]+)/i);
|
|
49810
|
+
if (match) {
|
|
49811
|
+
return `--${match[1].replace(/"/g, '')}`;
|
|
49812
|
+
}
|
|
49813
|
+
return null;
|
|
49814
|
+
}
|
|
49815
|
+
function makeRetrieveBulkData(waveformData, numberOfChannels, numberOfSamples, bitsAllocated, sampleInterpretation, wadoRsRoot, studyUID) {
|
|
49816
|
+
return async () => {
|
|
49817
|
+
if (waveformData.Value) {
|
|
49818
|
+
return waveformData.Value;
|
|
49819
|
+
}
|
|
49820
|
+
if (waveformData.InlineBinary) {
|
|
49821
|
+
const raw = base64ToUint8Array(waveformData.InlineBinary);
|
|
49822
|
+
return convertBuffer(raw, numberOfChannels, numberOfSamples, bitsAllocated, sampleInterpretation);
|
|
49823
|
+
}
|
|
49824
|
+
if (typeof waveformData.retrieveBulkData === 'function') {
|
|
49825
|
+
const bulkdata = await waveformData.retrieveBulkData();
|
|
49826
|
+
return convertBuffer(bulkdata, numberOfChannels, numberOfSamples, bitsAllocated, sampleInterpretation);
|
|
49827
|
+
}
|
|
49828
|
+
if (waveformData.BulkDataURI) {
|
|
49829
|
+
let url = waveformData.BulkDataURI;
|
|
49830
|
+
if (url.indexOf(':') === -1 && wadoRsRoot) {
|
|
49831
|
+
url = studyUID
|
|
49832
|
+
? `${wadoRsRoot}/studies/${studyUID}/${url}`
|
|
49833
|
+
: `${wadoRsRoot}/${url}`;
|
|
49834
|
+
}
|
|
49835
|
+
const response = await fetch(url);
|
|
49836
|
+
const buffer = await response.arrayBuffer();
|
|
49837
|
+
const contentType = response.headers.get('content-type') || '';
|
|
49838
|
+
const decoded = contentType.includes('multipart')
|
|
49839
|
+
? multipartDecode(buffer)[0]
|
|
49840
|
+
: buffer;
|
|
49841
|
+
return convertBuffer(decoded, numberOfChannels, numberOfSamples, bitsAllocated, sampleInterpretation);
|
|
49842
|
+
}
|
|
49843
|
+
throw new Error('[ECGHelpers] No data source found in WaveformData');
|
|
49844
|
+
};
|
|
49845
|
+
}
|
|
49846
|
+
function getECGModule(metadata, wadoRsRoot, studyUID) {
|
|
49847
|
+
const waveformSeqItems = metaData_getSequenceItems(metadata[TAG.WaveformSequence]);
|
|
49848
|
+
if (!waveformSeqItems || waveformSeqItems.length === 0) {
|
|
49849
|
+
return null;
|
|
49850
|
+
}
|
|
49851
|
+
const waveform = waveformSeqItems[0];
|
|
49852
|
+
const numberOfChannels = metaData_getNumberValue(waveform[TAG.NumberOfWaveformChannels]);
|
|
49853
|
+
const numberOfSamples = metaData_getNumberValue(waveform[TAG.NumberOfWaveformSamples]);
|
|
49854
|
+
const samplingFrequency = metaData_getNumberValue(waveform[TAG.SamplingFrequency]);
|
|
49855
|
+
const waveformBitsAllocated = metaData_getNumberValue(waveform[TAG.WaveformBitsAllocated]) ?? 16;
|
|
49856
|
+
const waveformSampleInterpretation = metaData_getValue(waveform[TAG.WaveformSampleInterpretation]) ?? 'SS';
|
|
49857
|
+
const multiplexGroupLabel = metaData_getValue(waveform[TAG.MultiplexGroupLabel]) ?? 'ECG';
|
|
49858
|
+
const channelDefItems = metaData_getSequenceItems(waveform[TAG.ChannelDefinitionSequence]);
|
|
49859
|
+
const channelDefinitionSequence = (channelDefItems || []).map((channelDef) => {
|
|
49860
|
+
const channelDefRecord = channelDef;
|
|
49861
|
+
const sourceSeqItems = metaData_getSequenceItems(channelDefRecord[TAG.ChannelSourceSequence]);
|
|
49862
|
+
const sourceSeq = sourceSeqItems?.[0] || {};
|
|
49863
|
+
const codeMeaning = metaData_getValue(sourceSeq[TAG.CodeMeaning]);
|
|
49864
|
+
return {
|
|
49865
|
+
channelSourceSequence: {
|
|
49866
|
+
codeMeaning: codeMeaning || 'Unknown',
|
|
49867
|
+
},
|
|
49868
|
+
};
|
|
49869
|
+
});
|
|
49870
|
+
const waveformDataObj = waveform[TAG.WaveformData] || {};
|
|
49871
|
+
return {
|
|
49872
|
+
numberOfWaveformChannels: numberOfChannels,
|
|
49873
|
+
numberOfWaveformSamples: numberOfSamples,
|
|
49874
|
+
samplingFrequency,
|
|
49875
|
+
waveformBitsAllocated,
|
|
49876
|
+
waveformSampleInterpretation,
|
|
49877
|
+
multiplexGroupLabel,
|
|
49878
|
+
channelDefinitionSequence,
|
|
49879
|
+
waveformData: {
|
|
49880
|
+
retrieveBulkData: makeRetrieveBulkData(waveformDataObj, numberOfChannels, numberOfSamples, waveformBitsAllocated, waveformSampleInterpretation, wadoRsRoot, studyUID),
|
|
49881
|
+
},
|
|
49882
|
+
};
|
|
49883
|
+
}
|
|
49884
|
+
|
|
49075
49885
|
;// ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/esm/imageLoader/wadors/metaData/metaDataProvider.js
|
|
49076
49886
|
|
|
49077
49887
|
|
|
@@ -49229,6 +50039,20 @@ function metaDataProvider_metaDataProvider(type, imageId) {
|
|
|
49229
50039
|
if (type === MetadataModules.ULTRASOUND_ENHANCED_REGION) {
|
|
49230
50040
|
return USHelpers_getUSEnhancedRegions(metaData);
|
|
49231
50041
|
}
|
|
50042
|
+
if (type === MetadataModules.ECG) {
|
|
50043
|
+
const imageUri = imageId.replace('wadors:', '');
|
|
50044
|
+
const studiesIndex = imageUri.indexOf('/studies/');
|
|
50045
|
+
let wadoRsRoot;
|
|
50046
|
+
let studyUID;
|
|
50047
|
+
if (studiesIndex !== -1) {
|
|
50048
|
+
wadoRsRoot = imageUri.substring(0, studiesIndex);
|
|
50049
|
+
const afterStudies = imageUri.substring(studiesIndex + 9);
|
|
50050
|
+
const nextSlash = afterStudies.indexOf('/');
|
|
50051
|
+
studyUID =
|
|
50052
|
+
nextSlash !== -1 ? afterStudies.substring(0, nextSlash) : afterStudies;
|
|
50053
|
+
}
|
|
50054
|
+
return getECGModule(metaData, wadoRsRoot, studyUID);
|
|
50055
|
+
}
|
|
49232
50056
|
if (type === MetadataModules.CALIBRATION) {
|
|
49233
50057
|
const modality = metaData_getValue(metaData['00080060']);
|
|
49234
50058
|
if (modality === 'US') {
|
|
@@ -49237,6 +50061,42 @@ function metaDataProvider_metaDataProvider(type, imageId) {
|
|
|
49237
50061
|
sequenceOfUltrasoundRegions: enhancedRegion,
|
|
49238
50062
|
};
|
|
49239
50063
|
}
|
|
50064
|
+
const imageUri = imageId.replace('wadors:', '');
|
|
50065
|
+
const studiesIndex = imageUri.indexOf('/studies/');
|
|
50066
|
+
let wadoRsRoot;
|
|
50067
|
+
let studyUID;
|
|
50068
|
+
if (studiesIndex !== -1) {
|
|
50069
|
+
wadoRsRoot = imageUri.substring(0, studiesIndex);
|
|
50070
|
+
const afterStudies = imageUri.substring(studiesIndex + 9);
|
|
50071
|
+
const nextSlash = afterStudies.indexOf('/');
|
|
50072
|
+
studyUID =
|
|
50073
|
+
nextSlash !== -1 ? afterStudies.substring(0, nextSlash) : afterStudies;
|
|
50074
|
+
}
|
|
50075
|
+
const ecgModule = getECGModule(metaData, wadoRsRoot, studyUID);
|
|
50076
|
+
if (ecgModule) {
|
|
50077
|
+
const { numberOfWaveformSamples, samplingFrequency } = ecgModule;
|
|
50078
|
+
const physicalDeltaX = 1 / (samplingFrequency || 1);
|
|
50079
|
+
const physicalDeltaY = 0.001;
|
|
50080
|
+
const ECG_AMPLITUDE_INDEX_SIZE = 65536;
|
|
50081
|
+
const ECG_AMPLITUDE_OFFSET = 32768;
|
|
50082
|
+
return {
|
|
50083
|
+
sequenceOfUltrasoundRegions: [
|
|
50084
|
+
{
|
|
50085
|
+
regionLocationMinX0: 0,
|
|
50086
|
+
regionLocationMaxX1: numberOfWaveformSamples,
|
|
50087
|
+
regionLocationMinY0: 0,
|
|
50088
|
+
regionLocationMaxY1: ECG_AMPLITUDE_INDEX_SIZE - 1,
|
|
50089
|
+
referencePixelX0: 0,
|
|
50090
|
+
referencePixelY0: ECG_AMPLITUDE_OFFSET,
|
|
50091
|
+
physicalDeltaX,
|
|
50092
|
+
physicalDeltaY,
|
|
50093
|
+
physicalUnitsXDirection: 4,
|
|
50094
|
+
physicalUnitsYDirection: -1,
|
|
50095
|
+
regionDataType: 1,
|
|
50096
|
+
},
|
|
50097
|
+
],
|
|
50098
|
+
};
|
|
50099
|
+
}
|
|
49240
50100
|
}
|
|
49241
50101
|
if (type === MetadataModules.IMAGE_URL) {
|
|
49242
50102
|
return getImageUrlModule(imageId, metaData);
|
|
@@ -79844,7 +80704,7 @@ const detectionOptions = {
|
|
|
79844
80704
|
}
|
|
79845
80705
|
});
|
|
79846
80706
|
;// ../../i18n/package.json
|
|
79847
|
-
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.13.0-beta.
|
|
80707
|
+
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.13.0-beta.25"}');
|
|
79848
80708
|
;// ../../i18n/src/utils.js
|
|
79849
80709
|
const languagesMap = {
|
|
79850
80710
|
ar: 'Arabic',
|
|
@@ -239915,8 +240775,8 @@ function _sortStringDates(s1, s2, sortModifier) {
|
|
|
239915
240775
|
|
|
239916
240776
|
// EXTERNAL MODULE: ../../../node_modules/react-dropzone/dist/es/index.js + 4 modules
|
|
239917
240777
|
var dist_es = __webpack_require__(85252);
|
|
239918
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/esm/index.js +
|
|
239919
|
-
var esm = __webpack_require__(
|
|
240778
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/esm/index.js + 80 modules
|
|
240779
|
+
var esm = __webpack_require__(76318);
|
|
239920
240780
|
;// ./routes/Local/fileLoader.js
|
|
239921
240781
|
class FileLoader {
|
|
239922
240782
|
constructor() {
|
|
@@ -395660,7 +396520,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
|
395660
396520
|
/******/ // This function allow to reference async chunks
|
|
395661
396521
|
/******/ __webpack_require__.u = (chunkId) => {
|
|
395662
396522
|
/******/ // return url for filenames based on template
|
|
395663
|
-
/******/ return "" + ({"572":"polySeg","2007":"interpolation","3054":"histogram-worker","3694":"compute"}[chunkId] || chunkId) + ".bundle." + {"85":"
|
|
396523
|
+
/******/ return "" + ({"572":"polySeg","2007":"interpolation","3054":"histogram-worker","3694":"compute"}[chunkId] || chunkId) + ".bundle." + {"85":"d5ec46ba8fc649b50106","147":"9c245011849e09bd7904","213":"39a9594920f69cf117c6","572":"cdcc2c3d11009ccf112c","581":"b70e5d2d0f3958df69f0","732":"ea6f9d8504e37e01a208","933":"ea9db108b8a4e3d51904","1459":"78c0d3f68c7bf270e668","1608":"7a4a3b49cae10f6ba2cf","1927":"be67b3aafe238ca9f191","1933":"ff45b34115749da319d2","2007":"072a28b303f2dbafe05c","2018":"b9d2ac618c23377cb6cd","2075":"16215ba94d714a1c905f","2108":"f1ef8e8746eb3936bb47","2424":"d867beac3dc2f248ff98","2701":"8abdc7f6578c00d4539f","3054":"5b679ce4142c803c80a4","3081":"3d1e707778f5869e8872","3138":"e25464a30fe01479228a","3461":"2aa5281a8cc683555852","3694":"6016de6e5f7c25749422","4202":"dd592e5575b8e302689a","4287":"d2d09ffd5cd8680fad8d","4406":"573d234b4641d23cf8db","4507":"601f253b00068ad2f069","4819":"c4b011e10d490b51636c","5015":"cb3361fcdff254ae2cb7","5028":"ffc3a7161b888b6fd0b0","5261":"2655560097e9250eac44","5457":"83e615e3bd63f68a3c5c","5485":"392fae4541d15edf92cf","5802":"70d423c8b488cc56cc36","6027":"de9008a750326fb298b5","6939":"41fbdef87597b5172ec6","7159":"fb9df255868960f69765","7431":"84b3d88ef94b97c84298","7639":"4b2f5183bb9f9eac3214","8094":"148a66619607e37cbf19","8305":"a1c83d47b477b2d67008","8499":"9398ee8f733b93220248","8558":"26dd566d92fc189baa48","8583":"82a7c9293ae0b8e396d9","9195":"5a1973df57059bc8dc68","9205":"09c52845b43bd8513d50","9845":"d52e8993eb5cde995219","9862":"126a8a8c84421a076527","9927":"2d2dd3bd5ee63121a527"}[chunkId] + ".js";
|
|
395664
396524
|
/******/ };
|
|
395665
396525
|
/******/ })();
|
|
395666
396526
|
/******/
|