@cornerstonejs/adapters 1.63.2 → 1.63.4
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/adapters.es.js +32 -24
- package/dist/adapters.es.js.map +1 -1
- package/package.json +5 -5
package/dist/adapters.es.js
CHANGED
|
@@ -41343,6 +41343,24 @@ var transferFunctionUtils = /*#__PURE__*/Object.freeze({
|
|
|
41343
41343
|
setTransferFunctionNodes: setTransferFunctionNodes
|
|
41344
41344
|
});
|
|
41345
41345
|
|
|
41346
|
+
const _colormaps = new Map();
|
|
41347
|
+
function registerColormap(colormap) {
|
|
41348
|
+
_colormaps.set(colormap.Name, colormap);
|
|
41349
|
+
}
|
|
41350
|
+
function getColormap(name) {
|
|
41351
|
+
return _colormaps.get(name);
|
|
41352
|
+
}
|
|
41353
|
+
function getColormapNames() {
|
|
41354
|
+
return Array.from(_colormaps.keys());
|
|
41355
|
+
}
|
|
41356
|
+
|
|
41357
|
+
var colormap = /*#__PURE__*/Object.freeze({
|
|
41358
|
+
__proto__: null,
|
|
41359
|
+
getColormap: getColormap,
|
|
41360
|
+
getColormapNames: getColormapNames,
|
|
41361
|
+
registerColormap: registerColormap
|
|
41362
|
+
});
|
|
41363
|
+
|
|
41346
41364
|
class BaseVolumeViewport extends Viewport$1 {
|
|
41347
41365
|
constructor(props) {
|
|
41348
41366
|
super(props);
|
|
@@ -41422,7 +41440,9 @@ class BaseVolumeViewport extends Viewport$1 {
|
|
|
41422
41440
|
acc.push(node.x, node.r, node.g, node.b);
|
|
41423
41441
|
return acc;
|
|
41424
41442
|
}, []);
|
|
41425
|
-
const
|
|
41443
|
+
const colormapsVTK = vtkColorMaps.rgbPresetNames.map(presetName => vtkColorMaps.getPresetByName(presetName));
|
|
41444
|
+
const colormapsCS3D = getColormapNames().map(colormapName => getColormap(colormapName));
|
|
41445
|
+
const colormaps = colormapsVTK.concat(colormapsCS3D);
|
|
41426
41446
|
const matchedColormap = colormaps.find(colormap => {
|
|
41427
41447
|
const {
|
|
41428
41448
|
RGBPoints: presetRGBPoints
|
|
@@ -42856,24 +42876,6 @@ var planar = /*#__PURE__*/Object.freeze({
|
|
|
42856
42876
|
threePlaneIntersection: threePlaneIntersection
|
|
42857
42877
|
});
|
|
42858
42878
|
|
|
42859
|
-
const _colormaps = new Map();
|
|
42860
|
-
function registerColormap(colormap) {
|
|
42861
|
-
_colormaps.set(colormap.Name, colormap);
|
|
42862
|
-
}
|
|
42863
|
-
function getColormap(name) {
|
|
42864
|
-
return _colormaps.get(name);
|
|
42865
|
-
}
|
|
42866
|
-
function getColormapNames() {
|
|
42867
|
-
return Array.from(_colormaps.keys());
|
|
42868
|
-
}
|
|
42869
|
-
|
|
42870
|
-
var colormap = /*#__PURE__*/Object.freeze({
|
|
42871
|
-
__proto__: null,
|
|
42872
|
-
getColormap: getColormap,
|
|
42873
|
-
getColormapNames: getColormapNames,
|
|
42874
|
-
registerColormap: registerColormap
|
|
42875
|
-
});
|
|
42876
|
-
|
|
42877
42879
|
var utilities = /*#__PURE__*/Object.freeze({
|
|
42878
42880
|
__proto__: null,
|
|
42879
42881
|
PointsManager: PointsManager$2,
|
|
@@ -46568,7 +46570,7 @@ class CanvasActor {
|
|
|
46568
46570
|
let indicesToDelete;
|
|
46569
46571
|
for (const run of row) {
|
|
46570
46572
|
const {
|
|
46571
|
-
start
|
|
46573
|
+
start,
|
|
46572
46574
|
end,
|
|
46573
46575
|
value: segmentIndex
|
|
46574
46576
|
} = run;
|
|
@@ -46594,7 +46596,7 @@ class CanvasActor {
|
|
|
46594
46596
|
}
|
|
46595
46597
|
const dirtyWidth = dirtyX2 - dirtyX;
|
|
46596
46598
|
const dirtyHeight = dirtyY2 - dirtyY;
|
|
46597
|
-
localContext.putImageData(imageData, 0, 0, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
|
|
46599
|
+
localContext.putImageData(imageData, 0, 0, dirtyX - 1, dirtyY - 1, dirtyWidth + 2, dirtyHeight + 2);
|
|
46598
46600
|
context.drawImage(canvas, dirtyX, dirtyY, dirtyWidth, dirtyHeight, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
|
|
46599
46601
|
}
|
|
46600
46602
|
render(viewport, context) {
|
|
@@ -46818,6 +46820,7 @@ class VideoViewport extends Viewport$1 {
|
|
|
46818
46820
|
time: this.videoElement.currentTime,
|
|
46819
46821
|
duration: this.videoElement.duration
|
|
46820
46822
|
});
|
|
46823
|
+
this.initialRender?.();
|
|
46821
46824
|
const frame = this.getFrameNumber();
|
|
46822
46825
|
if (this.isPlaying) {
|
|
46823
46826
|
if (frame < this.frameRange[0]) {
|
|
@@ -46844,6 +46847,7 @@ class VideoViewport extends Viewport$1 {
|
|
|
46844
46847
|
this.videoElement = document.createElement('video');
|
|
46845
46848
|
this.videoElement.muted = this.mute;
|
|
46846
46849
|
this.videoElement.loop = this.loop;
|
|
46850
|
+
this.videoElement.autoplay = true;
|
|
46847
46851
|
this.videoElement.crossOrigin = 'anonymous';
|
|
46848
46852
|
this.addEventListeners();
|
|
46849
46853
|
this.resize();
|
|
@@ -46928,13 +46932,16 @@ class VideoViewport extends Viewport$1 {
|
|
|
46928
46932
|
this.fps = cineRate;
|
|
46929
46933
|
this.numberOfFrames = numberOfFrames;
|
|
46930
46934
|
this.setFrameRange([1, numberOfFrames]);
|
|
46931
|
-
this.
|
|
46935
|
+
this.initialRender = () => {
|
|
46936
|
+
this.initialRender = null;
|
|
46937
|
+
this.pause();
|
|
46938
|
+
this.setFrameNumber(frameNumber || 1);
|
|
46939
|
+
};
|
|
46932
46940
|
return new Promise(resolve => {
|
|
46933
46941
|
window.setTimeout(() => {
|
|
46934
|
-
this.pause();
|
|
46935
46942
|
this.setFrameNumber(frameNumber || 1);
|
|
46936
46943
|
resolve(this);
|
|
46937
|
-
},
|
|
46944
|
+
}, 25);
|
|
46938
46945
|
});
|
|
46939
46946
|
});
|
|
46940
46947
|
}
|
|
@@ -47208,6 +47215,7 @@ class VideoViewport extends Viewport$1 {
|
|
|
47208
47215
|
const panWorldDelta = [(focalPointCanvas[0] - canvasCenter[0]) / this.videoCamera.parallelScale, (focalPointCanvas[1] - canvasCenter[1]) / this.videoCamera.parallelScale];
|
|
47209
47216
|
this.videoCamera.panWorld = [this.videoCamera.panWorld[0] - panWorldDelta[0], this.videoCamera.panWorld[1] - panWorldDelta[1]];
|
|
47210
47217
|
}
|
|
47218
|
+
this.canvasContext.fillStyle = 'rgba(0,0,0,1)';
|
|
47211
47219
|
this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
47212
47220
|
if (this.isPlaying === false) {
|
|
47213
47221
|
this.renderFrame();
|