@cornerstonejs/core 5.19.5 → 5.19.7
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/esm/RenderingEngine/GenericViewport/GenericViewport.js +1 -0
- package/dist/esm/RenderingEngine/GenericViewport/Planar/CpuImageSliceRenderPath.js +3 -0
- package/dist/esm/RenderingEngine/GenericViewport/Planar/CpuVolumeSliceRenderPath.js +2 -0
- package/dist/esm/RenderingEngine/GenericViewport/Planar/VtkImageMapperRenderPath.js +3 -0
- package/dist/esm/RenderingEngine/GenericViewport/ViewportArchitectureTypes.d.ts +2 -0
- package/dist/esm/RenderingEngine/StackViewport.d.ts +0 -1
- package/dist/esm/RenderingEngine/StackViewport.js +3 -9
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/buildViewportFidelityState.js +18 -2
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/collectFidelityLines.d.ts +2 -1
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/collectFidelityLines.js +8 -1
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityDetailsText.js +4 -0
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIndicatorState.d.ts +2 -1
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIndicatorState.js +3 -0
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIssues.d.ts +4 -0
- package/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIssues.js +25 -0
- package/dist/esm/RenderingEngine/helpers/setDefaultVolumeVOI.js +10 -11
- package/dist/esm/RenderingEngine/helpers/volumeStrategyLifecycle.js +2 -0
- package/dist/esm/types/IImage.d.ts +2 -0
- package/dist/esm/types/ViewportFidelity.d.ts +6 -1
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/utilities/getVOIRangeFromWindowLevel.js +2 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +5 -5
|
@@ -130,6 +130,7 @@ class GenericViewport {
|
|
|
130
130
|
imageQualityStatus: rendering.imageQualityStatus,
|
|
131
131
|
qualityPending: rendering.qualityPending,
|
|
132
132
|
reductionCause: rendering.reductionCause,
|
|
133
|
+
issues: rendering.fidelityIssues,
|
|
133
134
|
skip: rendering.excludeFromFidelity,
|
|
134
135
|
});
|
|
135
136
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fidelityIssuesOfImage } from '../../helpers/fidelityIndicator/fidelityIssues.js';
|
|
1
2
|
import { vec3 } from 'gl-matrix';
|
|
2
3
|
import { buildPlanarActorEntry } from './buildPlanarActorEntry.js';
|
|
3
4
|
import CanvasActor from '../../CanvasActor/index.js';
|
|
@@ -50,6 +51,7 @@ export class CpuImageSliceRenderPath {
|
|
|
50
51
|
actorEntryUID: uuidv4(),
|
|
51
52
|
excludeFromFidelity: isSegmentationOverlayData(payload, options),
|
|
52
53
|
imageQualityStatus: imageQualityStatusOf(payload.image),
|
|
54
|
+
fidelityIssues: fidelityIssuesOfImage(payload.image),
|
|
53
55
|
enabledElement,
|
|
54
56
|
compatibilityActor,
|
|
55
57
|
currentImageIdIndex: payload.initialImageIdIndex ?? 0,
|
|
@@ -454,6 +456,7 @@ async function updateRenderedImage(args) {
|
|
|
454
456
|
defaultViewport.displayedArea = resolvePlanarCpuImageDisplayedArea(image);
|
|
455
457
|
enabledElement.image = image;
|
|
456
458
|
rendering.imageQualityStatus = imageQualityStatusOf(image);
|
|
459
|
+
rendering.fidelityIssues = fidelityIssuesOfImage(image);
|
|
457
460
|
enabledElement.viewport = {
|
|
458
461
|
...defaultViewport,
|
|
459
462
|
hflip: previousViewport?.hflip ?? defaultViewport.hflip,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fidelityIssuesOfVolume } from '../../helpers/fidelityIndicator/fidelityIssues.js';
|
|
1
2
|
import { buildPlanarActorEntry } from './buildPlanarActorEntry.js';
|
|
2
3
|
import CanvasActor from '../../CanvasActor/index.js';
|
|
3
4
|
import { Events, ViewportStatus, ViewportType } from '../../../enums/index.js';
|
|
@@ -278,6 +279,7 @@ export class CpuVolumeSliceRenderPath {
|
|
|
278
279
|
runtime.voxelQuality = runtime.imageVolume.getVoxelQuality?.();
|
|
279
280
|
runtime.qualityPending = isVolumeLoading(runtime.imageVolume);
|
|
280
281
|
runtime.fullGrid = runtime.imageVolume.voxelGrid;
|
|
282
|
+
runtime.fidelityIssues = fidelityIssuesOfVolume(runtime.imageVolume);
|
|
281
283
|
runtime.interactiveReduction =
|
|
282
284
|
resampleDecision === 'defer' && !!runtime.sampledSliceState;
|
|
283
285
|
let sampledSliceState = runtime.sampledSliceState;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fidelityIssuesOfImage } from '../../helpers/fidelityIndicator/fidelityIssues.js';
|
|
1
2
|
import vtkImageMapper from '@kitware/vtk.js/Rendering/Core/ImageMapper.js';
|
|
2
3
|
import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice.js';
|
|
3
4
|
import { buildPlanarActorEntry } from './buildPlanarActorEntry.js';
|
|
@@ -37,6 +38,7 @@ export class VtkImageMapperRenderPath {
|
|
|
37
38
|
actor,
|
|
38
39
|
currentImage: payload.image,
|
|
39
40
|
imageQualityStatus: imageQualityStatusOf(payload.image),
|
|
41
|
+
fidelityIssues: fidelityIssuesOfImage(payload.image),
|
|
40
42
|
excludeFromFidelity: isSegmentationOverlayData(payload, options),
|
|
41
43
|
mapper,
|
|
42
44
|
imageData,
|
|
@@ -249,6 +251,7 @@ async function updateRenderedImage(args) {
|
|
|
249
251
|
}
|
|
250
252
|
rendering.currentImage = image;
|
|
251
253
|
rendering.imageQualityStatus = imageQualityStatusOf(image);
|
|
254
|
+
rendering.fidelityIssues = fidelityIssuesOfImage(image);
|
|
252
255
|
rendering.imageData = imageData;
|
|
253
256
|
rendering.currentImageIdIndex = imageIdIndex;
|
|
254
257
|
rendering.defaultVOIRange = getDefaultImageVOIRange(image);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ActorEntry, ICamera, Point2, Point3, ViewportFidelityCause, VoxelGrid, VoxelQualityRecord } from '../../types/index.js';
|
|
2
2
|
import type ImageQualityStatus from '../../enums/ImageQualityStatus.js';
|
|
3
|
+
import type { FidelityIssue } from '../../types/ViewportFidelity.js';
|
|
3
4
|
import type { ReferenceCompatibleOptions, ViewReference, ViewReferenceSpecifier } from '../../types/IViewport.js';
|
|
4
5
|
import type ViewportType from '../../enums/ViewportType.js';
|
|
5
6
|
import type ResolvedViewportView from './ResolvedViewportView.js';
|
|
@@ -47,6 +48,7 @@ export type RenderingFidelity = {
|
|
|
47
48
|
sampleDistanceIdle?: number;
|
|
48
49
|
interactiveReduction?: boolean;
|
|
49
50
|
imageQualityStatus?: ImageQualityStatus;
|
|
51
|
+
fidelityIssues?: FidelityIssue[];
|
|
50
52
|
qualityPending?: boolean;
|
|
51
53
|
reductionCause?: ViewportFidelityCause;
|
|
52
54
|
excludeFromFidelity?: boolean;
|
|
@@ -200,7 +200,6 @@ declare class StackViewport extends Viewport {
|
|
|
200
200
|
getRendererContextPool(): vtkRenderer;
|
|
201
201
|
getRendererTiled(): vtkRenderer;
|
|
202
202
|
private _getVOIRangeForCurrentImage;
|
|
203
|
-
private _getValidVOILUTFunction;
|
|
204
203
|
getCurrentImageIdIndex: () => number;
|
|
205
204
|
getSliceIndex: () => number;
|
|
206
205
|
getSliceInfo(): {
|
|
@@ -26,7 +26,7 @@ import getVOIRangeFromWindowLevel from '../utilities/getVOIRangeFromWindowLevel.
|
|
|
26
26
|
import Viewport from './Viewport.js';
|
|
27
27
|
import drawImageSync from './helpers/cpuFallback/drawImageSync.js';
|
|
28
28
|
import { resolveCPUFallbackColormap } from './helpers/cpuFallback/colors/index.js';
|
|
29
|
-
import { getImagePlaneModule } from '../utilities/buildMetadata.js';
|
|
29
|
+
import { getImagePlaneModule, getValidVOILUTFunction, } from '../utilities/buildMetadata.js';
|
|
30
30
|
import { createEmptyVTKImageData } from './helpers/planarImageRendering.js';
|
|
31
31
|
import { Events, InterpolationType, MetadataModules, RequestType, VOILUTFunctionType, ViewportStatus, } from '../enums/index.js';
|
|
32
32
|
import { loadAndCacheImage } from '../loaders/imageLoader.js';
|
|
@@ -982,7 +982,7 @@ class StackViewport extends Viewport {
|
|
|
982
982
|
if (this.useCPURendering) {
|
|
983
983
|
throw new Error('VOI LUT function is not supported in CPU rendering');
|
|
984
984
|
}
|
|
985
|
-
const newVOILUTFunction =
|
|
985
|
+
const newVOILUTFunction = getValidVOILUTFunction(voiLUTFunction);
|
|
986
986
|
let forceRecreateLUTFunction = false;
|
|
987
987
|
if (this.VOILUTFunction !== newVOILUTFunction) {
|
|
988
988
|
forceRecreateLUTFunction = true;
|
|
@@ -1194,7 +1194,7 @@ class StackViewport extends Viewport {
|
|
|
1194
1194
|
this._addScalingToViewport(scalingFactor);
|
|
1195
1195
|
}
|
|
1196
1196
|
this.modality = modality;
|
|
1197
|
-
const voiLUTFunctionEnum =
|
|
1197
|
+
const voiLUTFunctionEnum = getValidVOILUTFunction(voiLUTFunction);
|
|
1198
1198
|
this.VOILUTFunction = voiLUTFunctionEnum;
|
|
1199
1199
|
this.calibration = calibration;
|
|
1200
1200
|
let imagePlaneModule = this._getImagePlaneModule(imageId);
|
|
@@ -1895,12 +1895,6 @@ class StackViewport extends Viewport {
|
|
|
1895
1895
|
const { windowCenter, windowWidth, voiLUTFunction } = this.csImage;
|
|
1896
1896
|
return getVOIRangeFromWindowLevel(windowWidth, windowCenter, voiLUTFunction);
|
|
1897
1897
|
}
|
|
1898
|
-
_getValidVOILUTFunction(voiLUTFunction) {
|
|
1899
|
-
if (!Object.values(VOILUTFunctionType).includes(voiLUTFunction)) {
|
|
1900
|
-
return VOILUTFunctionType.LINEAR;
|
|
1901
|
-
}
|
|
1902
|
-
return voiLUTFunction;
|
|
1903
|
-
}
|
|
1904
1898
|
getSliceInfo() {
|
|
1905
1899
|
const sliceIndex = this.getSliceIndex();
|
|
1906
1900
|
const { dimensions } = this.getImageData();
|
|
@@ -38,12 +38,14 @@ export function buildViewportFidelityState(lines, displaySpacing) {
|
|
|
38
38
|
loading,
|
|
39
39
|
lod,
|
|
40
40
|
missingFrames: !line.qualityPending && record?.missing > 0,
|
|
41
|
+
displayIssue: !!line.issues?.length,
|
|
41
42
|
})
|
|
42
43
|
: undefined,
|
|
43
44
|
transient: lossy ? loading || lod : undefined,
|
|
44
45
|
progressive: progressiveOf(line),
|
|
45
46
|
shownState,
|
|
46
47
|
lossy,
|
|
48
|
+
issues: issuesOf(lines),
|
|
47
49
|
};
|
|
48
50
|
return state;
|
|
49
51
|
}
|
|
@@ -61,6 +63,7 @@ function emptyState(displaySpacing) {
|
|
|
61
63
|
progressive: undefined,
|
|
62
64
|
shownState: 'hidden',
|
|
63
65
|
lossy: false,
|
|
66
|
+
issues: undefined,
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
69
|
function worstLineOf(lines) {
|
|
@@ -79,6 +82,15 @@ function worstLineOf(lines) {
|
|
|
79
82
|
}
|
|
80
83
|
return worst;
|
|
81
84
|
}
|
|
85
|
+
function issuesOf(lines) {
|
|
86
|
+
const issues = new Map();
|
|
87
|
+
for (const line of lines) {
|
|
88
|
+
if (lineHasData(line)) {
|
|
89
|
+
line.issues?.forEach((issue) => issues.set(issue.message, issue));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return issues.size ? [...issues.values()] : undefined;
|
|
93
|
+
}
|
|
82
94
|
function progressiveOf(line) {
|
|
83
95
|
const { record, imageQualityStatus } = line;
|
|
84
96
|
if (record) {
|
|
@@ -101,7 +113,7 @@ function progressiveOf(line) {
|
|
|
101
113
|
return undefined;
|
|
102
114
|
}
|
|
103
115
|
function causeOf(args) {
|
|
104
|
-
const { record, imageQualityStatus, reductionCause, spatiallyReduced, standingSample, loading, lod, missingFrames, } = args;
|
|
116
|
+
const { record, imageQualityStatus, reductionCause, spatiallyReduced, standingSample, loading, lod, missingFrames, displayIssue, } = args;
|
|
105
117
|
if (loading) {
|
|
106
118
|
return 'incompleteLoad';
|
|
107
119
|
}
|
|
@@ -121,7 +133,10 @@ function causeOf(args) {
|
|
|
121
133
|
delivered >= ImageQualityStatus.SUBRESOLUTION) {
|
|
122
134
|
return 'lossyDecode';
|
|
123
135
|
}
|
|
124
|
-
|
|
136
|
+
if (standingSample && !spatial) {
|
|
137
|
+
return 'performanceTarget';
|
|
138
|
+
}
|
|
139
|
+
return displayIssue ? 'displayIssue' : undefined;
|
|
125
140
|
}
|
|
126
141
|
export function viewportFidelityStateKey(state) {
|
|
127
142
|
return JSON.stringify({
|
|
@@ -134,5 +149,6 @@ export function viewportFidelityStateKey(state) {
|
|
|
134
149
|
cause: state.cause,
|
|
135
150
|
transient: state.transient,
|
|
136
151
|
progressive: state.lossy ? state.progressive : undefined,
|
|
152
|
+
issues: state.issues,
|
|
137
153
|
});
|
|
138
154
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ImageQualityStatus from '../../../enums/ImageQualityStatus.js';
|
|
2
|
-
import type { ActorEntry, IImage, ViewportFidelityCause, VoxelGrid, VoxelQualityRecord } from '../../../types/index.js';
|
|
2
|
+
import type { ActorEntry, FidelityIssue, IImage, ViewportFidelityCause, VoxelGrid, VoxelQualityRecord } from '../../../types/index.js';
|
|
3
3
|
import { type CameraViewportLike, type FidelityDisplay } from './displaySpacingOfViewport.js';
|
|
4
4
|
import { type FidelityLine } from './fidelityIndicatorState.js';
|
|
5
5
|
type VolumeViewportLike = CameraViewportLike & {
|
|
@@ -19,6 +19,7 @@ export type BindingFidelitySource = {
|
|
|
19
19
|
imageQualityStatus?: ImageQualityStatus;
|
|
20
20
|
qualityPending?: boolean;
|
|
21
21
|
reductionCause?: ViewportFidelityCause;
|
|
22
|
+
issues?: FidelityIssue[];
|
|
22
23
|
label?: string;
|
|
23
24
|
skip?: boolean;
|
|
24
25
|
};
|
|
@@ -8,6 +8,7 @@ import { isBindingPending } from '../../GenericViewport/renderingFidelity.js';
|
|
|
8
8
|
import { gpuSettingsForRender } from '../../../utilities/gpuSettingsPresets.js';
|
|
9
9
|
import { displaySpacingForGrid, fidelityDisplayOfCamera, } from './displaySpacingOfViewport.js';
|
|
10
10
|
import { isLabelmapActorEntry } from './isLabelmapActorEntry.js';
|
|
11
|
+
import { fidelityIssuesOfImage, fidelityIssuesOfVolume, } from './fidelityIssues.js';
|
|
11
12
|
import { isReduced, reductionFactorsOf, } from './fidelityIndicatorState.js';
|
|
12
13
|
export function fidelityLinesFromBindings(display, sources) {
|
|
13
14
|
const lines = [];
|
|
@@ -21,6 +22,7 @@ export function fidelityLinesFromBindings(display, sources) {
|
|
|
21
22
|
...fidelityLineFromImageQuality(source.imageQualityStatus, source.qualityPending),
|
|
22
23
|
label: source.label ?? 'Image',
|
|
23
24
|
interactiveReduction: source.interactiveReduction,
|
|
25
|
+
issues: source.issues,
|
|
24
26
|
});
|
|
25
27
|
}
|
|
26
28
|
continue;
|
|
@@ -47,6 +49,7 @@ export function fidelityLinesFromBindings(display, sources) {
|
|
|
47
49
|
interactiveReduction: source.interactiveReduction,
|
|
48
50
|
qualityPending: source.qualityPending,
|
|
49
51
|
reductionCause: source.reductionCause,
|
|
52
|
+
issues: source.issues,
|
|
50
53
|
});
|
|
51
54
|
}
|
|
52
55
|
return lines;
|
|
@@ -105,6 +108,7 @@ export function fidelityLinesFromVolumeActors(viewport, records = new Map()) {
|
|
|
105
108
|
reductionCause: fullResolution
|
|
106
109
|
? undefined
|
|
107
110
|
: reductionCauseOf(volume, gpuSettingsForRender()),
|
|
111
|
+
issues: fidelityIssuesOfVolume(volume),
|
|
108
112
|
});
|
|
109
113
|
}
|
|
110
114
|
return lines;
|
|
@@ -128,7 +132,10 @@ export function fidelityLineFromStackImage(image) {
|
|
|
128
132
|
return [];
|
|
129
133
|
}
|
|
130
134
|
return [
|
|
131
|
-
|
|
135
|
+
{
|
|
136
|
+
...fidelityLineFromImageQuality(imageQualityStatusOf(image), image.imageQualityPending),
|
|
137
|
+
issues: fidelityIssuesOfImage(image),
|
|
138
|
+
},
|
|
132
139
|
];
|
|
133
140
|
}
|
|
134
141
|
export function imageQualityStatusOf(image) {
|
|
@@ -16,6 +16,7 @@ export function fidelityDetailsTextOf(state, lines) {
|
|
|
16
16
|
if (multi.length > 1) {
|
|
17
17
|
parts.push(multi.join(', '));
|
|
18
18
|
}
|
|
19
|
+
parts.push(...(state.issues ?? []).map((issue) => issue.message));
|
|
19
20
|
switch (state.cause) {
|
|
20
21
|
case 'incompleteLoad':
|
|
21
22
|
parts.push('Image is still loading.');
|
|
@@ -48,6 +49,9 @@ export function fidelityDetailsTextOf(state, lines) {
|
|
|
48
49
|
parts.push(...magnitudeLines(state.magnitude));
|
|
49
50
|
parts.push('Waiting will not improve the image.');
|
|
50
51
|
break;
|
|
52
|
+
case 'displayIssue':
|
|
53
|
+
parts.push('Waiting will not improve the image.');
|
|
54
|
+
break;
|
|
51
55
|
case 'memoryBudget':
|
|
52
56
|
parts.push('Image detail is reduced to fit the available memory.');
|
|
53
57
|
parts.push(...magnitudeLines(state.magnitude));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ImageQualityStatus from '../../../enums/ImageQualityStatus.js';
|
|
2
|
-
import type { Point3, ViewportFidelityCause, VoxelGrid, VoxelQualityRecord, VoxelQualityVerdict } from '../../../types/index.js';
|
|
2
|
+
import type { FidelityIssue, Point3, ViewportFidelityCause, VoxelGrid, VoxelQualityRecord, VoxelQualityVerdict } from '../../../types/index.js';
|
|
3
3
|
export type FidelityLine = {
|
|
4
4
|
label: string;
|
|
5
5
|
record?: VoxelQualityRecord;
|
|
@@ -13,6 +13,7 @@ export type FidelityLine = {
|
|
|
13
13
|
sampleDistanceLod: number;
|
|
14
14
|
sampleDistanceIdle?: number;
|
|
15
15
|
interactiveReduction?: boolean;
|
|
16
|
+
issues?: FidelityIssue[];
|
|
16
17
|
};
|
|
17
18
|
export declare function lineHasData(line: FidelityLine): boolean;
|
|
18
19
|
export type FidelityLineState = 'loading' | 'done' | 'lossy' | 'lod';
|
|
@@ -33,6 +33,9 @@ export function shownStateOf(lines) {
|
|
|
33
33
|
}
|
|
34
34
|
export function dataKindOf(line) {
|
|
35
35
|
const { record, imageQualityStatus, qualityPending } = line;
|
|
36
|
+
if (line.issues?.length) {
|
|
37
|
+
return 'reduced';
|
|
38
|
+
}
|
|
36
39
|
if (!record) {
|
|
37
40
|
return imageQualityStatus !== undefined
|
|
38
41
|
? dataKindOfImageQuality(imageQualityStatus, qualityPending)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FidelityIssue, IImage, IImageVolume } from '../../../types/index.js';
|
|
2
|
+
export declare function voiLUTFunctionIssueOf(voiLUTFunction: unknown): FidelityIssue | undefined;
|
|
3
|
+
export declare function fidelityIssuesOfImage(image: IImage | undefined): FidelityIssue[] | undefined;
|
|
4
|
+
export declare function fidelityIssuesOfVolume(volume: Pick<IImageVolume, 'metadata'> | undefined): FidelityIssue[] | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VOILUTFunctionType } from '../../../enums/index.js';
|
|
2
|
+
import { asArrayFirst } from '../../../utilities/asArray.js';
|
|
3
|
+
export function voiLUTFunctionIssueOf(voiLUTFunction) {
|
|
4
|
+
const value = asArrayFirst(voiLUTFunction);
|
|
5
|
+
if (value === undefined ||
|
|
6
|
+
value === null ||
|
|
7
|
+
value === '' ||
|
|
8
|
+
Object.values(VOILUTFunctionType).includes(value)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
code: 'unknownVOILUTFunction',
|
|
13
|
+
message: `The metadata gives an unknown VOI LUT function "${value}". The default display uses LINEAR.`,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function fidelityIssuesOfImage(image) {
|
|
17
|
+
return issuesOf(image?.fidelityIssues, voiLUTFunctionIssueOf(image?.voiLUTFunction));
|
|
18
|
+
}
|
|
19
|
+
export function fidelityIssuesOfVolume(volume) {
|
|
20
|
+
return issuesOf(undefined, voiLUTFunctionIssueOf(volume?.metadata?.VOILUTFunction));
|
|
21
|
+
}
|
|
22
|
+
function issuesOf(given, detected) {
|
|
23
|
+
const issues = [...(given ?? []), ...(detected ? [detected] : [])];
|
|
24
|
+
return issues.length ? issues : undefined;
|
|
25
|
+
}
|
|
@@ -2,6 +2,8 @@ import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransf
|
|
|
2
2
|
import { loadAndCacheImage } from '../../loaders/imageLoader.js';
|
|
3
3
|
import * as metaData from '../../metaData.js';
|
|
4
4
|
import * as windowLevel from '../../utilities/windowLevel.js';
|
|
5
|
+
import { asArrayFirst } from '../../utilities/asArray.js';
|
|
6
|
+
import { getValidVOILUTFunction } from '../../utilities/buildMetadata.js';
|
|
5
7
|
import { MetadataModules, RequestType } from '../../enums/index.js';
|
|
6
8
|
import cache from '../../cache/cache.js';
|
|
7
9
|
const PRIORITY = 0;
|
|
@@ -73,17 +75,14 @@ function getVOIFromMetadata(imageVolume) {
|
|
|
73
75
|
const imageId = imageIds[imageIdIndex];
|
|
74
76
|
const voiLutModule = metaData.get(MetadataModules.VOI_LUT, imageId);
|
|
75
77
|
if (voiLutModule && voiLutModule.windowWidth && voiLutModule.windowCenter) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
: windowCenter;
|
|
85
|
-
if (width !== 0) {
|
|
86
|
-
voi = { windowWidth: width, windowCenter: center };
|
|
78
|
+
const width = asArrayFirst(voiLutModule.windowWidth);
|
|
79
|
+
const center = asArrayFirst(voiLutModule.windowCenter);
|
|
80
|
+
if (width) {
|
|
81
|
+
voi = {
|
|
82
|
+
windowWidth: width,
|
|
83
|
+
windowCenter: center,
|
|
84
|
+
voiLUTFunction: getValidVOILUTFunction(asArrayFirst(voiLutModule.voiLUTFunction)),
|
|
85
|
+
};
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fidelityIssuesOfVolume } from './fidelityIndicator/fidelityIssues.js';
|
|
1
2
|
import { Events } from '../../enums/index.js';
|
|
2
3
|
import eventTarget from '../../eventTarget.js';
|
|
3
4
|
import { gpuSettingsForRender } from '../../utilities/gpuSettingsPresets.js';
|
|
@@ -84,6 +85,7 @@ export function refreshFidelity(rendering) {
|
|
|
84
85
|
rendering.voxelQuality = readBoundQuality(rendering.imageVolume, rendering.boundGrid);
|
|
85
86
|
}
|
|
86
87
|
rendering.qualityPending = isBindingPending(rendering.imageVolume, rendering.boundTexture);
|
|
88
|
+
rendering.fidelityIssues = fidelityIssuesOfVolume(rendering.imageVolume);
|
|
87
89
|
}
|
|
88
90
|
export function releaseStrategies(rendering) {
|
|
89
91
|
rendering.strategy?.deactivate();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FidelityIssue } from './ViewportFidelity.js';
|
|
1
2
|
import type CPUFallbackLUT from './CPUFallbackLUT.js';
|
|
2
3
|
import type { PixelDataTypedArray, PixelDataTypedArrayString } from './PixelDataTypedArray.js';
|
|
3
4
|
import type { ImageQualityStatus, VOILUTFunctionType } from '../enums/index.js';
|
|
@@ -36,6 +37,7 @@ interface IImage {
|
|
|
36
37
|
windowCenter: number[] | number;
|
|
37
38
|
windowWidth: number[] | number;
|
|
38
39
|
voiLUTFunction: VOILUTFunctionType;
|
|
40
|
+
fidelityIssues?: FidelityIssue[];
|
|
39
41
|
getPixelData: () => PixelDataTypedArray;
|
|
40
42
|
getCanvas: () => HTMLCanvasElement;
|
|
41
43
|
rows: number;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type ImageQualityStatus from '../enums/ImageQualityStatus.js';
|
|
2
2
|
import type Point3 from './Point3.js';
|
|
3
3
|
import type { VoxelDataSource, VoxelReduction } from './VoxelQualityRegistry.js';
|
|
4
|
-
export type ViewportFidelityCause = 'deviceTextureLimit' | 'memoryBudget' | 'performanceTarget' | 'incompleteLoad' | 'missingFrames' | 'lossyDecode';
|
|
4
|
+
export type ViewportFidelityCause = 'deviceTextureLimit' | 'memoryBudget' | 'performanceTarget' | 'incompleteLoad' | 'missingFrames' | 'lossyDecode' | 'displayIssue';
|
|
5
|
+
export type FidelityIssue = {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
5
9
|
export type ViewportFidelityShownState = 'hidden' | 'done' | 'loading' | 'lod' | 'lossy';
|
|
6
10
|
export type ViewportFidelityState = {
|
|
7
11
|
dataResolution?: {
|
|
@@ -25,6 +29,7 @@ export type ViewportFidelityState = {
|
|
|
25
29
|
};
|
|
26
30
|
shownState?: ViewportFidelityShownState;
|
|
27
31
|
lossy?: boolean;
|
|
32
|
+
issues?: FidelityIssue[];
|
|
28
33
|
};
|
|
29
34
|
export interface IViewportFidelity {
|
|
30
35
|
canReportFidelity(): boolean;
|
|
@@ -120,8 +120,8 @@ import type { EffectiveRenderBackend, RenderBackendConstants, RenderBackendRegis
|
|
|
120
120
|
import type { VoxelStatistic, VoxelStatisticConstants, VoxelStatisticRegistry } from './VoxelStatisticRegistry.js';
|
|
121
121
|
import type { VoxelDataSource, VoxelDataSourceConstants, VoxelDataSourceRegistry, VoxelReduction, VoxelReductionConstants, VoxelReductionRegistry } from './VoxelQualityRegistry.js';
|
|
122
122
|
import type { DeliveredRegion, VoxelQualityCause, VoxelQualityRecord, VoxelQualityRequirement, VoxelQualityVerdict, VoxelReductionDefinition } from './VoxelQuality.js';
|
|
123
|
-
import type { IViewportFidelity, ViewportFidelityCause, ViewportFidelityState, ViewportFidelityShownState } from './ViewportFidelity.js';
|
|
123
|
+
import type { IViewportFidelity, ViewportFidelityCause, ViewportFidelityState, ViewportFidelityShownState, FidelityIssue } from './ViewportFidelity.js';
|
|
124
124
|
export type * from './MetadataModuleTypes.js';
|
|
125
125
|
export type * from './InstanceTypes.js';
|
|
126
|
-
export type { Cornerstone3DConfig, LossyDownsampling, IBaseStreamingImageVolume, ICamera, ResetCameraOptions, SetAspectRatioOptions, IStackViewport, IVideoViewport, IECGViewport, IWSIViewport, IVolumeViewport, IEnabledElement, ICache, IVolume, IViewportId, IImageVolume, ImageVolumeProps, IDynamicImageVolume, IRenderingEngine, ScalingParameters, ScalingDescriptor, PTScaling, IPointsManager, PolyDataPointConfiguration, Scaling, IStreamingImageVolume, IImage, IImageData, IImageCalibration, CPUIImageData, CPUImageData, EventTypes, ImageLoaderFn, VolumeLoaderFn, IRegisterImageLoader, IStreamingVolumeProperties, IViewport, IGenericViewport, ViewportContentMode, ViewReference, DataSetOptions as ImageSetOptions, ViewPresentation, ViewPresentationSelector, ReferenceCompatibleOptions, ViewReferenceSpecifier, RenderingEngineResizeOptions, StackViewportProperties, VolumeViewportProperties, ViewportProperties, PublicViewportInput, VolumeActor, Actor, ActorEntry, ActorMapperProxy, ImageActor, ICanvasActor, IImageLoadObject, IVolumeLoadObject, IVolumeInput, VolumeInputCallback, IStackInput, StackInputCallback, ViewportPreset, Metadata, OrientationVectors, AABB2, AABB3, Point2, Point3, PointsXYZ, Point4, Mat3, Plane, ViewportInputOptions, VideoViewportProperties, WSIViewportProperties, VOIRange, VOI, DisplayArea, FlipDirection, ICachedImage, ICachedVolume, CPUFallbackEnabledElement, CPUFallbackViewport, CPUFallbackTransform, CPUFallbackColormapData, CPUFallbackViewportDisplayedArea, CPUFallbackColormapsData, CPUFallbackColormap, TransformMatrix2D, CPUFallbackLookupTable, CPUFallbackLUT, CPUFallbackRenderingTools, CustomEventType, ActorSliceRange, ImageSliceData, IGeometry, IGeometryLoadObject, ICachedGeometry, PublicContourSetData, ContourSetData, ContourData, IContourSet, IContour, PublicSurfaceData, SurfaceData, ISurface, PublicMeshData, MeshData, IMesh, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, InternalECGCamera, ECGViewportInput, ECGChannel, ECGWaveformData, ECGViewportProperties, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, LocalVolumeOptions, IVoxelManager, IVolumeVoxelManager, VoxelManagerForEachCallbackArguments, VoxelManagerForEachOptions, VoxelGrid, VoxelGridLimits, VoxelGridReduction, VoxelRepresentationId, VoxelStatistic, VoxelStatisticAccumulator, VoxelStatisticDefinition, VoxelStatisticSliceReducer, VoxelStatisticPlaneFill, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, IBaseVolumeViewport, GeometryLoaderFn, ScrollOptions, JumpToSliceOptions, Memo, HistoryMemo, VoxelManager, RLEVoxelMap, RenderingEngineModeType, VtkOffscreenMultiRenderWindow, OffscreenCanvasContainer, ViewportDataReference, ViewportType, ViewportTypeRegistry, ViewportTypeConstants, EffectiveRenderBackend, RenderBackendRegistry, RenderBackendConstants, VoxelStatisticRegistry, VoxelStatisticConstants, VoxelReduction, VoxelReductionRegistry, VoxelReductionConstants, VoxelReductionDefinition, VoxelDataSource, VoxelDataSourceRegistry, VoxelDataSourceConstants, DeliveredRegion, VoxelQualityRecord, VoxelQualityRequirement, VoxelQualityVerdict, VoxelQualityCause, IViewportFidelity, ViewportFidelityCause, ViewportFidelityState, ViewportFidelityShownState, };
|
|
126
|
+
export type { Cornerstone3DConfig, LossyDownsampling, IBaseStreamingImageVolume, ICamera, ResetCameraOptions, SetAspectRatioOptions, IStackViewport, IVideoViewport, IECGViewport, IWSIViewport, IVolumeViewport, IEnabledElement, ICache, IVolume, IViewportId, IImageVolume, ImageVolumeProps, IDynamicImageVolume, IRenderingEngine, ScalingParameters, ScalingDescriptor, PTScaling, IPointsManager, PolyDataPointConfiguration, Scaling, IStreamingImageVolume, IImage, IImageData, IImageCalibration, CPUIImageData, CPUImageData, EventTypes, ImageLoaderFn, VolumeLoaderFn, IRegisterImageLoader, IStreamingVolumeProperties, IViewport, IGenericViewport, ViewportContentMode, ViewReference, DataSetOptions as ImageSetOptions, ViewPresentation, ViewPresentationSelector, ReferenceCompatibleOptions, ViewReferenceSpecifier, RenderingEngineResizeOptions, StackViewportProperties, VolumeViewportProperties, ViewportProperties, PublicViewportInput, VolumeActor, Actor, ActorEntry, ActorMapperProxy, ImageActor, ICanvasActor, IImageLoadObject, IVolumeLoadObject, IVolumeInput, VolumeInputCallback, IStackInput, StackInputCallback, ViewportPreset, Metadata, OrientationVectors, AABB2, AABB3, Point2, Point3, PointsXYZ, Point4, Mat3, Plane, ViewportInputOptions, VideoViewportProperties, WSIViewportProperties, VOIRange, VOI, DisplayArea, FlipDirection, ICachedImage, ICachedVolume, CPUFallbackEnabledElement, CPUFallbackViewport, CPUFallbackTransform, CPUFallbackColormapData, CPUFallbackViewportDisplayedArea, CPUFallbackColormapsData, CPUFallbackColormap, TransformMatrix2D, CPUFallbackLookupTable, CPUFallbackLUT, CPUFallbackRenderingTools, CustomEventType, ActorSliceRange, ImageSliceData, IGeometry, IGeometryLoadObject, ICachedGeometry, PublicContourSetData, ContourSetData, ContourData, IContourSet, IContour, PublicSurfaceData, SurfaceData, ISurface, PublicMeshData, MeshData, IMesh, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, InternalECGCamera, ECGViewportInput, ECGChannel, ECGWaveformData, ECGViewportProperties, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, LocalVolumeOptions, IVoxelManager, IVolumeVoxelManager, VoxelManagerForEachCallbackArguments, VoxelManagerForEachOptions, VoxelGrid, VoxelGridLimits, VoxelGridReduction, VoxelRepresentationId, VoxelStatistic, VoxelStatisticAccumulator, VoxelStatisticDefinition, VoxelStatisticSliceReducer, VoxelStatisticPlaneFill, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, IBaseVolumeViewport, GeometryLoaderFn, ScrollOptions, JumpToSliceOptions, Memo, HistoryMemo, VoxelManager, RLEVoxelMap, RenderingEngineModeType, VtkOffscreenMultiRenderWindow, OffscreenCanvasContainer, ViewportDataReference, ViewportType, ViewportTypeRegistry, ViewportTypeConstants, EffectiveRenderBackend, RenderBackendRegistry, RenderBackendConstants, VoxelStatisticRegistry, VoxelStatisticConstants, VoxelReduction, VoxelReductionRegistry, VoxelReductionConstants, VoxelReductionDefinition, VoxelDataSource, VoxelDataSourceRegistry, VoxelDataSourceConstants, DeliveredRegion, VoxelQualityRecord, VoxelQualityRequirement, VoxelQualityVerdict, VoxelQualityCause, IViewportFidelity, ViewportFidelityCause, ViewportFidelityState, ViewportFidelityShownState, FidelityIssue, };
|
|
127
127
|
export { ActorRenderMode };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VOILUTFunctionType } from '../enums/index.js';
|
|
2
2
|
import { toLowHighRange } from './windowLevel.js';
|
|
3
|
+
import { getValidVOILUTFunction } from './buildMetadata.js';
|
|
3
4
|
export default function getVOIRangeFromWindowLevel(windowWidth, windowCenter, voiLUTFunction = VOILUTFunctionType.LINEAR) {
|
|
4
5
|
let center;
|
|
5
6
|
let width;
|
|
@@ -14,5 +15,5 @@ export default function getVOIRangeFromWindowLevel(windowWidth, windowCenter, vo
|
|
|
14
15
|
if (center === undefined || width === undefined) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
return toLowHighRange(width, center, voiLUTFunction);
|
|
18
|
+
return toLowHighRange(width, center, getValidVOILUTFunction(voiLUTFunction));
|
|
18
19
|
}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.19.
|
|
1
|
+
export declare const version = "5.19.7";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.19.
|
|
1
|
+
export const version = '5.19.7';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "5.19.
|
|
3
|
+
"version": "5.19.7",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -85,18 +85,18 @@
|
|
|
85
85
|
"prepublishOnly": "pnpm run build"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@cornerstonejs/utils": "5.19.
|
|
88
|
+
"@cornerstonejs/utils": "5.19.7",
|
|
89
89
|
"@kitware/vtk.js": "36.4.1",
|
|
90
90
|
"comlink": "4.4.2",
|
|
91
91
|
"gl-matrix": "3.4.3",
|
|
92
92
|
"loglevel": "1.9.2"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@cornerstonejs/metadata": "5.19.
|
|
95
|
+
"@cornerstonejs/metadata": "5.19.7"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@cornerstonejs/metadata": "5.19.
|
|
99
|
-
"@cornerstonejs/utils": "5.19.
|
|
98
|
+
"@cornerstonejs/metadata": "5.19.7",
|
|
99
|
+
"@cornerstonejs/utils": "5.19.7"
|
|
100
100
|
},
|
|
101
101
|
"contributors": [
|
|
102
102
|
{
|