@cornerstonejs/core 2.0.0-beta.21 → 2.0.0-beta.23
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/BaseVolumeViewport.d.ts +1 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js +16 -6
- package/dist/esm/RenderingEngine/RenderingEngine.d.ts +1 -2
- package/dist/esm/RenderingEngine/RenderingEngine.js +2 -1
- package/dist/esm/RenderingEngine/StackViewport.d.ts +1 -3
- package/dist/esm/RenderingEngine/StackViewport.js +15 -8
- package/dist/esm/RenderingEngine/VideoViewport.js +2 -2
- package/dist/esm/RenderingEngine/Viewport.js +4 -1
- package/dist/esm/RenderingEngine/VolumeViewport.d.ts +1 -1
- package/dist/esm/RenderingEngine/VolumeViewport.js +8 -3
- package/dist/esm/RenderingEngine/WSIViewport.js +1 -1
- package/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/renderPseudoColorImage.js +1 -1
- package/dist/esm/RenderingEngine/helpers/createVolumeActor.js +1 -1
- package/dist/esm/RenderingEngine/helpers/setDefaultVolumeVOI.js +3 -2
- package/dist/esm/RenderingEngine/helpers/volumeNewImageEventDispatcher.js +4 -4
- package/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLTexture.js +1 -1
- package/dist/esm/cache/cache.js +2 -1
- package/dist/esm/cache/classes/BaseStreamingImageVolume.d.ts +85 -0
- package/dist/esm/cache/classes/BaseStreamingImageVolume.js +339 -0
- package/dist/esm/cache/classes/ImageVolume.js +2 -1
- package/dist/esm/cache/classes/StreamingDynamicImageVolume.d.ts +52 -0
- package/dist/esm/cache/classes/StreamingDynamicImageVolume.js +81 -0
- package/dist/esm/cache/classes/StreamingImageVolume.d.ts +8 -0
- package/dist/esm/cache/classes/StreamingImageVolume.js +21 -0
- package/dist/esm/cache/index.d.ts +4 -3
- package/dist/esm/cache/index.js +4 -3
- package/dist/esm/enums/Events.d.ts +2 -1
- package/dist/esm/enums/Events.js +1 -0
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.js +8 -3
- package/dist/esm/init.js +1 -1
- package/dist/esm/loaders/ProgressiveRetrieveImages.js +4 -2
- package/dist/esm/loaders/cornerstoneStreamingDynamicImageVolumeLoader.d.ts +10 -0
- package/dist/esm/loaders/cornerstoneStreamingDynamicImageVolumeLoader.js +58 -0
- package/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.d.ts +12 -0
- package/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js +73 -0
- package/dist/esm/loaders/geometryLoader.js +1 -1
- package/dist/esm/loaders/imageLoader.js +6 -2
- package/dist/esm/loaders/volumeLoader.d.ts +1 -0
- package/dist/esm/loaders/volumeLoader.js +34 -5
- package/dist/esm/requestPool/requestPoolManager.js +1 -1
- package/dist/esm/types/CPUFallbackEnabledElement.d.ts +1 -39
- package/dist/esm/types/IImage.d.ts +37 -2
- package/dist/esm/types/ImageLoadRequests.d.ts +24 -0
- package/dist/esm/types/ImageLoadRequests.js +1 -0
- package/dist/esm/types/index.d.ts +3 -2
- package/dist/esm/utilities/VoxelManager.js +1 -1
- package/dist/esm/utilities/autoLoad.d.ts +2 -0
- package/dist/esm/utilities/autoLoad.js +28 -0
- package/dist/esm/utilities/calculateViewportsSpatialRegistration.js +3 -3
- package/dist/esm/utilities/convertVolumeToStackViewport.js +2 -1
- package/dist/esm/utilities/getClosestStackImageIndexForPoint.js +2 -2
- package/dist/esm/utilities/getDynamicVolumeInfo.d.ts +6 -0
- package/dist/esm/utilities/getDynamicVolumeInfo.js +7 -0
- package/dist/esm/utilities/getImageLegacy.js +1 -1
- package/dist/esm/utilities/getScalingParameters.js +4 -4
- package/dist/esm/utilities/getViewportImageIds.js +1 -1
- package/dist/esm/utilities/imageToWorldCoords.js +2 -2
- package/dist/esm/utilities/index.d.ts +5 -1
- package/dist/esm/utilities/index.js +6 -2
- package/dist/esm/utilities/isValidVolume.js +1 -1
- package/dist/esm/utilities/loadImageToCanvas.js +1 -1
- package/dist/esm/utilities/makeVolumeMetadata.js +5 -5
- package/dist/esm/utilities/scaleArray.d.ts +2 -0
- package/dist/esm/utilities/scaleArray.js +15 -0
- package/dist/esm/utilities/sortImageIdsAndGetSpacing.js +2 -1
- package/dist/esm/utilities/splitImageIdsBy4DTags.d.ts +5 -0
- package/dist/esm/utilities/splitImageIdsBy4DTags.js +161 -0
- package/dist/esm/utilities/worldToImageCoords.js +2 -2
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/esm/utilities/isTypedArray.d.ts +0 -1
- package/dist/esm/utilities/isTypedArray.js +0 -11
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { StreamingDynamicImageVolume } from '../cache';
|
|
2
|
+
import { generateVolumePropsFromImageIds, sortImageIdsAndGetSpacing, splitImageIdsBy4DTags, VoxelManager, } from '../utilities';
|
|
3
|
+
function cornerstoneStreamingDynamicImageVolumeLoader(volumeId, options) {
|
|
4
|
+
if (!options || !options.imageIds || !options.imageIds.length) {
|
|
5
|
+
throw new Error('ImageIds must be provided to create a 4D streaming image volume');
|
|
6
|
+
}
|
|
7
|
+
const { imageIds } = options;
|
|
8
|
+
const { splittingTag, imageIdGroups } = splitImageIdsBy4DTags(imageIds);
|
|
9
|
+
const volumeProps = generateVolumePropsFromImageIds(imageIdGroups[0], volumeId);
|
|
10
|
+
const { metadata: volumeMetadata, dimensions, spacing, direction, sizeInBytes, origin, numberOfComponents, dataType, } = volumeProps;
|
|
11
|
+
const scanAxisNormal = direction.slice(6, 9);
|
|
12
|
+
const sortedImageIdGroups = imageIdGroups.map((imageIds) => {
|
|
13
|
+
const sortedImageIds = sortImageIdsAndGetSpacing(imageIds, scanAxisNormal).sortedImageIds;
|
|
14
|
+
return sortedImageIds;
|
|
15
|
+
});
|
|
16
|
+
const sortedFlatImageIds = sortedImageIdGroups.flat();
|
|
17
|
+
const voxelManager = VoxelManager.createScalarDynamicVolumeVoxelManager({
|
|
18
|
+
dimensions,
|
|
19
|
+
imageIdGroups: sortedImageIdGroups,
|
|
20
|
+
timePoint: 0,
|
|
21
|
+
numberOfComponents,
|
|
22
|
+
});
|
|
23
|
+
let streamingImageVolume = new StreamingDynamicImageVolume({
|
|
24
|
+
volumeId,
|
|
25
|
+
metadata: volumeMetadata,
|
|
26
|
+
dimensions,
|
|
27
|
+
spacing,
|
|
28
|
+
origin,
|
|
29
|
+
direction,
|
|
30
|
+
sizeInBytes,
|
|
31
|
+
imageIds: sortedFlatImageIds,
|
|
32
|
+
imageIdGroups: sortedImageIdGroups,
|
|
33
|
+
splittingTag,
|
|
34
|
+
voxelManager,
|
|
35
|
+
numberOfComponents,
|
|
36
|
+
dataType,
|
|
37
|
+
}, {
|
|
38
|
+
imageIds: sortedFlatImageIds,
|
|
39
|
+
loadStatus: {
|
|
40
|
+
loaded: false,
|
|
41
|
+
loading: false,
|
|
42
|
+
cancelled: false,
|
|
43
|
+
cachedFrames: [],
|
|
44
|
+
callbacks: [],
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
promise: Promise.resolve(streamingImageVolume),
|
|
49
|
+
decache: () => {
|
|
50
|
+
streamingImageVolume.destroy();
|
|
51
|
+
streamingImageVolume = null;
|
|
52
|
+
},
|
|
53
|
+
cancel: () => {
|
|
54
|
+
streamingImageVolume.cancelLoading();
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export { cornerstoneStreamingDynamicImageVolumeLoader };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import StreamingImageVolume from '../cache/classes/StreamingImageVolume';
|
|
2
|
+
import type { IRetrieveConfiguration } from '../types';
|
|
3
|
+
interface IVolumeLoader {
|
|
4
|
+
promise: Promise<StreamingImageVolume>;
|
|
5
|
+
cancel: () => void;
|
|
6
|
+
decache: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare function cornerstoneStreamingImageVolumeLoader(volumeId: string, options: {
|
|
9
|
+
imageIds: string[];
|
|
10
|
+
progressiveRendering?: boolean | IRetrieveConfiguration;
|
|
11
|
+
}): IVolumeLoader;
|
|
12
|
+
export { cornerstoneStreamingImageVolumeLoader };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import StreamingImageVolume from '../cache/classes/StreamingImageVolume';
|
|
2
|
+
import { RequestType } from '../enums';
|
|
3
|
+
import imageLoadPoolManager from '../requestPool/imageLoadPoolManager';
|
|
4
|
+
import { generateVolumePropsFromImageIds } from '../utilities';
|
|
5
|
+
import { loadImage } from './imageLoader';
|
|
6
|
+
function cornerstoneStreamingImageVolumeLoader(volumeId, options) {
|
|
7
|
+
if (!options || !options.imageIds || !options.imageIds.length) {
|
|
8
|
+
throw new Error('ImageIds must be provided to create a streaming image volume');
|
|
9
|
+
}
|
|
10
|
+
async function getStreamingImageVolume() {
|
|
11
|
+
if (options.imageIds[0].split(':')[0] === 'wadouri') {
|
|
12
|
+
const [middleImageIndex, lastImageIndex] = [
|
|
13
|
+
Math.floor(options.imageIds.length / 2),
|
|
14
|
+
options.imageIds.length - 1,
|
|
15
|
+
];
|
|
16
|
+
const indexesToPrefetch = [0, middleImageIndex, lastImageIndex];
|
|
17
|
+
await Promise.all(indexesToPrefetch.map((index) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const imageId = options.imageIds[index];
|
|
20
|
+
imageLoadPoolManager.addRequest(async () => {
|
|
21
|
+
loadImage(imageId)
|
|
22
|
+
.then(() => {
|
|
23
|
+
console.log(`Prefetched imageId: ${imageId}`);
|
|
24
|
+
resolve(true);
|
|
25
|
+
})
|
|
26
|
+
.catch((err) => {
|
|
27
|
+
reject(err);
|
|
28
|
+
});
|
|
29
|
+
}, RequestType.Prefetch, { volumeId }, 1);
|
|
30
|
+
});
|
|
31
|
+
})).catch(console.error);
|
|
32
|
+
}
|
|
33
|
+
const volumeProps = generateVolumePropsFromImageIds(options.imageIds, volumeId);
|
|
34
|
+
const { dimensions, spacing, origin, direction, metadata, imageIds, dataType, numberOfComponents, } = volumeProps;
|
|
35
|
+
const streamingImageVolume = new StreamingImageVolume({
|
|
36
|
+
volumeId,
|
|
37
|
+
metadata,
|
|
38
|
+
dimensions,
|
|
39
|
+
spacing,
|
|
40
|
+
origin,
|
|
41
|
+
direction,
|
|
42
|
+
imageIds,
|
|
43
|
+
dataType,
|
|
44
|
+
numberOfComponents,
|
|
45
|
+
}, {
|
|
46
|
+
imageIds,
|
|
47
|
+
loadStatus: {
|
|
48
|
+
loaded: false,
|
|
49
|
+
loading: false,
|
|
50
|
+
cancelled: false,
|
|
51
|
+
cachedFrames: [],
|
|
52
|
+
callbacks: [],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
return streamingImageVolume;
|
|
56
|
+
}
|
|
57
|
+
const streamingImageVolumePromise = getStreamingImageVolume();
|
|
58
|
+
return {
|
|
59
|
+
promise: streamingImageVolumePromise,
|
|
60
|
+
decache: () => {
|
|
61
|
+
streamingImageVolumePromise.then((streamingImageVolume) => {
|
|
62
|
+
streamingImageVolume.destroy();
|
|
63
|
+
streamingImageVolume = null;
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
cancel: () => {
|
|
67
|
+
streamingImageVolumePromise.then((streamingImageVolume) => {
|
|
68
|
+
streamingImageVolume.cancelLoading();
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export { cornerstoneStreamingImageVolumeLoader };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@kitware/vtk.js/Rendering/Profiles/Geometry';
|
|
2
|
-
import cache from '../cache';
|
|
2
|
+
import cache from '../cache/cache';
|
|
3
3
|
import { GeometryType } from '../enums';
|
|
4
4
|
import { createContourSet } from './utils/contourSet/createContourSet';
|
|
5
5
|
import { createSurface } from './utils/surface/createSurface';
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import cache from '../cache/cache';
|
|
2
2
|
import Events from '../enums/Events';
|
|
3
3
|
import eventTarget from '../eventTarget';
|
|
4
|
-
import
|
|
4
|
+
import genericMetadataProvider from '../utilities/genericMetadataProvider';
|
|
5
|
+
import { getBufferConfiguration } from '../utilities/getBufferConfiguration';
|
|
6
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
7
|
+
import uuidv4 from '../utilities/uuidv4';
|
|
8
|
+
import VoxelManager from '../utilities/VoxelManager';
|
|
5
9
|
import imageLoadPoolManager from '../requestPool/imageLoadPoolManager';
|
|
6
|
-
import
|
|
10
|
+
import * as metaData from '../metaData';
|
|
7
11
|
const imageLoaders = {};
|
|
8
12
|
let unknownImageLoader;
|
|
9
13
|
function loadImageFromImageLoader(imageId, options) {
|
|
@@ -2,6 +2,7 @@ import '@kitware/vtk.js/Rendering/Profiles/Volume';
|
|
|
2
2
|
import type { Point3, Metadata, Mat3, IImageVolume, VolumeLoaderFn, PixelDataTypedArray, PixelDataTypedArrayString } from '../types';
|
|
3
3
|
interface VolumeLoaderOptions {
|
|
4
4
|
imageIds: string[];
|
|
5
|
+
progressiveRendering?: boolean;
|
|
5
6
|
}
|
|
6
7
|
interface DerivedVolumeOptions {
|
|
7
8
|
volumeId: string;
|
|
@@ -4,9 +4,9 @@ import cache from '../cache/cache';
|
|
|
4
4
|
import Events from '../enums/Events';
|
|
5
5
|
import eventTarget from '../eventTarget';
|
|
6
6
|
import triggerEvent from '../utilities/triggerEvent';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { createAndCacheLocalImage } from './imageLoader';
|
|
7
|
+
import uuidv4 from '../utilities/uuidv4';
|
|
8
|
+
import VoxelManager from '../utilities/VoxelManager';
|
|
9
|
+
import { createAndCacheLocalImage, createAndCacheDerivedImages, } from './imageLoader';
|
|
10
10
|
const volumeLoaders = {};
|
|
11
11
|
let unknownVolumeLoader;
|
|
12
12
|
function loadVolumeFromVolumeLoader(volumeId, options) {
|
|
@@ -68,7 +68,15 @@ export function createAndCacheDerivedVolume(referencedVolumeId, options) {
|
|
|
68
68
|
}
|
|
69
69
|
const { metadata, dimensions, spacing, origin, direction } = referencedVolume;
|
|
70
70
|
const referencedImageIds = referencedVolume.imageIds ?? [];
|
|
71
|
-
const
|
|
71
|
+
const byteLength = referencedImageIds.reduce((total, imageId) => {
|
|
72
|
+
const image = cache.getImage(imageId);
|
|
73
|
+
return total + image.sizeInBytes;
|
|
74
|
+
}, 0);
|
|
75
|
+
const isCacheable = cache.isCacheable(byteLength);
|
|
76
|
+
if (!isCacheable) {
|
|
77
|
+
throw new Error(`Cannot created derived volume: Referenced volume with id ${referencedVolumeId} does not exist.`);
|
|
78
|
+
}
|
|
79
|
+
const derivedImages = createAndCacheDerivedImages(referencedImageIds, {
|
|
72
80
|
targetBufferType: options.targetBufferType,
|
|
73
81
|
});
|
|
74
82
|
const dataType = derivedImages[0].dataType;
|
|
@@ -114,6 +122,25 @@ export function createLocalVolume(volumeId, options = {}) {
|
|
|
114
122
|
const dataType = scalarData
|
|
115
123
|
? scalarData.constructor.name
|
|
116
124
|
: targetBufferType;
|
|
125
|
+
const totalNumberOfVoxels = sliceLength * dimensions[2];
|
|
126
|
+
let byteLength;
|
|
127
|
+
switch (dataType) {
|
|
128
|
+
case 'Uint8Array':
|
|
129
|
+
case 'Int8Array':
|
|
130
|
+
byteLength = totalNumberOfVoxels;
|
|
131
|
+
break;
|
|
132
|
+
case 'Uint16Array':
|
|
133
|
+
case 'Int16Array':
|
|
134
|
+
byteLength = totalNumberOfVoxels * 2;
|
|
135
|
+
break;
|
|
136
|
+
case 'Float32Array':
|
|
137
|
+
byteLength = totalNumberOfVoxels * 4;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
const isCacheable = cache.isCacheable(byteLength);
|
|
141
|
+
if (!isCacheable) {
|
|
142
|
+
throw new Error(`Cannot created derived volume: Volume with id ${volumeId} is not cacheable.`);
|
|
143
|
+
}
|
|
117
144
|
const imageIds = [];
|
|
118
145
|
const derivedImages = [];
|
|
119
146
|
for (let i = 0; i < dimensions[2]; i++) {
|
|
@@ -146,7 +173,9 @@ export function createLocalVolume(volumeId, options = {}) {
|
|
|
146
173
|
numberOfComponents: 1,
|
|
147
174
|
});
|
|
148
175
|
imageVolume.voxelManager = voxelManager;
|
|
149
|
-
|
|
176
|
+
if (!preventCache) {
|
|
177
|
+
cache.putVolumeSync(volumeId, imageVolume);
|
|
178
|
+
}
|
|
150
179
|
return imageVolume;
|
|
151
180
|
}
|
|
152
181
|
export function registerVolumeLoader(scheme, volumeLoader) {
|
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type Point3 from './Point3';
|
|
3
|
-
import type Mat3 from './Mat3';
|
|
4
|
-
import type IImage from './IImage';
|
|
5
|
-
import type CPUFallbackViewport from './CPUFallbackViewport';
|
|
6
|
-
import type CPUFallbackTransform from './CPUFallbackTransform';
|
|
7
|
-
import type CPUFallbackColormap from './CPUFallbackColormap';
|
|
8
|
-
import type CPUFallbackRenderingTools from './CPUFallbackRenderingTools';
|
|
9
|
-
import type { ImagePlaneModule } from './ImagePlaneModule';
|
|
10
|
-
import type { ImagePixelModule } from './ImagePixelModule';
|
|
11
|
-
import type RGB from './RGB';
|
|
12
|
-
import type { IVoxelManager } from './IVoxelManager';
|
|
13
|
-
interface CPUFallbackEnabledElement {
|
|
14
|
-
scale?: number;
|
|
15
|
-
pan?: Point2;
|
|
16
|
-
zoom?: number;
|
|
17
|
-
rotation?: number;
|
|
18
|
-
image?: IImage;
|
|
19
|
-
canvas?: HTMLCanvasElement;
|
|
20
|
-
viewport?: CPUFallbackViewport;
|
|
21
|
-
colormap?: CPUFallbackColormap;
|
|
22
|
-
options?: {
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
colormap?: CPUFallbackColormap;
|
|
25
|
-
};
|
|
26
|
-
renderingTools?: CPUFallbackRenderingTools;
|
|
27
|
-
transform?: CPUFallbackTransform;
|
|
28
|
-
invalid?: boolean;
|
|
29
|
-
needsRedraw?: boolean;
|
|
30
|
-
metadata?: {
|
|
31
|
-
direction?: Mat3;
|
|
32
|
-
dimensions?: Point3;
|
|
33
|
-
spacing?: Point3;
|
|
34
|
-
origin?: Point3;
|
|
35
|
-
imagePlaneModule?: ImagePlaneModule;
|
|
36
|
-
imagePixelModule?: ImagePixelModule;
|
|
37
|
-
};
|
|
38
|
-
voxelManager?: IVoxelManager<number> | IVoxelManager<RGB>;
|
|
39
|
-
}
|
|
1
|
+
import type { CPUFallbackEnabledElement } from './IImage';
|
|
40
2
|
export type { CPUFallbackEnabledElement as default };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type CPUFallbackLUT from './CPUFallbackLUT';
|
|
2
|
-
import type CPUFallbackColormap from './CPUFallbackColormap';
|
|
3
|
-
import type CPUFallbackEnabledElement from './CPUFallbackEnabledElement';
|
|
4
2
|
import type { PixelDataTypedArray, PixelDataTypedArrayString } from './PixelDataTypedArray';
|
|
5
3
|
import type { ImageQualityStatus } from '../enums';
|
|
6
4
|
import type IImageCalibration from './IImageCalibration';
|
|
7
5
|
import type RGB from './RGB';
|
|
8
6
|
import type IImageFrame from './IImageFrame';
|
|
7
|
+
import type Point2 from './Point2';
|
|
8
|
+
import type Point3 from './Point3';
|
|
9
|
+
import type Mat3 from './Mat3';
|
|
10
|
+
import type CPUFallbackViewport from './CPUFallbackViewport';
|
|
11
|
+
import type CPUFallbackTransform from './CPUFallbackTransform';
|
|
12
|
+
import type CPUFallbackColormap from './CPUFallbackColormap';
|
|
13
|
+
import type CPUFallbackRenderingTools from './CPUFallbackRenderingTools';
|
|
14
|
+
import type { ImagePlaneModule } from './ImagePlaneModule';
|
|
15
|
+
import type { ImagePixelModule } from './ImagePixelModule';
|
|
9
16
|
import type { IVoxelManager } from './IVoxelManager';
|
|
10
17
|
interface IImage {
|
|
11
18
|
imageId: string;
|
|
@@ -85,4 +92,32 @@ interface IImage {
|
|
|
85
92
|
offset: number;
|
|
86
93
|
};
|
|
87
94
|
}
|
|
95
|
+
interface CPUFallbackEnabledElement {
|
|
96
|
+
scale?: number;
|
|
97
|
+
pan?: Point2;
|
|
98
|
+
zoom?: number;
|
|
99
|
+
rotation?: number;
|
|
100
|
+
image?: IImage;
|
|
101
|
+
canvas?: HTMLCanvasElement;
|
|
102
|
+
viewport?: CPUFallbackViewport;
|
|
103
|
+
colormap?: CPUFallbackColormap;
|
|
104
|
+
options?: {
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
colormap?: CPUFallbackColormap;
|
|
107
|
+
};
|
|
108
|
+
renderingTools?: CPUFallbackRenderingTools;
|
|
109
|
+
transform?: CPUFallbackTransform;
|
|
110
|
+
invalid?: boolean;
|
|
111
|
+
needsRedraw?: boolean;
|
|
112
|
+
metadata?: {
|
|
113
|
+
direction?: Mat3;
|
|
114
|
+
dimensions?: Point3;
|
|
115
|
+
spacing?: Point3;
|
|
116
|
+
origin?: Point3;
|
|
117
|
+
imagePlaneModule?: ImagePlaneModule;
|
|
118
|
+
imagePixelModule?: ImagePixelModule;
|
|
119
|
+
};
|
|
120
|
+
voxelManager?: IVoxelManager<number> | IVoxelManager<RGB>;
|
|
121
|
+
}
|
|
88
122
|
export type { IImage as default };
|
|
123
|
+
export type { CPUFallbackEnabledElement };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RequestType } from '../enums';
|
|
2
|
+
import type { ScalingParameters } from './ScalingParameters';
|
|
3
|
+
export default interface ImageLoadRequests {
|
|
4
|
+
callLoadImage: (imageId: string, imageIdIndex: number, options: unknown) => Promise<void>;
|
|
5
|
+
imageId: string;
|
|
6
|
+
imageIdIndex: number;
|
|
7
|
+
options: {
|
|
8
|
+
targetBuffer: {
|
|
9
|
+
type: string;
|
|
10
|
+
rows: number;
|
|
11
|
+
columns: number;
|
|
12
|
+
};
|
|
13
|
+
preScale: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
scalingParameters: ScalingParameters;
|
|
16
|
+
};
|
|
17
|
+
transferPixelData: boolean;
|
|
18
|
+
};
|
|
19
|
+
priority: number;
|
|
20
|
+
requestType: RequestType;
|
|
21
|
+
additionalDetails: {
|
|
22
|
+
volumeId: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,7 @@ import type IRegisterImageLoader from './IRegisterImageLoader';
|
|
|
13
13
|
import type IStreamingVolumeProperties from './IStreamingVolumeProperties';
|
|
14
14
|
import type CustomEventType from './CustomEventType';
|
|
15
15
|
import type { LocalVolumeOptions } from './../loaders/volumeLoader';
|
|
16
|
-
import type { IViewport, PublicViewportInput, ViewReferenceSpecifier, DataSetOptions, ReferenceCompatibleOptions, ViewReference, ViewPresentation, ViewPresentationSelector } from './IViewport';
|
|
16
|
+
import type { IViewport, PublicViewportInput, ViewReferenceSpecifier, DataSetOptions, ReferenceCompatibleOptions, ViewReference, ViewPresentation, ViewPresentationSelector, ViewportInput } from './IViewport';
|
|
17
17
|
import type { VolumeActor, Actor, ActorEntry, ImageActor, ICanvasActor } from './IActor';
|
|
18
18
|
import type { IImageLoadObject, IVolumeLoadObject, IGeometryLoadObject } from './ILoadObject';
|
|
19
19
|
import type Metadata from './Metadata';
|
|
@@ -92,4 +92,5 @@ import type IImageFrame from './IImageFrame';
|
|
|
92
92
|
import type { DicomDateObject, DicomTimeObject, GeneralSeriesModuleMetadata, ImagePlaneModuleMetadata, SopCommonModuleMetadata, ImagePixelModuleMetadata, PatientStudyModuleMetadata, TransferSyntaxMetadata } from './MetadataModuleTypes';
|
|
93
93
|
import type { IVoxelManager } from './IVoxelManager';
|
|
94
94
|
import type { IRLEVoxelMap, RLERun } from './IRLEVoxelMap';
|
|
95
|
-
|
|
95
|
+
import type ImageLoadRequests from './ImageLoadRequests';
|
|
96
|
+
export type { Cornerstone3DConfig, ICamera, IStackViewport, IVideoViewport, IWSIViewport, IVolumeViewport, IEnabledElement, ICache, IVolume, IViewportId, IImageVolume, ImageVolumeProps, IDynamicImageVolume, IRenderingEngine, ScalingParameters, PTScaling, IPointsManager, PolyDataPointConfiguration, Scaling, IStreamingImageVolume, IImage, IImageData, IImageCalibration, CPUIImageData, CPUImageData, EventTypes, ImageLoaderFn, VolumeLoaderFn, IRegisterImageLoader, IStreamingVolumeProperties, IViewport, ViewReference, DataSetOptions as ImageSetOptions, ViewPresentation, ViewPresentationSelector, ReferenceCompatibleOptions, ViewReferenceSpecifier, StackViewportProperties, VolumeViewportProperties, ViewportProperties, PublicViewportInput, VolumeActor, Actor, ActorEntry, 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, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, WSIViewportInput, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, DicomDateObject, DicomTimeObject, GeneralSeriesModuleMetadata, ImagePlaneModuleMetadata, SopCommonModuleMetadata, ImagePixelModuleMetadata, PatientStudyModuleMetadata, TransferSyntaxMetadata, LocalVolumeOptions, IVoxelManager, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getRenderingEngines } from '../RenderingEngine/getRenderingEngine';
|
|
2
|
+
import getViewportsWithVolumeId from './getViewportsWithVolumeId';
|
|
3
|
+
const autoLoad = (volumeId) => {
|
|
4
|
+
const renderingEngineAndViewportIds = getRenderingEngineAndViewportsContainingVolume(volumeId);
|
|
5
|
+
if (!renderingEngineAndViewportIds?.length) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
renderingEngineAndViewportIds.forEach(({ renderingEngine, viewportIds }) => {
|
|
9
|
+
if (!renderingEngine.hasBeenDestroyed) {
|
|
10
|
+
renderingEngine.renderViewports(viewportIds);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
function getRenderingEngineAndViewportsContainingVolume(volumeId) {
|
|
15
|
+
const renderingEnginesArray = getRenderingEngines();
|
|
16
|
+
const renderingEngineAndViewportIds = [];
|
|
17
|
+
renderingEnginesArray.forEach((renderingEngine) => {
|
|
18
|
+
const viewports = getViewportsWithVolumeId(volumeId, renderingEngine.id);
|
|
19
|
+
if (viewports.length) {
|
|
20
|
+
renderingEngineAndViewportIds.push({
|
|
21
|
+
renderingEngine,
|
|
22
|
+
viewportIds: viewports.map((viewport) => viewport.id),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return renderingEngineAndViewportIds;
|
|
27
|
+
}
|
|
28
|
+
export default autoLoad;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { vec3, mat4 } from 'gl-matrix';
|
|
2
2
|
import spatialRegistrationMetadataProvider from './spatialRegistrationMetadataProvider';
|
|
3
|
-
import {
|
|
3
|
+
import { get } from '../metaData';
|
|
4
4
|
const ALLOWED_DELTA = 0.05;
|
|
5
5
|
function calculateViewportsSpatialRegistration(viewport1, viewport2) {
|
|
6
6
|
const imageId1 = viewport1.getSliceIndex();
|
|
7
7
|
const imageId2 = viewport2.getSliceIndex();
|
|
8
|
-
const imagePlaneModule1 =
|
|
9
|
-
const imagePlaneModule2 =
|
|
8
|
+
const imagePlaneModule1 = get('imagePlaneModule', imageId1.toString());
|
|
9
|
+
const imagePlaneModule2 = get('imagePlaneModule', imageId2.toString());
|
|
10
10
|
if (!imagePlaneModule1 || !imagePlaneModule2) {
|
|
11
11
|
console.log('Viewport spatial registration requires image plane module');
|
|
12
12
|
return;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import cache
|
|
1
|
+
import cache from '../cache/cache';
|
|
2
|
+
import { ImageVolume } from '../cache/classes/ImageVolume';
|
|
2
3
|
import { ViewportType } from '../enums';
|
|
3
4
|
async function convertVolumeToStackViewport({ viewport, options, }) {
|
|
4
5
|
const volumeViewport = viewport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vec3 } from 'gl-matrix';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import * as planar from './planar';
|
|
3
|
+
import * as metaData from '../metaData';
|
|
4
4
|
export default function getClosestStackImageIndexForPoint(point, viewport) {
|
|
5
5
|
const minimalDistance = calculateMinimalDistanceForStackViewport(point, viewport);
|
|
6
6
|
return minimalDistance ? minimalDistance.index : null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import splitImageIdsBy4DTags from './splitImageIdsBy4DTags';
|
|
2
|
+
function getDynamicVolumeInfo(imageIds) {
|
|
3
|
+
const { imageIdGroups: timePoints, splittingTag } = splitImageIdsBy4DTags(imageIds);
|
|
4
|
+
const isDynamicVolume = timePoints.length > 1;
|
|
5
|
+
return { isDynamicVolume, timePoints, splittingTag };
|
|
6
|
+
}
|
|
7
|
+
export default getDynamicVolumeInfo;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as metaData from '../metaData';
|
|
2
2
|
export default function getScalingParameters(imageId) {
|
|
3
|
-
const modalityLutModule =
|
|
4
|
-
const generalSeriesModule =
|
|
3
|
+
const modalityLutModule = metaData.get('modalityLutModule', imageId) || {};
|
|
4
|
+
const generalSeriesModule = metaData.get('generalSeriesModule', imageId) || {};
|
|
5
5
|
const { modality } = generalSeriesModule;
|
|
6
6
|
const scalingParameters = {
|
|
7
7
|
rescaleSlope: modalityLutModule.rescaleSlope || 1,
|
|
8
8
|
rescaleIntercept: modalityLutModule.rescaleIntercept ?? 0,
|
|
9
9
|
modality,
|
|
10
10
|
};
|
|
11
|
-
const suvFactor =
|
|
11
|
+
const suvFactor = metaData.get('scalingModule', imageId) || {};
|
|
12
12
|
return {
|
|
13
13
|
...scalingParameters,
|
|
14
14
|
...(modality === 'PT' && {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { vec3 } from 'gl-matrix';
|
|
2
|
-
import {
|
|
2
|
+
import { get } from '../metaData';
|
|
3
3
|
export default function imageToWorldCoords(imageId, imageCoords) {
|
|
4
|
-
const imagePlaneModule =
|
|
4
|
+
const imagePlaneModule = get('imagePlaneModule', imageId);
|
|
5
5
|
if (!imagePlaneModule) {
|
|
6
6
|
throw new Error(`No imagePlaneModule found for imageId: ${imageId}`);
|
|
7
7
|
}
|
|
@@ -73,5 +73,9 @@ import * as colormap from './colormap';
|
|
|
73
73
|
import * as transferFunctionUtils from './transferFunctionUtils';
|
|
74
74
|
import * as color from './color';
|
|
75
75
|
import type { IViewport } from '../types/IViewport';
|
|
76
|
+
import getDynamicVolumeInfo from './getDynamicVolumeInfo';
|
|
77
|
+
import autoLoad from './autoLoad';
|
|
78
|
+
import scaleArray from './scaleArray';
|
|
79
|
+
import splitImageIdsBy4DTags from './splitImageIdsBy4DTags';
|
|
76
80
|
declare const getViewportModality: (viewport: IViewport, volumeId?: string) => string;
|
|
77
|
-
export { eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, planar, getMinMax, getRuntimeId, isEqual, isEqualAbs, isEqualNegative, isOpposite, getViewportModality, windowLevel, convertToGrayscale, getClosestImageId, getSpacingInNormalDirection, getTargetVolumeAndSpacingInNormalDir, getVolumeActorCorners, indexWithinDimensions, getVolumeViewportsContainingSameVolumes, getViewportsWithVolumeId, transformWorldToIndex, transformIndexToWorld, loadImageToCanvas, renderToCanvasCPU, renderToCanvasGPU, worldToImageCoords, imageToWorldCoords, getVolumeSliceRangeInfo, getVolumeViewportScrollInfo, getSliceRange, snapFocalPointToSlice, getImageSliceDataForVolumeViewport, isImageActor, isPTPrescaledWithSUV, actorIsA, getViewportsWithImageURI, getClosestStackImageIndexForPoint, getCurrentVolumeViewportSlice, calculateViewportsSpatialRegistration, spatialRegistrationMetadataProvider, getViewportImageCornersInWorld, hasNaNValues, applyPreset, deepMerge, PointsManager, getScalingParameters, colormap, getImageLegacy, ProgressiveIterator, decimate, imageRetrieveMetadataProvider, transferFunctionUtils, updateVTKImageDataWithCornerstoneImage, sortImageIdsAndGetSpacing, makeVolumeMetadata, isValidVolume, genericMetadataProvider, isVideoTransferSyntax, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, };
|
|
81
|
+
export { eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, planar, getMinMax, getRuntimeId, isEqual, isEqualAbs, isEqualNegative, isOpposite, getViewportModality, windowLevel, convertToGrayscale, getClosestImageId, getSpacingInNormalDirection, getTargetVolumeAndSpacingInNormalDir, getVolumeActorCorners, indexWithinDimensions, getVolumeViewportsContainingSameVolumes, getViewportsWithVolumeId, transformWorldToIndex, transformIndexToWorld, loadImageToCanvas, renderToCanvasCPU, renderToCanvasGPU, worldToImageCoords, imageToWorldCoords, getVolumeSliceRangeInfo, getVolumeViewportScrollInfo, getSliceRange, snapFocalPointToSlice, getImageSliceDataForVolumeViewport, isImageActor, isPTPrescaledWithSUV, actorIsA, getViewportsWithImageURI, getClosestStackImageIndexForPoint, getCurrentVolumeViewportSlice, calculateViewportsSpatialRegistration, spatialRegistrationMetadataProvider, getViewportImageCornersInWorld, hasNaNValues, applyPreset, deepMerge, PointsManager, getScalingParameters, colormap, getImageLegacy, ProgressiveIterator, decimate, imageRetrieveMetadataProvider, transferFunctionUtils, updateVTKImageDataWithCornerstoneImage, sortImageIdsAndGetSpacing, makeVolumeMetadata, isValidVolume, genericMetadataProvider, isVideoTransferSyntax, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, splitImageIdsBy4DTags, };
|
|
@@ -73,6 +73,10 @@ import * as colormap from './colormap';
|
|
|
73
73
|
import * as transferFunctionUtils from './transferFunctionUtils';
|
|
74
74
|
import * as color from './color';
|
|
75
75
|
import { _getViewportModality } from './getViewportModality';
|
|
76
|
-
import cache from '../cache';
|
|
76
|
+
import cache from '../cache/cache';
|
|
77
|
+
import getDynamicVolumeInfo from './getDynamicVolumeInfo';
|
|
78
|
+
import autoLoad from './autoLoad';
|
|
79
|
+
import scaleArray from './scaleArray';
|
|
80
|
+
import splitImageIdsBy4DTags from './splitImageIdsBy4DTags';
|
|
77
81
|
const getViewportModality = (viewport, volumeId) => _getViewportModality(viewport, volumeId, cache.getVolume);
|
|
78
|
-
export { eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, planar, getMinMax, getRuntimeId, isEqual, isEqualAbs, isEqualNegative, isOpposite, getViewportModality, windowLevel, convertToGrayscale, getClosestImageId, getSpacingInNormalDirection, getTargetVolumeAndSpacingInNormalDir, getVolumeActorCorners, indexWithinDimensions, getVolumeViewportsContainingSameVolumes, getViewportsWithVolumeId, transformWorldToIndex, transformIndexToWorld, loadImageToCanvas, renderToCanvasCPU, renderToCanvasGPU, worldToImageCoords, imageToWorldCoords, getVolumeSliceRangeInfo, getVolumeViewportScrollInfo, getSliceRange, snapFocalPointToSlice, getImageSliceDataForVolumeViewport, isImageActor, isPTPrescaledWithSUV, actorIsA, getViewportsWithImageURI, getClosestStackImageIndexForPoint, getCurrentVolumeViewportSlice, calculateViewportsSpatialRegistration, spatialRegistrationMetadataProvider, getViewportImageCornersInWorld, hasNaNValues, applyPreset, deepMerge, PointsManager, getScalingParameters, colormap, getImageLegacy, ProgressiveIterator, decimate, imageRetrieveMetadataProvider, transferFunctionUtils, updateVTKImageDataWithCornerstoneImage, sortImageIdsAndGetSpacing, makeVolumeMetadata, isValidVolume, genericMetadataProvider, isVideoTransferSyntax, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, };
|
|
82
|
+
export { eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, planar, getMinMax, getRuntimeId, isEqual, isEqualAbs, isEqualNegative, isOpposite, getViewportModality, windowLevel, convertToGrayscale, getClosestImageId, getSpacingInNormalDirection, getTargetVolumeAndSpacingInNormalDir, getVolumeActorCorners, indexWithinDimensions, getVolumeViewportsContainingSameVolumes, getViewportsWithVolumeId, transformWorldToIndex, transformIndexToWorld, loadImageToCanvas, renderToCanvasCPU, renderToCanvasGPU, worldToImageCoords, imageToWorldCoords, getVolumeSliceRangeInfo, getVolumeViewportScrollInfo, getSliceRange, snapFocalPointToSlice, getImageSliceDataForVolumeViewport, isImageActor, isPTPrescaledWithSUV, actorIsA, getViewportsWithImageURI, getClosestStackImageIndexForPoint, getCurrentVolumeViewportSlice, calculateViewportsSpatialRegistration, spatialRegistrationMetadataProvider, getViewportImageCornersInWorld, hasNaNValues, applyPreset, deepMerge, PointsManager, getScalingParameters, colormap, getImageLegacy, ProgressiveIterator, decimate, imageRetrieveMetadataProvider, transferFunctionUtils, updateVTKImageDataWithCornerstoneImage, sortImageIdsAndGetSpacing, makeVolumeMetadata, isValidVolume, genericMetadataProvider, isVideoTransferSyntax, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, splitImageIdsBy4DTags, };
|
|
@@ -5,7 +5,7 @@ import imageLoadPoolManager from '../requestPool/imageLoadPoolManager';
|
|
|
5
5
|
import renderToCanvasGPU from './renderToCanvasGPU';
|
|
6
6
|
import renderToCanvasCPU from './renderToCanvasCPU';
|
|
7
7
|
import { getConfiguration } from '../init';
|
|
8
|
-
import cache from '../cache';
|
|
8
|
+
import cache from '../cache/cache';
|
|
9
9
|
export default function loadImageToCanvas(options) {
|
|
10
10
|
const { canvas, imageId, viewReference, requestType = RequestType.Thumbnail, priority = -5, renderingEngineId = '_thumbnails', useCPURendering = false, thumbnail = false, imageAspect = false, viewportOptions: baseViewportOptions, } = options;
|
|
11
11
|
const volumeId = viewReference?.volumeId;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get } from '../metaData';
|
|
2
2
|
export default function makeVolumeMetadata(imageIds) {
|
|
3
3
|
const imageId0 = imageIds[0];
|
|
4
|
-
const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel, } =
|
|
4
|
+
const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel, } = get('imagePixelModule', imageId0);
|
|
5
5
|
const voiLut = [];
|
|
6
|
-
const voiLutModule =
|
|
6
|
+
const voiLutModule = get('voiLutModule', imageId0);
|
|
7
7
|
let voiLUTFunction;
|
|
8
8
|
if (voiLutModule) {
|
|
9
9
|
const { windowWidth, windowCenter } = voiLutModule;
|
|
@@ -29,8 +29,8 @@ export default function makeVolumeMetadata(imageIds) {
|
|
|
29
29
|
windowCenter: undefined,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
const { modality, seriesInstanceUID } =
|
|
33
|
-
const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, } =
|
|
32
|
+
const { modality, seriesInstanceUID } = get('generalSeriesModule', imageId0);
|
|
33
|
+
const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, } = get('imagePlaneModule', imageId0);
|
|
34
34
|
return {
|
|
35
35
|
BitsAllocated: bitsAllocated,
|
|
36
36
|
BitsStored: bitsStored,
|