larvitar 2.1.5 → 2.1.6
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/README.md +2 -2
- package/dist/imaging/imageIo.d.ts +1 -1
- package/dist/imaging/imageLoading.d.ts +6 -0
- package/dist/imaging/imageRendering.d.ts +7 -0
- package/dist/imaging/imageStore.d.ts +6 -3
- package/dist/imaging/imageUtils.d.ts +5 -7
- package/dist/imaging/loaders/dicomLoader.d.ts +16 -0
- package/dist/imaging/loaders/dsaImageLoader.d.ts +27 -0
- package/dist/imaging/loaders/multiframeLoader.d.ts +3 -4
- package/dist/imaging/postProcessing/applyDSA.d.ts +23 -0
- package/dist/imaging/tools/custom/customMouseWheelScrollTool.d.ts +1 -0
- package/dist/imaging/tools/custom/utils/customMouseWheelUtils.d.ts +1 -0
- package/dist/imaging/tools/custom/utils/loadHandlerManager.d.ts +17 -0
- package/dist/imaging/tools/default.d.ts +1 -1
- package/dist/imaging/tools/main.d.ts +1 -1
- package/dist/imaging/tools/segmentation.d.ts +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/larvitar.js +1001 -114
- package/dist/larvitar.js.map +1 -1
- package/imaging/MetaDataTypes.d.ts +2 -2
- package/imaging/types.d.ts +17 -0
- package/package.json +1 -1
package/dist/larvitar.js
CHANGED
|
@@ -4462,6 +4462,87 @@ function getCircleWithThreshold(image, radius, thresholds, xCoord = 0, yCoord =
|
|
|
4462
4462
|
|
|
4463
4463
|
/***/ }),
|
|
4464
4464
|
|
|
4465
|
+
/***/ 9003:
|
|
4466
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4467
|
+
|
|
4468
|
+
"use strict";
|
|
4469
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4470
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4471
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4472
|
+
/* harmony export */ });
|
|
4473
|
+
/* harmony import */ var cornerstone_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4030);
|
|
4474
|
+
/* harmony import */ var cornerstone_tools__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cornerstone_tools__WEBPACK_IMPORTED_MODULE_0__);
|
|
4475
|
+
// external libraries
|
|
4476
|
+
|
|
4477
|
+
|
|
4478
|
+
// global variables
|
|
4479
|
+
const external = (cornerstone_tools__WEBPACK_IMPORTED_MODULE_0___default().external);
|
|
4480
|
+
const _DEFAULT_LOAD_HANDLER = "DEFAULT";
|
|
4481
|
+
const defaultStartLoadHandler = {};
|
|
4482
|
+
const defaultEndLoadHandler = {};
|
|
4483
|
+
const defaultErrorLoadingHandler = {};
|
|
4484
|
+
function _getUUIDFromElement(element) {
|
|
4485
|
+
if (!element) {
|
|
4486
|
+
return _DEFAULT_LOAD_HANDLER;
|
|
4487
|
+
}
|
|
4488
|
+
const uuid = external.cornerstone.getEnabledElement(element).uuid;
|
|
4489
|
+
if (!uuid) {
|
|
4490
|
+
throw new Error("Something went wrong when getting uuid from element");
|
|
4491
|
+
}
|
|
4492
|
+
return uuid;
|
|
4493
|
+
}
|
|
4494
|
+
function setStartLoadHandler(handler, element = undefined) {
|
|
4495
|
+
if (!handler) {
|
|
4496
|
+
throw new Error("The Handler function must be defined");
|
|
4497
|
+
}
|
|
4498
|
+
const uuid = _getUUIDFromElement(element);
|
|
4499
|
+
defaultStartLoadHandler[uuid] = handler;
|
|
4500
|
+
}
|
|
4501
|
+
function getStartLoadHandler(element) {
|
|
4502
|
+
const uuid = _getUUIDFromElement(element);
|
|
4503
|
+
return defaultStartLoadHandler[uuid] || defaultStartLoadHandler[_DEFAULT_LOAD_HANDLER];
|
|
4504
|
+
}
|
|
4505
|
+
function setEndLoadHandler(handler, element = undefined) {
|
|
4506
|
+
if (!handler) {
|
|
4507
|
+
throw new Error("The Handler function must be defined");
|
|
4508
|
+
}
|
|
4509
|
+
const uuid = _getUUIDFromElement(element);
|
|
4510
|
+
defaultEndLoadHandler[uuid] = handler;
|
|
4511
|
+
}
|
|
4512
|
+
function getEndLoadHandler(element) {
|
|
4513
|
+
const uuid = _getUUIDFromElement(element);
|
|
4514
|
+
return defaultEndLoadHandler[uuid] || defaultEndLoadHandler[_DEFAULT_LOAD_HANDLER];
|
|
4515
|
+
}
|
|
4516
|
+
function setErrorLoadingHandler(handler, element = undefined) {
|
|
4517
|
+
if (!handler) {
|
|
4518
|
+
throw new Error("The Handler function must be defined");
|
|
4519
|
+
}
|
|
4520
|
+
const uuid = _getUUIDFromElement(element);
|
|
4521
|
+
defaultErrorLoadingHandler[uuid] = handler;
|
|
4522
|
+
}
|
|
4523
|
+
function getErrorLoadingHandler(element) {
|
|
4524
|
+
const uuid = _getUUIDFromElement(element);
|
|
4525
|
+
return defaultErrorLoadingHandler[uuid] || defaultErrorLoadingHandler[_DEFAULT_LOAD_HANDLER];
|
|
4526
|
+
}
|
|
4527
|
+
function removeHandlers(element) {
|
|
4528
|
+
const uuid = _getUUIDFromElement(element);
|
|
4529
|
+
delete defaultStartLoadHandler[uuid];
|
|
4530
|
+
delete defaultEndLoadHandler[uuid];
|
|
4531
|
+
delete defaultErrorLoadingHandler[uuid];
|
|
4532
|
+
}
|
|
4533
|
+
const loadHandlerManager = {
|
|
4534
|
+
setStartLoadHandler,
|
|
4535
|
+
getStartLoadHandler,
|
|
4536
|
+
setEndLoadHandler,
|
|
4537
|
+
getEndLoadHandler,
|
|
4538
|
+
setErrorLoadingHandler,
|
|
4539
|
+
getErrorLoadingHandler,
|
|
4540
|
+
removeHandlers
|
|
4541
|
+
};
|
|
4542
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (loadHandlerManager);
|
|
4543
|
+
|
|
4544
|
+
/***/ }),
|
|
4545
|
+
|
|
4465
4546
|
/***/ 7371:
|
|
4466
4547
|
/***/ ((module) => {
|
|
4467
4548
|
|
|
@@ -156941,7 +157022,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
156941
157022
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
156942
157023
|
};
|
|
156943
157024
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
156944
|
-
exports.updateLoadedStack = exports.registerMultiFrameImageLoader = exports.registerResliceLoader = exports.registerNRRDImageLoader = exports.initializeFileImageLoader = exports.initializeWebImageLoader = exports.initializeImageLoader = void 0;
|
|
157025
|
+
exports.updateLoadedStack = exports.registerDsaImageLoader = exports.registerMultiFrameImageLoader = exports.registerResliceLoader = exports.registerNRRDImageLoader = exports.initializeFileImageLoader = exports.initializeWebImageLoader = exports.initializeImageLoader = void 0;
|
|
156945
157026
|
// external libraries
|
|
156946
157027
|
const cornerstone_core_1 = __importDefault(__webpack_require__(7371));
|
|
156947
157028
|
const dicom_parser_1 = __importDefault(__webpack_require__(4705));
|
|
@@ -156956,6 +157037,7 @@ const imageUtils_1 = __webpack_require__(8345);
|
|
|
156956
157037
|
const nrrdLoader_1 = __webpack_require__(6934);
|
|
156957
157038
|
const resliceLoader_1 = __webpack_require__(5779);
|
|
156958
157039
|
const multiframeLoader_1 = __webpack_require__(934);
|
|
157040
|
+
const dsaImageLoader_1 = __webpack_require__(6475);
|
|
156959
157041
|
/**
|
|
156960
157042
|
* Global standard configuration
|
|
156961
157043
|
* @inner
|
|
@@ -157050,6 +157132,15 @@ const registerMultiFrameImageLoader = function () {
|
|
|
157050
157132
|
cornerstone_core_1.default.registerImageLoader("multiFrameLoader", multiframeLoader_1.loadMultiFrameImage);
|
|
157051
157133
|
};
|
|
157052
157134
|
exports.registerMultiFrameImageLoader = registerMultiFrameImageLoader;
|
|
157135
|
+
/**
|
|
157136
|
+
* Register custom DSA ImageLoader
|
|
157137
|
+
* @instance
|
|
157138
|
+
* @function registerDsaImageLoader
|
|
157139
|
+
*/
|
|
157140
|
+
const registerDsaImageLoader = function () {
|
|
157141
|
+
cornerstone_core_1.default.registerImageLoader("dsaImageLoader", dsaImageLoader_1.loadDsaImage);
|
|
157142
|
+
};
|
|
157143
|
+
exports.registerDsaImageLoader = registerDsaImageLoader;
|
|
157053
157144
|
/**
|
|
157054
157145
|
* Update the allSeriesStack object using DICOMImageLoader fileManager
|
|
157055
157146
|
* @instance
|
|
@@ -157789,7 +157880,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
157789
157880
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
157790
157881
|
};
|
|
157791
157882
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
157792
|
-
exports.rotateImageRight = exports.rotateImageLeft = exports.flipImageVertical = exports.flipImageHorizontal = exports.invertImage = exports.storeViewportData = exports.updateViewportData = exports.resetViewports = exports.updateImage = exports.renderImage = exports.resizeViewport = exports.unloadViewport = exports.disableViewport = exports.renderWebImage = exports.renderFileImage = exports.renderDICOMPDF = exports.loadAndCacheImages = exports.loadAndCacheImage = exports.clearImageCache = void 0;
|
|
157883
|
+
exports.rotateImageRight = exports.rotateImageLeft = exports.flipImageVertical = exports.flipImageHorizontal = exports.invertImage = exports.storeViewportData = exports.updateViewportData = exports.resetViewports = exports.updateImage = exports.redrawImage = exports.renderImage = exports.resizeViewport = exports.unloadViewport = exports.disableViewport = exports.renderWebImage = exports.renderFileImage = exports.renderDICOMPDF = exports.loadAndCacheImages = exports.loadAndCacheImage = exports.clearImageCache = void 0;
|
|
157793
157884
|
// external libraries
|
|
157794
157885
|
const cornerstone_core_1 = __importDefault(__webpack_require__(7371));
|
|
157795
157886
|
const cornerstone_wado_image_loader_1 = __importDefault(__webpack_require__(2424));
|
|
@@ -157805,6 +157896,7 @@ const imageUtils_1 = __webpack_require__(8345);
|
|
|
157805
157896
|
const default_1 = __webpack_require__(6694);
|
|
157806
157897
|
const imageLoading_1 = __webpack_require__(5848);
|
|
157807
157898
|
const pdf_1 = __webpack_require__(9425);
|
|
157899
|
+
const dsaImageLoader_1 = __webpack_require__(6475);
|
|
157808
157900
|
/*
|
|
157809
157901
|
* This module provides the following functions to be exported:
|
|
157810
157902
|
* clearImageCache(seriesId)
|
|
@@ -158271,12 +158363,30 @@ const renderImage = function (seriesStack, elementId, defaultProps) {
|
|
|
158271
158363
|
data = null;
|
|
158272
158364
|
resolve(true);
|
|
158273
158365
|
});
|
|
158366
|
+
// }
|
|
158274
158367
|
});
|
|
158275
158368
|
(0, main_1.csToolsCreateStack)(element, series.imageIds, data.imageIndex - 1);
|
|
158276
158369
|
(0, interaction_1.toggleMouseToolsListeners)(id, false);
|
|
158277
158370
|
return renderPromise;
|
|
158278
158371
|
};
|
|
158279
158372
|
exports.renderImage = renderImage;
|
|
158373
|
+
/**
|
|
158374
|
+
* Redraw the cornerstone image
|
|
158375
|
+
* @instance
|
|
158376
|
+
* @function redrawImage
|
|
158377
|
+
* @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
|
|
158378
|
+
*/
|
|
158379
|
+
const redrawImage = function (elementId) {
|
|
158380
|
+
const element = document.getElementById(elementId);
|
|
158381
|
+
if (element) {
|
|
158382
|
+
const cornestoneElement = cornerstone_core_1.default.getEnabledElement(element);
|
|
158383
|
+
cornerstone_core_1.default.drawImage(cornestoneElement, true);
|
|
158384
|
+
}
|
|
158385
|
+
else {
|
|
158386
|
+
console.error("invalid html element: " + elementId);
|
|
158387
|
+
}
|
|
158388
|
+
};
|
|
158389
|
+
exports.redrawImage = redrawImage;
|
|
158280
158390
|
/**
|
|
158281
158391
|
* Update the cornerstone image with new imageIndex
|
|
158282
158392
|
* @instance
|
|
@@ -158295,7 +158405,15 @@ const updateImage = function (series, elementId, imageIndex, cacheImage) {
|
|
|
158295
158405
|
throw "not element";
|
|
158296
158406
|
}
|
|
158297
158407
|
const id = (0, imageUtils_1.isElement)(elementId) ? element.id : elementId;
|
|
158298
|
-
const
|
|
158408
|
+
const isDSAEnabled = imageStore_1.default.get(["viewports", id, "isDSAEnabled"]);
|
|
158409
|
+
const imageId = isDSAEnabled === true
|
|
158410
|
+
? series.dsa.imageIds[imageIndex]
|
|
158411
|
+
: series.imageIds[imageIndex];
|
|
158412
|
+
if (isDSAEnabled === true) {
|
|
158413
|
+
// get the optional custom pixel shift
|
|
158414
|
+
const pixelShift = imageStore_1.default.get(["viewports", id, "pixelShift"]);
|
|
158415
|
+
(0, dsaImageLoader_1.setPixelShift)(pixelShift);
|
|
158416
|
+
}
|
|
158299
158417
|
if (!imageId) {
|
|
158300
158418
|
(0, imageStore_1.set)(["pendingSliceId", id, imageIndex]);
|
|
158301
158419
|
throw `Error: wrong image index ${imageIndex}, no imageId available`;
|
|
@@ -158317,7 +158435,7 @@ const updateImage = function (series, elementId, imageIndex, cacheImage) {
|
|
|
158317
158435
|
const t1 = performance.now();
|
|
158318
158436
|
if (t0 !== undefined) {
|
|
158319
158437
|
// check if t0 is defined before using it
|
|
158320
|
-
console.log(`Call to updateImage took ${t1 - t0} milliseconds.`);
|
|
158438
|
+
console.log(`Call to updateImage for viewport ${id} took ${t1 - t0} milliseconds.`);
|
|
158321
158439
|
}
|
|
158322
158440
|
}
|
|
158323
158441
|
(0, imageStore_1.set)(["sliceId", id, imageIndex]);
|
|
@@ -158339,7 +158457,7 @@ const updateImage = function (series, elementId, imageIndex, cacheImage) {
|
|
|
158339
158457
|
const t1 = performance.now();
|
|
158340
158458
|
if (t0 !== undefined) {
|
|
158341
158459
|
// check if t0 is defined before using it
|
|
158342
|
-
console.log(`Call to updateImage took ${t1 - t0} milliseconds.`);
|
|
158460
|
+
console.log(`Call to updateImage for viewport ${id} took ${t1 - t0} milliseconds.`);
|
|
158343
158461
|
}
|
|
158344
158462
|
}
|
|
158345
158463
|
(0, imageStore_1.set)(["sliceId", id, imageIndex]);
|
|
@@ -158906,6 +159024,7 @@ const DEFAULT_VIEWPORT = {
|
|
|
158906
159024
|
isColor: false,
|
|
158907
159025
|
isMultiframe: false,
|
|
158908
159026
|
isTimeserie: false,
|
|
159027
|
+
isDSAEnabled: false,
|
|
158909
159028
|
isPDF: false,
|
|
158910
159029
|
waveform: false,
|
|
158911
159030
|
viewport: {
|
|
@@ -158983,6 +159102,7 @@ const setValue = (store, data) => {
|
|
|
158983
159102
|
case "isPDF":
|
|
158984
159103
|
case "waveform":
|
|
158985
159104
|
case "isTimeserie":
|
|
159105
|
+
case "isDSAEnabled":
|
|
158986
159106
|
case "ready":
|
|
158987
159107
|
if (!viewport) {
|
|
158988
159108
|
return;
|
|
@@ -159011,6 +159131,7 @@ const setValue = (store, data) => {
|
|
|
159011
159131
|
break;
|
|
159012
159132
|
case "timestamps":
|
|
159013
159133
|
case "timeIds":
|
|
159134
|
+
case "pixelShift":
|
|
159014
159135
|
if (!viewport) {
|
|
159015
159136
|
return;
|
|
159016
159137
|
}
|
|
@@ -159181,10 +159302,16 @@ exports["default"] = {
|
|
|
159181
159302
|
setTimeId: (elementId, timeIndex) => {
|
|
159182
159303
|
(0, exports.set)(["timeId", elementId, timeIndex]);
|
|
159183
159304
|
},
|
|
159305
|
+
setDSAEnabled: (elementId, enabled) => {
|
|
159306
|
+
(0, exports.set)(["isDSAEnabled", elementId, enabled]);
|
|
159307
|
+
},
|
|
159308
|
+
setDSAPixelShift: (elementId, pixelShift) => {
|
|
159309
|
+
(0, exports.set)(["pixelShift", elementId, pixelShift]);
|
|
159310
|
+
},
|
|
159184
159311
|
// get
|
|
159185
159312
|
get: (props) => {
|
|
159186
159313
|
validateStore();
|
|
159187
|
-
return (0, lodash_1.get)(STORE, props);
|
|
159314
|
+
return props ? (0, lodash_1.get)(STORE, props) : STORE;
|
|
159188
159315
|
},
|
|
159189
159316
|
// watch store
|
|
159190
159317
|
addStoreListener: (listener) => (storeListener = listener),
|
|
@@ -159880,17 +160007,13 @@ const getNormalOrientation = function (el) {
|
|
|
159880
160007
|
};
|
|
159881
160008
|
exports.getNormalOrientation = getNormalOrientation;
|
|
159882
160009
|
/**
|
|
159883
|
-
*
|
|
160010
|
+
* Get the min pixel value from pixelData
|
|
159884
160011
|
* @instance
|
|
159885
160012
|
* @function getMinPixelValue
|
|
159886
|
-
* @param {Number} value - The min value
|
|
159887
160013
|
* @param {Array} pixelData - Pixel data array
|
|
159888
160014
|
*/
|
|
159889
|
-
const getMinPixelValue = function (
|
|
159890
|
-
|
|
159891
|
-
return value;
|
|
159892
|
-
}
|
|
159893
|
-
let min;
|
|
160015
|
+
const getMinPixelValue = function (pixelData) {
|
|
160016
|
+
let min = 0;
|
|
159894
160017
|
for (let i = 0; i < pixelData.length; i++) {
|
|
159895
160018
|
if (!min || min > pixelData[i]) {
|
|
159896
160019
|
min = pixelData[i];
|
|
@@ -159900,17 +160023,13 @@ const getMinPixelValue = function (value, pixelData) {
|
|
|
159900
160023
|
};
|
|
159901
160024
|
exports.getMinPixelValue = getMinPixelValue;
|
|
159902
160025
|
/**
|
|
159903
|
-
*
|
|
160026
|
+
* Get the max pixel value from pixelData
|
|
159904
160027
|
* @instance
|
|
159905
160028
|
* @function getMaxPixelValue
|
|
159906
|
-
* @param {Number} value - The max value
|
|
159907
160029
|
* @param {Array} pixelData - Pixel data array
|
|
159908
160030
|
*/
|
|
159909
|
-
const getMaxPixelValue = function (
|
|
159910
|
-
|
|
159911
|
-
return value;
|
|
159912
|
-
}
|
|
159913
|
-
let max;
|
|
160031
|
+
const getMaxPixelValue = function (pixelData) {
|
|
160032
|
+
let max = 0;
|
|
159914
160033
|
for (let i = 0; i < pixelData.length; i++) {
|
|
159915
160034
|
if (!max || max < pixelData[i]) {
|
|
159916
160035
|
max = pixelData[i];
|
|
@@ -161000,13 +161119,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
161000
161119
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
161001
161120
|
});
|
|
161002
161121
|
};
|
|
161122
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
161123
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
161124
|
+
};
|
|
161003
161125
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
161004
|
-
exports.getDicomImageId = exports.cacheImages = exports.cacheImage = void 0;
|
|
161126
|
+
exports.getDicomImageId = exports.loadAndCacheImageStack = exports.unloadAndRecacheImageStackDSA = exports.cacheImages = exports.cacheImage = void 0;
|
|
161127
|
+
// external libraries
|
|
161128
|
+
const cornerstone_core_1 = __importDefault(__webpack_require__(7371));
|
|
161005
161129
|
// internal libraries
|
|
161006
161130
|
const imageRendering_1 = __webpack_require__(4767);
|
|
161131
|
+
const imageStore_1 = __importDefault(__webpack_require__(5278));
|
|
161007
161132
|
/*
|
|
161008
161133
|
* This module provides the following functions to be exported:
|
|
161009
161134
|
* cacheImage(seriesData, imageIndex)
|
|
161135
|
+
* loadAndCacheImageStack(seriesData)
|
|
161136
|
+
* unloadAndRecacheImageStackDSA(seriesData)
|
|
161010
161137
|
* cacheImages(seriesData, callback)
|
|
161011
161138
|
* getDicomImageId(dicomLoaderName)
|
|
161012
161139
|
*/
|
|
@@ -161044,6 +161171,95 @@ const cacheImages = function (seriesData, callback) {
|
|
|
161044
161171
|
});
|
|
161045
161172
|
};
|
|
161046
161173
|
exports.cacheImages = cacheImages;
|
|
161174
|
+
/**
|
|
161175
|
+
* Unload DSA Image Stack and Recache Image Stack for DSA
|
|
161176
|
+
* @instance
|
|
161177
|
+
* @function unloadAndRecacheImageStackDSA
|
|
161178
|
+
* @param {Object} seriesData The series data
|
|
161179
|
+
* @return {Promise} Promise object represents the loading and caching of the image stack
|
|
161180
|
+
*/
|
|
161181
|
+
const unloadAndRecacheImageStackDSA = function (seriesData) {
|
|
161182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161183
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
161184
|
+
const t0 = performance.now();
|
|
161185
|
+
// add DSA imageIds to store
|
|
161186
|
+
if (seriesData.dsa === undefined) {
|
|
161187
|
+
console.warn("DSA image stack is not available");
|
|
161188
|
+
reject();
|
|
161189
|
+
return;
|
|
161190
|
+
}
|
|
161191
|
+
let promises = new Array(seriesData.dsa.imageIds.length);
|
|
161192
|
+
function cacheImageStack(imageIds, index) {
|
|
161193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161194
|
+
if (index < imageIds.length) {
|
|
161195
|
+
const imageId = imageIds[index];
|
|
161196
|
+
if (imageId) {
|
|
161197
|
+
yield cornerstone_core_1.default.imageCache.removeImageLoadObject(imageId);
|
|
161198
|
+
yield cornerstone_core_1.default.loadAndCacheImage(imageId).then(promise => {
|
|
161199
|
+
promises[index] = Promise.resolve(promise);
|
|
161200
|
+
});
|
|
161201
|
+
}
|
|
161202
|
+
else {
|
|
161203
|
+
console.warn(`Stack is not fully loaded, skipping cache for index ${index}`);
|
|
161204
|
+
}
|
|
161205
|
+
yield cacheImageStack(imageIds, index + 1);
|
|
161206
|
+
}
|
|
161207
|
+
});
|
|
161208
|
+
}
|
|
161209
|
+
yield cacheImageStack(seriesData.dsa.imageIds, 0);
|
|
161210
|
+
yield Promise.all(promises);
|
|
161211
|
+
const t1 = performance.now();
|
|
161212
|
+
console.log(`Call to unloadAndRecacheImageStackDSA took ${t1 - t0} milliseconds.`);
|
|
161213
|
+
resolve();
|
|
161214
|
+
}));
|
|
161215
|
+
});
|
|
161216
|
+
};
|
|
161217
|
+
exports.unloadAndRecacheImageStackDSA = unloadAndRecacheImageStackDSA;
|
|
161218
|
+
/**
|
|
161219
|
+
* Load and cache image stack
|
|
161220
|
+
* @instance
|
|
161221
|
+
* @function loadAndCacheImageStack
|
|
161222
|
+
* @param {Object} seriesData The series data
|
|
161223
|
+
* @return {Promise} Promise object represents the loading and caching of the image stack
|
|
161224
|
+
*/
|
|
161225
|
+
const loadAndCacheImageStack = function (seriesData) {
|
|
161226
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161227
|
+
return new Promise((resolve, _) => __awaiter(this, void 0, void 0, function* () {
|
|
161228
|
+
const t0 = performance.now();
|
|
161229
|
+
imageStore_1.default.addSeriesId(seriesData.seriesUID, seriesData.imageIds);
|
|
161230
|
+
let imageIds = seriesData.imageIds;
|
|
161231
|
+
// add DSA imageIds to store
|
|
161232
|
+
if (seriesData.dsa !== undefined) {
|
|
161233
|
+
const dsaSeriesUID = seriesData.seriesUID + "-DSA";
|
|
161234
|
+
imageStore_1.default.addSeriesId(dsaSeriesUID, seriesData.dsa.imageIds);
|
|
161235
|
+
imageIds = imageIds.concat(seriesData.dsa.imageIds);
|
|
161236
|
+
}
|
|
161237
|
+
let promises = new Array(imageIds.length);
|
|
161238
|
+
function cacheImageStack(imageIds, index) {
|
|
161239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161240
|
+
if (index < imageIds.length) {
|
|
161241
|
+
const imageId = imageIds[index];
|
|
161242
|
+
if (imageId) {
|
|
161243
|
+
yield cornerstone_core_1.default.loadAndCacheImage(imageId).then(promise => {
|
|
161244
|
+
promises[index] = Promise.resolve(promise);
|
|
161245
|
+
});
|
|
161246
|
+
}
|
|
161247
|
+
else {
|
|
161248
|
+
console.warn(`Stack is not fully loaded, skipping cache for index ${index}`);
|
|
161249
|
+
}
|
|
161250
|
+
yield cacheImageStack(imageIds, index + 1);
|
|
161251
|
+
}
|
|
161252
|
+
});
|
|
161253
|
+
}
|
|
161254
|
+
yield cacheImageStack(imageIds, 0);
|
|
161255
|
+
yield Promise.all(promises);
|
|
161256
|
+
const t1 = performance.now();
|
|
161257
|
+
console.log(`Call to loadAndCacheImageStack took ${t1 - t0} milliseconds.`);
|
|
161258
|
+
resolve();
|
|
161259
|
+
}));
|
|
161260
|
+
});
|
|
161261
|
+
};
|
|
161262
|
+
exports.loadAndCacheImageStack = loadAndCacheImageStack;
|
|
161047
161263
|
/**
|
|
161048
161264
|
* Get the dicom imageId from dicom loader
|
|
161049
161265
|
* @instance
|
|
@@ -161059,6 +161275,171 @@ const getDicomImageId = function (dicomLoaderName) {
|
|
|
161059
161275
|
exports.getDicomImageId = getDicomImageId;
|
|
161060
161276
|
|
|
161061
161277
|
|
|
161278
|
+
/***/ }),
|
|
161279
|
+
|
|
161280
|
+
/***/ 6475:
|
|
161281
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
161282
|
+
|
|
161283
|
+
"use strict";
|
|
161284
|
+
|
|
161285
|
+
/** @module loaders/multiframeLoader
|
|
161286
|
+
* @desc This file is a custom DICOM loader for multiframe images
|
|
161287
|
+
*/
|
|
161288
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
161289
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
161290
|
+
};
|
|
161291
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
161292
|
+
exports.setPixelShift = exports.populateDsaImageIds = exports.loadDsaImage = void 0;
|
|
161293
|
+
// external libraries
|
|
161294
|
+
const cornerstone_wado_image_loader_1 = __importDefault(__webpack_require__(2424));
|
|
161295
|
+
const cornerstone_core_1 = __importDefault(__webpack_require__(7371));
|
|
161296
|
+
const lodash_1 = __webpack_require__(6486);
|
|
161297
|
+
// internal libraries
|
|
161298
|
+
const commonLoader_1 = __webpack_require__(326);
|
|
161299
|
+
const imageUtils_1 = __webpack_require__(8345);
|
|
161300
|
+
const applyDSA_1 = __webpack_require__(1446);
|
|
161301
|
+
// global module variables
|
|
161302
|
+
let customImageLoaderCounter = 0;
|
|
161303
|
+
let PIXEL_SHIFT = undefined;
|
|
161304
|
+
/*
|
|
161305
|
+
* This module provides the following functions to be exported:
|
|
161306
|
+
* loadDsaImage(imageId)
|
|
161307
|
+
* setPixelShift(pixelShift)
|
|
161308
|
+
* populateDsaImageIds(seriesId)
|
|
161309
|
+
*/
|
|
161310
|
+
/**
|
|
161311
|
+
* Custom DSA Image Loader Function
|
|
161312
|
+
* @export
|
|
161313
|
+
* @function loadDsaImage
|
|
161314
|
+
* @param {String} imageId - ImageId tag
|
|
161315
|
+
* @returns {Function} Custom Image Creation Function
|
|
161316
|
+
*/
|
|
161317
|
+
const loadDsaImage = function (imageId) {
|
|
161318
|
+
let parsedImageId = cornerstone_wado_image_loader_1.default.wadouri.parseImageId(imageId);
|
|
161319
|
+
let rootImageId = parsedImageId.scheme + ":" + parsedImageId.url;
|
|
161320
|
+
let imageTracker = (0, commonLoader_1.getLarvitarImageTracker)();
|
|
161321
|
+
let seriesId = imageTracker[rootImageId];
|
|
161322
|
+
let manager = (0, commonLoader_1.getLarvitarManager)();
|
|
161323
|
+
if (manager) {
|
|
161324
|
+
let multiFrameSerie = manager[seriesId];
|
|
161325
|
+
const imageIds = multiFrameSerie.dsa.imageIds;
|
|
161326
|
+
const index = imageIds.indexOf(imageId);
|
|
161327
|
+
const pixelData = (0, applyDSA_1.applyDSA)(multiFrameSerie, index, PIXEL_SHIFT);
|
|
161328
|
+
const srcImage = (0, lodash_1.find)(cornerstone_core_1.default.imageCache.cachedImages, {
|
|
161329
|
+
imageId: multiFrameSerie.imageIds[index]
|
|
161330
|
+
}).image;
|
|
161331
|
+
console.debug(`Load DSA Image with custom loader for imageId: ${imageId}`);
|
|
161332
|
+
return createCustomImage(imageId, srcImage, pixelData);
|
|
161333
|
+
}
|
|
161334
|
+
else {
|
|
161335
|
+
throw new Error("No multiframe dataset found for seriesId: " + seriesId);
|
|
161336
|
+
}
|
|
161337
|
+
};
|
|
161338
|
+
exports.loadDsaImage = loadDsaImage;
|
|
161339
|
+
/**
|
|
161340
|
+
* Populate the DSA imageIds for a given seriesId
|
|
161341
|
+
* @export
|
|
161342
|
+
* @function populateDsaImageIds
|
|
161343
|
+
* @param {String} seriesId - SeriesId tag
|
|
161344
|
+
* @param {Object} serie - parsed serie object
|
|
161345
|
+
*/
|
|
161346
|
+
const populateDsaImageIds = function (larvitarSeriesInstanceUID) {
|
|
161347
|
+
let t0 = performance.now();
|
|
161348
|
+
const serie = (0, commonLoader_1.getSeriesDataFromLarvitarManager)(larvitarSeriesInstanceUID);
|
|
161349
|
+
if (serie) {
|
|
161350
|
+
const numberOfFrames = serie.metadata.numberOfFrames;
|
|
161351
|
+
const imageId = getDsaImageId("dsaImageLoader");
|
|
161352
|
+
let imageTracker = (0, commonLoader_1.getLarvitarImageTracker)();
|
|
161353
|
+
imageTracker[imageId] = larvitarSeriesInstanceUID;
|
|
161354
|
+
let imageIds = [];
|
|
161355
|
+
(0, lodash_1.each)((0, lodash_1.range)(numberOfFrames), function (frameNumber) {
|
|
161356
|
+
const frameImageId = imageId + "?frame=" + frameNumber;
|
|
161357
|
+
imageIds.push(frameImageId);
|
|
161358
|
+
});
|
|
161359
|
+
const dsa = {
|
|
161360
|
+
imageIds: imageIds,
|
|
161361
|
+
x00286101: serie.metadata.x00286100[0].x00286101,
|
|
161362
|
+
x00286102: serie.metadata.x00286100[0].x00286102,
|
|
161363
|
+
x00286110: serie.metadata.x00286100[0].x00286110,
|
|
161364
|
+
x00286112: serie.metadata.x00286100[0].x00286112,
|
|
161365
|
+
x00286114: serie.metadata.x00286100[0].x00286114,
|
|
161366
|
+
x00286120: serie.metadata.x00286100[0].x00286120,
|
|
161367
|
+
x00286190: serie.metadata.x00286100[0].x00286190,
|
|
161368
|
+
x00289416: serie.metadata.x00286100[0].x00289416,
|
|
161369
|
+
x00289454: serie.metadata.x00286100[0].x00289454
|
|
161370
|
+
};
|
|
161371
|
+
serie.dsa = dsa;
|
|
161372
|
+
}
|
|
161373
|
+
else {
|
|
161374
|
+
throw new Error("No serie found for seriesId: " + larvitarSeriesInstanceUID);
|
|
161375
|
+
}
|
|
161376
|
+
let t1 = performance.now();
|
|
161377
|
+
console.log(`Call to populateDsaImageIds took ${t1 - t0} milliseconds.`);
|
|
161378
|
+
};
|
|
161379
|
+
exports.populateDsaImageIds = populateDsaImageIds;
|
|
161380
|
+
/**
|
|
161381
|
+
* Set the pixel shift for DSA
|
|
161382
|
+
* @instance
|
|
161383
|
+
* @function setPixelShift
|
|
161384
|
+
* @param {Array} pixelShift The pixel shift array
|
|
161385
|
+
*/
|
|
161386
|
+
const setPixelShift = function (pixelShift) {
|
|
161387
|
+
PIXEL_SHIFT = pixelShift;
|
|
161388
|
+
};
|
|
161389
|
+
exports.setPixelShift = setPixelShift;
|
|
161390
|
+
/**
|
|
161391
|
+
* Get the custom imageId from custom loader
|
|
161392
|
+
* @instance
|
|
161393
|
+
* @function getDsaImageId
|
|
161394
|
+
* @param {String} customLoaderName The custom loader name
|
|
161395
|
+
* @return {String} the custom image id
|
|
161396
|
+
*/
|
|
161397
|
+
const getDsaImageId = function (customLoaderName) {
|
|
161398
|
+
let imageId = customLoaderName + "://" + customImageLoaderCounter;
|
|
161399
|
+
customImageLoaderCounter++;
|
|
161400
|
+
return imageId;
|
|
161401
|
+
};
|
|
161402
|
+
/**
|
|
161403
|
+
* Create the custom image object for cornerstone from custom image
|
|
161404
|
+
* @instance
|
|
161405
|
+
* @function createCustomImage
|
|
161406
|
+
* @param {String} imageId The custom image id
|
|
161407
|
+
* @param {Object} srcImage The source image object
|
|
161408
|
+
* @param {Array} pixelData The pixel data array
|
|
161409
|
+
* @return {Object} the custom image object
|
|
161410
|
+
*/
|
|
161411
|
+
let createCustomImage = function (imageId, srcImage, pixelData) {
|
|
161412
|
+
let promise = new Promise((resolve, _) => {
|
|
161413
|
+
const minPixelValue = (0, imageUtils_1.getMinPixelValue)(pixelData);
|
|
161414
|
+
const maxPixelValue = (0, imageUtils_1.getMaxPixelValue)(pixelData);
|
|
161415
|
+
const windowWidth = (maxPixelValue - minPixelValue) / 2;
|
|
161416
|
+
const windowCenter = windowWidth / 2;
|
|
161417
|
+
const image = {
|
|
161418
|
+
imageId: imageId,
|
|
161419
|
+
minPixelValue: minPixelValue,
|
|
161420
|
+
maxPixelValue: maxPixelValue,
|
|
161421
|
+
slope: srcImage.slope,
|
|
161422
|
+
intercept: srcImage.intercept,
|
|
161423
|
+
windowCenter: windowCenter,
|
|
161424
|
+
windowWidth: windowWidth,
|
|
161425
|
+
getPixelData: () => pixelData,
|
|
161426
|
+
rows: srcImage.rows,
|
|
161427
|
+
columns: srcImage.columns,
|
|
161428
|
+
height: srcImage.height,
|
|
161429
|
+
width: srcImage.width,
|
|
161430
|
+
color: srcImage.color,
|
|
161431
|
+
columnPixelSpacing: srcImage.columnPixelSpacing,
|
|
161432
|
+
rowPixelSpacing: srcImage.rowPixelSpacing,
|
|
161433
|
+
sizeInBytes: srcImage.sizeInBytes
|
|
161434
|
+
};
|
|
161435
|
+
resolve(image);
|
|
161436
|
+
});
|
|
161437
|
+
return {
|
|
161438
|
+
promise
|
|
161439
|
+
};
|
|
161440
|
+
};
|
|
161441
|
+
|
|
161442
|
+
|
|
161062
161443
|
/***/ }),
|
|
161063
161444
|
|
|
161064
161445
|
/***/ 9995:
|
|
@@ -161172,6 +161553,7 @@ const lodash_1 = __webpack_require__(6486);
|
|
|
161172
161553
|
// internal libraries
|
|
161173
161554
|
const commonLoader_1 = __webpack_require__(326);
|
|
161174
161555
|
const imageParsing_1 = __webpack_require__(1539);
|
|
161556
|
+
const dsaImageLoader_1 = __webpack_require__(6475);
|
|
161175
161557
|
// global module variables
|
|
161176
161558
|
let customImageLoaderCounter = 0;
|
|
161177
161559
|
// Local cache used to store multiframe datasets to avoid reading and parsing
|
|
@@ -161272,6 +161654,10 @@ const buildMultiFrameImage = function (larvitarSeriesInstanceUID, serie) {
|
|
|
161272
161654
|
managerSeriesId.seriesDescription = serie.metadata
|
|
161273
161655
|
.seriesDescription;
|
|
161274
161656
|
});
|
|
161657
|
+
// check for DSA
|
|
161658
|
+
if (serie.metadata["x00282110"] !== undefined) {
|
|
161659
|
+
(0, dsaImageLoader_1.populateDsaImageIds)(larvitarSeriesInstanceUID);
|
|
161660
|
+
}
|
|
161275
161661
|
let t1 = performance.now();
|
|
161276
161662
|
console.log(`Call to buildMultiFrameImage took ${t1 - t0} milliseconds.`);
|
|
161277
161663
|
};
|
|
@@ -161322,7 +161708,6 @@ const clearMultiFrameCache = function (seriesId) {
|
|
|
161322
161708
|
}
|
|
161323
161709
|
};
|
|
161324
161710
|
exports.clearMultiFrameCache = clearMultiFrameCache;
|
|
161325
|
-
/* Internal module functions */
|
|
161326
161711
|
/**
|
|
161327
161712
|
* Create the custom image object for cornerstone from custom image
|
|
161328
161713
|
* @instance
|
|
@@ -162505,6 +162890,341 @@ function generateFile(pdf, pageNumber) {
|
|
|
162505
162890
|
}
|
|
162506
162891
|
|
|
162507
162892
|
|
|
162893
|
+
/***/ }),
|
|
162894
|
+
|
|
162895
|
+
/***/ 1446:
|
|
162896
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
162897
|
+
|
|
162898
|
+
"use strict";
|
|
162899
|
+
|
|
162900
|
+
/** @module imaging/postProcessing/applyDSA
|
|
162901
|
+
* @desc This file provides digital subtraction algorithm for XA images
|
|
162902
|
+
*/
|
|
162903
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
162904
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
162905
|
+
};
|
|
162906
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
162907
|
+
exports.applyDSAShift = exports.applyDSA = void 0;
|
|
162908
|
+
// external libraries
|
|
162909
|
+
const lodash_1 = __webpack_require__(6486);
|
|
162910
|
+
const cornerstone_core_1 = __importDefault(__webpack_require__(7371));
|
|
162911
|
+
const imageRendering_1 = __webpack_require__(4767);
|
|
162912
|
+
const imageStore_1 = __importDefault(__webpack_require__(5278));
|
|
162913
|
+
/*
|
|
162914
|
+
* This module provides the following functions to be exported:
|
|
162915
|
+
* applyDSA(multiframeSerie: Series, index: number): number[]
|
|
162916
|
+
* applyDSAShift(elementId: string, multiFrameSerie: Series, frameId: number, inputMaskSubPixelShift: number[]): void
|
|
162917
|
+
*/
|
|
162918
|
+
/**
|
|
162919
|
+
* Apply DSA to a multiframe serie
|
|
162920
|
+
* @function applyDSA
|
|
162921
|
+
* @param {Series} multiframeSerie - multiframe serie to apply DSA
|
|
162922
|
+
* @param {number} index - index of the frame to apply DSA
|
|
162923
|
+
* @param {number[]} inputMaskSubPixelShift - pixel shift applied to the mask
|
|
162924
|
+
* @returns {number[]} - pixel data of the frame after DSA
|
|
162925
|
+
*/
|
|
162926
|
+
function applyDSA(multiframeSerie, index, inputMaskSubPixelShift) {
|
|
162927
|
+
const dsaMetadata = multiframeSerie.dsa;
|
|
162928
|
+
const imageIds = multiframeSerie.imageIds;
|
|
162929
|
+
// switch on DSA MaskOperation
|
|
162930
|
+
switch (dsaMetadata.x00286101 // DSA MaskOperation
|
|
162931
|
+
) {
|
|
162932
|
+
case "AVG_SUB":
|
|
162933
|
+
return avgSubMask(dsaMetadata, imageIds, index, inputMaskSubPixelShift);
|
|
162934
|
+
case "TID":
|
|
162935
|
+
return tidMask(dsaMetadata, imageIds, index);
|
|
162936
|
+
case "REV_TID":
|
|
162937
|
+
return revTidMask(dsaMetadata, imageIds, index);
|
|
162938
|
+
default:
|
|
162939
|
+
return [];
|
|
162940
|
+
}
|
|
162941
|
+
}
|
|
162942
|
+
exports.applyDSA = applyDSA;
|
|
162943
|
+
/**
|
|
162944
|
+
* Apply DSA with Pixel Shift and update the image
|
|
162945
|
+
* @function applyDSAShift
|
|
162946
|
+
* @param {string} elementId - elementId of the viewer
|
|
162947
|
+
* @param {Series} multiFrameSerie - multiframe serie to apply DSA
|
|
162948
|
+
* @param {number} frameId - index of the frame to apply DSA
|
|
162949
|
+
* @param {number[]} inputMaskSubPixelShift - pixel shift applied to the mask
|
|
162950
|
+
* @returns {void}
|
|
162951
|
+
*/
|
|
162952
|
+
const applyDSAShift = function (elementId, multiFrameSerie, frameId, inputMaskSubPixelShift) {
|
|
162953
|
+
const t0 = performance.now();
|
|
162954
|
+
// set in store the mask subpixel shift
|
|
162955
|
+
imageStore_1.default.setDSAPixelShift(elementId, inputMaskSubPixelShift);
|
|
162956
|
+
// uncache image from cornestone cache
|
|
162957
|
+
const imageId = multiFrameSerie.dsa.imageIds[frameId];
|
|
162958
|
+
cornerstone_core_1.default.imageCache.removeImageLoadObject(imageId);
|
|
162959
|
+
// update image
|
|
162960
|
+
(0, imageRendering_1.updateImage)(multiFrameSerie, elementId, frameId, true);
|
|
162961
|
+
(0, imageRendering_1.redrawImage)(elementId);
|
|
162962
|
+
const t1 = performance.now();
|
|
162963
|
+
console.debug(`Call to DSA applyDSAShift took ${t1 - t0} milliseconds.`);
|
|
162964
|
+
};
|
|
162965
|
+
exports.applyDSAShift = applyDSAShift;
|
|
162966
|
+
/**
|
|
162967
|
+
* Compute the digital subtraction with avgSub mask
|
|
162968
|
+
* @function avgSubMask
|
|
162969
|
+
* @param {DSA} metadataInfo - DSA metadata
|
|
162970
|
+
* @param {string[]} imageIds - imageIds of the serie
|
|
162971
|
+
* @param {number} index - index of the frame to apply DSA
|
|
162972
|
+
* @returns {number[]} - pixel data of the frame after DSA
|
|
162973
|
+
*/
|
|
162974
|
+
function avgSubMask(metadataInfo, imageIds, index, inputMaskSubPixelShift) {
|
|
162975
|
+
const t0 = performance.now();
|
|
162976
|
+
// Mask Frame Numbers Attribute (might be an array) Required if AVGSUB
|
|
162977
|
+
const frameIndexNumber = typeof metadataInfo.x00286110 === "number"
|
|
162978
|
+
? [metadataInfo.x00286110]
|
|
162979
|
+
: metadataInfo.x00286110;
|
|
162980
|
+
// get cached images from cornerstone cache
|
|
162981
|
+
const cachedImages = cornerstone_core_1.default.imageCache.cachedImages;
|
|
162982
|
+
// A pair of floating point numbers specifying the fractional vertical
|
|
162983
|
+
// [adjacent row spacing] and horizontal [adjacent column spacing] pixel
|
|
162984
|
+
// shift applied to the mask before subtracting it from the contrast frame.
|
|
162985
|
+
// The row offset results in a shift of the pixels along the column axis.
|
|
162986
|
+
// The column offset results in a shift of the pixels along the row axis.
|
|
162987
|
+
// A positive row offset is a shift toward the pixels of the lower row of the pixel plane.
|
|
162988
|
+
// A positive column offset is a shift toward the pixels of the left hand side column of the pixel plane.
|
|
162989
|
+
const maskSubPixelShift = inputMaskSubPixelShift
|
|
162990
|
+
? inputMaskSubPixelShift
|
|
162991
|
+
: metadataInfo.x00286114 || [0.0, 0.0];
|
|
162992
|
+
// Specifies the number of contrast frames to average together
|
|
162993
|
+
// before performing the mask operation.
|
|
162994
|
+
// If the Attribute is missing, no averaging is performed.
|
|
162995
|
+
const contrastFrameAveragingAvg = metadataInfo.x00286112 || 1;
|
|
162996
|
+
// Each pair of numbers in this multi-valued Attribute specify a
|
|
162997
|
+
// beginning and ending frame number inclusive of a range where
|
|
162998
|
+
// this particular mask operation is valid.
|
|
162999
|
+
const frameRangeAvg = metadataInfo.x00286102 || [
|
|
163000
|
+
0,
|
|
163001
|
+
imageIds.length - 1 - contrastFrameAveragingAvg + 1
|
|
163002
|
+
];
|
|
163003
|
+
let isFrameIncluded = false;
|
|
163004
|
+
for (let i = 0; i < frameRangeAvg.length; i += 2) {
|
|
163005
|
+
isFrameIncluded =
|
|
163006
|
+
index >= frameRangeAvg[i] && index <= frameRangeAvg[i + 1];
|
|
163007
|
+
}
|
|
163008
|
+
// source image where mask will be applied
|
|
163009
|
+
let srcImage = (0, lodash_1.find)(cachedImages, {
|
|
163010
|
+
imageId: imageIds[index]
|
|
163011
|
+
}).image;
|
|
163012
|
+
// get pixel data from source image
|
|
163013
|
+
let contrastFrame = srcImage.getPixelData();
|
|
163014
|
+
if (isFrameIncluded) {
|
|
163015
|
+
let maskFramesAvg = frameIndexNumber.map((i) => {
|
|
163016
|
+
const imageId = imageIds[i];
|
|
163017
|
+
const image = (0, lodash_1.find)(cachedImages, { imageId: imageId }).image;
|
|
163018
|
+
return image.getPixelData();
|
|
163019
|
+
});
|
|
163020
|
+
const resultFramesAvg = new Array(contrastFrame.length);
|
|
163021
|
+
const applyAverage = Array.isArray(maskFramesAvg) && maskFramesAvg.length > 1 ? true : false;
|
|
163022
|
+
if (applyAverage) {
|
|
163023
|
+
const valueAveraged = new Array(contrastFrame.length);
|
|
163024
|
+
for (let j = 0; j < contrastFrame.length; j++) {
|
|
163025
|
+
let valueAverage = 0;
|
|
163026
|
+
for (let i = 0; i < maskFramesAvg.length; i++) {
|
|
163027
|
+
valueAverage = valueAverage + maskFramesAvg[i][j];
|
|
163028
|
+
}
|
|
163029
|
+
valueAveraged[j] = valueAverage / maskFramesAvg.length;
|
|
163030
|
+
}
|
|
163031
|
+
// Extract fractional vertical and horizontal pixel shifts from maskSubPixelShift
|
|
163032
|
+
const rowOffset = -1.0 * maskSubPixelShift[0];
|
|
163033
|
+
const colOffset = maskSubPixelShift[1];
|
|
163034
|
+
for (let j = 0; j < contrastFrame.length; j++) {
|
|
163035
|
+
// Apply sub-pixel shift to the averaged frame
|
|
163036
|
+
if (colOffset !== 0 || rowOffset !== 0) {
|
|
163037
|
+
let rowNumber = Math.floor(j / srcImage.columns) + 1;
|
|
163038
|
+
if (colOffset + j >= rowNumber * srcImage.columns ||
|
|
163039
|
+
colOffset + j < 0 ||
|
|
163040
|
+
rowOffset * srcImage.columns + j >= contrastFrame.length ||
|
|
163041
|
+
rowOffset * srcImage.columns + j < 0 ||
|
|
163042
|
+
rowOffset * srcImage.columns + colOffset + j >=
|
|
163043
|
+
contrastFrame.length ||
|
|
163044
|
+
rowOffset * srcImage.columns + colOffset + j < 0) {
|
|
163045
|
+
resultFramesAvg[j] = contrastFrame[j];
|
|
163046
|
+
}
|
|
163047
|
+
else {
|
|
163048
|
+
const shiftedj = j + colOffset + rowOffset * srcImage.columns;
|
|
163049
|
+
resultFramesAvg[j] = contrastFrame[j] - valueAveraged[shiftedj];
|
|
163050
|
+
}
|
|
163051
|
+
}
|
|
163052
|
+
else {
|
|
163053
|
+
resultFramesAvg[j] = contrastFrame[j] - valueAveraged[j];
|
|
163054
|
+
}
|
|
163055
|
+
}
|
|
163056
|
+
}
|
|
163057
|
+
else {
|
|
163058
|
+
const rowOffset = -1.0 * maskSubPixelShift[0];
|
|
163059
|
+
const colOffset = maskSubPixelShift[1];
|
|
163060
|
+
for (let j = 0; j < contrastFrame.length; j++) {
|
|
163061
|
+
// Apply sub-pixel shift to the averaged frame
|
|
163062
|
+
if (colOffset !== 0 || rowOffset !== 0) {
|
|
163063
|
+
let rowNumber = Math.floor(j / srcImage.columns) + 1;
|
|
163064
|
+
if (colOffset + j >= rowNumber * srcImage.columns ||
|
|
163065
|
+
colOffset + j < 0 ||
|
|
163066
|
+
rowOffset * srcImage.columns + j >= contrastFrame.length ||
|
|
163067
|
+
rowOffset * srcImage.columns + j < 0 ||
|
|
163068
|
+
rowOffset * srcImage.columns + colOffset + j >=
|
|
163069
|
+
contrastFrame.length ||
|
|
163070
|
+
rowOffset * srcImage.columns + colOffset + j < 0) {
|
|
163071
|
+
resultFramesAvg[j] = contrastFrame[j];
|
|
163072
|
+
}
|
|
163073
|
+
else {
|
|
163074
|
+
const shiftedj = j + colOffset + rowOffset * srcImage.columns;
|
|
163075
|
+
resultFramesAvg[j] = contrastFrame[j] - maskFramesAvg[0][shiftedj];
|
|
163076
|
+
}
|
|
163077
|
+
}
|
|
163078
|
+
else {
|
|
163079
|
+
resultFramesAvg[j] = contrastFrame[j] - maskFramesAvg[0][j];
|
|
163080
|
+
}
|
|
163081
|
+
}
|
|
163082
|
+
let t1 = performance.now();
|
|
163083
|
+
console.debug(`Call to DSA avgSubMask took ${t1 - t0} milliseconds.`);
|
|
163084
|
+
}
|
|
163085
|
+
// @ts-ignore
|
|
163086
|
+
srcImage = null;
|
|
163087
|
+
// @ts-ignore
|
|
163088
|
+
contrastFrame = null;
|
|
163089
|
+
// @ts-ignore
|
|
163090
|
+
maskFramesAvg = null;
|
|
163091
|
+
return resultFramesAvg;
|
|
163092
|
+
}
|
|
163093
|
+
else {
|
|
163094
|
+
// @ts-ignore
|
|
163095
|
+
srcImage = null;
|
|
163096
|
+
let t1 = performance.now();
|
|
163097
|
+
console.debug(`Call to DSA avgSubMask took ${t1 - t0} milliseconds.`);
|
|
163098
|
+
console.warn("Frame not included in the Applicable Frame Range");
|
|
163099
|
+
return contrastFrame;
|
|
163100
|
+
}
|
|
163101
|
+
}
|
|
163102
|
+
/**
|
|
163103
|
+
* Compute the digital subtraction with tid mask
|
|
163104
|
+
* @function tidMask
|
|
163105
|
+
* @param {DSA} metadataInfo - DSA metadata
|
|
163106
|
+
* @param {string[]} imageIds - imageIds of the serie
|
|
163107
|
+
* @param {number} index - index of the frame to apply DSA
|
|
163108
|
+
* @returns {number[]} - pixel data of the frame after DSA
|
|
163109
|
+
*/
|
|
163110
|
+
function tidMask(metadataInfo, imageIds, index) {
|
|
163111
|
+
const t0 = performance.now();
|
|
163112
|
+
// get cached images from cornerstone cache
|
|
163113
|
+
const cachedImages = cornerstone_core_1.default.imageCache.cachedImages;
|
|
163114
|
+
// TID Offset to be subtracted from the respective frame number.
|
|
163115
|
+
const TidOffset = metadataInfo.x00286120 || 1;
|
|
163116
|
+
// Applicable Frame Range
|
|
163117
|
+
const frameRangeTid = metadataInfo.x00286102 || [
|
|
163118
|
+
Math.abs(TidOffset) - 1,
|
|
163119
|
+
imageIds.length - Math.abs(TidOffset) - 1
|
|
163120
|
+
];
|
|
163121
|
+
// Filter frames within the Applicable Frame Range
|
|
163122
|
+
let isFrameIncluded = false;
|
|
163123
|
+
for (let i = 0; i < frameRangeTid.length; i += 2) {
|
|
163124
|
+
isFrameIncluded =
|
|
163125
|
+
index >= frameRangeTid[i] && index <= frameRangeTid[i + 1];
|
|
163126
|
+
}
|
|
163127
|
+
// source image where mask will be applied
|
|
163128
|
+
let srcImage = (0, lodash_1.find)(cachedImages, {
|
|
163129
|
+
imageId: imageIds[index]
|
|
163130
|
+
}).image;
|
|
163131
|
+
// get pixel data from source image
|
|
163132
|
+
let contrastFrame = srcImage.getPixelData();
|
|
163133
|
+
if (isFrameIncluded) {
|
|
163134
|
+
let maskImage = (0, lodash_1.find)(cachedImages, {
|
|
163135
|
+
imageId: imageIds[index - TidOffset]
|
|
163136
|
+
}).image;
|
|
163137
|
+
let contrastMaskFrame = maskImage.getPixelData();
|
|
163138
|
+
// Apply Time Interval Differencing
|
|
163139
|
+
const resultFramesTid = new Array(contrastFrame.length);
|
|
163140
|
+
for (let i = 0; i < contrastFrame.length; i++) {
|
|
163141
|
+
resultFramesTid[i] = contrastFrame[i] - contrastMaskFrame[i];
|
|
163142
|
+
}
|
|
163143
|
+
// @ts-ignore
|
|
163144
|
+
srcImage = null;
|
|
163145
|
+
// @ts-ignore
|
|
163146
|
+
contrastFrame = null;
|
|
163147
|
+
// @ts-ignore
|
|
163148
|
+
maskImage = null;
|
|
163149
|
+
// @ts-ignore
|
|
163150
|
+
contrastMaskFrame = null;
|
|
163151
|
+
let t1 = performance.now();
|
|
163152
|
+
console.debug(`Call to DSA tidMask took ${t1 - t0} milliseconds.`);
|
|
163153
|
+
return resultFramesTid;
|
|
163154
|
+
}
|
|
163155
|
+
else {
|
|
163156
|
+
// @ts-ignore
|
|
163157
|
+
srcImage = null;
|
|
163158
|
+
let t1 = performance.now();
|
|
163159
|
+
console.debug(`Call to DSA tidMask took ${t1 - t0} milliseconds.`);
|
|
163160
|
+
return contrastFrame;
|
|
163161
|
+
}
|
|
163162
|
+
}
|
|
163163
|
+
/**
|
|
163164
|
+
* Compute the digital subtraction with revTid mask
|
|
163165
|
+
* @function revTidMask
|
|
163166
|
+
* @param {DSA} metadataInfo - DSA metadata
|
|
163167
|
+
* @param {string[]} imageIds - imageIds of the serie
|
|
163168
|
+
* @param {number} index - index of the frame to apply DSA
|
|
163169
|
+
* @returns {number[]} - pixel data of the frame after DSA
|
|
163170
|
+
*/
|
|
163171
|
+
function revTidMask(metadataInfo, imageIds, index) {
|
|
163172
|
+
const t0 = performance.now();
|
|
163173
|
+
// get cached images from cornerstone cache
|
|
163174
|
+
const cachedImages = cornerstone_core_1.default.imageCache.cachedImages;
|
|
163175
|
+
// TID Offset to be subtracted from the first frame within the Applicable Frame Range,
|
|
163176
|
+
// TID Offset +2 from the second frame within the Applicable Frame Range,
|
|
163177
|
+
// TID Offset (0028,6120)+4 from the third frame and so on.
|
|
163178
|
+
const RevTidOffset = metadataInfo.x00286120 || 1;
|
|
163179
|
+
//Applicable Frame Range, shall be present in this case
|
|
163180
|
+
const frameRangeRevTid = metadataInfo.x00286102 || [
|
|
163181
|
+
Math.abs(RevTidOffset) - 1,
|
|
163182
|
+
imageIds.length - Math.abs(RevTidOffset) - 1
|
|
163183
|
+
];
|
|
163184
|
+
// Filter frames within the Applicable Frame Range
|
|
163185
|
+
let isFrameIncluded = false;
|
|
163186
|
+
for (let i = 0; i < frameRangeRevTid.length; i += 2) {
|
|
163187
|
+
isFrameIncluded =
|
|
163188
|
+
index >= frameRangeRevTid[i] && index <= frameRangeRevTid[i + 1];
|
|
163189
|
+
}
|
|
163190
|
+
// source image where mask will be applied
|
|
163191
|
+
let srcImage = (0, lodash_1.find)(cachedImages, {
|
|
163192
|
+
imageId: imageIds[index]
|
|
163193
|
+
}).image;
|
|
163194
|
+
// get pixel data from source image
|
|
163195
|
+
let contrastFrame = srcImage.getPixelData();
|
|
163196
|
+
if (isFrameIncluded) {
|
|
163197
|
+
let maskimage = (0, lodash_1.find)(cachedImages, {
|
|
163198
|
+
imageId: imageIds[frameRangeRevTid[0] - RevTidOffset - index - frameRangeRevTid[0]]
|
|
163199
|
+
}).image;
|
|
163200
|
+
let contrastMaskFrame = maskimage.getPixelData();
|
|
163201
|
+
// Apply Time Interval Differencing
|
|
163202
|
+
const resultFramesRevTid = new Array(contrastFrame.length);
|
|
163203
|
+
for (let i = 0; i < contrastFrame.length; i++) {
|
|
163204
|
+
resultFramesRevTid[i] = contrastFrame[i] - contrastMaskFrame[i];
|
|
163205
|
+
}
|
|
163206
|
+
// @ts-ignore
|
|
163207
|
+
srcImage = null;
|
|
163208
|
+
// @ts-ignore
|
|
163209
|
+
contrastFrame = null;
|
|
163210
|
+
// @ts-ignore
|
|
163211
|
+
maskImage = null;
|
|
163212
|
+
// @ts-ignore
|
|
163213
|
+
contrastMaskFrame = null;
|
|
163214
|
+
let t1 = performance.now();
|
|
163215
|
+
console.debug(`Call to DSA revTidMask took ${t1 - t0} milliseconds.`);
|
|
163216
|
+
return resultFramesRevTid;
|
|
163217
|
+
}
|
|
163218
|
+
else {
|
|
163219
|
+
// @ts-ignore
|
|
163220
|
+
srcImage = null;
|
|
163221
|
+
let t1 = performance.now();
|
|
163222
|
+
console.debug(`Call to DSA revTidMask took ${t1 - t0} milliseconds.`);
|
|
163223
|
+
return contrastFrame;
|
|
163224
|
+
}
|
|
163225
|
+
}
|
|
163226
|
+
|
|
163227
|
+
|
|
162508
163228
|
/***/ }),
|
|
162509
163229
|
|
|
162510
163230
|
/***/ 4585:
|
|
@@ -162544,12 +163264,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
162544
163264
|
};
|
|
162545
163265
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
162546
163266
|
const cornerstone_tools_1 = __importDefault(__webpack_require__(4030));
|
|
163267
|
+
const cornerstone_wado_image_loader_1 = __importDefault(__webpack_require__(2424));
|
|
162547
163268
|
const BaseTool = cornerstone_tools_1.default.importInternal("base/BaseTool");
|
|
162548
|
-
const scrollToIndex = cornerstone_tools_1.default.importInternal("util/scrollToIndex");
|
|
162549
163269
|
const getToolState = cornerstone_tools_1.default.getToolState;
|
|
162550
163270
|
// internal libraries
|
|
162551
163271
|
const imageStore_1 = __importStar(__webpack_require__(5278));
|
|
162552
163272
|
const default_1 = __webpack_require__(6694);
|
|
163273
|
+
const customMouseWheelUtils_1 = __importDefault(__webpack_require__(7683));
|
|
163274
|
+
const commonLoader_1 = __webpack_require__(326);
|
|
163275
|
+
const commonLoader_2 = __webpack_require__(326);
|
|
162553
163276
|
/*
|
|
162554
163277
|
* @class CustomMouseWheelScrollTool
|
|
162555
163278
|
* @extends BaseTool
|
|
@@ -162578,6 +163301,7 @@ class CustomMouseWheelScrollTool extends BaseTool {
|
|
|
162578
163301
|
}
|
|
162579
163302
|
};
|
|
162580
163303
|
super(props, defaultProps);
|
|
163304
|
+
this.nextIndex = null;
|
|
162581
163305
|
this.currentMode = "stack";
|
|
162582
163306
|
this.framesNumber = this.configuration.framesNumber;
|
|
162583
163307
|
this.slicesnumber = 0;
|
|
@@ -162640,6 +163364,7 @@ class CustomMouseWheelScrollTool extends BaseTool {
|
|
|
162640
163364
|
}
|
|
162641
163365
|
const stackData = toolData.data[0];
|
|
162642
163366
|
const currentIndex = stackData.currentImageIdIndex;
|
|
163367
|
+
this.currentIndex = currentIndex;
|
|
162643
163368
|
switch (this.currentMode) {
|
|
162644
163369
|
case "stack":
|
|
162645
163370
|
// Switching from 'stack' to 'slice'
|
|
@@ -162671,33 +163396,53 @@ class CustomMouseWheelScrollTool extends BaseTool {
|
|
|
162671
163396
|
return;
|
|
162672
163397
|
}
|
|
162673
163398
|
const stackData = toolData.data[0];
|
|
163399
|
+
const isDSAEnabled = imageStore_1.default.get([
|
|
163400
|
+
"viewports",
|
|
163401
|
+
element.id,
|
|
163402
|
+
"isDSAEnabled"
|
|
163403
|
+
]);
|
|
163404
|
+
let imageIds;
|
|
163405
|
+
if (isDSAEnabled) {
|
|
163406
|
+
const originalImageIdSample = toolData.data[0].imageIds[0];
|
|
163407
|
+
const parsedImageId = cornerstone_wado_image_loader_1.default.wadouri.parseImageId(originalImageIdSample);
|
|
163408
|
+
const rootImageId = parsedImageId.scheme + ":" + parsedImageId.url;
|
|
163409
|
+
const imageTracker = (0, commonLoader_1.getLarvitarImageTracker)();
|
|
163410
|
+
const seriesId = imageTracker[rootImageId];
|
|
163411
|
+
const manager = (0, commonLoader_2.getLarvitarManager)();
|
|
163412
|
+
const multiFrameSerie = manager[seriesId];
|
|
163413
|
+
imageIds = multiFrameSerie.dsa.imageIds;
|
|
163414
|
+
}
|
|
163415
|
+
else {
|
|
163416
|
+
imageIds = stackData.imageIds;
|
|
163417
|
+
}
|
|
162674
163418
|
if (this.configuration.currentMode === "stack") {
|
|
162675
163419
|
// Handle 'stack' mode
|
|
162676
163420
|
// Calculate validIndex for 'stack' mode (no looping) between 0 and (N-1)*framesnumber where N=numberofslices=numberofimageids/numberofframes
|
|
162677
|
-
let lastIndex =
|
|
163421
|
+
let lastIndex = this.nextIndex != null
|
|
163422
|
+
? this.nextIndex
|
|
163423
|
+
: imageStore_1.default.get(["viewports", element.id, "sliceId"]);
|
|
162678
163424
|
let nextIndex = lastIndex + direction;
|
|
162679
163425
|
if (lastIndex === -1) {
|
|
162680
163426
|
nextIndex = 0 + direction;
|
|
162681
163427
|
lastIndex = 0;
|
|
162682
163428
|
}
|
|
162683
|
-
this.slicesnumber =
|
|
162684
|
-
Math.ceil(stackData.imageIds.length / this.framesNumber) - 1;
|
|
163429
|
+
this.slicesnumber = Math.ceil(imageIds.length / this.framesNumber) - 1;
|
|
162685
163430
|
// Ensure nextIndex is between 0 and upperBound
|
|
162686
|
-
const validIndex = nextIndex >= 0 &&
|
|
162687
|
-
nextIndex < stackData.imageIds.length &&
|
|
162688
|
-
this.slicesnumber > 0
|
|
163431
|
+
const validIndex = nextIndex >= 0 && nextIndex < imageIds.length && this.slicesnumber > 0
|
|
162689
163432
|
? nextIndex
|
|
162690
163433
|
: lastIndex;
|
|
163434
|
+
this.nextIndex = validIndex;
|
|
162691
163435
|
// Scroll to the calculated index
|
|
162692
|
-
|
|
163436
|
+
(0, customMouseWheelUtils_1.default)(element, validIndex);
|
|
162693
163437
|
}
|
|
162694
163438
|
else {
|
|
162695
163439
|
// Handle 'slice' mode
|
|
162696
163440
|
let lastIndex = this.isMultiframe === true || this.is4D === true
|
|
162697
|
-
?
|
|
163441
|
+
? this.nextIndex != null
|
|
163442
|
+
? this.nextIndex
|
|
163443
|
+
: imageStore_1.default.get(["viewports", element.id, "sliceId"])
|
|
162698
163444
|
: stackData.currentImageIdIndex;
|
|
162699
|
-
this.slicesnumber =
|
|
162700
|
-
Math.ceil(stackData.imageIds.length / this.framesNumber) - 1;
|
|
163445
|
+
this.slicesnumber = Math.ceil(imageIds.length / this.framesNumber) - 1;
|
|
162701
163446
|
const startFrame = this.configuration.fixedSlice * this.configuration.framesNumber;
|
|
162702
163447
|
const endFrame = (this.configuration.fixedSlice + 1) * this.configuration.framesNumber -
|
|
162703
163448
|
1;
|
|
@@ -162706,11 +163451,12 @@ class CustomMouseWheelScrollTool extends BaseTool {
|
|
|
162706
163451
|
// Check if the new index is within the valid range for the current slice
|
|
162707
163452
|
if (nextIndex < startFrame ||
|
|
162708
163453
|
nextIndex > endFrame ||
|
|
162709
|
-
nextIndex >=
|
|
163454
|
+
nextIndex >= imageIds.length) {
|
|
162710
163455
|
nextIndex = startFrame;
|
|
162711
163456
|
}
|
|
163457
|
+
this.nextIndex = nextIndex;
|
|
162712
163458
|
// Scroll to the calculated index
|
|
162713
|
-
|
|
163459
|
+
(0, customMouseWheelUtils_1.default)(element, nextIndex);
|
|
162714
163460
|
if (this.is4D) {
|
|
162715
163461
|
const viewport = imageStore_1.default.get(["viewports", element.id]);
|
|
162716
163462
|
const timeId = viewport.timeIds[nextIndex];
|
|
@@ -162736,7 +163482,7 @@ class CustomMouseWheelScrollTool extends BaseTool {
|
|
|
162736
163482
|
}
|
|
162737
163483
|
};
|
|
162738
163484
|
element.addEventListener("cornerstoneimagerendered", newImageHandler);
|
|
162739
|
-
|
|
163485
|
+
(0, customMouseWheelUtils_1.default)(element, pendingEvent.index);
|
|
162740
163486
|
}
|
|
162741
163487
|
}
|
|
162742
163488
|
exports["default"] = CustomMouseWheelScrollTool;
|
|
@@ -162943,6 +163689,139 @@ function setLabelmap3DByFirstImageId(firstImageId, buffer, labelmapIndex, metada
|
|
|
162943
163689
|
exports.setLabelmap3DByFirstImageId = setLabelmap3DByFirstImageId;
|
|
162944
163690
|
|
|
162945
163691
|
|
|
163692
|
+
/***/ }),
|
|
163693
|
+
|
|
163694
|
+
/***/ 7683:
|
|
163695
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
163696
|
+
|
|
163697
|
+
"use strict";
|
|
163698
|
+
|
|
163699
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
163700
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
163701
|
+
};
|
|
163702
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
163703
|
+
// external libraries
|
|
163704
|
+
const cornerstone_tools_1 = __importDefault(__webpack_require__(4030));
|
|
163705
|
+
const cornerstone_wado_image_loader_1 = __importDefault(__webpack_require__(2424));
|
|
163706
|
+
// internal libraries
|
|
163707
|
+
const commonLoader_1 = __webpack_require__(326);
|
|
163708
|
+
const imageStore_1 = __importDefault(__webpack_require__(5278));
|
|
163709
|
+
const commonLoader_2 = __webpack_require__(326);
|
|
163710
|
+
const loadHandlerManager_1 = __importDefault(__webpack_require__(9003));
|
|
163711
|
+
//const loadHandlerManager = cornerstoneTools.importInternal(
|
|
163712
|
+
// "stateManagement/loadHandlerManager"
|
|
163713
|
+
//);// TODO LAURA CHECK HOW TO IMPORT IT
|
|
163714
|
+
// global variables
|
|
163715
|
+
const EVENTS = cornerstone_tools_1.default.EVENTS;
|
|
163716
|
+
const external = cornerstone_tools_1.default.external;
|
|
163717
|
+
const getToolState = cornerstone_tools_1.default.getToolState;
|
|
163718
|
+
const triggerEvent = cornerstone_tools_1.default.importInternal("util/triggerEvent");
|
|
163719
|
+
function scrollToIndex(element, newImageIdIndex) {
|
|
163720
|
+
const toolData = getToolState(element, "stack");
|
|
163721
|
+
if (!toolData || !toolData.data || !toolData.data.length) {
|
|
163722
|
+
return;
|
|
163723
|
+
}
|
|
163724
|
+
const cornerstone = external.cornerstone;
|
|
163725
|
+
// If we have more than one stack, check if we have a stack renderer defined
|
|
163726
|
+
let stackRenderer;
|
|
163727
|
+
if (toolData.data.length > 1) {
|
|
163728
|
+
const stackRendererData = getToolState(element, "stackRenderer");
|
|
163729
|
+
if (stackRendererData &&
|
|
163730
|
+
stackRendererData.data &&
|
|
163731
|
+
stackRendererData.data.length) {
|
|
163732
|
+
stackRenderer = stackRendererData.data[0];
|
|
163733
|
+
}
|
|
163734
|
+
}
|
|
163735
|
+
const stackData = toolData.data[0];
|
|
163736
|
+
const originalImageIdSample = toolData.data[0].imageIds[0];
|
|
163737
|
+
const parsedImageId = cornerstone_wado_image_loader_1.default.wadouri.parseImageId(originalImageIdSample);
|
|
163738
|
+
const rootImageId = parsedImageId.scheme + ":" + parsedImageId.url;
|
|
163739
|
+
const imageTracker = (0, commonLoader_2.getLarvitarImageTracker)();
|
|
163740
|
+
const seriesId = imageTracker[rootImageId];
|
|
163741
|
+
const manager = (0, commonLoader_1.getLarvitarManager)();
|
|
163742
|
+
const multiFrameSerie = manager[seriesId];
|
|
163743
|
+
const id = element.id;
|
|
163744
|
+
const isDSAEnabled = imageStore_1.default.get(["viewports", id, "isDSAEnabled"]);
|
|
163745
|
+
const imageIds = isDSAEnabled === true
|
|
163746
|
+
? multiFrameSerie.dsa.imageIds
|
|
163747
|
+
: multiFrameSerie.imageIds;
|
|
163748
|
+
// Allow for negative indexing
|
|
163749
|
+
if (newImageIdIndex < 0) {
|
|
163750
|
+
newImageIdIndex += imageIds.length;
|
|
163751
|
+
}
|
|
163752
|
+
const startLoadingHandler = loadHandlerManager_1.default.getStartLoadHandler(element);
|
|
163753
|
+
const endLoadingHandler = loadHandlerManager_1.default.getEndLoadHandler(element);
|
|
163754
|
+
const errorLoadingHandler = loadHandlerManager_1.default.getErrorLoadingHandler(element);
|
|
163755
|
+
function doneCallback(image) {
|
|
163756
|
+
if (stackData.currentImageIdIndex !== newImageIdIndex) {
|
|
163757
|
+
return;
|
|
163758
|
+
}
|
|
163759
|
+
// Check if the element is still enabled in Cornerstone,
|
|
163760
|
+
// If an error is thrown, stop here.
|
|
163761
|
+
try {
|
|
163762
|
+
// TODO: Add 'isElementEnabled' to Cornerstone?
|
|
163763
|
+
cornerstone.getEnabledElement(element);
|
|
163764
|
+
}
|
|
163765
|
+
catch (error) {
|
|
163766
|
+
return;
|
|
163767
|
+
}
|
|
163768
|
+
if (stackRenderer) {
|
|
163769
|
+
stackRenderer.currentImageIdIndex = newImageIdIndex;
|
|
163770
|
+
stackRenderer.render(element, toolData.data);
|
|
163771
|
+
}
|
|
163772
|
+
else {
|
|
163773
|
+
cornerstone.displayImage(element, image);
|
|
163774
|
+
}
|
|
163775
|
+
if (endLoadingHandler) {
|
|
163776
|
+
endLoadingHandler(element, image);
|
|
163777
|
+
}
|
|
163778
|
+
}
|
|
163779
|
+
function failCallback(error) {
|
|
163780
|
+
const imageId = imageIds[newImageIdIndex];
|
|
163781
|
+
if (errorLoadingHandler) {
|
|
163782
|
+
errorLoadingHandler(element, imageId, error);
|
|
163783
|
+
}
|
|
163784
|
+
}
|
|
163785
|
+
if (newImageIdIndex === stackData.currentImageIdIndex) {
|
|
163786
|
+
return;
|
|
163787
|
+
}
|
|
163788
|
+
if (startLoadingHandler) {
|
|
163789
|
+
startLoadingHandler(element);
|
|
163790
|
+
}
|
|
163791
|
+
const eventData = {
|
|
163792
|
+
newImageIdIndex,
|
|
163793
|
+
direction: newImageIdIndex - stackData.currentImageIdIndex
|
|
163794
|
+
};
|
|
163795
|
+
stackData.currentImageIdIndex = newImageIdIndex;
|
|
163796
|
+
const newImageId = imageIds[newImageIdIndex];
|
|
163797
|
+
// Retry image loading in cases where previous image promise
|
|
163798
|
+
// Was rejected, if the option is set
|
|
163799
|
+
/*
|
|
163800
|
+
|
|
163801
|
+
Const config = stackScroll.getConfiguration();
|
|
163802
|
+
|
|
163803
|
+
TODO: Revisit this. It appears that Core's imageCache is not
|
|
163804
|
+
keeping rejected promises anywhere, so we have no way to know
|
|
163805
|
+
if something was previously rejected.
|
|
163806
|
+
|
|
163807
|
+
if (config && config.retryLoadOnScroll === true) {
|
|
163808
|
+
}
|
|
163809
|
+
*/
|
|
163810
|
+
// Convert the preventCache value in stack data to a boolean
|
|
163811
|
+
const preventCache = Boolean(stackData.preventCache);
|
|
163812
|
+
let imagePromise;
|
|
163813
|
+
if (preventCache) {
|
|
163814
|
+
imagePromise = cornerstone.loadImage(newImageId);
|
|
163815
|
+
}
|
|
163816
|
+
else {
|
|
163817
|
+
imagePromise = cornerstone.loadAndCacheImage(newImageId);
|
|
163818
|
+
}
|
|
163819
|
+
imagePromise.then(doneCallback, failCallback);
|
|
163820
|
+
triggerEvent(element, EVENTS.STACK_SCROLL, eventData);
|
|
163821
|
+
}
|
|
163822
|
+
exports["default"] = scrollToIndex;
|
|
163823
|
+
|
|
163824
|
+
|
|
162946
163825
|
/***/ }),
|
|
162947
163826
|
|
|
162948
163827
|
/***/ 6694:
|
|
@@ -162995,31 +163874,31 @@ const DEFAULT_TOOLS = {
|
|
|
162995
163874
|
viewports: "all",
|
|
162996
163875
|
configuration: {
|
|
162997
163876
|
minorTickLength: 25,
|
|
162998
|
-
majorTickLength: 50
|
|
163877
|
+
majorTickLength: 50
|
|
162999
163878
|
},
|
|
163000
163879
|
options: {
|
|
163001
|
-
mouseButtonMask: 1
|
|
163880
|
+
mouseButtonMask: 1
|
|
163002
163881
|
},
|
|
163003
163882
|
cleanable: false,
|
|
163004
163883
|
defaultActive: false,
|
|
163005
163884
|
class: "ScaleOverlayTool",
|
|
163006
163885
|
description: "Add scale overlay",
|
|
163007
163886
|
shortcut: "ctrl-m",
|
|
163008
|
-
type: "overlay"
|
|
163887
|
+
type: "overlay"
|
|
163009
163888
|
},
|
|
163010
163889
|
OrientationMarkers: {
|
|
163011
163890
|
name: "OrientationMarkers",
|
|
163012
163891
|
viewports: "all",
|
|
163013
163892
|
configuration: {},
|
|
163014
163893
|
options: {
|
|
163015
|
-
mouseButtonMask: 1
|
|
163894
|
+
mouseButtonMask: 1
|
|
163016
163895
|
},
|
|
163017
163896
|
cleanable: false,
|
|
163018
163897
|
defaultActive: false,
|
|
163019
163898
|
class: "OrientationMarkersTool",
|
|
163020
163899
|
description: "Add orientation markers",
|
|
163021
163900
|
shortcut: "ctrl-m",
|
|
163022
|
-
type: "overlay"
|
|
163901
|
+
type: "overlay"
|
|
163023
163902
|
},
|
|
163024
163903
|
Wwwc: {
|
|
163025
163904
|
name: "Wwwc",
|
|
@@ -163027,7 +163906,7 @@ const DEFAULT_TOOLS = {
|
|
|
163027
163906
|
configuration: {},
|
|
163028
163907
|
options: {
|
|
163029
163908
|
mouseButtonMask: 1,
|
|
163030
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163909
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163031
163910
|
},
|
|
163032
163911
|
cleanable: false,
|
|
163033
163912
|
defaultActive: true,
|
|
@@ -163035,7 +163914,7 @@ const DEFAULT_TOOLS = {
|
|
|
163035
163914
|
// sync: "wwwcSynchronizer",
|
|
163036
163915
|
description: "Change image contrast",
|
|
163037
163916
|
shortcut: "ctrl-m",
|
|
163038
|
-
type: "utils"
|
|
163917
|
+
type: "utils"
|
|
163039
163918
|
},
|
|
163040
163919
|
WwwcRegion: {
|
|
163041
163920
|
name: "WwwcRegion",
|
|
@@ -163043,7 +163922,7 @@ const DEFAULT_TOOLS = {
|
|
|
163043
163922
|
configuration: {},
|
|
163044
163923
|
options: {
|
|
163045
163924
|
mouseButtonMask: 1,
|
|
163046
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163925
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163047
163926
|
},
|
|
163048
163927
|
cleanable: false,
|
|
163049
163928
|
defaultActive: false,
|
|
@@ -163051,22 +163930,22 @@ const DEFAULT_TOOLS = {
|
|
|
163051
163930
|
// sync: "wwwcSynchronizer",
|
|
163052
163931
|
description: "Change image contrast based on selected region",
|
|
163053
163932
|
shortcut: "ctrl-m",
|
|
163054
|
-
type: "utils"
|
|
163933
|
+
type: "utils"
|
|
163055
163934
|
},
|
|
163056
163935
|
StackScroll: {
|
|
163057
163936
|
name: "StackScroll",
|
|
163058
163937
|
viewports: "all",
|
|
163059
163938
|
configuration: {
|
|
163060
163939
|
loop: false, // default false
|
|
163061
|
-
allowSkipping: true
|
|
163940
|
+
allowSkipping: true // default true
|
|
163062
163941
|
},
|
|
163063
163942
|
options: {
|
|
163064
163943
|
mouseButtonMask: 1,
|
|
163065
|
-
deltaY: 0
|
|
163944
|
+
deltaY: 0 // default 0
|
|
163066
163945
|
},
|
|
163067
163946
|
cleanable: false,
|
|
163068
163947
|
defaultActive: false,
|
|
163069
|
-
class: "StackScrollTool"
|
|
163948
|
+
class: "StackScrollTool"
|
|
163070
163949
|
},
|
|
163071
163950
|
StackScrollMouseWheel: {
|
|
163072
163951
|
name: "StackScrollMouseWheel",
|
|
@@ -163074,12 +163953,12 @@ const DEFAULT_TOOLS = {
|
|
|
163074
163953
|
configuration: {
|
|
163075
163954
|
loop: false, // default false
|
|
163076
163955
|
allowSkipping: true, // default true
|
|
163077
|
-
invert: false
|
|
163956
|
+
invert: false
|
|
163078
163957
|
},
|
|
163079
163958
|
options: {},
|
|
163080
163959
|
cleanable: false,
|
|
163081
163960
|
defaultActive: true,
|
|
163082
|
-
class: "StackScrollMouseWheelTool"
|
|
163961
|
+
class: "StackScrollMouseWheelTool"
|
|
163083
163962
|
},
|
|
163084
163963
|
CustomMouseWheelScroll: {
|
|
163085
163964
|
name: "CustomMouseWheelScroll",
|
|
@@ -163091,17 +163970,17 @@ const DEFAULT_TOOLS = {
|
|
|
163091
163970
|
fixedFrame: 1,
|
|
163092
163971
|
fixedSlice: 0,
|
|
163093
163972
|
currentMode: "stack", // 'stack' or 'slice'
|
|
163094
|
-
framesNumber: 1
|
|
163973
|
+
framesNumber: 1
|
|
163095
163974
|
},
|
|
163096
163975
|
options: {
|
|
163097
|
-
mouseButtonMask: 0
|
|
163976
|
+
mouseButtonMask: 0
|
|
163098
163977
|
},
|
|
163099
163978
|
cleanable: false,
|
|
163100
163979
|
defaultActive: true,
|
|
163101
163980
|
class: "CustomMouseWheelScrollTool",
|
|
163102
163981
|
description: "scroll images/frames",
|
|
163103
163982
|
shortcut: "mouse wheel",
|
|
163104
|
-
type: "utils"
|
|
163983
|
+
type: "utils"
|
|
163105
163984
|
},
|
|
163106
163985
|
Pan: {
|
|
163107
163986
|
name: "Pan",
|
|
@@ -163109,14 +163988,14 @@ const DEFAULT_TOOLS = {
|
|
|
163109
163988
|
configuration: {},
|
|
163110
163989
|
options: {
|
|
163111
163990
|
mouseButtonMask: 1,
|
|
163112
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163991
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163113
163992
|
},
|
|
163114
163993
|
cleanable: false,
|
|
163115
163994
|
defaultActive: false,
|
|
163116
163995
|
class: "PanTool",
|
|
163117
163996
|
description: "Move image xy",
|
|
163118
163997
|
shortcut: "ctrl-p",
|
|
163119
|
-
type: "utils"
|
|
163998
|
+
type: "utils"
|
|
163120
163999
|
},
|
|
163121
164000
|
Zoom: {
|
|
163122
164001
|
name: "Zoom",
|
|
@@ -163125,19 +164004,19 @@ const DEFAULT_TOOLS = {
|
|
|
163125
164004
|
invert: false,
|
|
163126
164005
|
preventZoomOutsideImage: false,
|
|
163127
164006
|
minScale: 0.01,
|
|
163128
|
-
maxScale: 25.0
|
|
164007
|
+
maxScale: 25.0
|
|
163129
164008
|
},
|
|
163130
164009
|
options: {
|
|
163131
164010
|
mouseButtonMask: 2,
|
|
163132
164011
|
supportedInteractionTypes: ["Mouse", "Touch"],
|
|
163133
|
-
defaultStrategy: "default"
|
|
164012
|
+
defaultStrategy: "default" // can be 'default', 'translate' or 'zoomToCenter'
|
|
163134
164013
|
},
|
|
163135
164014
|
cleanable: false,
|
|
163136
164015
|
class: "ZoomTool",
|
|
163137
164016
|
defaultActive: true,
|
|
163138
164017
|
description: "Zoom image at mouse position",
|
|
163139
164018
|
shortcut: "ctrl-z",
|
|
163140
|
-
type: "utils"
|
|
164019
|
+
type: "utils"
|
|
163141
164020
|
},
|
|
163142
164021
|
BorderMagnify: {
|
|
163143
164022
|
name: "BorderMagnify",
|
|
@@ -163145,14 +164024,14 @@ const DEFAULT_TOOLS = {
|
|
|
163145
164024
|
configuration: {},
|
|
163146
164025
|
options: {
|
|
163147
164026
|
mouseButtonMask: 1,
|
|
163148
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
164027
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163149
164028
|
},
|
|
163150
164029
|
cleanable: false,
|
|
163151
164030
|
class: "BorderMagnifyTool",
|
|
163152
164031
|
defaultActive: false,
|
|
163153
164032
|
description: "Magnify image at mouse position",
|
|
163154
164033
|
shortcut: "ctrl-m",
|
|
163155
|
-
type: "utils"
|
|
164034
|
+
type: "utils"
|
|
163156
164035
|
},
|
|
163157
164036
|
DragProbe: {
|
|
163158
164037
|
name: "DragProbe",
|
|
@@ -163160,13 +164039,13 @@ const DEFAULT_TOOLS = {
|
|
|
163160
164039
|
configuration: {},
|
|
163161
164040
|
options: {
|
|
163162
164041
|
mouseButtonMask: 1,
|
|
163163
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
164042
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163164
164043
|
},
|
|
163165
164044
|
cleanable: false,
|
|
163166
164045
|
class: "DragProbeTool",
|
|
163167
164046
|
description: "Probe image at mouse position",
|
|
163168
164047
|
shortcut: "ctrl-p",
|
|
163169
|
-
type: "utils"
|
|
164048
|
+
type: "utils"
|
|
163170
164049
|
},
|
|
163171
164050
|
Rotate: {
|
|
163172
164051
|
name: "Rotate",
|
|
@@ -163174,11 +164053,11 @@ const DEFAULT_TOOLS = {
|
|
|
163174
164053
|
configuration: {},
|
|
163175
164054
|
options: {
|
|
163176
164055
|
mouseButtonMask: 1,
|
|
163177
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
164056
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163178
164057
|
},
|
|
163179
164058
|
cleanable: false,
|
|
163180
164059
|
class: "RotateTool",
|
|
163181
|
-
description: "Rotate image"
|
|
164060
|
+
description: "Rotate image"
|
|
163182
164061
|
},
|
|
163183
164062
|
Length: {
|
|
163184
164063
|
name: "Length",
|
|
@@ -163186,10 +164065,10 @@ const DEFAULT_TOOLS = {
|
|
|
163186
164065
|
configuration: {},
|
|
163187
164066
|
options: {
|
|
163188
164067
|
mouseButtonMask: 1,
|
|
163189
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
164068
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163190
164069
|
},
|
|
163191
164070
|
cleanable: true,
|
|
163192
|
-
class: "LengthTool"
|
|
164071
|
+
class: "LengthTool"
|
|
163193
164072
|
},
|
|
163194
164073
|
Angle: {
|
|
163195
164074
|
name: "Angle",
|
|
@@ -163197,10 +164076,10 @@ const DEFAULT_TOOLS = {
|
|
|
163197
164076
|
configuration: {},
|
|
163198
164077
|
options: {
|
|
163199
164078
|
mouseButtonMask: 1,
|
|
163200
|
-
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
164079
|
+
supportedInteractionTypes: ["Mouse", "Touch"]
|
|
163201
164080
|
},
|
|
163202
164081
|
cleanable: true,
|
|
163203
|
-
class: "AngleTool"
|
|
164082
|
+
class: "AngleTool"
|
|
163204
164083
|
},
|
|
163205
164084
|
Bidirectional: {
|
|
163206
164085
|
name: "Bidirectional",
|
|
@@ -163208,7 +164087,7 @@ const DEFAULT_TOOLS = {
|
|
|
163208
164087
|
configuration: {},
|
|
163209
164088
|
options: { mouseButtonMask: 1 },
|
|
163210
164089
|
cleanable: true,
|
|
163211
|
-
class: "BidirectionalTool"
|
|
164090
|
+
class: "BidirectionalTool"
|
|
163212
164091
|
},
|
|
163213
164092
|
EllipticalRoi: {
|
|
163214
164093
|
name: "EllipticalRoi",
|
|
@@ -163219,7 +164098,7 @@ const DEFAULT_TOOLS = {
|
|
|
163219
164098
|
class: "EllipticalRoiTool",
|
|
163220
164099
|
description: "Draw an ellipse",
|
|
163221
164100
|
shortcut: "ctrl-f",
|
|
163222
|
-
type: "annotation"
|
|
164101
|
+
type: "annotation"
|
|
163223
164102
|
},
|
|
163224
164103
|
RectangleRoi: {
|
|
163225
164104
|
name: "RectangleRoi",
|
|
@@ -163231,7 +164110,7 @@ const DEFAULT_TOOLS = {
|
|
|
163231
164110
|
class: "RectangleRoiTool",
|
|
163232
164111
|
description: "Draw a rectangle",
|
|
163233
164112
|
shortcut: "ctrl-a",
|
|
163234
|
-
type: "annotation"
|
|
164113
|
+
type: "annotation"
|
|
163235
164114
|
},
|
|
163236
164115
|
EllipticalRoiOverlay: {
|
|
163237
164116
|
name: "EllipticalRoiOverlay",
|
|
@@ -163242,7 +164121,7 @@ const DEFAULT_TOOLS = {
|
|
|
163242
164121
|
class: "EllipticalRoiOverlayTool",
|
|
163243
164122
|
description: "Draw an ellipse",
|
|
163244
164123
|
shortcut: "ctrl-f",
|
|
163245
|
-
type: "annotation"
|
|
164124
|
+
type: "annotation"
|
|
163246
164125
|
},
|
|
163247
164126
|
RectangleRoiOverlay: {
|
|
163248
164127
|
name: "RectangleRoiOverlay",
|
|
@@ -163254,7 +164133,7 @@ const DEFAULT_TOOLS = {
|
|
|
163254
164133
|
class: "RectangleRoiOverlayTool",
|
|
163255
164134
|
description: "Draw a rectangle",
|
|
163256
164135
|
shortcut: "ctrl-a",
|
|
163257
|
-
type: "annotation"
|
|
164136
|
+
type: "annotation"
|
|
163258
164137
|
},
|
|
163259
164138
|
FreehandRoi: {
|
|
163260
164139
|
name: "FreehandRoi",
|
|
@@ -163265,7 +164144,7 @@ const DEFAULT_TOOLS = {
|
|
|
163265
164144
|
class: "FreehandRoiTool",
|
|
163266
164145
|
description: "Draw a polyline / freehand form",
|
|
163267
164146
|
shortcut: "ctrl-s",
|
|
163268
|
-
type: "annotation"
|
|
164147
|
+
type: "annotation"
|
|
163269
164148
|
},
|
|
163270
164149
|
Probe: {
|
|
163271
164150
|
name: "Probe",
|
|
@@ -163273,7 +164152,7 @@ const DEFAULT_TOOLS = {
|
|
|
163273
164152
|
configuration: {},
|
|
163274
164153
|
options: { mouseButtonMask: 1 },
|
|
163275
164154
|
cleanable: true,
|
|
163276
|
-
class: "ProbeTool"
|
|
164155
|
+
class: "ProbeTool"
|
|
163277
164156
|
},
|
|
163278
164157
|
ArrowAnnotate: {
|
|
163279
164158
|
name: "ArrowAnnotate",
|
|
@@ -163284,7 +164163,7 @@ const DEFAULT_TOOLS = {
|
|
|
163284
164163
|
class: "ArrowAnnotateTool",
|
|
163285
164164
|
description: "Draw an arrow",
|
|
163286
164165
|
shortcut: "ctrl-d",
|
|
163287
|
-
type: "annotation"
|
|
164166
|
+
type: "annotation"
|
|
163288
164167
|
},
|
|
163289
164168
|
TextMarker: {
|
|
163290
164169
|
name: "TextMarker",
|
|
@@ -163293,18 +164172,18 @@ const DEFAULT_TOOLS = {
|
|
|
163293
164172
|
markers: Object.keys(new Array(100).fill(0)),
|
|
163294
164173
|
current: "0",
|
|
163295
164174
|
ascending: true,
|
|
163296
|
-
loop: true
|
|
164175
|
+
loop: true
|
|
163297
164176
|
},
|
|
163298
164177
|
options: { mouseButtonMask: 1 },
|
|
163299
164178
|
cleanable: true,
|
|
163300
|
-
class: "TextMarkerTool"
|
|
164179
|
+
class: "TextMarkerTool"
|
|
163301
164180
|
},
|
|
163302
164181
|
Eraser: {
|
|
163303
164182
|
name: "Eraser",
|
|
163304
164183
|
viewports: "all",
|
|
163305
164184
|
configuration: {},
|
|
163306
164185
|
options: { mouseButtonMask: 1 },
|
|
163307
|
-
class: "EraserTool"
|
|
164186
|
+
class: "EraserTool"
|
|
163308
164187
|
},
|
|
163309
164188
|
ZoomTouchPinch: {
|
|
163310
164189
|
name: "ZoomTouchPinch",
|
|
@@ -163312,25 +164191,25 @@ const DEFAULT_TOOLS = {
|
|
|
163312
164191
|
configuration: {},
|
|
163313
164192
|
options: {
|
|
163314
164193
|
mouseButtonMask: 1,
|
|
163315
|
-
supportedInteractionTypes: ["TouchPinch"]
|
|
164194
|
+
supportedInteractionTypes: ["TouchPinch"]
|
|
163316
164195
|
},
|
|
163317
164196
|
cleanable: false,
|
|
163318
164197
|
class: "ZoomTouchPinchTool",
|
|
163319
|
-
defaultActive: false
|
|
164198
|
+
defaultActive: false
|
|
163320
164199
|
},
|
|
163321
164200
|
PanMultiTouch: {
|
|
163322
164201
|
name: "PanMultiTouch",
|
|
163323
164202
|
viewports: "all",
|
|
163324
164203
|
configuration: {
|
|
163325
|
-
touchPointers: 2
|
|
164204
|
+
touchPointers: 2
|
|
163326
164205
|
},
|
|
163327
164206
|
options: {
|
|
163328
164207
|
mouseButtonMask: 1,
|
|
163329
|
-
supportedInteractionTypes: ["MultiTouch"]
|
|
164208
|
+
supportedInteractionTypes: ["MultiTouch"]
|
|
163330
164209
|
},
|
|
163331
164210
|
cleanable: false,
|
|
163332
164211
|
class: "PanMultiTouchTool",
|
|
163333
|
-
defaultActive: false
|
|
164212
|
+
defaultActive: false
|
|
163334
164213
|
},
|
|
163335
164214
|
Brush: {
|
|
163336
164215
|
name: "Brush",
|
|
@@ -163341,7 +164220,7 @@ const DEFAULT_TOOLS = {
|
|
|
163341
164220
|
class: "BrushTool",
|
|
163342
164221
|
description: "A simple brush",
|
|
163343
164222
|
shortcut: "ctrl-q",
|
|
163344
|
-
type: "segmentation"
|
|
164223
|
+
type: "segmentation"
|
|
163345
164224
|
},
|
|
163346
164225
|
ThresholdsBrush: {
|
|
163347
164226
|
name: "ThresholdsBrush",
|
|
@@ -163352,7 +164231,7 @@ const DEFAULT_TOOLS = {
|
|
|
163352
164231
|
class: "ThresholdsBrushTool",
|
|
163353
164232
|
description: "Brush only values inside thresholds",
|
|
163354
164233
|
shortcut: "ctrl-t",
|
|
163355
|
-
type: "segmentation"
|
|
164234
|
+
type: "segmentation"
|
|
163356
164235
|
},
|
|
163357
164236
|
RectangleScissors: {
|
|
163358
164237
|
name: "RectangleScissors",
|
|
@@ -163363,7 +164242,7 @@ const DEFAULT_TOOLS = {
|
|
|
163363
164242
|
class: "RectangleScissorsTool",
|
|
163364
164243
|
description: "A rectangular segmentation tool",
|
|
163365
164244
|
shortcut: "ctrl-w",
|
|
163366
|
-
type: "segmentation"
|
|
164245
|
+
type: "segmentation"
|
|
163367
164246
|
},
|
|
163368
164247
|
FreehandScissors: {
|
|
163369
164248
|
name: "FreehandScissors",
|
|
@@ -163374,7 +164253,7 @@ const DEFAULT_TOOLS = {
|
|
|
163374
164253
|
class: "FreehandScissorsTool",
|
|
163375
164254
|
description: "A free-hand segmentation tool",
|
|
163376
164255
|
shortcut: "ctrl-e",
|
|
163377
|
-
type: "segmentation"
|
|
164256
|
+
type: "segmentation"
|
|
163378
164257
|
},
|
|
163379
164258
|
CircleScissors: {
|
|
163380
164259
|
name: "CircleScissors",
|
|
@@ -163385,7 +164264,7 @@ const DEFAULT_TOOLS = {
|
|
|
163385
164264
|
class: "CircleScissorsTool",
|
|
163386
164265
|
description: "A circular segmentation tool",
|
|
163387
164266
|
shortcut: "ctrl-r",
|
|
163388
|
-
type: "segmentation"
|
|
164267
|
+
type: "segmentation"
|
|
163389
164268
|
},
|
|
163390
164269
|
CorrectionScissors: {
|
|
163391
164270
|
name: "CorrectionScissors",
|
|
@@ -163396,7 +164275,7 @@ const DEFAULT_TOOLS = {
|
|
|
163396
164275
|
class: "CorrectionScissorsTool",
|
|
163397
164276
|
description: "A correction segmentation tool",
|
|
163398
164277
|
shortcut: "ctrl-p",
|
|
163399
|
-
type: "segmentation"
|
|
164278
|
+
type: "segmentation"
|
|
163400
164279
|
},
|
|
163401
164280
|
PolylineScissors: {
|
|
163402
164281
|
name: "PolylineScissors",
|
|
@@ -163407,8 +164286,8 @@ const DEFAULT_TOOLS = {
|
|
|
163407
164286
|
class: "PolylineScissorsTool",
|
|
163408
164287
|
description: "A polyline segmentation tool",
|
|
163409
164288
|
shortcut: "ctrl-s",
|
|
163410
|
-
type: "segmentation"
|
|
163411
|
-
}
|
|
164289
|
+
type: "segmentation"
|
|
164290
|
+
}
|
|
163412
164291
|
};
|
|
163413
164292
|
exports.DEFAULT_TOOLS = DEFAULT_TOOLS;
|
|
163414
164293
|
/**
|
|
@@ -163421,7 +164300,7 @@ const dvTools = {
|
|
|
163421
164300
|
RectangleRoiOverlayTool: rectangleRoiOverlayTool_1.default,
|
|
163422
164301
|
EllipticalRoiOverlayTool: ellipticalRoiOverlayTool_1.default,
|
|
163423
164302
|
BorderMagnifyTool: BorderMagnifyTool_1.default,
|
|
163424
|
-
CustomMouseWheelScrollTool: customMouseWheelScrollTool_1.default
|
|
164303
|
+
CustomMouseWheelScrollTool: customMouseWheelScrollTool_1.default
|
|
163425
164304
|
};
|
|
163426
164305
|
exports.dvTools = dvTools;
|
|
163427
164306
|
/**
|
|
@@ -163438,7 +164317,7 @@ const DEFAULT_STYLE = {
|
|
|
163438
164317
|
fillColor: "#0000FF",
|
|
163439
164318
|
fontFamily: "Roboto",
|
|
163440
164319
|
fontSize: 18,
|
|
163441
|
-
backgroundColor: "rgba(1, 1, 1, 0.7)"
|
|
164320
|
+
backgroundColor: "rgba(1, 1, 1, 0.7)"
|
|
163442
164321
|
};
|
|
163443
164322
|
exports.DEFAULT_STYLE = DEFAULT_STYLE;
|
|
163444
164323
|
/**
|
|
@@ -163450,7 +164329,7 @@ const DEFAULT_SETTINGS = {
|
|
|
163450
164329
|
showSVGCursors: true,
|
|
163451
164330
|
globalToolSyncEnabled: false,
|
|
163452
164331
|
autoResizeViewports: true,
|
|
163453
|
-
lineDash: [4, 4]
|
|
164332
|
+
lineDash: [4, 4]
|
|
163454
164333
|
};
|
|
163455
164334
|
exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
|
|
163456
164335
|
/**
|
|
@@ -163461,19 +164340,19 @@ const DEFAULT_MOUSE_KEYS = {
|
|
|
163461
164340
|
mouse_button_left: {
|
|
163462
164341
|
shift: "Zoom",
|
|
163463
164342
|
ctrl: "Pan",
|
|
163464
|
-
default: "Wwwc"
|
|
164343
|
+
default: "Wwwc"
|
|
163465
164344
|
},
|
|
163466
164345
|
mouse_button_right: {
|
|
163467
164346
|
shift: "Zoom",
|
|
163468
164347
|
ctrl: "Pan",
|
|
163469
|
-
default: "Wwwc"
|
|
164348
|
+
default: "Wwwc"
|
|
163470
164349
|
},
|
|
163471
164350
|
keyboard_shortcuts: {
|
|
163472
164351
|
// alt key + letter
|
|
163473
164352
|
KEY_R: "Rotate",
|
|
163474
164353
|
KEY_A: "Angle",
|
|
163475
|
-
KEY_L: "Length"
|
|
163476
|
-
}
|
|
164354
|
+
KEY_L: "Length"
|
|
164355
|
+
}
|
|
163477
164356
|
};
|
|
163478
164357
|
exports.DEFAULT_MOUSE_KEYS = DEFAULT_MOUSE_KEYS;
|
|
163479
164358
|
/**
|
|
@@ -163491,7 +164370,7 @@ exports.getDefaultToolsByType = getDefaultToolsByType;
|
|
|
163491
164370
|
*/
|
|
163492
164371
|
const setDefaultToolsProps = function (newProps) {
|
|
163493
164372
|
if ((0, lodash_1.isArray)(newProps)) {
|
|
163494
|
-
newProps.forEach(
|
|
164373
|
+
newProps.forEach(props => {
|
|
163495
164374
|
if (!props.name) {
|
|
163496
164375
|
console.error("newProps must have a name property");
|
|
163497
164376
|
return;
|
|
@@ -163528,7 +164407,7 @@ const registerExternalTool = function (toolName, toolClass) {
|
|
|
163528
164407
|
viewports: "all",
|
|
163529
164408
|
configuration: {},
|
|
163530
164409
|
options: { mouseButtonMask: 1 },
|
|
163531
|
-
defaultActive: false
|
|
164410
|
+
defaultActive: false
|
|
163532
164411
|
};
|
|
163533
164412
|
};
|
|
163534
164413
|
exports.registerExternalTool = registerExternalTool;
|
|
@@ -164014,13 +164893,13 @@ const csToolsCreateStack = function (element, imageIds, currentImageIndex) {
|
|
|
164014
164893
|
if (imageIds) {
|
|
164015
164894
|
stack = {
|
|
164016
164895
|
currentImageIdIndex: currentImageIndex === undefined ? 0 : currentImageIndex,
|
|
164017
|
-
imageIds: imageIds
|
|
164896
|
+
imageIds: imageIds
|
|
164018
164897
|
};
|
|
164019
164898
|
}
|
|
164020
164899
|
else {
|
|
164021
164900
|
stack = {
|
|
164022
164901
|
currentImageIdIndex: 0,
|
|
164023
|
-
imageIds: "imageLoader://0"
|
|
164902
|
+
imageIds: "imageLoader://0"
|
|
164024
164903
|
};
|
|
164025
164904
|
if (cornerstone_core_1.default.getEnabledElements().length == 0) {
|
|
164026
164905
|
cornerstone_core_1.default.enable(element);
|
|
@@ -164114,7 +164993,7 @@ const addDefaultTools = function (elementId) {
|
|
|
164114
164993
|
cornerstone_core_1.default.enable(element);
|
|
164115
164994
|
}
|
|
164116
164995
|
// for each default tool
|
|
164117
|
-
(0, lodash_1.each)(default_1.DEFAULT_TOOLS,
|
|
164996
|
+
(0, lodash_1.each)(default_1.DEFAULT_TOOLS, tool => {
|
|
164118
164997
|
// check if already added
|
|
164119
164998
|
if (!isToolMissing(tool.name)) {
|
|
164120
164999
|
console.log("missing");
|
|
@@ -164126,14 +165005,14 @@ const addDefaultTools = function (elementId) {
|
|
|
164126
165005
|
}
|
|
164127
165006
|
else {
|
|
164128
165007
|
// call add tool for element for each element
|
|
164129
|
-
(0, lodash_1.each)(tool.viewports,
|
|
165008
|
+
(0, lodash_1.each)(tool.viewports, targetElementId => {
|
|
164130
165009
|
addTool(tool.name, tool.configuration, targetElementId);
|
|
164131
165010
|
});
|
|
164132
165011
|
}
|
|
164133
165012
|
// if sync tool, enable
|
|
164134
165013
|
if (tool.sync) {
|
|
164135
165014
|
const synchronizer = new cornerstone_tools_1.default.Synchronizer("cornerstoneimagerendered", cornerstone_tools_1.default[tool.sync]);
|
|
164136
|
-
elements.forEach(
|
|
165015
|
+
elements.forEach(element => {
|
|
164137
165016
|
synchronizer.add(element.element);
|
|
164138
165017
|
});
|
|
164139
165018
|
synchronizer.enabled = true;
|
|
@@ -164182,7 +165061,7 @@ const setToolActive = function (toolName, options, viewports, doNotSetInStore) {
|
|
|
164182
165061
|
// activate and update all
|
|
164183
165062
|
cornerstone_tools_1.default.setToolActive(toolName, defaultOpt);
|
|
164184
165063
|
let enabledElements = cornerstone_core_1.default.getEnabledElements();
|
|
164185
|
-
(0, lodash_1.each)(enabledElements,
|
|
165064
|
+
(0, lodash_1.each)(enabledElements, enel => {
|
|
164186
165065
|
tryUpdateImage(enel.element);
|
|
164187
165066
|
});
|
|
164188
165067
|
}
|
|
@@ -164234,7 +165113,7 @@ const setToolDisabled = function (toolName, viewports, resetCursor = true) {
|
|
|
164234
165113
|
// disable and update all
|
|
164235
165114
|
cornerstone_tools_1.default.setToolDisabled(toolName);
|
|
164236
165115
|
let enabledElements = cornerstone_core_1.default.getEnabledElements();
|
|
164237
|
-
(0, lodash_1.each)(enabledElements,
|
|
165116
|
+
(0, lodash_1.each)(enabledElements, enel => {
|
|
164238
165117
|
if (resetCursor) {
|
|
164239
165118
|
// restore native cursor
|
|
164240
165119
|
enel.element.style.cursor = "initial";
|
|
@@ -164272,7 +165151,7 @@ const setToolEnabled = function (toolName, viewports, resetCursor = true) {
|
|
|
164272
165151
|
// enable and update all
|
|
164273
165152
|
cornerstone_tools_1.default.setToolEnabled(toolName);
|
|
164274
165153
|
let enabledElements = cornerstone_core_1.default.getEnabledElements();
|
|
164275
|
-
(0, lodash_1.each)(enabledElements,
|
|
165154
|
+
(0, lodash_1.each)(enabledElements, enel => {
|
|
164276
165155
|
if (resetCursor) {
|
|
164277
165156
|
// restore native cursor
|
|
164278
165157
|
enel.element.style.cursor = "initial";
|
|
@@ -164305,7 +165184,7 @@ const setToolPassive = function (toolName, viewports) {
|
|
|
164305
165184
|
// activate and update all
|
|
164306
165185
|
cornerstone_tools_1.default.setToolPassive(toolName);
|
|
164307
165186
|
let enabledElements = cornerstone_core_1.default.getEnabledElements();
|
|
164308
|
-
(0, lodash_1.each)(enabledElements,
|
|
165187
|
+
(0, lodash_1.each)(enabledElements, enel => {
|
|
164309
165188
|
tryUpdateImage(enel.element);
|
|
164310
165189
|
});
|
|
164311
165190
|
}
|
|
@@ -165040,9 +165919,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
165040
165919
|
};
|
|
165041
165920
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
165042
165921
|
exports.registerNRRDImageLoader = exports.initializeFileImageLoader = exports.initializeWebImageLoader = exports.initializeImageLoader = exports.setActiveLayer = exports.getActiveLayer = exports.updateLayer = exports.buildLayer = exports.anonymize = exports.exportImageToBase64 = exports.importNRRDImage = exports.buildDataAsync = exports.buildData = exports.getCachedPixelData = exports.buildHeader = exports.getImageMetadata = exports.getDistanceBetweenSlices = exports.getReslicedPixeldata = exports.getReslicedMetadata = exports.getMeanValue = exports.randomId = exports.getSortedStack = exports.getTypedArrayFromDataType = exports.getPixelRepresentation = exports.getMaxPixelValue = exports.getMinPixelValue = exports.getNormalOrientation = exports.setImageCustomPreset = exports.setImagePreset = exports.getImagePresets = exports.getDefaultECGLayout = exports.updateECGFrame = exports.syncECGFrame = exports.unrenderECG = exports.renderECG = exports.parseECG = exports.store = exports.deactivatePerformanceMonitor = exports.activatePerformanceMonitor = exports.getPerformanceMonitor = exports.getAvailableMemory = exports.getUsedMemory = exports.checkMemoryAllocation = exports.checkAndClearMemory = exports.cornerstoneDICOMImageLoader = exports.segModule = exports.parseDicom = exports.cornerstoneTools = exports.cornerstone = exports.VERSION = void 0;
|
|
165043
|
-
exports.
|
|
165044
|
-
exports.
|
|
165045
|
-
exports.getActiveLabelmapBuffer = exports.toggleVisibility = exports.toggleContourMode = exports.disableBrushTool = exports.enableBrushTool = exports.deleteMask = exports.clearSegmentationState = exports.rgbToHex = exports.hexToRgb = exports.setBrushProps = exports.redoLastStroke = exports.undoLastStroke = exports.setActiveSegment = void 0;
|
|
165922
|
+
exports.getNrrdSerieDimensions = exports.getSliceNumberFromImageId = exports.getImageIdFromSlice = exports.loadNrrdImage = exports.getNrrdImageId = exports.buildNrrdImage = exports.getSopInstanceUIDFromLarvitarManager = exports.getImageFrame = exports.getSeriesDataFromLarvitarManager = exports.removeSeriesFromLarvitarManager = exports.resetLarvitarManager = exports.getLarvitarImageTracker = exports.getLarvitarManager = exports.populateLarvitarManager = exports.updateLarvitarManager = exports.parseContours = exports.HSVToRGB = exports.fillPixelData = exports.addColorMap = exports.applyColorMap = exports.getColormapsList = exports.resliceSeries = exports.rotateImageRight = exports.rotateImageLeft = exports.flipImageVertical = exports.flipImageHorizontal = exports.invertImage = exports.storeViewportData = exports.toggleMouseToolsListeners = exports.updateViewportData = exports.resetViewports = exports.redrawImage = exports.updateImage = exports.renderImage = exports.resizeViewport = exports.unloadViewport = exports.disableViewport = exports.renderWebImage = exports.renderDICOMPDF = exports.renderFileImage = exports.loadAndCacheImages = exports.clearImageCache = exports.clearImageParsing = exports.parseDataSet = exports.readFiles = exports.readFile = exports.updateLoadedStack = exports.registerDsaImageLoader = exports.registerMultiFrameImageLoader = exports.registerResliceLoader = void 0;
|
|
165923
|
+
exports.saveAnnotations = exports.registerExternalTool = exports.setDefaultToolsProps = exports.getDefaultToolsByType = exports.dvTools = exports.DEFAULT_TOOLS = exports.exportAnnotations = exports.setToolPassive = exports.setToolEnabled = exports.setToolDisabled = exports.setToolActive = exports.addTool = exports.addDefaultTools = exports.setToolsStyle = exports.initializeCSTools = exports.csToolsUpdateImageIndex = exports.csToolsUpdateImageIds = exports.csToolsCreateStack = exports.setSegmentationConfig = exports.updateStackToolState = exports.syncToolStack = exports.clearCornerstoneElements = exports.addToolStateSingleSlice = exports.updateDiameterTool = exports.clearToolStateByName = exports.getToolState = exports.clearMeasurements = exports.addSeedsTool = exports.addStackStateToElement = exports.getCurrentMaskData = exports.addMaskEditingTool = exports.addContoursTool = exports.addDiameterTool = exports.applyDSAShift = exports.getFileImageId = exports.populateFileManager = exports.resetFileManager = exports.resetFileLoader = exports.getFileManager = exports.populateDsaImageIds = exports.clearMultiFrameCache = exports.getMultiFrameImageId = exports.buildMultiFrameImage = exports.loadMultiFrameImage = exports.unloadAndRecacheImageStackDSA = exports.loadAndCacheImageStack = exports.cacheImages = exports.cacheImage = exports.getDicomImageId = exports.loadReslicedImage = void 0;
|
|
165924
|
+
exports.getActiveLabelmapBuffer = exports.toggleVisibility = exports.toggleContourMode = exports.disableBrushTool = exports.enableBrushTool = exports.deleteMask = exports.clearSegmentationState = exports.rgbToHex = exports.hexToRgb = exports.setBrushProps = exports.redoLastStroke = exports.undoLastStroke = exports.setActiveSegment = exports.setActiveLabelmap = exports.addSegmentationMask = exports.initSegmentationModule = exports.removeMouseKeyHandlers = exports.addMouseKeyHandlers = exports.loadAnnotations = void 0;
|
|
165046
165925
|
const package_json_1 = __importDefault(__webpack_require__(4147));
|
|
165047
165926
|
const VERSION = package_json_1.default.version;
|
|
165048
165927
|
exports.VERSION = VERSION;
|
|
@@ -165118,6 +165997,7 @@ Object.defineProperty(exports, "initializeFileImageLoader", ({ enumerable: true,
|
|
|
165118
165997
|
Object.defineProperty(exports, "registerNRRDImageLoader", ({ enumerable: true, get: function () { return imageLoading_1.registerNRRDImageLoader; } }));
|
|
165119
165998
|
Object.defineProperty(exports, "registerResliceLoader", ({ enumerable: true, get: function () { return imageLoading_1.registerResliceLoader; } }));
|
|
165120
165999
|
Object.defineProperty(exports, "registerMultiFrameImageLoader", ({ enumerable: true, get: function () { return imageLoading_1.registerMultiFrameImageLoader; } }));
|
|
166000
|
+
Object.defineProperty(exports, "registerDsaImageLoader", ({ enumerable: true, get: function () { return imageLoading_1.registerDsaImageLoader; } }));
|
|
165121
166001
|
Object.defineProperty(exports, "updateLoadedStack", ({ enumerable: true, get: function () { return imageLoading_1.updateLoadedStack; } }));
|
|
165122
166002
|
const imageParsing_1 = __webpack_require__(1539);
|
|
165123
166003
|
Object.defineProperty(exports, "readFile", ({ enumerable: true, get: function () { return imageParsing_1.readFile; } }));
|
|
@@ -165135,6 +166015,7 @@ Object.defineProperty(exports, "unloadViewport", ({ enumerable: true, get: funct
|
|
|
165135
166015
|
Object.defineProperty(exports, "resizeViewport", ({ enumerable: true, get: function () { return imageRendering_1.resizeViewport; } }));
|
|
165136
166016
|
Object.defineProperty(exports, "renderImage", ({ enumerable: true, get: function () { return imageRendering_1.renderImage; } }));
|
|
165137
166017
|
Object.defineProperty(exports, "updateImage", ({ enumerable: true, get: function () { return imageRendering_1.updateImage; } }));
|
|
166018
|
+
Object.defineProperty(exports, "redrawImage", ({ enumerable: true, get: function () { return imageRendering_1.redrawImage; } }));
|
|
165138
166019
|
Object.defineProperty(exports, "resetViewports", ({ enumerable: true, get: function () { return imageRendering_1.resetViewports; } }));
|
|
165139
166020
|
Object.defineProperty(exports, "updateViewportData", ({ enumerable: true, get: function () { return imageRendering_1.updateViewportData; } }));
|
|
165140
166021
|
Object.defineProperty(exports, "storeViewportData", ({ enumerable: true, get: function () { return imageRendering_1.storeViewportData; } }));
|
|
@@ -165218,6 +166099,8 @@ const dicomLoader_1 = __webpack_require__(6790);
|
|
|
165218
166099
|
Object.defineProperty(exports, "getDicomImageId", ({ enumerable: true, get: function () { return dicomLoader_1.getDicomImageId; } }));
|
|
165219
166100
|
Object.defineProperty(exports, "cacheImage", ({ enumerable: true, get: function () { return dicomLoader_1.cacheImage; } }));
|
|
165220
166101
|
Object.defineProperty(exports, "cacheImages", ({ enumerable: true, get: function () { return dicomLoader_1.cacheImages; } }));
|
|
166102
|
+
Object.defineProperty(exports, "loadAndCacheImageStack", ({ enumerable: true, get: function () { return dicomLoader_1.loadAndCacheImageStack; } }));
|
|
166103
|
+
Object.defineProperty(exports, "unloadAndRecacheImageStackDSA", ({ enumerable: true, get: function () { return dicomLoader_1.unloadAndRecacheImageStackDSA; } }));
|
|
165221
166104
|
const resliceLoader_1 = __webpack_require__(5779);
|
|
165222
166105
|
Object.defineProperty(exports, "loadReslicedImage", ({ enumerable: true, get: function () { return resliceLoader_1.loadReslicedImage; } }));
|
|
165223
166106
|
const multiframeLoader_1 = __webpack_require__(934);
|
|
@@ -165225,6 +166108,8 @@ Object.defineProperty(exports, "loadMultiFrameImage", ({ enumerable: true, get:
|
|
|
165225
166108
|
Object.defineProperty(exports, "buildMultiFrameImage", ({ enumerable: true, get: function () { return multiframeLoader_1.buildMultiFrameImage; } }));
|
|
165226
166109
|
Object.defineProperty(exports, "getMultiFrameImageId", ({ enumerable: true, get: function () { return multiframeLoader_1.getMultiFrameImageId; } }));
|
|
165227
166110
|
Object.defineProperty(exports, "clearMultiFrameCache", ({ enumerable: true, get: function () { return multiframeLoader_1.clearMultiFrameCache; } }));
|
|
166111
|
+
const dsaImageLoader_1 = __webpack_require__(6475);
|
|
166112
|
+
Object.defineProperty(exports, "populateDsaImageIds", ({ enumerable: true, get: function () { return dsaImageLoader_1.populateDsaImageIds; } }));
|
|
165228
166113
|
const fileLoader_1 = __webpack_require__(9995);
|
|
165229
166114
|
Object.defineProperty(exports, "getFileManager", ({ enumerable: true, get: function () { return fileLoader_1.getFileManager; } }));
|
|
165230
166115
|
Object.defineProperty(exports, "resetFileLoader", ({ enumerable: true, get: function () { return fileLoader_1.resetFileLoader; } }));
|
|
@@ -165237,6 +166122,8 @@ Object.defineProperty(exports, "applyColorMap", ({ enumerable: true, get: functi
|
|
|
165237
166122
|
Object.defineProperty(exports, "addColorMap", ({ enumerable: true, get: function () { return imageColormaps_1.addColorMap; } }));
|
|
165238
166123
|
Object.defineProperty(exports, "fillPixelData", ({ enumerable: true, get: function () { return imageColormaps_1.fillPixelData; } }));
|
|
165239
166124
|
Object.defineProperty(exports, "HSVToRGB", ({ enumerable: true, get: function () { return imageColormaps_1.HSVToRGB; } }));
|
|
166125
|
+
const applyDSA_1 = __webpack_require__(1446);
|
|
166126
|
+
Object.defineProperty(exports, "applyDSAShift", ({ enumerable: true, get: function () { return applyDSA_1.applyDSAShift; } }));
|
|
165240
166127
|
const io_1 = __webpack_require__(5604);
|
|
165241
166128
|
Object.defineProperty(exports, "saveAnnotations", ({ enumerable: true, get: function () { return io_1.saveAnnotations; } }));
|
|
165242
166129
|
Object.defineProperty(exports, "loadAnnotations", ({ enumerable: true, get: function () { return io_1.loadAnnotations; } }));
|
|
@@ -165962,7 +166849,7 @@ module.exports = JSON.parse('{"x00000000":{"tag":"x00000000","vr":"UL","vm":"1",
|
|
|
165962
166849
|
/***/ ((module) => {
|
|
165963
166850
|
|
|
165964
166851
|
"use strict";
|
|
165965
|
-
module.exports = JSON.parse('{"name":"larvitar","keywords":["DICOM","imaging","medical","cornerstone"],"version":"2.1.
|
|
166852
|
+
module.exports = JSON.parse('{"name":"larvitar","keywords":["DICOM","imaging","medical","cornerstone"],"version":"2.1.6","description":"typescript library for parsing, loading, rendering and interacting with DICOM images","repository":{"url":"https://github.com/dvisionlab/Larvitar.git","type":"git"},"main":"dist/larvitar.js","types":"dist/index.d.ts","files":["dist","imaging/**/*.d.ts"],"scripts":{"coverage":"typescript-coverage-report","generate-docs":"node_modules/.bin/jsdoc -c jsdoc.json","build":"webpack --config ./bundler/webpack.prod.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js","dev":"webpack --progress --config ./bundler/webpack.dev.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js","dev-wip":"webpack serve --config ./bundler/webpack.dev-wip.js"},"author":"Simone Manini <simone.manini@dvisionlab.com> (https://www.dvisionlab.com)","contributors":["Mattia Ronzoni <mattia.ronzoni@dvisionlab.com> (https://www.dvisionlab.com)","Sara Zanchi <sara.zanchi@dvisionlab.com> (https://www.dvisionlab.com)","Ale Re <ale.re@dvisionlab.com> (https://www.dvisionlab.com)","Laura Borghesi Re <laura.borghesi@dvisionlab.com> (https://www.dvisionlab.com)"],"license":"MIT","dependencies":{"@rollup/plugin-commonjs":"^17.1.0","cornerstone-core":"^2.6.1","cornerstone-file-image-loader":"^0.3.0","cornerstone-tools":"^6.0.7","cornerstone-wado-image-loader":"^4.13.2","cornerstone-web-image-loader":"^2.1.1","crypto-js":"^4.1.1","dicom-character-set":"^1.0.3","dicom-parser":"^1.8.13","docdash":"^1.2.0","hammerjs":"^2.0.8","jpeg-lossless-decoder-js":"^2.0.7","keycode-js":"^3.1.0","lodash":"^4.17.15","pako":"^1.0.10","papaparse":"^5.3.0","pdfjs-dist":"^3.8.162","plotly.js-dist-min":"^2.27.1","uuid":"^8.3.2"},"devDependencies":{"@babel/core":"^7.21.8","@types/cornerstone-core":"^2.3.0","@types/crypto-js":"^4.1.1","@types/hammerjs":"^2.0.41","@types/lodash":"^4.14.192","@types/papaparse":"^5.3.7","@types/pdfjs-dist":"^2.10.378","@types/plotly.js":"^2.12.30","@types/plotly.js-dist-min":"^2.3.4","@types/uuid":"^9.0.1","babel-loader":"^9.1.2","clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^11.0.0","fs":"^0.0.1-security","html-loader":"^4.2.0","html-webpack-plugin":"^5.5.0","ip":"^1.1.8","jsdoc":"^3.6.4","portfinder-sync":"^0.0.2","ts-loader":"^9.4.2","typescript":"^5.0.2","typescript-coverage-report":"^0.7.0","webpack":"^5.76.3","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-server":"^4.13.1"}}');
|
|
165966
166853
|
|
|
165967
166854
|
/***/ })
|
|
165968
166855
|
|