dwv 0.31.0 → 0.31.1
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/dwv.js +25 -4
- package/dist/dwv.min.js +2 -2
- package/package.json +1 -1
package/dist/dwv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! dwv 0.31.
|
|
1
|
+
/*! dwv 0.31.1 2023-04-27 19:37:50 */
|
|
2
2
|
// Inspired from umdjs
|
|
3
3
|
// See https://github.com/umdjs/umd/blob/master/templates/returnExports.js
|
|
4
4
|
(function (root, factory) {
|
|
@@ -4749,7 +4749,7 @@ dwv.dicom = dwv.dicom || {};
|
|
|
4749
4749
|
* @returns {string} The version of the library.
|
|
4750
4750
|
*/
|
|
4751
4751
|
dwv.getVersion = function () {
|
|
4752
|
-
return '0.31.
|
|
4752
|
+
return '0.31.1';
|
|
4753
4753
|
};
|
|
4754
4754
|
|
|
4755
4755
|
/**
|
|
@@ -15923,6 +15923,8 @@ dwv.gui.ViewLayer = function (containerDiv) {
|
|
|
15923
15923
|
needsDraw = true;
|
|
15924
15924
|
}
|
|
15925
15925
|
|
|
15926
|
+
// previous fit scale
|
|
15927
|
+
var previousFitScale = fitScale;
|
|
15926
15928
|
// previous scale without fit
|
|
15927
15929
|
var previousScale = {
|
|
15928
15930
|
x: scale.x / fitScale.x,
|
|
@@ -15951,9 +15953,19 @@ dwv.gui.ViewLayer = function (containerDiv) {
|
|
|
15951
15953
|
x: fitOffset.x / newFitScale.x,
|
|
15952
15954
|
y: fitOffset.y / newFitScale.y
|
|
15953
15955
|
};
|
|
15956
|
+
var newFlipOffset = {
|
|
15957
|
+
x: flipOffset.x * previousFitScale.x / newFitScale.x,
|
|
15958
|
+
y: flipOffset.y * previousFitScale.y / newFitScale.y
|
|
15959
|
+
};
|
|
15954
15960
|
// check if different
|
|
15955
|
-
if (viewOffset.x !== newViewOffset.x ||
|
|
15961
|
+
if (viewOffset.x !== newViewOffset.x ||
|
|
15962
|
+
viewOffset.y !== newViewOffset.y ||
|
|
15963
|
+
flipOffset.x !== newFlipOffset.x ||
|
|
15964
|
+
flipOffset.y !== newFlipOffset.y) {
|
|
15965
|
+
// update private local offsets
|
|
15966
|
+
flipOffset = newFlipOffset;
|
|
15956
15967
|
viewOffset = newViewOffset;
|
|
15968
|
+
// update global offset
|
|
15957
15969
|
offset = {
|
|
15958
15970
|
x: viewOffset.x + baseOffset.x + zoomOffset.x + flipOffset.x,
|
|
15959
15971
|
y: viewOffset.y + baseOffset.y + zoomOffset.y + flipOffset.y
|
|
@@ -21263,6 +21275,15 @@ dwv.image.MaskFactory.prototype.create = function (
|
|
|
21263
21275
|
dwv.logger.warn(
|
|
21264
21276
|
'Using larger real world epsilon in SEG pos pat adding'
|
|
21265
21277
|
);
|
|
21278
|
+
} else {
|
|
21279
|
+
// try even larger epsilon
|
|
21280
|
+
res = value > dwv.math.REAL_WORLD_EPSILON * 100;
|
|
21281
|
+
if (!res) {
|
|
21282
|
+
// warn if epsilon < value < epsilon * 100
|
|
21283
|
+
dwv.logger.warn(
|
|
21284
|
+
'Using even larger real world epsilon in SEG pos pat adding'
|
|
21285
|
+
);
|
|
21286
|
+
}
|
|
21266
21287
|
}
|
|
21267
21288
|
}
|
|
21268
21289
|
return res;
|
|
@@ -23423,7 +23444,7 @@ dwv.image.ViewFactory.prototype.create = function (dicomElements, image) {
|
|
|
23423
23444
|
for (var key in dwv.tool.defaultpresets[modality]) {
|
|
23424
23445
|
var preset = dwv.tool.defaultpresets[modality][key];
|
|
23425
23446
|
windowPresets[key] = {
|
|
23426
|
-
wl: new dwv.image.WindowLevel(preset.center, preset.width),
|
|
23447
|
+
wl: [new dwv.image.WindowLevel(preset.center, preset.width)],
|
|
23427
23448
|
name: key
|
|
23428
23449
|
};
|
|
23429
23450
|
}
|