@ohif/app 3.14.0-beta.71 → 3.14.0-beta.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{8199.bundle.25557805.js → 1153.bundle.efd8a415.js} +4482 -731
- package/dist/{1566.bundle.e9f5d851.js → 1566.bundle.d58db206.js} +47 -9
- package/dist/{1645.bundle.618a2886.js → 1645.bundle.a8ee81ea.js} +82 -46
- package/dist/{1793.bundle.7b6d510f.js → 1793.bundle.27458a55.js} +2 -2
- package/dist/{1862.bundle.10bed54a.js → 1862.bundle.79bfe469.js} +1 -1
- package/dist/{2717.bundle.4167aa16.js → 2717.bundle.e4bad54f.js} +2 -2
- package/dist/{2748.bundle.a90b290d.js → 2748.bundle.eaa94e2e.js} +0 -805
- package/dist/{3004.bundle.cbd2e499.js → 3004.bundle.c6734d77.js} +2 -2
- package/dist/3723.bundle.eab70100.js +808 -0
- package/dist/{3771.bundle.1c9e74f3.js → 3771.bundle.6cb07c14.js} +2 -2
- package/dist/{3044.bundle.039294b9.js → 4449.bundle.3e4b07e6.js} +1067 -85
- package/dist/{4606.bundle.05282205.js → 4606.bundle.a2a1aa34.js} +1 -1
- package/dist/{5076.bundle.157252dd.js → 5076.bundle.95c07142.js} +50 -8
- package/dist/{5143.bundle.67167d39.js → 5143.bundle.2ea0b15d.js} +1211 -176
- package/dist/{5320.bundle.0c7b2cb7.js → 5320.bundle.335efd86.js} +263 -235
- package/dist/{5914.bundle.00f408d2.js → 5914.bundle.f6e9fc4a.js} +37 -9
- package/dist/{5989.bundle.f8096a4e.js → 5989.bundle.2999d206.js} +336 -256
- package/dist/{1283.bundle.f2c2bb56.js → 6133.bundle.d4f7403f.js} +7802 -504
- package/dist/{3386.bundle.61e687a7.js → 6289.bundle.2795699d.js} +107 -29
- package/dist/{4018.bundle.48c288e5.js → 6847.bundle.5a087332.js} +59 -9
- package/dist/{7604.bundle.2d399cf0.js → 7604.bundle.e703a54d.js} +1 -1
- package/dist/{7464.bundle.492c83ce.js → 8037.bundle.8b5f4114.js} +4148 -1047
- package/dist/{1724.bundle.59b20c59.js → 8699.bundle.024fb1bc.js} +480 -87
- package/dist/{9187.bundle.237037e4.js → 9187.bundle.7d18bb1c.js} +4 -4
- package/dist/{9481.bundle.027aa5ca.js → 9481.bundle.f443c81b.js} +4 -4
- package/dist/{9620.bundle.67375c83.js → 9620.bundle.24273cf3.js} +4 -4
- package/dist/{9886.bundle.5c1ff898.js → 9886.bundle.cabb4a24.js} +2 -2
- package/dist/{9892.bundle.8c1ccb0e.js → 9892.bundle.9bc28476.js} +5 -5
- package/dist/{9948.bundle.29548cec.js → 9948.bundle.b4ff610d.js} +2 -2
- package/dist/app-config.js +2 -0
- package/dist/{app.bundle.7ff9e2bc.js → app.bundle.220fbf72.js} +40 -37
- package/dist/{compute.bundle.79a2d455.js → compute.bundle.19cf1283.js} +10 -10
- package/dist/customizations/gpu/high-texture-4096.jsonc +9 -0
- package/dist/customizations/gpu/high.jsonc +8 -0
- package/dist/customizations/gpu/low-tablet.jsonc +7 -0
- package/dist/customizations/gpu/low.jsonc +7 -0
- package/dist/customizations/gpu/medium.jsonc +7 -0
- package/dist/customizations/index.html +39 -0
- package/dist/{histogram-worker.bundle.a8bb873a.js → histogram-worker.bundle.58e60d7c.js} +4 -4
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.302d242b.js → interpolation.bundle.7b3850e6.js} +7 -7
- package/dist/{polySeg.bundle.aaf002b1.js → polySeg.bundle.157e1e17.js} +11 -11
- package/dist/sw.js +1 -1
- package/package.json +6 -6
|
@@ -2414,16 +2414,21 @@ class TiledRenderingEngine extends _BaseRenderingEngine_js__rspack_import_0/* ["
|
|
|
2414
2414
|
super(id);
|
|
2415
2415
|
this._renderFlaggedViewports = () => {
|
|
2416
2416
|
this._throwIfDestroyed();
|
|
2417
|
+
const renderStart = performance.now();
|
|
2417
2418
|
if (this.offscreenMultiRenderWindow) {
|
|
2418
2419
|
this.performVtkDrawCall();
|
|
2419
2420
|
}
|
|
2420
2421
|
const viewports = this._getViewportsAsArray();
|
|
2421
2422
|
const eventDetailArray = [];
|
|
2423
|
+
const renderedViewports = [];
|
|
2422
2424
|
for (let i = 0; i < viewports.length; i++) {
|
|
2423
2425
|
const viewport = viewports[i];
|
|
2424
2426
|
if (this._needsRender.has(viewport.id)) {
|
|
2425
2427
|
const eventDetail = this.renderViewportUsingCustomOrVtkPipeline(viewport);
|
|
2426
|
-
|
|
2428
|
+
if (!this._waitsForStorage(viewport, renderStart)) {
|
|
2429
|
+
eventDetailArray.push(eventDetail);
|
|
2430
|
+
renderedViewports.push(viewport);
|
|
2431
|
+
}
|
|
2427
2432
|
viewport.setRendered();
|
|
2428
2433
|
this._needsRender.delete(viewport.id);
|
|
2429
2434
|
if (this._needsRender.size === 0) {
|
|
@@ -2439,6 +2444,7 @@ class TiledRenderingEngine extends _BaseRenderingEngine_js__rspack_import_0/* ["
|
|
|
2439
2444
|
}
|
|
2440
2445
|
(0,_utilities_triggerEvent_js__rspack_import_3/* ["default"] */.A)(eventDetail.element, _enums_Events_js__rspack_import_1/* ["default"].IMAGE_RENDERED */.A.IMAGE_RENDERED, eventDetail);
|
|
2441
2446
|
});
|
|
2447
|
+
this._notifyFidelityOfRenderedViewports(renderedViewports);
|
|
2442
2448
|
};
|
|
2443
2449
|
if (!this.useCPURendering) {
|
|
2444
2450
|
this.ensureOffscreenResources();
|
|
@@ -2864,13 +2870,36 @@ function isVolumeCompatible(viewport) {
|
|
|
2864
2870
|
/* import */ var _kitware_vtk_js_Common_DataModel_ImageData_js__rspack_import_0 = __webpack_require__(41698);
|
|
2865
2871
|
/* import */ var _utilities_imageIdToURI_js__rspack_import_1 = __webpack_require__(60465);
|
|
2866
2872
|
/* import */ var _utilities_VoxelManager_js__rspack_import_2 = __webpack_require__(60719);
|
|
2867
|
-
/* import */ var
|
|
2868
|
-
/* import */ var
|
|
2873
|
+
/* import */ var _utilities_CompositeVoxelManager_js__rspack_import_3 = __webpack_require__(86998);
|
|
2874
|
+
/* import */ var _volumeTextureStore_js__rspack_import_4 = __webpack_require__(82340);
|
|
2875
|
+
/* import */ var _utilities_voxelGrid_index_js__rspack_import_5 = __webpack_require__(49617);
|
|
2876
|
+
/* import */ var _RenderingEngine_vtkClasses_index_js__rspack_import_6 = __webpack_require__(44418);
|
|
2877
|
+
/* import */ var _enums_ImageQualityStatus_js__rspack_import_7 = __webpack_require__(7330);
|
|
2878
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_8 = __webpack_require__(10475);
|
|
2879
|
+
/* import */ var _enums_Events_js__rspack_import_9 = __webpack_require__(33635);
|
|
2880
|
+
/* import */ var _eventTarget_js__rspack_import_10 = __webpack_require__(45340);
|
|
2881
|
+
/* import */ var _utilities_triggerEvent_js__rspack_import_11 = __webpack_require__(84444);
|
|
2882
|
+
/* import */ var _cache_js__rspack_import_12 = __webpack_require__(73998);
|
|
2883
|
+
/* import */ var _utilities_logger_js__rspack_import_13 = __webpack_require__(34040);
|
|
2884
|
+
|
|
2885
|
+
|
|
2886
|
+
|
|
2887
|
+
|
|
2888
|
+
|
|
2889
|
+
|
|
2869
2890
|
|
|
2870
2891
|
|
|
2871
2892
|
|
|
2872
2893
|
|
|
2873
2894
|
|
|
2895
|
+
|
|
2896
|
+
|
|
2897
|
+
|
|
2898
|
+
const log = _utilities_logger_js__rspack_import_13.coreLog.getLogger('cache', 'ImageVolume');
|
|
2899
|
+
const FULL_RESOLUTION_TEXTURE_SET = 'full-resolution/full-extent';
|
|
2900
|
+
function markSlice(slot, slice) {
|
|
2901
|
+
slot.texture.setUpdatedFrame(slice);
|
|
2902
|
+
}
|
|
2874
2903
|
class ImageVolume {
|
|
2875
2904
|
get numTimePoints() {
|
|
2876
2905
|
return typeof this.numDimensionGroups === 'number'
|
|
@@ -2883,7 +2912,7 @@ class ImageVolume {
|
|
|
2883
2912
|
this.cornerstoneImageMetaData = null;
|
|
2884
2913
|
this.isPreScaled = false;
|
|
2885
2914
|
this.numFrames = null;
|
|
2886
|
-
const { imageIds, scaling, dimensions, spacing, origin, direction, dataType, volumeId, referencedVolumeId, metadata, referencedImageIds, additionalDetails, voxelManager, numberOfComponents, } = props;
|
|
2915
|
+
const { imageIds, scaling, dimensions, spacing, origin, direction, dataType, volumeId, referencedVolumeId, metadata, referencedImageIds, additionalDetails, voxelManager, numberOfComponents, reductionStatistic, } = props;
|
|
2887
2916
|
if (!dataType) {
|
|
2888
2917
|
throw new Error('Data type is required, please provide a data type as string such as "Uint8Array", "Float32Array", etc.');
|
|
2889
2918
|
}
|
|
@@ -2897,13 +2926,13 @@ class ImageVolume {
|
|
|
2897
2926
|
this.origin = origin;
|
|
2898
2927
|
this.direction = direction;
|
|
2899
2928
|
this.dataType = dataType;
|
|
2929
|
+
this.reductionStatistic = reductionStatistic;
|
|
2930
|
+
this._numberOfComponents = numberOfComponents || 1;
|
|
2900
2931
|
this.hasPixelSpacing =
|
|
2901
2932
|
Number.isFinite(spacing[0]) &&
|
|
2902
2933
|
spacing[0] > 0 &&
|
|
2903
2934
|
Number.isFinite(spacing[1]) &&
|
|
2904
2935
|
spacing[1] > 0;
|
|
2905
|
-
this.vtkOpenGLTexture = _RenderingEngine_vtkClasses_index_js__rspack_import_3/* .vtkStreamingOpenGLTexture.newInstance */.uT.newInstance();
|
|
2906
|
-
this.vtkOpenGLTexture.setVolumeId(volumeId);
|
|
2907
2936
|
this.voxelManager =
|
|
2908
2937
|
voxelManager ??
|
|
2909
2938
|
_utilities_VoxelManager_js__rspack_import_2/* ["default"].createImageVolumeVoxelManager */.A.createImageVolumeVoxelManager({
|
|
@@ -2911,6 +2940,7 @@ class ImageVolume {
|
|
|
2911
2940
|
imageIds,
|
|
2912
2941
|
numberOfComponents,
|
|
2913
2942
|
id: volumeId,
|
|
2943
|
+
dataType,
|
|
2914
2944
|
});
|
|
2915
2945
|
this.numVoxels =
|
|
2916
2946
|
this.dimensions[0] * this.dimensions[1] * this.dimensions[2];
|
|
@@ -2949,6 +2979,153 @@ class ImageVolume {
|
|
|
2949
2979
|
get sizeInBytes() {
|
|
2950
2980
|
return this.voxelManager.sizeInBytes;
|
|
2951
2981
|
}
|
|
2982
|
+
get voxelGrid() {
|
|
2983
|
+
return {
|
|
2984
|
+
origin: [...this.origin],
|
|
2985
|
+
direction: [...this.direction],
|
|
2986
|
+
spacing: [...this.spacing],
|
|
2987
|
+
dimensions: [...this.dimensions],
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
deliveredRegions() {
|
|
2991
|
+
return undefined;
|
|
2992
|
+
}
|
|
2993
|
+
get reductionStatistic() {
|
|
2994
|
+
return this._reductionStatistic;
|
|
2995
|
+
}
|
|
2996
|
+
set reductionStatistic(statistic) {
|
|
2997
|
+
if (statistic === this._reductionStatistic) {
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
const effective = statistic ?? _enums_VoxelStatistics_js__rspack_import_8/* ["default"].Average */.A.Average;
|
|
3001
|
+
const reducedWithAnother = this.textureSets.some((set) => set.name !== FULL_RESOLUTION_TEXTURE_SET && set.statistic !== effective);
|
|
3002
|
+
if (reducedWithAnother) {
|
|
3003
|
+
log.warn(`reductionStatistic of ${this.volumeId} changed to ${statistic} after a reduction with another statistic; existing reduced textures do not match it.`);
|
|
3004
|
+
}
|
|
3005
|
+
this._reductionStatistic = statistic;
|
|
3006
|
+
}
|
|
3007
|
+
resetCompositeVoxelManager() {
|
|
3008
|
+
this._compositeVoxelManager = undefined;
|
|
3009
|
+
}
|
|
3010
|
+
get compositeVoxelManager() {
|
|
3011
|
+
const primary = this.voxelManager;
|
|
3012
|
+
if (!this._compositeVoxelManager ||
|
|
3013
|
+
this._compositeVoxelManager.primary !== primary) {
|
|
3014
|
+
const delivered = this.deliveredRegions();
|
|
3015
|
+
this._compositeVoxelManager = new _utilities_CompositeVoxelManager_js__rspack_import_3/* ["default"] */.Ay({
|
|
3016
|
+
primary,
|
|
3017
|
+
grid: this.voxelGrid,
|
|
3018
|
+
delivered,
|
|
3019
|
+
quality: delivered === undefined
|
|
3020
|
+
? _enums_ImageQualityStatus_js__rspack_import_7/* ["default"].FULL_RESOLUTION */.A.FULL_RESOLUTION
|
|
3021
|
+
: undefined,
|
|
3022
|
+
id: `composite-${this.volumeId}`,
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
return this._compositeVoxelManager;
|
|
3026
|
+
}
|
|
3027
|
+
getVoxelRepresentations() {
|
|
3028
|
+
return this.compositeVoxelManager.getRepresentations();
|
|
3029
|
+
}
|
|
3030
|
+
selectVoxelRepresentation(selector = {}) {
|
|
3031
|
+
return this.compositeVoxelManager.selectRepresentation(selector);
|
|
3032
|
+
}
|
|
3033
|
+
getVoxelQuality(selector = {}) {
|
|
3034
|
+
return this.compositeVoxelManager.getQuality(selector);
|
|
3035
|
+
}
|
|
3036
|
+
getGridQuality(grid, statistic) {
|
|
3037
|
+
return this.compositeVoxelManager.getGridQuality(grid, { statistic });
|
|
3038
|
+
}
|
|
3039
|
+
static get textureBytesUsed() {
|
|
3040
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].bytesUsed */.Ay.bytesUsed;
|
|
3041
|
+
}
|
|
3042
|
+
static get textureBudget() {
|
|
3043
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].budget */.Ay.budget;
|
|
3044
|
+
}
|
|
3045
|
+
static setTextureBudget(bytes) {
|
|
3046
|
+
_volumeTextureStore_js__rspack_import_4/* ["default"].setBudget */.Ay.setBudget(bytes);
|
|
3047
|
+
(0,_utilities_triggerEvent_js__rspack_import_11/* ["default"] */.A)(_eventTarget_js__rspack_import_10/* ["default"] */.A, _enums_Events_js__rspack_import_9/* ["default"].VOLUME_TEXTURE_LIMITS_CHANGED */.A.VOLUME_TEXTURE_LIMITS_CHANGED);
|
|
3048
|
+
}
|
|
3049
|
+
static clearTextureSets() {
|
|
3050
|
+
_volumeTextureStore_js__rspack_import_4/* ["default"].clear */.Ay.clear();
|
|
3051
|
+
}
|
|
3052
|
+
get textureSets() {
|
|
3053
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].setsOfVolume */.Ay.setsOfVolume(this.volumeId);
|
|
3054
|
+
}
|
|
3055
|
+
getTextureSet(name) {
|
|
3056
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].getSet */.Ay.getSet(this.volumeId, name);
|
|
3057
|
+
}
|
|
3058
|
+
provisionTextureSet(options) {
|
|
3059
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].provision */.Ay.provision({
|
|
3060
|
+
volumeId: this.volumeId,
|
|
3061
|
+
volumeGrid: this.voxelGrid,
|
|
3062
|
+
dataType: this.dataType,
|
|
3063
|
+
numberOfComponents: this._numberOfComponents,
|
|
3064
|
+
createTexture: ({ grid, statistic }) => {
|
|
3065
|
+
const texture = _RenderingEngine_vtkClasses_index_js__rspack_import_6/* .vtkStreamingOpenGLTexture.newInstance */.uT.newInstance();
|
|
3066
|
+
texture.setVolumeId(this.volumeId);
|
|
3067
|
+
texture.setGrid(grid);
|
|
3068
|
+
texture.setStatistic(statistic);
|
|
3069
|
+
return texture;
|
|
3070
|
+
},
|
|
3071
|
+
destroyTexture: (texture) => {
|
|
3072
|
+
texture.releaseGraphicsResources();
|
|
3073
|
+
texture.delete();
|
|
3074
|
+
},
|
|
3075
|
+
applyGrid: (texture, grid) => {
|
|
3076
|
+
texture.setGrid(grid);
|
|
3077
|
+
texture.markAllFramesUpdated();
|
|
3078
|
+
},
|
|
3079
|
+
markTextureSlice: markSlice,
|
|
3080
|
+
...options,
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
claimTextureSet(name) {
|
|
3084
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].claim */.Ay.claim(this.volumeId, name);
|
|
3085
|
+
}
|
|
3086
|
+
releaseTextureSet(name) {
|
|
3087
|
+
return _volumeTextureStore_js__rspack_import_4/* ["default"].release */.Ay.release(this.volumeId, name);
|
|
3088
|
+
}
|
|
3089
|
+
getFullResolutionTexture() {
|
|
3090
|
+
if (this.vtkOpenGLTexture) {
|
|
3091
|
+
return this.vtkOpenGLTexture;
|
|
3092
|
+
}
|
|
3093
|
+
this.provisionTextureSet({
|
|
3094
|
+
name: FULL_RESOLUTION_TEXTURE_SET,
|
|
3095
|
+
grids: [this.voxelGrid],
|
|
3096
|
+
coverage: 'full-extent',
|
|
3097
|
+
backstop: true,
|
|
3098
|
+
});
|
|
3099
|
+
return this.vtkOpenGLTexture;
|
|
3100
|
+
}
|
|
3101
|
+
get vtkOpenGLTexture() {
|
|
3102
|
+
const member = this.getTextureSet(FULL_RESOLUTION_TEXTURE_SET)?.members()[0];
|
|
3103
|
+
return member?.texture;
|
|
3104
|
+
}
|
|
3105
|
+
markFrameTexturesDirty(frameIndex) {
|
|
3106
|
+
this.voxelManager?.invalidateSlice?.(frameIndex);
|
|
3107
|
+
for (const set of this.textureSets) {
|
|
3108
|
+
set.markDirty((0,_utilities_voxelGrid_index_js__rspack_import_5.boundsOfFrame)(this.voxelGrid, frameIndex), markSlice);
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
recordFrameDelivery(frameIndex, quality) {
|
|
3112
|
+
this.compositeVoxelManager.acceptData({
|
|
3113
|
+
grid: this.voxelGrid,
|
|
3114
|
+
frameIndex,
|
|
3115
|
+
quality,
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
markFrameModified(frameIndex) {
|
|
3119
|
+
this.markFrameTexturesDirty(frameIndex);
|
|
3120
|
+
}
|
|
3121
|
+
markAllTexturesDirty() {
|
|
3122
|
+
for (const set of this.textureSets) {
|
|
3123
|
+
set.markAllDirty(markSlice);
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
getImageQuality(_imageIdIndex) {
|
|
3127
|
+
return _enums_ImageQualityStatus_js__rspack_import_7/* ["default"].FULL_RESOLUTION */.A.FULL_RESOLUTION;
|
|
3128
|
+
}
|
|
2952
3129
|
get imageIds() {
|
|
2953
3130
|
return this._imageIds;
|
|
2954
3131
|
}
|
|
@@ -2986,22 +3163,20 @@ class ImageVolume {
|
|
|
2986
3163
|
this.imageData.delete();
|
|
2987
3164
|
this.imageData = null;
|
|
2988
3165
|
this.voxelManager.clear();
|
|
2989
|
-
this.
|
|
2990
|
-
|
|
3166
|
+
this.resetCompositeVoxelManager();
|
|
3167
|
+
_volumeTextureStore_js__rspack_import_4/* ["default"].evictVolume */.Ay.evictVolume(this.volumeId);
|
|
2991
3168
|
}
|
|
2992
3169
|
invalidate() {
|
|
2993
|
-
|
|
2994
|
-
this.vtkOpenGLTexture.setUpdatedFrame(i);
|
|
2995
|
-
}
|
|
3170
|
+
this.markAllTexturesDirty();
|
|
2996
3171
|
this.imageData.modified();
|
|
2997
3172
|
}
|
|
2998
3173
|
modified() {
|
|
2999
3174
|
this.imageData.modified();
|
|
3000
|
-
this.
|
|
3175
|
+
this.markAllTexturesDirty();
|
|
3001
3176
|
this.numFrames = this._getNumFrames();
|
|
3002
3177
|
}
|
|
3003
3178
|
removeFromCache() {
|
|
3004
|
-
|
|
3179
|
+
_cache_js__rspack_import_12/* ["default"].removeVolumeLoadObject */.Ay.removeVolumeLoadObject(this.volumeId);
|
|
3005
3180
|
}
|
|
3006
3181
|
getScalarDataLength() {
|
|
3007
3182
|
return this.voxelManager.getScalarDataLength();
|
|
@@ -3018,16 +3193,21 @@ class ImageVolume {
|
|
|
3018
3193
|
getCornerstoneImages() {
|
|
3019
3194
|
const { imageIds } = this;
|
|
3020
3195
|
return imageIds.map((imageId) => {
|
|
3021
|
-
return
|
|
3196
|
+
return _cache_js__rspack_import_12/* ["default"].getImage */.Ay.getImage(imageId);
|
|
3022
3197
|
});
|
|
3023
3198
|
}
|
|
3024
3199
|
}
|
|
3025
|
-
/* export default */ __webpack_exports__.
|
|
3200
|
+
/* export default */ __webpack_exports__.Ay = (ImageVolume);
|
|
3201
|
+
|
|
3202
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
3203
|
+
}, {
|
|
3204
|
+
gl: FULL_RESOLUTION_TEXTURE_SET
|
|
3205
|
+
});
|
|
3026
3206
|
|
|
3027
3207
|
|
|
3028
3208
|
},
|
|
3029
3209
|
85387(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
3030
|
-
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(
|
|
3210
|
+
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(86049);
|
|
3031
3211
|
|
|
3032
3212
|
const CalibrationTypes = _cornerstonejs_metadata__rspack_import_0/* .Enums.CalibrationTypes */.fX.ov;
|
|
3033
3213
|
/* unused export default */ var __rspack_default_export = (_cornerstonejs_metadata__rspack_import_0/* .Enums.CalibrationTypes */.fX.ov);
|
|
@@ -3054,8 +3234,14 @@ const CalibrationTypes = _cornerstonejs_metadata__rspack_import_0/* .Enums.Calib
|
|
|
3054
3234
|
/* import */ var _MetadataModules_js__rspack_import_16 = __webpack_require__(10234);
|
|
3055
3235
|
/* import */ var _GenerateImageType_js__rspack_import_17 = __webpack_require__(45180);
|
|
3056
3236
|
/* import */ var _VoxelManagerEnum_js__rspack_import_18 = __webpack_require__(20908);
|
|
3057
|
-
/* import */ var
|
|
3058
|
-
/* import */ var
|
|
3237
|
+
/* import */ var _VoxelStatistics_js__rspack_import_19 = __webpack_require__(10475);
|
|
3238
|
+
/* import */ var _VoxelReductions_js__rspack_import_20 = __webpack_require__(33170);
|
|
3239
|
+
/* import */ var _VoxelDataSources_js__rspack_import_21 = __webpack_require__(2568);
|
|
3240
|
+
/* import */ var _RenderingEngineModeEnum_js__rspack_import_22 = __webpack_require__(21280);
|
|
3241
|
+
/* import */ var _RenderBackends_js__rspack_import_23 = __webpack_require__(52587);
|
|
3242
|
+
|
|
3243
|
+
|
|
3244
|
+
|
|
3059
3245
|
|
|
3060
3246
|
|
|
3061
3247
|
|
|
@@ -3080,6 +3266,7 @@ const CalibrationTypes = _cornerstonejs_metadata__rspack_import_0/* .Enums.Calib
|
|
|
3080
3266
|
|
|
3081
3267
|
|
|
3082
3268
|
__webpack_require__.d(__webpack_exports__, {
|
|
3269
|
+
BlendModes: () => (/* reexport safe */ _BlendModes_js__rspack_import_5.A),
|
|
3083
3270
|
Events: () => (/* reexport safe */ _Events_js__rspack_import_0.A),
|
|
3084
3271
|
GeometryType: () => (/* reexport safe */ _GeometryType_js__rspack_import_7.A),
|
|
3085
3272
|
ImageQualityStatus: () => (/* reexport safe */ _ImageQualityStatus_js__rspack_import_14.A),
|
|
@@ -3087,8 +3274,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
3087
3274
|
MeshType: () => (/* reexport safe */ _MeshType_js__rspack_import_9.A),
|
|
3088
3275
|
MetadataModules: () => (/* reexport safe */ _MetadataModules_js__rspack_import_16.A),
|
|
3089
3276
|
OrientationAxis: () => (/* reexport safe */ _OrientationAxis_js__rspack_import_6.A),
|
|
3090
|
-
RenderBackends: () => (/* reexport safe */
|
|
3091
|
-
RenderingEngineModeEnum: () => (/* reexport safe */
|
|
3277
|
+
RenderBackends: () => (/* reexport safe */ _RenderBackends_js__rspack_import_23.A),
|
|
3278
|
+
RenderingEngineModeEnum: () => (/* reexport safe */ _RenderingEngineModeEnum_js__rspack_import_22.A),
|
|
3092
3279
|
RequestType: () => (/* reexport safe */ _RequestType_js__rspack_import_1.A),
|
|
3093
3280
|
VOILUTFunctionType: () => (/* reexport safe */ _VOILUTFunctionType_js__rspack_import_10.A),
|
|
3094
3281
|
VideoEnums: () => (/* reexport module object */ _VideoEnums_js__rspack_import_15),
|
|
@@ -3166,13 +3353,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
3166
3353
|
up: () => (/* binding */ getCanUseNorm16Texture),
|
|
3167
3354
|
D0: () => (/* binding */ getConfiguration),
|
|
3168
3355
|
cz: () => (/* binding */ getEffectiveRenderBackend),
|
|
3356
|
+
GR: () => (/* binding */ getLossyDownsampling),
|
|
3169
3357
|
LH: () => (/* binding */ getShouldUseCPURendering),
|
|
3170
3358
|
xu: () => (/* binding */ getUseGenericViewport),
|
|
3171
3359
|
Dh: () => (/* binding */ isCornerstoneInitialized),
|
|
3172
3360
|
a: () => (/* binding */ peerImport)
|
|
3173
3361
|
});
|
|
3174
3362
|
|
|
3175
|
-
// UNUSED EXPORTS: getRenderBackend, getWebWorkerManager, init, resetInitialization, resetUseCPURendering, resolveAutoRenderBackend, setConfiguration, setPreferSizeOverAccuracy, setRenderBackend, setUseCPURendering
|
|
3363
|
+
// UNUSED EXPORTS: getRenderBackend, getWebWorkerManager, init, resetInitialization, resetUseCPURendering, resolveAutoRenderBackend, setConfiguration, setLossyDownsampling, setPreferSizeOverAccuracy, setRenderBackend, setUseCPURendering
|
|
3176
3364
|
|
|
3177
3365
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/getRenderingEngine.js
|
|
3178
3366
|
var getRenderingEngine = __webpack_require__(2448);
|
|
@@ -3358,6 +3546,7 @@ let csRenderInitialized = false;
|
|
|
3358
3546
|
const log = logger.coreLog.getLogger('init');
|
|
3359
3547
|
const defaultConfig = {
|
|
3360
3548
|
isMobile: false,
|
|
3549
|
+
dangerouslyDisableFidelityIndicator: false,
|
|
3361
3550
|
rendering: {
|
|
3362
3551
|
useCPURendering: false,
|
|
3363
3552
|
preferSizeOverAccuracy: false,
|
|
@@ -3376,12 +3565,18 @@ const defaultConfig = {
|
|
|
3376
3565
|
volumeRendering: {
|
|
3377
3566
|
sampleDistanceMultiplier: 1,
|
|
3378
3567
|
},
|
|
3568
|
+
lossyDownsampling: {
|
|
3569
|
+
final: false,
|
|
3570
|
+
interactive: true,
|
|
3571
|
+
interleavedLoading: true,
|
|
3572
|
+
},
|
|
3379
3573
|
},
|
|
3380
3574
|
segmentation: {
|
|
3381
3575
|
labelmapVoxelRepresentation: enums.VoxelManagerEnum.Volume,
|
|
3382
3576
|
},
|
|
3383
3577
|
debug: {
|
|
3384
3578
|
statsOverlay: false,
|
|
3579
|
+
fidelityIndicatorDebug: false,
|
|
3385
3580
|
},
|
|
3386
3581
|
peerImport: (moduleId) => null,
|
|
3387
3582
|
};
|
|
@@ -3501,7 +3696,7 @@ function setPreferSizeOverAccuracy(status) {
|
|
|
3501
3696
|
}
|
|
3502
3697
|
function canRenderFloatTextures() {
|
|
3503
3698
|
const capabilities = (0,renderingCapabilities/* .getRenderingCapabilities */.BV)();
|
|
3504
|
-
if (capabilities.
|
|
3699
|
+
if (capabilities.webgl) {
|
|
3505
3700
|
return capabilities.floatLinear;
|
|
3506
3701
|
}
|
|
3507
3702
|
return !isIOS();
|
|
@@ -3556,6 +3751,20 @@ function getWebWorkerManager() {
|
|
|
3556
3751
|
}
|
|
3557
3752
|
return init_webWorkerManager;
|
|
3558
3753
|
}
|
|
3754
|
+
function getLossyDownsampling() {
|
|
3755
|
+
return {
|
|
3756
|
+
...defaultConfig.rendering
|
|
3757
|
+
.lossyDownsampling,
|
|
3758
|
+
...config.rendering?.lossyDownsampling,
|
|
3759
|
+
};
|
|
3760
|
+
}
|
|
3761
|
+
function setLossyDownsampling(change) {
|
|
3762
|
+
config.rendering = {
|
|
3763
|
+
...config.rendering,
|
|
3764
|
+
lossyDownsampling: { ...getLossyDownsampling(), ...change },
|
|
3765
|
+
};
|
|
3766
|
+
triggerEvent(eventTarget, Events.VOLUME_TEXTURE_LIMITS_CHANGED);
|
|
3767
|
+
}
|
|
3559
3768
|
async function peerImport(moduleId) {
|
|
3560
3769
|
return config.peerImport(moduleId);
|
|
3561
3770
|
}
|
|
@@ -4010,6 +4219,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4010
4219
|
/* import */ var _imageLoader_js__rspack_import_9 = __webpack_require__(65092);
|
|
4011
4220
|
/* import */ var _utilities_generateVolumePropsFromImageIds_js__rspack_import_10 = __webpack_require__(53286);
|
|
4012
4221
|
/* import */ var _cornerstoneStreamingImageVolumeLoader_js__rspack_import_11 = __webpack_require__(45516);
|
|
4222
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_12 = __webpack_require__(10475);
|
|
4223
|
+
|
|
4013
4224
|
|
|
4014
4225
|
|
|
4015
4226
|
|
|
@@ -4217,6 +4428,7 @@ function createLocalVolume(volumeId, options = {}) {
|
|
|
4217
4428
|
dimensions,
|
|
4218
4429
|
numberOfComponents: 1,
|
|
4219
4430
|
id: volumeId,
|
|
4431
|
+
dataType,
|
|
4220
4432
|
});
|
|
4221
4433
|
imageVolume.voxelManager = voxelManager;
|
|
4222
4434
|
if (!preventCache) {
|
|
@@ -4239,19 +4451,23 @@ function getUnknownVolumeLoaderSchema() {
|
|
|
4239
4451
|
return unknownVolumeLoader.name;
|
|
4240
4452
|
}
|
|
4241
4453
|
function createAndCacheDerivedLabelmapVolume(referencedVolumeId, options = {}) {
|
|
4242
|
-
|
|
4454
|
+
const volume = createAndCacheDerivedVolume(referencedVolumeId, {
|
|
4243
4455
|
...options,
|
|
4244
4456
|
targetBuffer: {
|
|
4245
4457
|
type: 'Uint8Array',
|
|
4246
4458
|
...options?.targetBuffer,
|
|
4247
4459
|
},
|
|
4248
4460
|
});
|
|
4461
|
+
volume.reductionStatistic = VoxelStatistics.ForegroundMajority;
|
|
4462
|
+
return volume;
|
|
4249
4463
|
}
|
|
4250
4464
|
function createLocalLabelmapVolume(options, volumeId, preventCache = false) {
|
|
4251
4465
|
if (!options.scalarData) {
|
|
4252
4466
|
options.scalarData = new Uint8Array(options.dimensions[0] * options.dimensions[1] * options.dimensions[2]);
|
|
4253
4467
|
}
|
|
4254
|
-
|
|
4468
|
+
const volume = createLocalVolume(volumeId, { ...options, preventCache });
|
|
4469
|
+
volume.reductionStatistic = VoxelStatistics.ForegroundMajority;
|
|
4470
|
+
return volume;
|
|
4255
4471
|
}
|
|
4256
4472
|
|
|
4257
4473
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -4262,29 +4478,50 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4262
4478
|
|
|
4263
4479
|
|
|
4264
4480
|
},
|
|
4265
|
-
|
|
4481
|
+
52284(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
4482
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4483
|
+
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(86049);
|
|
4484
|
+
|
|
4485
|
+
const { /* addProvider */Zi: addProvider, /* removeProvider */iw: removeProvider, /* removeAllProviders */SD: removeAllProviders, /* getMetaData */YA: getMetaData, /* getTyped */FE: getTyped, /* get */Jt: get, /* getNormalized */Y2: getNormalized, /* toUpperCamelTag */Qy: toUpperCamelTag, /* toLowerCamelTag */Hw: toLowerCamelTag, } = _cornerstonejs_metadata__rspack_import_0/* .metaData */.wx;
|
|
4486
|
+
|
|
4487
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
4488
|
+
}, {
|
|
4489
|
+
addProvider: addProvider,
|
|
4490
|
+
get: get,
|
|
4491
|
+
getMetaData: getMetaData,
|
|
4492
|
+
getNormalized: getNormalized,
|
|
4493
|
+
getTyped: getTyped,
|
|
4494
|
+
removeAllProviders: removeAllProviders,
|
|
4495
|
+
removeProvider: removeProvider,
|
|
4496
|
+
toLowerCamelTag: toLowerCamelTag,
|
|
4497
|
+
toUpperCamelTag: toUpperCamelTag
|
|
4498
|
+
});
|
|
4499
|
+
|
|
4500
|
+
|
|
4501
|
+
},
|
|
4502
|
+
24511(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
4266
4503
|
/* import */ var _enums_index_js__rspack_import_0 = __webpack_require__(71088);
|
|
4267
4504
|
/* import */ var _metaData_js__rspack_import_1 = __webpack_require__(52284);
|
|
4268
4505
|
|
|
4269
4506
|
|
|
4270
4507
|
const ECG_SECONDS_WIDTH = 150;
|
|
4271
4508
|
const ECG_CHANNEL_SPACING = 5;
|
|
4272
|
-
const ECG_RENDERING_COLORS = {
|
|
4509
|
+
const ECG_RENDERING_COLORS = (/* unused pure expression or super */ null && ({
|
|
4273
4510
|
gridMajor: '#7f0000',
|
|
4274
4511
|
gridMinor: '#3f0000',
|
|
4275
4512
|
baseline: '#7f4c00',
|
|
4276
4513
|
trace: '#ffffff',
|
|
4277
4514
|
label: '#ffff00',
|
|
4278
4515
|
background: '#000000',
|
|
4279
|
-
};
|
|
4516
|
+
}));
|
|
4280
4517
|
async function loadECGWaveform(dataId) {
|
|
4281
|
-
const ecgModule =
|
|
4518
|
+
const ecgModule = metaData.get(MetadataModules.ECG, dataId);
|
|
4282
4519
|
if (!ecgModule?.waveformData?.retrieveBulkData) {
|
|
4283
4520
|
throw new Error(`[ECG] No ECG waveform data for ${dataId}`);
|
|
4284
4521
|
}
|
|
4285
4522
|
const { numberOfWaveformChannels: numberOfChannels, numberOfWaveformSamples: numberOfSamples, samplingFrequency, waveformBitsAllocated: bitsAllocated = 16, waveformSampleInterpretation: sampleInterpretation = 'SS', multiplexGroupLabel, channelDefinitionSequence: channelDefinitions = [], } = ecgModule;
|
|
4286
4523
|
const channelArrays = await ecgModule.waveformData.retrieveBulkData();
|
|
4287
|
-
const calibration =
|
|
4524
|
+
const calibration = metaData.get(MetadataModules.CALIBRATION, dataId);
|
|
4288
4525
|
const channels = [];
|
|
4289
4526
|
for (let index = 0; index < numberOfChannels; index++) {
|
|
4290
4527
|
const channelDefinition = channelDefinitions[index] || {};
|
|
@@ -4494,24 +4731,6 @@ function ensureECGCanvasSize(canvas) {
|
|
|
4494
4731
|
}
|
|
4495
4732
|
}
|
|
4496
4733
|
|
|
4497
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
4498
|
-
computeECGChannelLayouts: () => (computeECGChannelLayouts),
|
|
4499
|
-
computeECGHeight: () => (computeECGHeight),
|
|
4500
|
-
computeECGRenderMetrics: () => (computeECGRenderMetrics),
|
|
4501
|
-
drawECGGrid: () => (drawECGGrid),
|
|
4502
|
-
drawECGLabels: () => (drawECGLabels),
|
|
4503
|
-
drawECGTraces: () => (drawECGTraces),
|
|
4504
|
-
ensureECGCanvasSize: () => (ensureECGCanvasSize),
|
|
4505
|
-
getDefaultECGValueRange: () => (getDefaultECGValueRange),
|
|
4506
|
-
getVisibleECGChannels: () => (getVisibleECGChannels),
|
|
4507
|
-
getVisibleECGChannelsByFlag: () => (getVisibleECGChannelsByFlag),
|
|
4508
|
-
loadECGWaveform: () => (loadECGWaveform)
|
|
4509
|
-
}, {
|
|
4510
|
-
ECG_CHANNEL_SPACING: ECG_CHANNEL_SPACING,
|
|
4511
|
-
ECG_RENDERING_COLORS: ECG_RENDERING_COLORS,
|
|
4512
|
-
ECG_SECONDS_WIDTH: ECG_SECONDS_WIDTH
|
|
4513
|
-
});
|
|
4514
|
-
|
|
4515
4734
|
|
|
4516
4735
|
},
|
|
4517
4736
|
18421(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
@@ -4636,10 +4855,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4636
4855
|
/* import */ var _cache_cache_js__rspack_import_0 = __webpack_require__(73998);
|
|
4637
4856
|
/* import */ var _enums_index_js__rspack_import_1 = __webpack_require__(71088);
|
|
4638
4857
|
/* import */ var gl_matrix__rspack_import_2 = __webpack_require__(50341);
|
|
4639
|
-
/* import */ var
|
|
4640
|
-
/* import */ var
|
|
4641
|
-
/* import */ var
|
|
4642
|
-
/* import */ var
|
|
4858
|
+
/* import */ var _getBufferConfiguration_js__rspack_import_3 = __webpack_require__(25752);
|
|
4859
|
+
/* import */ var _RLEVoxelMap_js__rspack_import_4 = __webpack_require__(71325);
|
|
4860
|
+
/* import */ var _isEqual_js__rspack_import_5 = __webpack_require__(3886);
|
|
4861
|
+
/* import */ var _pointInShapeCallback_js__rspack_import_6 = __webpack_require__(87169);
|
|
4862
|
+
/* import */ var _logger_js__rspack_import_7 = __webpack_require__(34040);
|
|
4643
4863
|
|
|
4644
4864
|
|
|
4645
4865
|
|
|
@@ -4647,7 +4867,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4647
4867
|
|
|
4648
4868
|
|
|
4649
4869
|
|
|
4650
|
-
|
|
4870
|
+
|
|
4871
|
+
const log = _logger_js__rspack_import_7.coreLog.getLogger('utilities', 'VoxelManager');
|
|
4651
4872
|
const DEFAULT_RLE_SIZE = 5 * 1024;
|
|
4652
4873
|
const worldToIndexDeltaScratch = [0, 0, 0];
|
|
4653
4874
|
const worldToIndexResultScratch = [0, 0, 0];
|
|
@@ -4714,7 +4935,7 @@ class VoxelManager {
|
|
|
4714
4935
|
const kMax = Math.max(isInObjectBoundsIJK[2][0], isInObjectBoundsIJK[2][1]);
|
|
4715
4936
|
const pointsInShape = [];
|
|
4716
4937
|
if (useLPSTransform) {
|
|
4717
|
-
const pointsInShape = (0,
|
|
4938
|
+
const pointsInShape = (0,_pointInShapeCallback_js__rspack_import_6/* .iterateOverPointsInShapeVoxelManager */.X6)({
|
|
4718
4939
|
voxelManager: this,
|
|
4719
4940
|
imageData: options.imageData,
|
|
4720
4941
|
bounds: [
|
|
@@ -4729,7 +4950,7 @@ class VoxelManager {
|
|
|
4729
4950
|
return pointsInShape;
|
|
4730
4951
|
}
|
|
4731
4952
|
if (this.map) {
|
|
4732
|
-
if (this.map instanceof
|
|
4953
|
+
if (this.map instanceof _RLEVoxelMap_js__rspack_import_4/* ["default"] */.A) {
|
|
4733
4954
|
return this.rleForEach(callback, options);
|
|
4734
4955
|
}
|
|
4735
4956
|
for (const index of this.map.keys()) {
|
|
@@ -4777,6 +4998,10 @@ class VoxelManager {
|
|
|
4777
4998
|
}
|
|
4778
4999
|
};
|
|
4779
5000
|
this.getSliceData = ({ sliceIndex, slicePlane, }) => {
|
|
5001
|
+
const direct = this._getSliceData?.({ sliceIndex, slicePlane });
|
|
5002
|
+
if (direct) {
|
|
5003
|
+
return direct;
|
|
5004
|
+
}
|
|
4780
5005
|
const [width, height, depth] = this.dimensions;
|
|
4781
5006
|
const frameSize = width * height;
|
|
4782
5007
|
const startIndex = sliceIndex * frameSize;
|
|
@@ -4939,7 +5164,7 @@ class VoxelManager {
|
|
|
4939
5164
|
}
|
|
4940
5165
|
setFromScalarData(scalarData) {
|
|
4941
5166
|
const map = this.map;
|
|
4942
|
-
if (map instanceof
|
|
5167
|
+
if (map instanceof _RLEVoxelMap_js__rspack_import_4/* ["default"] */.A) {
|
|
4943
5168
|
const [width, height, depth] = this.dimensions;
|
|
4944
5169
|
const sparseValue = (map.defaultValue ?? 0);
|
|
4945
5170
|
map.clear();
|
|
@@ -4980,7 +5205,7 @@ class VoxelManager {
|
|
|
4980
5205
|
if (Constructor?.BYTES_PER_ELEMENT) {
|
|
4981
5206
|
return Constructor.BYTES_PER_ELEMENT;
|
|
4982
5207
|
}
|
|
4983
|
-
if (this.map instanceof
|
|
5208
|
+
if (this.map instanceof _RLEVoxelMap_js__rspack_import_4/* ["default"] */.A) {
|
|
4984
5209
|
const ExpansionConstructor = this.map.pixelDataConstructor
|
|
4985
5210
|
? this.map.pixelDataConstructor
|
|
4986
5211
|
: Uint8ClampedArray;
|
|
@@ -5006,7 +5231,10 @@ class VoxelManager {
|
|
|
5006
5231
|
return this.scalarData.constructor;
|
|
5007
5232
|
}
|
|
5008
5233
|
if (this._getConstructor) {
|
|
5009
|
-
|
|
5234
|
+
const Constructor = this._getConstructor();
|
|
5235
|
+
if (Constructor) {
|
|
5236
|
+
return Constructor;
|
|
5237
|
+
}
|
|
5010
5238
|
}
|
|
5011
5239
|
log.warn('No scalar data available or can be used to get the constructor');
|
|
5012
5240
|
return Float32Array;
|
|
@@ -5169,7 +5397,7 @@ class VoxelManager {
|
|
|
5169
5397
|
_id: id || '_createRGBScalarVolumeVoxelManager',
|
|
5170
5398
|
_set: (index, v) => {
|
|
5171
5399
|
index *= 3;
|
|
5172
|
-
const isChanged = !(0,
|
|
5400
|
+
const isChanged = !(0,_isEqual_js__rspack_import_5/* ["default"] */.Ay)(scalarData[index], v);
|
|
5173
5401
|
scalarData[index++] = v[0];
|
|
5174
5402
|
scalarData[index++] = v[1];
|
|
5175
5403
|
scalarData[index++] = v[2];
|
|
@@ -5183,22 +5411,53 @@ class VoxelManager {
|
|
|
5183
5411
|
};
|
|
5184
5412
|
return voxels;
|
|
5185
5413
|
}
|
|
5186
|
-
static createImageVolumeVoxelManager({ dimensions, imageIds, numberOfComponents = 1, id, }) {
|
|
5187
|
-
const
|
|
5188
|
-
const
|
|
5414
|
+
static createImageVolumeVoxelManager({ dimensions, imageIds, numberOfComponents = 1, id, dataType, }) {
|
|
5415
|
+
const [width, height, depth] = dimensions;
|
|
5416
|
+
const pixelsPerSlice = width * height;
|
|
5189
5417
|
const sliceVoxelManagers = new Array(depth);
|
|
5418
|
+
const sliceMissGenerations = new Array(depth);
|
|
5190
5419
|
let lastSliceIndex = -1;
|
|
5191
5420
|
let lastSliceVoxelManager = null;
|
|
5192
5421
|
const warnedMissingImageIds = new Set();
|
|
5193
5422
|
const warnedMissingImages = new Set();
|
|
5423
|
+
const sliceScalings = new Array(depth);
|
|
5424
|
+
const scalingsBySize = new Map();
|
|
5425
|
+
const scalingFor = (imageWidth, imageHeight) => {
|
|
5426
|
+
const key = `${imageWidth}x${imageHeight}`;
|
|
5427
|
+
const cached = scalingsBySize.get(key);
|
|
5428
|
+
if (cached) {
|
|
5429
|
+
return cached;
|
|
5430
|
+
}
|
|
5431
|
+
const columns = new Int32Array(width);
|
|
5432
|
+
const rows = new Int32Array(height);
|
|
5433
|
+
for (let i = 0; i < width; i++) {
|
|
5434
|
+
columns[i] =
|
|
5435
|
+
width > 1 ? Math.floor((i * (imageWidth - 1)) / (width - 1)) : 0;
|
|
5436
|
+
}
|
|
5437
|
+
for (let j = 0; j < height; j++) {
|
|
5438
|
+
const row = height > 1 ? Math.floor((j * (imageHeight - 1)) / (height - 1)) : 0;
|
|
5439
|
+
rows[j] = row * imageWidth;
|
|
5440
|
+
}
|
|
5441
|
+
const scaling = { columns, rows };
|
|
5442
|
+
scalingsBySize.set(key, scaling);
|
|
5443
|
+
return scaling;
|
|
5444
|
+
};
|
|
5445
|
+
const scaleIndex = (scaling, pixelIndex) => {
|
|
5446
|
+
const row = Math.floor(pixelIndex / width);
|
|
5447
|
+
return scaling.rows[row] + scaling.columns[pixelIndex - row * width];
|
|
5448
|
+
};
|
|
5194
5449
|
const resolveSliceVoxelManager = (sliceIndex) => {
|
|
5195
5450
|
if (sliceIndex < 0 || sliceIndex >= depth) {
|
|
5196
5451
|
return null;
|
|
5197
5452
|
}
|
|
5198
5453
|
const cachedVoxelManager = sliceVoxelManagers[sliceIndex];
|
|
5199
|
-
if (cachedVoxelManager
|
|
5454
|
+
if (cachedVoxelManager) {
|
|
5200
5455
|
return cachedVoxelManager;
|
|
5201
5456
|
}
|
|
5457
|
+
if (cachedVoxelManager === null &&
|
|
5458
|
+
sliceMissGenerations[sliceIndex] === _cache_cache_js__rspack_import_0/* ["default"].getImageGeneration */.Ay.getImageGeneration()) {
|
|
5459
|
+
return null;
|
|
5460
|
+
}
|
|
5202
5461
|
const imageId = imageIds[sliceIndex];
|
|
5203
5462
|
if (!imageId) {
|
|
5204
5463
|
if (!warnedMissingImageIds.has(sliceIndex)) {
|
|
@@ -5206,36 +5465,51 @@ class VoxelManager {
|
|
|
5206
5465
|
log.warn(`ImageId not found for sliceIndex: ${sliceIndex}`);
|
|
5207
5466
|
}
|
|
5208
5467
|
sliceVoxelManagers[sliceIndex] = null;
|
|
5468
|
+
sliceMissGenerations[sliceIndex] = _cache_cache_js__rspack_import_0/* ["default"].getImageGeneration */.Ay.getImageGeneration();
|
|
5209
5469
|
return null;
|
|
5210
5470
|
}
|
|
5211
5471
|
const image = _cache_cache_js__rspack_import_0/* ["default"].getImage */.Ay.getImage(imageId);
|
|
5212
5472
|
if (!image?.voxelManager) {
|
|
5213
5473
|
if (!warnedMissingImages.has(imageId)) {
|
|
5214
5474
|
warnedMissingImages.add(imageId);
|
|
5215
|
-
log.
|
|
5475
|
+
log.debug(`Image not found for imageId: ${imageId}`);
|
|
5216
5476
|
}
|
|
5477
|
+
sliceVoxelManagers[sliceIndex] = null;
|
|
5478
|
+
sliceMissGenerations[sliceIndex] = _cache_cache_js__rspack_import_0/* ["default"].getImageGeneration */.Ay.getImageGeneration();
|
|
5217
5479
|
return null;
|
|
5218
5480
|
}
|
|
5219
5481
|
const imageVoxelManager = image.voxelManager;
|
|
5482
|
+
const imageWidth = image.width ?? imageVoxelManager.dimensions?.[0];
|
|
5483
|
+
const imageHeight = image.height ?? imageVoxelManager.dimensions?.[1];
|
|
5220
5484
|
sliceVoxelManagers[sliceIndex] = imageVoxelManager;
|
|
5485
|
+
sliceScalings[sliceIndex] =
|
|
5486
|
+
imageWidth === width && imageHeight === height
|
|
5487
|
+
? null
|
|
5488
|
+
: scalingFor(imageWidth, imageHeight);
|
|
5221
5489
|
return imageVoxelManager;
|
|
5222
5490
|
};
|
|
5491
|
+
const imageIndexOf = (sliceIndex, pixelIndex) => {
|
|
5492
|
+
const scaling = sliceScalings[sliceIndex];
|
|
5493
|
+
return scaling ? scaleIndex(scaling, pixelIndex) : pixelIndex;
|
|
5494
|
+
};
|
|
5223
5495
|
function getVoxelValue(index) {
|
|
5224
5496
|
const sliceIndex = Math.floor(index / pixelsPerSlice);
|
|
5225
5497
|
if (sliceIndex < 0 || sliceIndex >= depth) {
|
|
5226
5498
|
return null;
|
|
5227
5499
|
}
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
if (!imageVoxelManager) {
|
|
5232
|
-
return null;
|
|
5500
|
+
let imageVoxelManager;
|
|
5501
|
+
if (sliceIndex === lastSliceIndex && lastSliceVoxelManager) {
|
|
5502
|
+
imageVoxelManager = lastSliceVoxelManager;
|
|
5233
5503
|
}
|
|
5234
|
-
|
|
5504
|
+
else {
|
|
5505
|
+
imageVoxelManager = resolveSliceVoxelManager(sliceIndex);
|
|
5235
5506
|
lastSliceIndex = sliceIndex;
|
|
5236
5507
|
lastSliceVoxelManager = imageVoxelManager;
|
|
5237
5508
|
}
|
|
5238
|
-
|
|
5509
|
+
if (!imageVoxelManager) {
|
|
5510
|
+
return null;
|
|
5511
|
+
}
|
|
5512
|
+
const pixelIndex = imageIndexOf(sliceIndex, index - sliceIndex * pixelsPerSlice);
|
|
5239
5513
|
return imageVoxelManager.getAtIndex(pixelIndex);
|
|
5240
5514
|
}
|
|
5241
5515
|
function setVoxelValue(index, v) {
|
|
@@ -5243,19 +5517,21 @@ class VoxelManager {
|
|
|
5243
5517
|
if (sliceIndex < 0 || sliceIndex >= depth) {
|
|
5244
5518
|
return false;
|
|
5245
5519
|
}
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
if (!imageVoxelManager) {
|
|
5250
|
-
return false;
|
|
5520
|
+
let imageVoxelManager;
|
|
5521
|
+
if (sliceIndex === lastSliceIndex && lastSliceVoxelManager) {
|
|
5522
|
+
imageVoxelManager = lastSliceVoxelManager;
|
|
5251
5523
|
}
|
|
5252
|
-
|
|
5524
|
+
else {
|
|
5525
|
+
imageVoxelManager = resolveSliceVoxelManager(sliceIndex);
|
|
5253
5526
|
lastSliceIndex = sliceIndex;
|
|
5254
5527
|
lastSliceVoxelManager = imageVoxelManager;
|
|
5255
5528
|
}
|
|
5256
|
-
|
|
5529
|
+
if (!imageVoxelManager) {
|
|
5530
|
+
return false;
|
|
5531
|
+
}
|
|
5532
|
+
const pixelIndex = imageIndexOf(sliceIndex, index - sliceIndex * pixelsPerSlice);
|
|
5257
5533
|
const currentValue = imageVoxelManager.getAtIndex(pixelIndex);
|
|
5258
|
-
const isChanged = !(0,
|
|
5534
|
+
const isChanged = !(0,_isEqual_js__rspack_import_5/* ["default"] */.Ay)(v, currentValue);
|
|
5259
5535
|
if (!isChanged) {
|
|
5260
5536
|
return isChanged;
|
|
5261
5537
|
}
|
|
@@ -5264,10 +5540,10 @@ class VoxelManager {
|
|
|
5264
5540
|
}
|
|
5265
5541
|
const _getConstructor = () => {
|
|
5266
5542
|
const imageVoxelManager = resolveSliceVoxelManager(0);
|
|
5267
|
-
if (
|
|
5268
|
-
return
|
|
5543
|
+
if (imageVoxelManager) {
|
|
5544
|
+
return imageVoxelManager.getConstructor();
|
|
5269
5545
|
}
|
|
5270
|
-
return
|
|
5546
|
+
return dataType ? (0,_getBufferConfiguration_js__rspack_import_3/* .getConstructorFromType */.j5)(dataType, false) : null;
|
|
5271
5547
|
};
|
|
5272
5548
|
const voxelManager = new VoxelManager(dimensions, {
|
|
5273
5549
|
_get: getVoxelValue,
|
|
@@ -5278,9 +5554,58 @@ class VoxelManager {
|
|
|
5278
5554
|
});
|
|
5279
5555
|
voxelManager.invalidateCache = () => {
|
|
5280
5556
|
sliceVoxelManagers.fill(undefined);
|
|
5557
|
+
sliceScalings.fill(undefined);
|
|
5281
5558
|
lastSliceIndex = -1;
|
|
5282
5559
|
lastSliceVoxelManager = null;
|
|
5283
5560
|
};
|
|
5561
|
+
voxelManager.invalidateSlice = (sliceIndex) => {
|
|
5562
|
+
if (sliceIndex < 0 || sliceIndex >= depth) {
|
|
5563
|
+
return;
|
|
5564
|
+
}
|
|
5565
|
+
sliceVoxelManagers[sliceIndex] = undefined;
|
|
5566
|
+
sliceScalings[sliceIndex] = undefined;
|
|
5567
|
+
if (lastSliceIndex === sliceIndex) {
|
|
5568
|
+
lastSliceIndex = -1;
|
|
5569
|
+
lastSliceVoxelManager = null;
|
|
5570
|
+
}
|
|
5571
|
+
};
|
|
5572
|
+
voxelManager._getSliceData = ({ sliceIndex, slicePlane }) => {
|
|
5573
|
+
if (slicePlane !== 2) {
|
|
5574
|
+
return undefined;
|
|
5575
|
+
}
|
|
5576
|
+
const imageVoxelManager = resolveSliceVoxelManager(sliceIndex);
|
|
5577
|
+
if (!imageVoxelManager || numberOfComponents !== 1) {
|
|
5578
|
+
return undefined;
|
|
5579
|
+
}
|
|
5580
|
+
const stored = imageVoxelManager.scalarData;
|
|
5581
|
+
const scalarData = stored ??
|
|
5582
|
+
(imageVoxelManager._getScalarData
|
|
5583
|
+
? imageVoxelManager.getScalarData()
|
|
5584
|
+
: undefined);
|
|
5585
|
+
if (!scalarData) {
|
|
5586
|
+
return undefined;
|
|
5587
|
+
}
|
|
5588
|
+
const scaling = sliceScalings[sliceIndex];
|
|
5589
|
+
if (!scaling) {
|
|
5590
|
+
return (stored ? stored.slice() : scalarData);
|
|
5591
|
+
}
|
|
5592
|
+
const slice = new scalarData.constructor(pixelsPerSlice);
|
|
5593
|
+
for (let j = 0; j < height; j++) {
|
|
5594
|
+
const sourceRow = scaling.rows[j];
|
|
5595
|
+
const targetRow = j * width;
|
|
5596
|
+
for (let i = 0; i < width; i++) {
|
|
5597
|
+
slice[targetRow + i] = scalarData[sourceRow + scaling.columns[i]];
|
|
5598
|
+
}
|
|
5599
|
+
}
|
|
5600
|
+
return slice;
|
|
5601
|
+
};
|
|
5602
|
+
voxelManager._getSliceView = (sliceIndex) => {
|
|
5603
|
+
if (numberOfComponents !== 1) {
|
|
5604
|
+
return undefined;
|
|
5605
|
+
}
|
|
5606
|
+
const scalarData = resolveSliceVoxelManager(sliceIndex)?.scalarData;
|
|
5607
|
+
return sliceScalings[sliceIndex] ? undefined : scalarData;
|
|
5608
|
+
};
|
|
5284
5609
|
voxelManager.getMiddleSliceData = () => {
|
|
5285
5610
|
const middleSliceIndex = Math.floor(dimensions[2] / 2);
|
|
5286
5611
|
return voxelManager.getSliceData({
|
|
@@ -5314,13 +5639,9 @@ class VoxelManager {
|
|
|
5314
5639
|
}
|
|
5315
5640
|
return [minValue, maxValue];
|
|
5316
5641
|
};
|
|
5317
|
-
voxelManager._getScalarDataLength = () =>
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
return 0;
|
|
5321
|
-
}
|
|
5322
|
-
return imageVoxelManager.getScalarDataLength() * dimensions[2];
|
|
5323
|
-
};
|
|
5642
|
+
voxelManager._getScalarDataLength = () => resolveSliceVoxelManager(0)
|
|
5643
|
+
? dimensions[0] * dimensions[1] * dimensions[2] * numberOfComponents
|
|
5644
|
+
: 0;
|
|
5324
5645
|
voxelManager.getCompleteScalarDataArray = () => {
|
|
5325
5646
|
const ScalarDataConstructor = voxelManager._getConstructor();
|
|
5326
5647
|
if (!ScalarDataConstructor) {
|
|
@@ -5333,7 +5654,9 @@ class VoxelManager {
|
|
|
5333
5654
|
const imageVoxelManager = resolveSliceVoxelManager(sliceIndex);
|
|
5334
5655
|
if (imageVoxelManager) {
|
|
5335
5656
|
const sliceStart = sliceIndex * sliceSize;
|
|
5336
|
-
const pixelData =
|
|
5657
|
+
const pixelData = sliceScalings[sliceIndex]
|
|
5658
|
+
? voxelManager.getSliceData({ sliceIndex, slicePlane: 2 })
|
|
5659
|
+
: imageVoxelManager.getScalarData();
|
|
5337
5660
|
if (numberOfComponents === 1) {
|
|
5338
5661
|
scalarData.set(pixelData, sliceStart);
|
|
5339
5662
|
}
|
|
@@ -5360,13 +5683,14 @@ class VoxelManager {
|
|
|
5360
5683
|
const sliceEnd = sliceStart + sliceSize;
|
|
5361
5684
|
const sliceData = new SliceDataConstructor(sliceSize);
|
|
5362
5685
|
sliceData.set(scalarData.subarray(sliceStart, sliceEnd));
|
|
5363
|
-
if (imageVoxelManager.scalarData
|
|
5686
|
+
if (imageVoxelManager.scalarData &&
|
|
5687
|
+
imageVoxelManager.scalarData.length >= sliceSize) {
|
|
5364
5688
|
imageVoxelManager.scalarData.set(sliceData);
|
|
5365
5689
|
imageVoxelManager.modifiedSlices.add(sliceIndex);
|
|
5366
5690
|
}
|
|
5367
5691
|
else {
|
|
5368
5692
|
for (let i = 0; i < sliceSize; i++) {
|
|
5369
|
-
|
|
5693
|
+
voxelManager.setAtIndex(sliceStart + i, sliceData[i]);
|
|
5370
5694
|
}
|
|
5371
5695
|
}
|
|
5372
5696
|
for (let i = 0; i < sliceData.length; i++) {
|
|
@@ -5468,6 +5792,9 @@ class VoxelManager {
|
|
|
5468
5792
|
voxelManager.getMiddleSliceData = () => {
|
|
5469
5793
|
return voxelGroups[activeDimensionGroup].getMiddleSliceData();
|
|
5470
5794
|
};
|
|
5795
|
+
voxelManager.invalidateSlice = (sliceIndex) => {
|
|
5796
|
+
voxelGroups.forEach((group) => group.invalidateSlice?.(sliceIndex));
|
|
5797
|
+
};
|
|
5471
5798
|
voxelManager.setTimePoint = (newTimePoint) => {
|
|
5472
5799
|
log.warn('Warning: setTimePoint is deprecated. Please use setDimensionGroupNumber instead. Note that timePoint is zero-based while dimensionGroupNumber starts at 1.');
|
|
5473
5800
|
voxelManager.setDimensionGroupNumber(newTimePoint + 1);
|
|
@@ -5595,7 +5922,7 @@ class VoxelManager {
|
|
|
5595
5922
|
}
|
|
5596
5923
|
static createRLEHistoryVoxelManager(sourceVoxelManager, id) {
|
|
5597
5924
|
const { dimensions } = sourceVoxelManager;
|
|
5598
|
-
const map = new
|
|
5925
|
+
const map = new _RLEVoxelMap_js__rspack_import_4/* ["default"] */.A(dimensions[0], dimensions[1], dimensions[2]);
|
|
5599
5926
|
const voxelManager = new VoxelManager(dimensions, {
|
|
5600
5927
|
_get: (index) => map.get(index),
|
|
5601
5928
|
_set: function (index, v) {
|
|
@@ -5613,7 +5940,7 @@ class VoxelManager {
|
|
|
5613
5940
|
}
|
|
5614
5941
|
this.sourceVoxelManager.setAtIndex(index, v);
|
|
5615
5942
|
},
|
|
5616
|
-
_getScalarData:
|
|
5943
|
+
_getScalarData: _RLEVoxelMap_js__rspack_import_4/* ["default"].getScalarData */.A.getScalarData,
|
|
5617
5944
|
_updateScalarData: (scalarData) => {
|
|
5618
5945
|
map.updateScalarData(scalarData);
|
|
5619
5946
|
return scalarData;
|
|
@@ -5647,7 +5974,7 @@ class VoxelManager {
|
|
|
5647
5974
|
}
|
|
5648
5975
|
static createRLEVolumeVoxelManager({ dimensions, id, pixelDataConstructor, defaultValue, }) {
|
|
5649
5976
|
const [width, height, depth] = dimensions;
|
|
5650
|
-
const map = new
|
|
5977
|
+
const map = new _RLEVoxelMap_js__rspack_import_4/* ["default"] */.A(width, height, depth);
|
|
5651
5978
|
if (pixelDataConstructor) {
|
|
5652
5979
|
map.pixelDataConstructor =
|
|
5653
5980
|
pixelDataConstructor;
|
|
@@ -5661,7 +5988,7 @@ class VoxelManager {
|
|
|
5661
5988
|
map.set(index, v);
|
|
5662
5989
|
return true;
|
|
5663
5990
|
},
|
|
5664
|
-
_getScalarData:
|
|
5991
|
+
_getScalarData: _RLEVoxelMap_js__rspack_import_4/* ["default"].getScalarData */.A.getScalarData,
|
|
5665
5992
|
_getConstructor: pixelDataConstructor
|
|
5666
5993
|
? () => map.pixelDataConstructor
|
|
5667
5994
|
: undefined,
|
|
@@ -5833,6 +6160,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5833
6160
|
});
|
|
5834
6161
|
|
|
5835
6162
|
|
|
6163
|
+
},
|
|
6164
|
+
22779(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6165
|
+
/* import */ var _cornerstonejs_utils__rspack_import_0 = __webpack_require__(20325);
|
|
6166
|
+
|
|
6167
|
+
|
|
6168
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
6169
|
+
_: () => (/* reexport safe */ _cornerstonejs_utils__rspack_import_0._j)
|
|
6170
|
+
});
|
|
6171
|
+
|
|
6172
|
+
|
|
5836
6173
|
},
|
|
5837
6174
|
69123() {
|
|
5838
6175
|
function calculateNeighborhoodStats(scalarData, dimensions, centerIjk, radius) {
|
|
@@ -5917,23 +6254,11 @@ function calculateViewportsSpatialRegistration(viewport1, viewport2) {
|
|
|
5917
6254
|
|
|
5918
6255
|
},
|
|
5919
6256
|
14974(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
5920
|
-
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(
|
|
6257
|
+
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(86049);
|
|
5921
6258
|
|
|
5922
6259
|
/* unused export default */ var __rspack_default_export = (_cornerstonejs_metadata__rspack_import_0/* .utilities.calibratedPixelSpacingMetadataProvider */.BF.ZX);
|
|
5923
6260
|
|
|
5924
6261
|
|
|
5925
|
-
},
|
|
5926
|
-
20637(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
5927
|
-
function clamp(value, min, max) {
|
|
5928
|
-
return Math.max(min, Math.min(max, value));
|
|
5929
|
-
}
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
5933
|
-
q: () => (clamp)
|
|
5934
|
-
});
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
6262
|
},
|
|
5938
6263
|
22462() {
|
|
5939
6264
|
function clip(val, low, high) {
|
|
@@ -6756,15 +7081,24 @@ function getBufferConfiguration(targetBufferType, length, options = {}) {
|
|
|
6756
7081
|
const numBytes = length * bytesPerElement;
|
|
6757
7082
|
return { numBytes, TypedArrayConstructor };
|
|
6758
7083
|
}
|
|
7084
|
+
function volumeTextureBytes(voxelCount, dataType, numberOfComponents = 1) {
|
|
7085
|
+
const values = voxelCount * Math.max(numberOfComponents || 1, 1);
|
|
7086
|
+
if (!dataType) {
|
|
7087
|
+
return values;
|
|
7088
|
+
}
|
|
7089
|
+
return getBufferConfiguration(dataType, values, { isVolumeBuffer: true })
|
|
7090
|
+
.numBytes;
|
|
7091
|
+
}
|
|
6759
7092
|
|
|
6760
7093
|
|
|
6761
7094
|
__webpack_require__.d(__webpack_exports__, {
|
|
6762
|
-
|
|
7095
|
+
Bw: () => (volumeTextureBytes),
|
|
7096
|
+
j5: () => (getConstructorFromType)
|
|
6763
7097
|
});
|
|
6764
7098
|
|
|
6765
7099
|
|
|
6766
7100
|
},
|
|
6767
|
-
10259(__unused_rspack___webpack_module__,
|
|
7101
|
+
10259(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6768
7102
|
/* import */ var gl_matrix__rspack_import_0 = __webpack_require__(50341);
|
|
6769
7103
|
/* import */ var _planar_js__rspack_import_1 = __webpack_require__(30828);
|
|
6770
7104
|
/* import */ var _metaData_js__rspack_import_2 = __webpack_require__(52284);
|
|
@@ -6788,8 +7122,8 @@ function calculateMinimalDistanceForStackViewport(point, viewport) {
|
|
|
6788
7122
|
if (!planeMetadata) {
|
|
6789
7123
|
return null;
|
|
6790
7124
|
}
|
|
6791
|
-
const plane =
|
|
6792
|
-
const distance =
|
|
7125
|
+
const plane = _planar_js__rspack_import_1.planeEquation(planeMetadata.planeNormal, planeMetadata.imagePositionPatient);
|
|
7126
|
+
const distance = _planar_js__rspack_import_1.planeDistanceToPoint(plane, point);
|
|
6793
7127
|
return distance;
|
|
6794
7128
|
};
|
|
6795
7129
|
const closestStack = {
|
|
@@ -6829,7 +7163,7 @@ function calculateMinimalDistanceForStackViewport(point, viewport) {
|
|
|
6829
7163
|
return closestStack.distance === Infinity ? null : closestStack;
|
|
6830
7164
|
}
|
|
6831
7165
|
function getPlaneMetadata(imageId) {
|
|
6832
|
-
const targetImagePlane =
|
|
7166
|
+
const targetImagePlane = _metaData_js__rspack_import_2.get(_enums_index_js__rspack_import_3.MetadataModules.IMAGE_PLANE, imageId);
|
|
6833
7167
|
if (!targetImagePlane ||
|
|
6834
7168
|
!(targetImagePlane.rowCosines instanceof Array &&
|
|
6835
7169
|
targetImagePlane.rowCosines.length === 3) ||
|
|
@@ -6840,12 +7174,16 @@ function getPlaneMetadata(imageId) {
|
|
|
6840
7174
|
return null;
|
|
6841
7175
|
}
|
|
6842
7176
|
const { rowCosines, columnCosines, imagePositionPatient, } = targetImagePlane;
|
|
6843
|
-
const rowVec = vec3.set(vec3.create(), ...rowCosines);
|
|
6844
|
-
const colVec = vec3.set(vec3.create(), ...columnCosines);
|
|
6845
|
-
const planeNormal = vec3.cross(vec3.create(), rowVec, colVec);
|
|
7177
|
+
const rowVec = gl_matrix__rspack_import_0/* .vec3.set */.eR.hZ(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), ...rowCosines);
|
|
7178
|
+
const colVec = gl_matrix__rspack_import_0/* .vec3.set */.eR.hZ(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), ...columnCosines);
|
|
7179
|
+
const planeNormal = gl_matrix__rspack_import_0/* .vec3.cross */.eR.$A(gl_matrix__rspack_import_0/* .vec3.create */.eR.vt(), rowVec, colVec);
|
|
6846
7180
|
return { rowCosines, columnCosines, imagePositionPatient, planeNormal };
|
|
6847
7181
|
}
|
|
6848
7182
|
|
|
7183
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7184
|
+
M: () => (calculateMinimalDistanceForStackViewport)
|
|
7185
|
+
});
|
|
7186
|
+
|
|
6849
7187
|
|
|
6850
7188
|
},
|
|
6851
7189
|
67419(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
@@ -6934,7 +7272,7 @@ function getImageLegacy(element) {
|
|
|
6934
7272
|
|
|
6935
7273
|
},
|
|
6936
7274
|
61293(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
6937
|
-
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(
|
|
7275
|
+
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(86049);
|
|
6938
7276
|
|
|
6939
7277
|
const { /* getPixelSpacingInformation */Cc: getPixelSpacingInformation, /* calculateRadiographicPixelSpacing */VD: calculateRadiographicPixelSpacing, /* getERMF */lJ: getERMF, } = _cornerstonejs_metadata__rspack_import_0/* .utilities */.BF;
|
|
6940
7278
|
|
|
@@ -7490,59 +7828,63 @@ function imageToWorldCoords(imageId, imageCoords) {
|
|
|
7490
7828
|
/* import */ var _convertStackToVolumeViewport_js__rspack_import_66 = __webpack_require__(94152);
|
|
7491
7829
|
/* import */ var _convertVolumeToStackViewport_js__rspack_import_67 = __webpack_require__(66802);
|
|
7492
7830
|
/* import */ var _VoxelManager_js__rspack_import_68 = __webpack_require__(60719);
|
|
7493
|
-
/* import */ var
|
|
7494
|
-
/* import */ var
|
|
7495
|
-
/* import */ var
|
|
7496
|
-
/* import */ var
|
|
7497
|
-
/* import */ var
|
|
7498
|
-
/* import */ var
|
|
7499
|
-
/* import */ var
|
|
7500
|
-
/* import */ var
|
|
7501
|
-
/* import */ var
|
|
7502
|
-
/* import */ var
|
|
7503
|
-
/* import */ var
|
|
7504
|
-
/* import */ var
|
|
7505
|
-
/* import */ var
|
|
7506
|
-
/* import */ var
|
|
7507
|
-
/* import */ var
|
|
7508
|
-
/* import */ var
|
|
7509
|
-
/* import */ var
|
|
7510
|
-
/* import */ var
|
|
7511
|
-
/* import */ var
|
|
7512
|
-
/* import */ var
|
|
7513
|
-
/* import */ var
|
|
7514
|
-
/* import */ var
|
|
7515
|
-
/* import */ var
|
|
7516
|
-
/* import */ var
|
|
7517
|
-
/* import */ var
|
|
7518
|
-
/* import */ var
|
|
7519
|
-
/* import */ var
|
|
7520
|
-
/* import */ var
|
|
7521
|
-
/* import */ var
|
|
7522
|
-
/* import */ var
|
|
7523
|
-
/* import */ var
|
|
7524
|
-
/* import */ var
|
|
7525
|
-
/* import */ var
|
|
7526
|
-
/* import */ var
|
|
7527
|
-
/* import */ var
|
|
7528
|
-
/* import */ var
|
|
7529
|
-
/* import */ var
|
|
7530
|
-
/* import */ var
|
|
7531
|
-
/* import */ var
|
|
7532
|
-
/* import */ var
|
|
7533
|
-
/* import */ var
|
|
7534
|
-
/* import */ var
|
|
7535
|
-
/* import */ var
|
|
7536
|
-
/* import */ var
|
|
7537
|
-
/* import */ var
|
|
7538
|
-
/* import */ var
|
|
7539
|
-
/* import */ var
|
|
7540
|
-
/* import */ var
|
|
7541
|
-
/* import */ var
|
|
7542
|
-
/* import */ var
|
|
7543
|
-
/* import */ var
|
|
7544
|
-
/* import */ var
|
|
7545
|
-
/* import */ var
|
|
7831
|
+
/* import */ var _CompositeVoxelManager_js__rspack_import_69 = __webpack_require__(86998);
|
|
7832
|
+
/* import */ var _RLEVoxelMap_js__rspack_import_70 = __webpack_require__(71325);
|
|
7833
|
+
/* import */ var _roundNumber_js__rspack_import_71 = __webpack_require__(18355);
|
|
7834
|
+
/* import */ var _convertToGrayscale_js__rspack_import_72 = __webpack_require__(53373);
|
|
7835
|
+
/* import */ var _convertColorArrayToRgbString_js__rspack_import_73 = __webpack_require__(83860);
|
|
7836
|
+
/* import */ var _getViewportImageIds_js__rspack_import_74 = __webpack_require__(41109);
|
|
7837
|
+
/* import */ var _getRandomSampleFromArray_js__rspack_import_75 = __webpack_require__(62742);
|
|
7838
|
+
/* import */ var _getVolumeId_js__rspack_import_76 = __webpack_require__(65237);
|
|
7839
|
+
/* import */ var _hasFloatScalingParameters_js__rspack_import_77 = __webpack_require__(8985);
|
|
7840
|
+
/* import */ var _pointInShapeCallback_js__rspack_import_78 = __webpack_require__(87169);
|
|
7841
|
+
/* import */ var _ECGUtilities_js__rspack_import_79 = __webpack_require__(24511);
|
|
7842
|
+
/* import */ var _VideoUtilities_js__rspack_import_80 = __webpack_require__(18421);
|
|
7843
|
+
/* import */ var _WSIUtilities_js__rspack_import_81 = __webpack_require__(15975);
|
|
7844
|
+
/* import */ var _voxelGrid_index_js__rspack_import_82 = __webpack_require__(49617);
|
|
7845
|
+
/* import */ var _planar_js__rspack_import_83 = __webpack_require__(30828);
|
|
7846
|
+
/* import */ var _windowLevel_js__rspack_import_84 = __webpack_require__(30344);
|
|
7847
|
+
/* import */ var _colormap_js__rspack_import_85 = __webpack_require__(21155);
|
|
7848
|
+
/* import */ var _transferFunctionUtils_js__rspack_import_86 = __webpack_require__(48030);
|
|
7849
|
+
/* import */ var _color_js__rspack_import_87 = __webpack_require__(71813);
|
|
7850
|
+
/* import */ var _deepEqual_js__rspack_import_88 = __webpack_require__(46492);
|
|
7851
|
+
/* import */ var _FrameRange_js__rspack_import_89 = __webpack_require__(90446);
|
|
7852
|
+
/* import */ var _fnv1aHash_js__rspack_import_90 = __webpack_require__(29758);
|
|
7853
|
+
/* import */ var _getImageDataMetadata_js__rspack_import_91 = __webpack_require__(57804);
|
|
7854
|
+
/* import */ var _buildMetadata_js__rspack_import_92 = __webpack_require__(15499);
|
|
7855
|
+
/* import */ var _getViewportModality_js__rspack_import_93 = __webpack_require__(37191);
|
|
7856
|
+
/* import */ var _getScalingDescriptor_js__rspack_import_94 = __webpack_require__(67372);
|
|
7857
|
+
/* import */ var _resolveGenericViewportVolumeId_js__rspack_import_95 = __webpack_require__(25464);
|
|
7858
|
+
/* import */ var _cache_cache_js__rspack_import_96 = __webpack_require__(73998);
|
|
7859
|
+
/* import */ var _getDynamicVolumeInfo_js__rspack_import_97 = __webpack_require__(97587);
|
|
7860
|
+
/* import */ var _autoLoad_js__rspack_import_98 = __webpack_require__(38795);
|
|
7861
|
+
/* import */ var _scaleArray_js__rspack_import_99 = __webpack_require__(57039);
|
|
7862
|
+
/* import */ var _splitImageIdsBy4DTags_js__rspack_import_100 = __webpack_require__(50863);
|
|
7863
|
+
/* import */ var _deepClone_js__rspack_import_101 = __webpack_require__(46765);
|
|
7864
|
+
/* import */ var _jumpToSlice_js__rspack_import_102 = __webpack_require__(31223);
|
|
7865
|
+
/* import */ var _scroll_js__rspack_import_103 = __webpack_require__(29877);
|
|
7866
|
+
/* import */ var _clip_js__rspack_import_104 = __webpack_require__(22462);
|
|
7867
|
+
/* import */ var _createSubVolume_js__rspack_import_105 = __webpack_require__(63554);
|
|
7868
|
+
/* import */ var _getAcquisitionPlaneOrientation_js__rspack_import_106 = __webpack_require__(98567);
|
|
7869
|
+
/* import */ var _getVolumeDirectionVectors_js__rspack_import_107 = __webpack_require__(72707);
|
|
7870
|
+
/* import */ var _getVolumeViewReferenceId_js__rspack_import_108 = __webpack_require__(95045);
|
|
7871
|
+
/* import */ var _calculateSpacingBetweenImageIds_js__rspack_import_109 = __webpack_require__(78480);
|
|
7872
|
+
/* import */ var _logger_js__rspack_import_110 = __webpack_require__(34040);
|
|
7873
|
+
/* import */ var _calculateNeighborhoodStats_js__rspack_import_111 = __webpack_require__(69123);
|
|
7874
|
+
/* import */ var _viewportVoiIntensityMapping_js__rspack_import_112 = __webpack_require__(31459);
|
|
7875
|
+
/* import */ var _getPixelSpacingInformation_js__rspack_import_113 = __webpack_require__(61293);
|
|
7876
|
+
/* import */ var _getPlaneCubeIntersectionDimensions_js__rspack_import_114 = __webpack_require__(32367);
|
|
7877
|
+
/* import */ var _rotateToViewCoordinates_js__rspack_import_115 = __webpack_require__(4272);
|
|
7878
|
+
/* import */ var _voxelSlab_index_js__rspack_import_116 = __webpack_require__(46989);
|
|
7879
|
+
/* import */ var _asArray_js__rspack_import_117 = __webpack_require__(22779);
|
|
7880
|
+
/* import */ var _viewportCapabilities_js__rspack_import_118 = __webpack_require__(73224);
|
|
7881
|
+
/* import */ var _getNormalizedAspectRatio_js__rspack_import_119 = __webpack_require__(47232);
|
|
7882
|
+
/* import */ var _wasmBasePath_js__rspack_import_120 = __webpack_require__(59318);
|
|
7883
|
+
/* import */ var _resolveApplicationUrl_js__rspack_import_121 = __webpack_require__(49825);
|
|
7884
|
+
/* import */ var _updatePlaneRestriction_js__rspack_import_122 = __webpack_require__(49429);
|
|
7885
|
+
/* import */ var _isAcquisitionPlaneNormal_js__rspack_import_123 = __webpack_require__(72372);
|
|
7886
|
+
/* import */ var _isEqual_js__rspack_import_124 = __webpack_require__(3886);
|
|
7887
|
+
|
|
7546
7888
|
|
|
7547
7889
|
|
|
7548
7890
|
|
|
@@ -7625,6 +7967,9 @@ function imageToWorldCoords(imageId, imageCoords) {
|
|
|
7625
7967
|
|
|
7626
7968
|
|
|
7627
7969
|
|
|
7970
|
+
const ECGUtilities = (/* unused pure expression or super */ null && (ECGUtilitiesModule));
|
|
7971
|
+
|
|
7972
|
+
|
|
7628
7973
|
|
|
7629
7974
|
|
|
7630
7975
|
|
|
@@ -7670,7 +8015,7 @@ const getScalingDescriptor = (viewport, targetId) => _getScalingDescriptor(viewp
|
|
|
7670
8015
|
|
|
7671
8016
|
|
|
7672
8017
|
__webpack_require__.d(__webpack_exports__, {
|
|
7673
|
-
logger: () => (/* reexport module object */
|
|
8018
|
+
logger: () => (/* reexport module object */ _logger_js__rspack_import_110),
|
|
7674
8019
|
triggerEvent: () => (/* reexport safe */ _triggerEvent_js__rspack_import_6.A)
|
|
7675
8020
|
});
|
|
7676
8021
|
|
|
@@ -7922,7 +8267,9 @@ function isPointOnPlane(point, plane, tolerance = EPSILON) {
|
|
|
7922
8267
|
|
|
7923
8268
|
|
|
7924
8269
|
__webpack_require__.d(__webpack_exports__, {
|
|
7925
|
-
linePlaneIntersection: () => (linePlaneIntersection)
|
|
8270
|
+
linePlaneIntersection: () => (linePlaneIntersection),
|
|
8271
|
+
planeDistanceToPoint: () => (planeDistanceToPoint),
|
|
8272
|
+
planeEquation: () => (planeEquation)
|
|
7926
8273
|
});
|
|
7927
8274
|
|
|
7928
8275
|
|
|
@@ -8333,6 +8680,8 @@ function scaleRGBTransferFunction(rgbTransferFunction, scalingFactor) {
|
|
|
8333
8680
|
/* import */ var _getEnabledElement_js__rspack_import_5 = __webpack_require__(22046);
|
|
8334
8681
|
/* import */ var _triggerEvent_js__rspack_import_6 = __webpack_require__(84444);
|
|
8335
8682
|
/* import */ var _eventTarget_js__rspack_import_7 = __webpack_require__(45340);
|
|
8683
|
+
/* import */ var _viewportCapabilities_js__rspack_import_8 = __webpack_require__(73224);
|
|
8684
|
+
|
|
8336
8685
|
|
|
8337
8686
|
|
|
8338
8687
|
|
|
@@ -8355,6 +8704,10 @@ function scroll(viewport, options) {
|
|
|
8355
8704
|
scrollVolume(viewport, volumeId, delta, scrollSlabs);
|
|
8356
8705
|
}
|
|
8357
8706
|
else {
|
|
8707
|
+
if (getViewportContentMode(viewport) === 'ecg') {
|
|
8708
|
+
viewport.scroll(delta);
|
|
8709
|
+
return;
|
|
8710
|
+
}
|
|
8358
8711
|
if (typeof viewport.getCurrentImageIdIndex !==
|
|
8359
8712
|
'function' ||
|
|
8360
8713
|
typeof viewport.scroll !== 'function') {
|
|
@@ -8445,7 +8798,7 @@ const spatialRegistrationMetadataProvider = {
|
|
|
8445
8798
|
|
|
8446
8799
|
},
|
|
8447
8800
|
50863(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
8448
|
-
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(
|
|
8801
|
+
/* import */ var _cornerstonejs_metadata__rspack_import_0 = __webpack_require__(86049);
|
|
8449
8802
|
|
|
8450
8803
|
const { /* splitImageIdsBy4DTags */Qy: splitImageIdsBy4DTags, /* handleMultiframe4D */FM: handleMultiframe4D, /* generateFrameImageId */Hf: generateFrameImageId } = _cornerstonejs_metadata__rspack_import_0/* .utilities */.BF;
|
|
8451
8804
|
/* unused export default */ var __rspack_default_export = ((/* unused pure expression or super */ null && (splitImageIdsBy4DTags)));
|
|
@@ -8546,6 +8899,10 @@ function viewportSupportsDisplaySetPresentation(viewport) {
|
|
|
8546
8899
|
viewportHasMethod(viewport, 'getSourceDataId') &&
|
|
8547
8900
|
viewportHasMethod(viewport, 'getDefaultVOIRange'));
|
|
8548
8901
|
}
|
|
8902
|
+
function viewportSupportsWaveform(viewport) {
|
|
8903
|
+
return (viewportHasMethod(viewport, 'getWaveformData') &&
|
|
8904
|
+
viewportHasMethod(viewport, 'getImageData'));
|
|
8905
|
+
}
|
|
8549
8906
|
function getViewportContentMode(viewport) {
|
|
8550
8907
|
return viewportHasMethod(viewport, 'getCurrentMode')
|
|
8551
8908
|
? viewport.getCurrentMode()
|
|
@@ -8625,6 +8982,660 @@ function clamp(x, lo, hi) {
|
|
|
8625
8982
|
}
|
|
8626
8983
|
|
|
8627
8984
|
|
|
8985
|
+
},
|
|
8986
|
+
49617(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
8987
|
+
|
|
8988
|
+
// EXPORTS
|
|
8989
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
8990
|
+
boundsOfFrame: () => (/* reexport */ boundsOfFrame),
|
|
8991
|
+
boundsOfGrid: () => (/* reexport */ boundsOfGrid),
|
|
8992
|
+
boxAverageReductionFactors: () => (/* reexport */ boxAverageReductionFactors),
|
|
8993
|
+
compareVoxelQuality: () => (/* reexport */ compareVoxelQuality),
|
|
8994
|
+
containsBounds: () => (/* reexport */ containsBounds),
|
|
8995
|
+
deriveBoxAverageGrid: () => (/* reexport */ deriveBoxAverageGrid/* .deriveBoxAverageGrid */.y),
|
|
8996
|
+
gridCoversRegion: () => (/* reexport */ gridCoversRegion),
|
|
8997
|
+
gridWorldToIndex: () => (/* reexport */ gridWorldToIndex),
|
|
8998
|
+
imageQualityStatusOfRecord: () => (/* reexport */ imageQualityStatusOfRecord),
|
|
8999
|
+
intersectBounds: () => (/* reexport */ intersectBounds),
|
|
9000
|
+
isAliasingReduction: () => (/* reexport */ isAliasingReduction),
|
|
9001
|
+
isDefaultSelectionStatistic: () => (/* reexport */ voxelStatistics/* .isDefaultSelectionStatistic */.Yg),
|
|
9002
|
+
mapBoundsBetweenGrids: () => (/* reexport */ mapBoundsBetweenGrids),
|
|
9003
|
+
mapIndexToNearestVoxel: () => (/* reexport */ mapIndexToNearestVoxel),
|
|
9004
|
+
requireVoxelStatistic: () => (/* reexport */ voxelStatistics/* .requireVoxelStatistic */.Qk),
|
|
9005
|
+
volumeOfBounds: () => (/* reexport */ volumeOfBounds),
|
|
9006
|
+
voxelCountOfGrid: () => (/* reexport */ voxelCountOfGrid),
|
|
9007
|
+
voxelGridKey: () => (/* reexport */ voxelGridKey/* .voxelGridKey */.oC),
|
|
9008
|
+
voxelGridWithinLimits: () => (/* reexport */ voxelGridWithinLimits),
|
|
9009
|
+
voxelGridsEqual: () => (/* reexport */ voxelGridKey/* .voxelGridsEqual */._I)
|
|
9010
|
+
});
|
|
9011
|
+
|
|
9012
|
+
// UNUSED EXPORTS: boxAverageAtIJK, boxStatisticAtIJK, cornersOfBounds, createAverageAccumulator, getVoxelReduction, getVoxelStatistic, getVoxelStatistics, gridContainsIndex, gridIndexToWorld, isRegisteredVoxelStatistic, largestAxis, mapIndexBetweenGrids, maxEdgeOfGrid, normalizedFactors, reduceByBoxAverage, reduceByBoxStatistic, reducedDimensions, registerVoxelReduction, registerVoxelStatistic, sameBounds
|
|
9013
|
+
|
|
9014
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/reducedDimensions.js
|
|
9015
|
+
var reducedDimensions = __webpack_require__(8014);
|
|
9016
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/boxAverageReductionFactors.js
|
|
9017
|
+
const DIVISOR_PREFERENCE_MIN_RATIO = 0.9;
|
|
9018
|
+
const WHOLE_FACTOR_MIN_FITTING_EDGE = 1024;
|
|
9019
|
+
function edgeLimitedEdge(sourceEdge, maxEdge) {
|
|
9020
|
+
if (!(maxEdge > 0) || sourceEdge <= maxEdge) {
|
|
9021
|
+
return sourceEdge;
|
|
9022
|
+
}
|
|
9023
|
+
const fitting = Math.max(1, Math.floor(maxEdge));
|
|
9024
|
+
return fitting > WHOLE_FACTOR_MIN_FITTING_EDGE
|
|
9025
|
+
? Math.ceil(sourceEdge / Math.ceil(sourceEdge / fitting))
|
|
9026
|
+
: fitting;
|
|
9027
|
+
}
|
|
9028
|
+
function largestAxis(dimensions) {
|
|
9029
|
+
let axis = 0;
|
|
9030
|
+
for (let other = 1; other < 3; other++) {
|
|
9031
|
+
if (dimensions[other] > dimensions[axis]) {
|
|
9032
|
+
axis = other;
|
|
9033
|
+
}
|
|
9034
|
+
}
|
|
9035
|
+
return axis;
|
|
9036
|
+
}
|
|
9037
|
+
function preferDivisor(sourceEdge, fitting) {
|
|
9038
|
+
for (let factor = Math.ceil(sourceEdge / fitting); sourceEdge / factor >= DIVISOR_PREFERENCE_MIN_RATIO * fitting; factor++) {
|
|
9039
|
+
if (sourceEdge % factor === 0) {
|
|
9040
|
+
return sourceEdge / factor;
|
|
9041
|
+
}
|
|
9042
|
+
}
|
|
9043
|
+
return fitting;
|
|
9044
|
+
}
|
|
9045
|
+
function boxAverageReductionFactors(dimensions, limits) {
|
|
9046
|
+
const { maxEdge, maxVoxelCount } = limits ?? {};
|
|
9047
|
+
const reduced = dimensions.map((edge) => Math.max(1, edgeLimitedEdge(edge, maxEdge)));
|
|
9048
|
+
if (maxVoxelCount > 0) {
|
|
9049
|
+
while (reduced[0] * reduced[1] * reduced[2] > maxVoxelCount) {
|
|
9050
|
+
const axis = largestAxis(reduced);
|
|
9051
|
+
if (reduced[axis] <= 1) {
|
|
9052
|
+
break;
|
|
9053
|
+
}
|
|
9054
|
+
reduced[axis] -= 1;
|
|
9055
|
+
}
|
|
9056
|
+
}
|
|
9057
|
+
return reduced.map((edge, axis) => edge >= dimensions[axis]
|
|
9058
|
+
? 1
|
|
9059
|
+
: dimensions[axis] / preferDivisor(dimensions[axis], edge));
|
|
9060
|
+
}
|
|
9061
|
+
|
|
9062
|
+
|
|
9063
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/deriveBoxAverageGrid.js
|
|
9064
|
+
var deriveBoxAverageGrid = __webpack_require__(99190);
|
|
9065
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/resolveReduction.js
|
|
9066
|
+
var voxelGrid_resolveReduction = __webpack_require__(37728);
|
|
9067
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/boxSpan.js
|
|
9068
|
+
var boxSpan = __webpack_require__(9844);
|
|
9069
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/enums/VoxelStatistics.js
|
|
9070
|
+
var enums_VoxelStatistics = __webpack_require__(10475);
|
|
9071
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelStatistics.js
|
|
9072
|
+
var voxelStatistics = __webpack_require__(40210);
|
|
9073
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/boxStatistic.js
|
|
9074
|
+
|
|
9075
|
+
|
|
9076
|
+
|
|
9077
|
+
|
|
9078
|
+
function createAccumulators(statistic) {
|
|
9079
|
+
return { definition: requireVoxelStatistic(statistic), perComponent: [] };
|
|
9080
|
+
}
|
|
9081
|
+
function growAccumulators(accumulators, count) {
|
|
9082
|
+
const { definition, perComponent } = accumulators;
|
|
9083
|
+
while (perComponent.length < count) {
|
|
9084
|
+
perComponent.push(definition.createAccumulator());
|
|
9085
|
+
}
|
|
9086
|
+
}
|
|
9087
|
+
function valueOfBox(source, resolved, accumulators, i, j, k) {
|
|
9088
|
+
const { factors, sourceOffset, sourceEnd } = resolved;
|
|
9089
|
+
const { perComponent } = accumulators;
|
|
9090
|
+
const spanI = spanOfBox(sourceOffset[0], factors[0], sourceEnd[0], i);
|
|
9091
|
+
const spanJ = spanOfBox(sourceOffset[1], factors[1], sourceEnd[1], j);
|
|
9092
|
+
const spanK = spanOfBox(sourceOffset[2], factors[2], sourceEnd[2], k);
|
|
9093
|
+
for (let component = 0; component < perComponent.length; component++) {
|
|
9094
|
+
perComponent[component].reset();
|
|
9095
|
+
}
|
|
9096
|
+
let components = 0;
|
|
9097
|
+
for (let sourceK = spanK.first; sourceK < spanK.end; sourceK++) {
|
|
9098
|
+
const weightK = weightInSpan(spanK, sourceK);
|
|
9099
|
+
for (let sourceJ = spanJ.first; sourceJ < spanJ.end; sourceJ++) {
|
|
9100
|
+
const weightJK = weightK * weightInSpan(spanJ, sourceJ);
|
|
9101
|
+
for (let sourceI = spanI.first; sourceI < spanI.end; sourceI++) {
|
|
9102
|
+
const weight = weightJK * weightInSpan(spanI, sourceI);
|
|
9103
|
+
const value = source.getAtIJK(sourceI, sourceJ, sourceK);
|
|
9104
|
+
if (typeof value === 'number') {
|
|
9105
|
+
if (Number.isFinite(value)) {
|
|
9106
|
+
growAccumulators(accumulators, 1);
|
|
9107
|
+
perComponent[0].add(value, weight);
|
|
9108
|
+
}
|
|
9109
|
+
continue;
|
|
9110
|
+
}
|
|
9111
|
+
if (!value) {
|
|
9112
|
+
continue;
|
|
9113
|
+
}
|
|
9114
|
+
const length = value.length;
|
|
9115
|
+
growAccumulators(accumulators, length);
|
|
9116
|
+
if (length > components) {
|
|
9117
|
+
components = length;
|
|
9118
|
+
}
|
|
9119
|
+
for (let component = 0; component < length; component++) {
|
|
9120
|
+
const componentValue = value[component];
|
|
9121
|
+
if (Number.isFinite(componentValue)) {
|
|
9122
|
+
perComponent[component].add(componentValue, weight);
|
|
9123
|
+
}
|
|
9124
|
+
}
|
|
9125
|
+
}
|
|
9126
|
+
}
|
|
9127
|
+
}
|
|
9128
|
+
if (components === 0) {
|
|
9129
|
+
return perComponent.length === 0 ? undefined : perComponent[0].getValue();
|
|
9130
|
+
}
|
|
9131
|
+
const result = [];
|
|
9132
|
+
for (let component = 0; component < components; component++) {
|
|
9133
|
+
const componentValue = perComponent[component].getValue();
|
|
9134
|
+
if (componentValue === undefined) {
|
|
9135
|
+
return undefined;
|
|
9136
|
+
}
|
|
9137
|
+
result.push(componentValue);
|
|
9138
|
+
}
|
|
9139
|
+
return result;
|
|
9140
|
+
}
|
|
9141
|
+
function roundValue(value) {
|
|
9142
|
+
if (typeof value === 'number') {
|
|
9143
|
+
return Math.round(value);
|
|
9144
|
+
}
|
|
9145
|
+
for (let component = 0; component < value.length; component++) {
|
|
9146
|
+
value[component] = Math.round(value[component]);
|
|
9147
|
+
}
|
|
9148
|
+
return value;
|
|
9149
|
+
}
|
|
9150
|
+
function boxStatisticAtIJK(source, reduction, i, j, k, statistic = VoxelStatistics.Average) {
|
|
9151
|
+
return valueOfBox(source, resolveReduction(source, reduction), createAccumulators(statistic), i, j, k);
|
|
9152
|
+
}
|
|
9153
|
+
function boxAverageAtIJK(source, reduction, i, j, k) {
|
|
9154
|
+
return boxStatisticAtIJK(source, reduction, i, j, k, VoxelStatistics.Average);
|
|
9155
|
+
}
|
|
9156
|
+
function reduceByBoxStatistic(source, reduction, target, options = {}) {
|
|
9157
|
+
const { round = true, statistic = VoxelStatistics.Average } = options;
|
|
9158
|
+
const definition = requireVoxelStatistic(statistic);
|
|
9159
|
+
const sliceWritten = definition.reduceBySlices?.(source, reduction, target, {
|
|
9160
|
+
round,
|
|
9161
|
+
});
|
|
9162
|
+
if (sliceWritten !== undefined) {
|
|
9163
|
+
return sliceWritten;
|
|
9164
|
+
}
|
|
9165
|
+
const accumulators = { definition, perComponent: [] };
|
|
9166
|
+
const resolved = resolveReduction(source, reduction);
|
|
9167
|
+
const { dimensions } = resolved;
|
|
9168
|
+
const [targetI, targetJ, targetK] = reduction.targetOffset ?? [0, 0, 0];
|
|
9169
|
+
let written = 0;
|
|
9170
|
+
for (let k = 0; k < dimensions[2]; k++) {
|
|
9171
|
+
for (let j = 0; j < dimensions[1]; j++) {
|
|
9172
|
+
for (let i = 0; i < dimensions[0]; i++) {
|
|
9173
|
+
const value = valueOfBox(source, resolved, accumulators, i, j, k);
|
|
9174
|
+
if (value === undefined) {
|
|
9175
|
+
continue;
|
|
9176
|
+
}
|
|
9177
|
+
target.setAtIJK(targetI + i, targetJ + j, targetK + k, (round ? roundValue(value) : value));
|
|
9178
|
+
written++;
|
|
9179
|
+
}
|
|
9180
|
+
}
|
|
9181
|
+
}
|
|
9182
|
+
return written;
|
|
9183
|
+
}
|
|
9184
|
+
function reduceByBoxAverage(source, reduction, target, options = {}) {
|
|
9185
|
+
return reduceByBoxStatistic(source, reduction, target, {
|
|
9186
|
+
...options,
|
|
9187
|
+
statistic: VoxelStatistics.Average,
|
|
9188
|
+
});
|
|
9189
|
+
}
|
|
9190
|
+
|
|
9191
|
+
|
|
9192
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/enums/ImageQualityStatus.js
|
|
9193
|
+
var ImageQualityStatus = __webpack_require__(7330);
|
|
9194
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/enums/VoxelReductions.js
|
|
9195
|
+
var enums_VoxelReductions = __webpack_require__(33170);
|
|
9196
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelQuality.js
|
|
9197
|
+
|
|
9198
|
+
|
|
9199
|
+
const reductionDefinitions = new Map();
|
|
9200
|
+
const registeredConstantNames = [];
|
|
9201
|
+
let hasRegisteredCoreVoxelReductions = false;
|
|
9202
|
+
function registerCoreVoxelReductions() {
|
|
9203
|
+
if (hasRegisteredCoreVoxelReductions) {
|
|
9204
|
+
return;
|
|
9205
|
+
}
|
|
9206
|
+
hasRegisteredCoreVoxelReductions = true;
|
|
9207
|
+
registerVoxelReduction({
|
|
9208
|
+
reduction: enums_VoxelReductions/* ["default"].None */.A.None,
|
|
9209
|
+
aliases: false,
|
|
9210
|
+
description: 'The data holds every voxel of its own grid.',
|
|
9211
|
+
});
|
|
9212
|
+
registerVoxelReduction({
|
|
9213
|
+
reduction: enums_VoxelReductions/* ["default"].BoxAverage */.A.BoxAverage,
|
|
9214
|
+
aliases: false,
|
|
9215
|
+
description: 'The mean of the source voxels of one box.',
|
|
9216
|
+
});
|
|
9217
|
+
registerVoxelReduction({
|
|
9218
|
+
reduction: enums_VoxelReductions/* ["default"].BoxForegroundMajority */.A.BoxForegroundMajority,
|
|
9219
|
+
aliases: false,
|
|
9220
|
+
description: 'The majority non-zero label of the source voxels of one box. It reduces labelmaps.',
|
|
9221
|
+
});
|
|
9222
|
+
registerVoxelReduction({
|
|
9223
|
+
reduction: enums_VoxelReductions/* ["default"].Decimation */.A.Decimation,
|
|
9224
|
+
aliases: true,
|
|
9225
|
+
description: 'Every n-th source voxel. It folds the high spatial frequencies into the signal.',
|
|
9226
|
+
});
|
|
9227
|
+
}
|
|
9228
|
+
function registerVoxelReduction({ reduction, name, aliases, description, }) {
|
|
9229
|
+
if (!reduction) {
|
|
9230
|
+
throw new Error('registerVoxelReduction: the definition needs a reduction');
|
|
9231
|
+
}
|
|
9232
|
+
if (reductionDefinitions.has(reduction)) {
|
|
9233
|
+
throw new Error(`Voxel reduction "${reduction}" is already registered`);
|
|
9234
|
+
}
|
|
9235
|
+
if (typeof aliases !== 'boolean') {
|
|
9236
|
+
throw new Error(`Voxel reduction "${reduction}" must state whether it aliases`);
|
|
9237
|
+
}
|
|
9238
|
+
if (name && Object.prototype.hasOwnProperty.call(enums_VoxelReductions/* ["default"] */.A, name)) {
|
|
9239
|
+
throw new Error(`Voxel reduction constant "${String(name)}" already exists`);
|
|
9240
|
+
}
|
|
9241
|
+
reductionDefinitions.set(reduction, { reduction, aliases, description });
|
|
9242
|
+
if (name) {
|
|
9243
|
+
(0,enums_VoxelReductions/* .registerVoxelReductionsConstant */.o)(name, reduction);
|
|
9244
|
+
registeredConstantNames.push(name);
|
|
9245
|
+
}
|
|
9246
|
+
}
|
|
9247
|
+
function getVoxelReduction(reduction) {
|
|
9248
|
+
registerCoreVoxelReductions();
|
|
9249
|
+
return reductionDefinitions.get(reduction);
|
|
9250
|
+
}
|
|
9251
|
+
function isAliasingReduction(reduction) {
|
|
9252
|
+
return getVoxelReduction(reduction)?.aliases !== false;
|
|
9253
|
+
}
|
|
9254
|
+
function __resetVoxelReductionRegistry() {
|
|
9255
|
+
reductionDefinitions.clear();
|
|
9256
|
+
hasRegisteredCoreVoxelReductions = false;
|
|
9257
|
+
for (const name of registeredConstantNames) {
|
|
9258
|
+
delete VoxelReductions[name];
|
|
9259
|
+
}
|
|
9260
|
+
registeredConstantNames.length = 0;
|
|
9261
|
+
}
|
|
9262
|
+
function imageQualityStatusOfRecord(record) {
|
|
9263
|
+
if (record.missing >= record.voxels) {
|
|
9264
|
+
return ImageQualityStatus/* ["default"].FAR_REPLICATE */.A.FAR_REPLICATE;
|
|
9265
|
+
}
|
|
9266
|
+
if (record.missing > 0) {
|
|
9267
|
+
return Math.min(record.lowest ?? ImageQualityStatus/* ["default"].FAR_REPLICATE */.A.FAR_REPLICATE, ImageQualityStatus/* ["default"].ADJACENT_REPLICATE */.A.ADJACENT_REPLICATE);
|
|
9268
|
+
}
|
|
9269
|
+
const lowest = record.lowest ?? ImageQualityStatus/* ["default"].FAR_REPLICATE */.A.FAR_REPLICATE;
|
|
9270
|
+
if (isAliasingReduction(record.reduction)) {
|
|
9271
|
+
return Math.min(lowest, ImageQualityStatus/* ["default"].SUBRESOLUTION */.A.SUBRESOLUTION);
|
|
9272
|
+
}
|
|
9273
|
+
return lowest;
|
|
9274
|
+
}
|
|
9275
|
+
function compareVoxelQuality(record, requirement = {}) {
|
|
9276
|
+
const { displaySpacing, missingAllowed = 0, minStatus } = requirement;
|
|
9277
|
+
const causes = [];
|
|
9278
|
+
let magnitude = 0;
|
|
9279
|
+
if (displaySpacing) {
|
|
9280
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9281
|
+
const display = displaySpacing[axis];
|
|
9282
|
+
if (!(display > 0)) {
|
|
9283
|
+
continue;
|
|
9284
|
+
}
|
|
9285
|
+
magnitude = Math.max(magnitude, record.grid.spacing[axis] / display);
|
|
9286
|
+
}
|
|
9287
|
+
if (magnitude > 1 + 1e-6) {
|
|
9288
|
+
causes.push('resolution');
|
|
9289
|
+
}
|
|
9290
|
+
}
|
|
9291
|
+
if (isAliasingReduction(record.reduction)) {
|
|
9292
|
+
causes.push('aliasing');
|
|
9293
|
+
}
|
|
9294
|
+
if (record.missing > missingAllowed) {
|
|
9295
|
+
causes.push('missingData');
|
|
9296
|
+
}
|
|
9297
|
+
if (minStatus !== undefined && record.status < minStatus) {
|
|
9298
|
+
causes.push('quality');
|
|
9299
|
+
}
|
|
9300
|
+
return { lossless: causes.length === 0, causes, magnitude, record };
|
|
9301
|
+
}
|
|
9302
|
+
|
|
9303
|
+
|
|
9304
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelGridKey.js
|
|
9305
|
+
var voxelGridKey = __webpack_require__(70070);
|
|
9306
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelGridTransforms.js
|
|
9307
|
+
function gridIndexToWorld(grid, ijk) {
|
|
9308
|
+
const world = [grid.origin[0], grid.origin[1], grid.origin[2]];
|
|
9309
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9310
|
+
const distance = ijk[axis] * grid.spacing[axis];
|
|
9311
|
+
world[0] += grid.direction[axis * 3] * distance;
|
|
9312
|
+
world[1] += grid.direction[axis * 3 + 1] * distance;
|
|
9313
|
+
world[2] += grid.direction[axis * 3 + 2] * distance;
|
|
9314
|
+
}
|
|
9315
|
+
return world;
|
|
9316
|
+
}
|
|
9317
|
+
function gridWorldToIndex(grid, world) {
|
|
9318
|
+
const dx = world[0] - grid.origin[0];
|
|
9319
|
+
const dy = world[1] - grid.origin[1];
|
|
9320
|
+
const dz = world[2] - grid.origin[2];
|
|
9321
|
+
const ijk = [0, 0, 0];
|
|
9322
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9323
|
+
const projection = dx * grid.direction[axis * 3] +
|
|
9324
|
+
dy * grid.direction[axis * 3 + 1] +
|
|
9325
|
+
dz * grid.direction[axis * 3 + 2];
|
|
9326
|
+
ijk[axis] = projection / grid.spacing[axis];
|
|
9327
|
+
}
|
|
9328
|
+
return ijk;
|
|
9329
|
+
}
|
|
9330
|
+
function mapIndexBetweenGrids(source, target, ijk) {
|
|
9331
|
+
return gridWorldToIndex(target, gridIndexToWorld(source, ijk));
|
|
9332
|
+
}
|
|
9333
|
+
function mapIndexToNearestVoxel(source, target, ijk) {
|
|
9334
|
+
const mapped = mapIndexBetweenGrids(source, target, ijk);
|
|
9335
|
+
return [Math.round(mapped[0]), Math.round(mapped[1]), Math.round(mapped[2])];
|
|
9336
|
+
}
|
|
9337
|
+
function gridContainsIndex(grid, ijk) {
|
|
9338
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9339
|
+
if (ijk[axis] < 0 || ijk[axis] > grid.dimensions[axis] - 1) {
|
|
9340
|
+
return false;
|
|
9341
|
+
}
|
|
9342
|
+
}
|
|
9343
|
+
return true;
|
|
9344
|
+
}
|
|
9345
|
+
function cornersOfBounds(bounds) {
|
|
9346
|
+
const corners = [];
|
|
9347
|
+
for (const i of bounds[0]) {
|
|
9348
|
+
for (const j of bounds[1]) {
|
|
9349
|
+
for (const k of bounds[2]) {
|
|
9350
|
+
corners.push([i, j, k]);
|
|
9351
|
+
}
|
|
9352
|
+
}
|
|
9353
|
+
}
|
|
9354
|
+
return corners;
|
|
9355
|
+
}
|
|
9356
|
+
function gridCoversRegion(source, bounds, target) {
|
|
9357
|
+
const tolerance = 0.5 + 1e-6;
|
|
9358
|
+
for (const corner of cornersOfBounds(bounds)) {
|
|
9359
|
+
const mapped = mapIndexBetweenGrids(source, target, corner);
|
|
9360
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9361
|
+
if (mapped[axis] < -tolerance ||
|
|
9362
|
+
mapped[axis] > target.dimensions[axis] - 1 + tolerance) {
|
|
9363
|
+
return false;
|
|
9364
|
+
}
|
|
9365
|
+
}
|
|
9366
|
+
}
|
|
9367
|
+
return true;
|
|
9368
|
+
}
|
|
9369
|
+
function mapBoundsBetweenGrids(source, target, bounds) {
|
|
9370
|
+
const tolerance = 1e-6;
|
|
9371
|
+
const faces = [
|
|
9372
|
+
[bounds[0][0] - 0.5, bounds[0][1] + 0.5],
|
|
9373
|
+
[bounds[1][0] - 0.5, bounds[1][1] + 0.5],
|
|
9374
|
+
[bounds[2][0] - 0.5, bounds[2][1] + 0.5],
|
|
9375
|
+
];
|
|
9376
|
+
const mapped = [
|
|
9377
|
+
[Infinity, -Infinity],
|
|
9378
|
+
[Infinity, -Infinity],
|
|
9379
|
+
[Infinity, -Infinity],
|
|
9380
|
+
];
|
|
9381
|
+
for (const corner of cornersOfBounds(faces)) {
|
|
9382
|
+
const point = mapIndexBetweenGrids(source, target, corner);
|
|
9383
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9384
|
+
mapped[axis][0] = Math.min(mapped[axis][0], point[axis]);
|
|
9385
|
+
mapped[axis][1] = Math.max(mapped[axis][1], point[axis]);
|
|
9386
|
+
}
|
|
9387
|
+
}
|
|
9388
|
+
return [
|
|
9389
|
+
[
|
|
9390
|
+
Math.ceil(mapped[0][0] - 0.5 + tolerance),
|
|
9391
|
+
Math.floor(mapped[0][1] + 0.5 - tolerance),
|
|
9392
|
+
],
|
|
9393
|
+
[
|
|
9394
|
+
Math.ceil(mapped[1][0] - 0.5 + tolerance),
|
|
9395
|
+
Math.floor(mapped[1][1] + 0.5 - tolerance),
|
|
9396
|
+
],
|
|
9397
|
+
[
|
|
9398
|
+
Math.ceil(mapped[2][0] - 0.5 + tolerance),
|
|
9399
|
+
Math.floor(mapped[2][1] + 0.5 - tolerance),
|
|
9400
|
+
],
|
|
9401
|
+
];
|
|
9402
|
+
}
|
|
9403
|
+
function boundsOfGrid(grid) {
|
|
9404
|
+
return [
|
|
9405
|
+
[0, grid.dimensions[0] - 1],
|
|
9406
|
+
[0, grid.dimensions[1] - 1],
|
|
9407
|
+
[0, grid.dimensions[2] - 1],
|
|
9408
|
+
];
|
|
9409
|
+
}
|
|
9410
|
+
function boundsOfFrame(grid, frameIndex) {
|
|
9411
|
+
return [
|
|
9412
|
+
[0, grid.dimensions[0] - 1],
|
|
9413
|
+
[0, grid.dimensions[1] - 1],
|
|
9414
|
+
[frameIndex, frameIndex],
|
|
9415
|
+
];
|
|
9416
|
+
}
|
|
9417
|
+
function intersectBounds(a, b) {
|
|
9418
|
+
return [
|
|
9419
|
+
[Math.max(a[0][0], b[0][0]), Math.min(a[0][1], b[0][1])],
|
|
9420
|
+
[Math.max(a[1][0], b[1][0]), Math.min(a[1][1], b[1][1])],
|
|
9421
|
+
[Math.max(a[2][0], b[2][0]), Math.min(a[2][1], b[2][1])],
|
|
9422
|
+
];
|
|
9423
|
+
}
|
|
9424
|
+
function volumeOfBounds(bounds) {
|
|
9425
|
+
let volume = 1;
|
|
9426
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9427
|
+
const length = bounds[axis][1] - bounds[axis][0] + 1;
|
|
9428
|
+
if (length <= 0) {
|
|
9429
|
+
return 0;
|
|
9430
|
+
}
|
|
9431
|
+
volume *= length;
|
|
9432
|
+
}
|
|
9433
|
+
return volume;
|
|
9434
|
+
}
|
|
9435
|
+
function containsBounds(outer, inner) {
|
|
9436
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9437
|
+
if (inner[axis][0] < outer[axis][0] || inner[axis][1] > outer[axis][1]) {
|
|
9438
|
+
return false;
|
|
9439
|
+
}
|
|
9440
|
+
}
|
|
9441
|
+
return true;
|
|
9442
|
+
}
|
|
9443
|
+
function sameBounds(a, b) {
|
|
9444
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
9445
|
+
if (a[axis][0] !== b[axis][0] || a[axis][1] !== b[axis][1]) {
|
|
9446
|
+
return false;
|
|
9447
|
+
}
|
|
9448
|
+
}
|
|
9449
|
+
return true;
|
|
9450
|
+
}
|
|
9451
|
+
|
|
9452
|
+
|
|
9453
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelGridSize.js
|
|
9454
|
+
function voxelCountOfGrid(grid) {
|
|
9455
|
+
return grid.dimensions[0] * grid.dimensions[1] * grid.dimensions[2];
|
|
9456
|
+
}
|
|
9457
|
+
function maxEdgeOfGrid(grid) {
|
|
9458
|
+
return Math.max(...grid.dimensions);
|
|
9459
|
+
}
|
|
9460
|
+
function voxelGridWithinLimits(grid, limits) {
|
|
9461
|
+
const { maxEdge, maxVoxelCount } = limits ?? {};
|
|
9462
|
+
if (maxEdge > 0 && maxEdgeOfGrid(grid) > maxEdge) {
|
|
9463
|
+
return false;
|
|
9464
|
+
}
|
|
9465
|
+
if (maxVoxelCount > 0 && voxelCountOfGrid(grid) > maxVoxelCount) {
|
|
9466
|
+
return false;
|
|
9467
|
+
}
|
|
9468
|
+
return true;
|
|
9469
|
+
}
|
|
9470
|
+
|
|
9471
|
+
|
|
9472
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/index.js
|
|
9473
|
+
|
|
9474
|
+
|
|
9475
|
+
|
|
9476
|
+
|
|
9477
|
+
|
|
9478
|
+
|
|
9479
|
+
|
|
9480
|
+
|
|
9481
|
+
|
|
9482
|
+
|
|
9483
|
+
|
|
9484
|
+
},
|
|
9485
|
+
40210(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
9486
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_0 = __webpack_require__(10475);
|
|
9487
|
+
/* import */ var _enums_VoxelReductions_js__rspack_import_1 = __webpack_require__(33170);
|
|
9488
|
+
/* import */ var _sliceReductions_js__rspack_import_2 = __webpack_require__(80365);
|
|
9489
|
+
/* import */ var _averagePlane_js__rspack_import_3 = __webpack_require__(29678);
|
|
9490
|
+
/* import */ var _foregroundMajorityPlane_js__rspack_import_4 = __webpack_require__(12593);
|
|
9491
|
+
|
|
9492
|
+
|
|
9493
|
+
|
|
9494
|
+
|
|
9495
|
+
|
|
9496
|
+
const statisticDefinitions = new Map();
|
|
9497
|
+
const registeredConstantNames = [];
|
|
9498
|
+
let hasRegisteredCoreVoxelStatistics = false;
|
|
9499
|
+
function createAverageAccumulator() {
|
|
9500
|
+
let sum = 0;
|
|
9501
|
+
let count = 0;
|
|
9502
|
+
return {
|
|
9503
|
+
reset: () => {
|
|
9504
|
+
sum = 0;
|
|
9505
|
+
count = 0;
|
|
9506
|
+
},
|
|
9507
|
+
add: (value, weight = 1) => {
|
|
9508
|
+
sum += value * weight;
|
|
9509
|
+
count += weight;
|
|
9510
|
+
},
|
|
9511
|
+
getValue: () => (count === 0 ? undefined : sum / count),
|
|
9512
|
+
};
|
|
9513
|
+
}
|
|
9514
|
+
function createForegroundMajorityAccumulator() {
|
|
9515
|
+
const counts = new Map();
|
|
9516
|
+
let majority;
|
|
9517
|
+
let majorityCount = 0;
|
|
9518
|
+
let sawBackground = false;
|
|
9519
|
+
return {
|
|
9520
|
+
reset: () => {
|
|
9521
|
+
counts.clear();
|
|
9522
|
+
majority = undefined;
|
|
9523
|
+
majorityCount = 0;
|
|
9524
|
+
sawBackground = false;
|
|
9525
|
+
},
|
|
9526
|
+
add: (value, weight = 1) => {
|
|
9527
|
+
if (value === 0) {
|
|
9528
|
+
sawBackground = true;
|
|
9529
|
+
return;
|
|
9530
|
+
}
|
|
9531
|
+
const next = (counts.get(value) ?? 0) + weight;
|
|
9532
|
+
counts.set(value, next);
|
|
9533
|
+
if (next > majorityCount) {
|
|
9534
|
+
majorityCount = next;
|
|
9535
|
+
majority = value;
|
|
9536
|
+
}
|
|
9537
|
+
},
|
|
9538
|
+
getValue: () => {
|
|
9539
|
+
if (majority !== undefined) {
|
|
9540
|
+
return majority;
|
|
9541
|
+
}
|
|
9542
|
+
return sawBackground ? 0 : undefined;
|
|
9543
|
+
},
|
|
9544
|
+
};
|
|
9545
|
+
}
|
|
9546
|
+
function registerCoreVoxelStatistics() {
|
|
9547
|
+
if (hasRegisteredCoreVoxelStatistics) {
|
|
9548
|
+
return;
|
|
9549
|
+
}
|
|
9550
|
+
hasRegisteredCoreVoxelStatistics = true;
|
|
9551
|
+
registerVoxelStatistic({
|
|
9552
|
+
statistic: _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average,
|
|
9553
|
+
defaultSelection: true,
|
|
9554
|
+
description: 'The mean of the source voxels of one box.',
|
|
9555
|
+
createAccumulator: createAverageAccumulator,
|
|
9556
|
+
reduceBySlices: _sliceReductions_js__rspack_import_2/* .reduceAverageAlongKBySlices */.m,
|
|
9557
|
+
fillPlane: _averagePlane_js__rspack_import_3/* ["default"] */.A,
|
|
9558
|
+
boxReduction: _enums_VoxelReductions_js__rspack_import_1/* ["default"].BoxAverage */.A.BoxAverage,
|
|
9559
|
+
});
|
|
9560
|
+
registerVoxelStatistic({
|
|
9561
|
+
statistic: _enums_VoxelStatistics_js__rspack_import_0/* ["default"].ForegroundMajority */.A.ForegroundMajority,
|
|
9562
|
+
defaultSelection: false,
|
|
9563
|
+
description: 'The majority non-zero label of one box (background ignored unless the box is empty). Used to reduce labelmaps.',
|
|
9564
|
+
createAccumulator: createForegroundMajorityAccumulator,
|
|
9565
|
+
reduceBySlices: _sliceReductions_js__rspack_import_2/* .reduceForegroundMajorityBySlices */.R,
|
|
9566
|
+
fillPlane: _foregroundMajorityPlane_js__rspack_import_4/* ["default"] */.A,
|
|
9567
|
+
boxReduction: _enums_VoxelReductions_js__rspack_import_1/* ["default"].BoxForegroundMajority */.A.BoxForegroundMajority,
|
|
9568
|
+
});
|
|
9569
|
+
}
|
|
9570
|
+
function registerVoxelStatistic({ statistic, name, defaultSelection = false, description, createAccumulator, reduceBySlices, fillPlane, boxReduction, }) {
|
|
9571
|
+
if (!statistic) {
|
|
9572
|
+
throw new Error('registerVoxelStatistic: the definition needs a statistic');
|
|
9573
|
+
}
|
|
9574
|
+
if (statisticDefinitions.has(statistic)) {
|
|
9575
|
+
throw new Error(`Voxel statistic "${statistic}" is already registered`);
|
|
9576
|
+
}
|
|
9577
|
+
if (typeof createAccumulator !== 'function') {
|
|
9578
|
+
throw new Error(`Voxel statistic "${statistic}" must declare a createAccumulator function`);
|
|
9579
|
+
}
|
|
9580
|
+
for (const [field, hook] of Object.entries({ reduceBySlices, fillPlane })) {
|
|
9581
|
+
if (hook !== undefined && typeof hook !== 'function') {
|
|
9582
|
+
throw new Error(`Voxel statistic "${statistic}" declares ${field}, which is not a function`);
|
|
9583
|
+
}
|
|
9584
|
+
}
|
|
9585
|
+
if (name && Object.prototype.hasOwnProperty.call(_enums_VoxelStatistics_js__rspack_import_0/* ["default"] */.A, name)) {
|
|
9586
|
+
throw new Error(`Voxel statistic constant "${String(name)}" already exists`);
|
|
9587
|
+
}
|
|
9588
|
+
statisticDefinitions.set(statistic, {
|
|
9589
|
+
statistic,
|
|
9590
|
+
defaultSelection,
|
|
9591
|
+
description,
|
|
9592
|
+
createAccumulator,
|
|
9593
|
+
reduceBySlices,
|
|
9594
|
+
fillPlane,
|
|
9595
|
+
boxReduction,
|
|
9596
|
+
});
|
|
9597
|
+
if (name) {
|
|
9598
|
+
(0,_enums_VoxelStatistics_js__rspack_import_0/* .registerVoxelStatisticsConstant */.F)(name, statistic);
|
|
9599
|
+
registeredConstantNames.push(name);
|
|
9600
|
+
}
|
|
9601
|
+
}
|
|
9602
|
+
function getVoxelStatistic(statistic) {
|
|
9603
|
+
registerCoreVoxelStatistics();
|
|
9604
|
+
return statisticDefinitions.get(statistic);
|
|
9605
|
+
}
|
|
9606
|
+
function requireVoxelStatistic(statistic) {
|
|
9607
|
+
const definition = getVoxelStatistic(statistic);
|
|
9608
|
+
if (!definition) {
|
|
9609
|
+
throw new Error(`Voxel statistic "${statistic}" is not registered. Call registerVoxelStatistic first.`);
|
|
9610
|
+
}
|
|
9611
|
+
return definition;
|
|
9612
|
+
}
|
|
9613
|
+
function getVoxelStatistics() {
|
|
9614
|
+
registerCoreVoxelStatistics();
|
|
9615
|
+
return [...statisticDefinitions.values()];
|
|
9616
|
+
}
|
|
9617
|
+
function isRegisteredVoxelStatistic(statistic) {
|
|
9618
|
+
return getVoxelStatistic(statistic) !== undefined;
|
|
9619
|
+
}
|
|
9620
|
+
function isDefaultSelectionStatistic(statistic) {
|
|
9621
|
+
return getVoxelStatistic(statistic)?.defaultSelection === true;
|
|
9622
|
+
}
|
|
9623
|
+
function __resetVoxelStatisticRegistry() {
|
|
9624
|
+
statisticDefinitions.clear();
|
|
9625
|
+
hasRegisteredCoreVoxelStatistics = false;
|
|
9626
|
+
for (const name of registeredConstantNames) {
|
|
9627
|
+
delete VoxelStatistics[name];
|
|
9628
|
+
}
|
|
9629
|
+
registeredConstantNames.length = 0;
|
|
9630
|
+
}
|
|
9631
|
+
|
|
9632
|
+
|
|
9633
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9634
|
+
Qk: () => (requireVoxelStatistic),
|
|
9635
|
+
Yg: () => (isDefaultSelectionStatistic)
|
|
9636
|
+
});
|
|
9637
|
+
|
|
9638
|
+
|
|
8628
9639
|
},
|
|
8629
9640
|
46989(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
8630
9641
|
/* import */ var _getVoxelThicknessAlongNormal_js__rspack_import_0 = __webpack_require__(61761);
|
|
@@ -9590,6 +10601,8 @@ var createVolumeActor = __webpack_require__(25745);
|
|
|
9590
10601
|
var createVolumeMapper = __webpack_require__(9891);
|
|
9591
10602
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/getOrCreateCanvas.js
|
|
9592
10603
|
var getOrCreateCanvas = __webpack_require__(567);
|
|
10604
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/index.js + 1 modules
|
|
10605
|
+
var fidelityIndicator = __webpack_require__(93348);
|
|
9593
10606
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VolumeViewport.js + 2 modules
|
|
9594
10607
|
var VolumeViewport = __webpack_require__(69662);
|
|
9595
10608
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VolumeViewport3D.js
|
|
@@ -9626,6 +10639,10 @@ var version = __webpack_require__(6945);
|
|
|
9626
10639
|
var getRenderingEngine = __webpack_require__(2448);
|
|
9627
10640
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/cache/index.js
|
|
9628
10641
|
var cache = __webpack_require__(61048);
|
|
10642
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/gpuSettingsPresets.js
|
|
10643
|
+
var gpuSettingsPresets = __webpack_require__(701);
|
|
10644
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeRenderStrategy.js
|
|
10645
|
+
var volumeRenderStrategy = __webpack_require__(53703);
|
|
9629
10646
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/cache/cache.js
|
|
9630
10647
|
var cache_cache = __webpack_require__(73998);
|
|
9631
10648
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/requestPool/imageRetrievalPoolManager.js
|
|
@@ -9672,6 +10689,8 @@ var helpers = __webpack_require__(83582);
|
|
|
9672
10689
|
var viewportTypeToViewportClass = __webpack_require__(35586);
|
|
9673
10690
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/renderBackendRegistry.js
|
|
9674
10691
|
var renderBackendRegistry = __webpack_require__(92117);
|
|
10692
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/voxelStatistics.js
|
|
10693
|
+
var voxelStatistics = __webpack_require__(40210);
|
|
9675
10694
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/index.js
|
|
9676
10695
|
|
|
9677
10696
|
|
|
@@ -9718,6 +10737,10 @@ var renderBackendRegistry = __webpack_require__(92117);
|
|
|
9718
10737
|
|
|
9719
10738
|
|
|
9720
10739
|
|
|
10740
|
+
|
|
10741
|
+
|
|
10742
|
+
|
|
10743
|
+
|
|
9721
10744
|
|
|
9722
10745
|
|
|
9723
10746
|
|
|
@@ -9732,6 +10755,12 @@ const renderingEngineExportsV2 = (/* unused pure expression or super */ null &&
|
|
|
9732
10755
|
createECGRenderPathResolver,
|
|
9733
10756
|
DefaultECGDataProvider,
|
|
9734
10757
|
ecgProjection,
|
|
10758
|
+
registerECGTraceLayout,
|
|
10759
|
+
getECGTraceLayout,
|
|
10760
|
+
getECGTraceLayoutNames,
|
|
10761
|
+
resolveDefaultECGTraceLayout,
|
|
10762
|
+
ECG_CLINICAL_SWEEP_SPEEDS,
|
|
10763
|
+
ECG_CLINICAL_SENSITIVITIES,
|
|
9735
10764
|
VideoGenericViewport,
|
|
9736
10765
|
createDefaultVideoRenderPaths,
|
|
9737
10766
|
createVideoRenderPathResolver,
|
|
@@ -9895,7 +10924,7 @@ const computeWorker = {
|
|
|
9895
10924
|
/* import */ var _version_js__rspack_import_0 = __webpack_require__(88253);
|
|
9896
10925
|
/* import */ var _utilities_index_js__rspack_import_1 = __webpack_require__(28102);
|
|
9897
10926
|
/* import */ var _utilities_logging_index_js__rspack_import_2 = __webpack_require__(68272);
|
|
9898
|
-
/* import */ var _utilities_object_index_js__rspack_import_3 = __webpack_require__(
|
|
10927
|
+
/* import */ var _utilities_object_index_js__rspack_import_3 = __webpack_require__(24132);
|
|
9899
10928
|
/* import */ var _utilities_math_index_js__rspack_import_4 = __webpack_require__(40937);
|
|
9900
10929
|
|
|
9901
10930
|
|
|
@@ -9904,11 +10933,15 @@ const computeWorker = {
|
|
|
9904
10933
|
|
|
9905
10934
|
|
|
9906
10935
|
__webpack_require__.d(__webpack_exports__, {
|
|
10936
|
+
FL: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.FL),
|
|
9907
10937
|
IQ: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.IQ),
|
|
9908
10938
|
Ph: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.Ph),
|
|
9909
10939
|
WC: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.WC),
|
|
10940
|
+
_j: () => (/* reexport safe */ _utilities_object_index_js__rspack_import_3._j),
|
|
9910
10941
|
m9: () => (/* reexport module object */ _utilities_logging_index_js__rspack_import_2),
|
|
9911
|
-
|
|
10942
|
+
mm: () => (/* reexport safe */ _utilities_object_index_js__rspack_import_3.mm),
|
|
10943
|
+
n4: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.n4),
|
|
10944
|
+
w7: () => (/* reexport safe */ _utilities_math_index_js__rspack_import_4.w7)
|
|
9912
10945
|
});
|
|
9913
10946
|
|
|
9914
10947
|
|
|
@@ -9922,10 +10955,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9922
10955
|
|
|
9923
10956
|
|
|
9924
10957
|
__webpack_require__.d(__webpack_exports__, {
|
|
10958
|
+
FL: () => (/* reexport safe */ _toNumber_js__rspack_import_0.FL),
|
|
9925
10959
|
IQ: () => (/* reexport safe */ _toNumber_js__rspack_import_0.IQ),
|
|
9926
10960
|
Ph: () => (/* reexport safe */ _isEqual_js__rspack_import_1.Ph),
|
|
9927
10961
|
WC: () => (/* reexport safe */ _isEqual_js__rspack_import_1.WC),
|
|
9928
|
-
n4: () => (/* reexport safe */ _isEqual_js__rspack_import_1.n4)
|
|
10962
|
+
n4: () => (/* reexport safe */ _isEqual_js__rspack_import_1.n4),
|
|
10963
|
+
w7: () => (/* reexport safe */ _toNumber_js__rspack_import_0.w7)
|
|
9929
10964
|
});
|
|
9930
10965
|
|
|
9931
10966
|
|