@cornerstonejs/core 3.5.3 → 3.6.0
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/StackViewport.d.ts +0 -2
- package/dist/esm/RenderingEngine/StackViewport.js +21 -93
- package/dist/esm/types/ImagePixelModule.d.ts +1 -1
- package/dist/esm/types/ImagePlaneModule.d.ts +3 -0
- package/dist/esm/utilities/buildMetadata.d.ts +34 -0
- package/dist/esm/utilities/buildMetadata.js +82 -0
- package/dist/esm/utilities/getImageDataMetadata.d.ts +20 -0
- package/dist/esm/utilities/getImageDataMetadata.js +51 -0
- package/dist/esm/utilities/index.d.ts +3 -1
- package/dist/esm/utilities/index.js +3 -1
- package/dist/esm/utilities/isValidVolume.js +4 -1
- package/package.json +2 -2
|
@@ -86,7 +86,6 @@ declare class StackViewport extends Viewport {
|
|
|
86
86
|
getCornerstoneImage: () => IImage;
|
|
87
87
|
private createActorMapper;
|
|
88
88
|
getNumberOfSlices: () => number;
|
|
89
|
-
private buildMetadata;
|
|
90
89
|
private calibrateIfNecessary;
|
|
91
90
|
setDefaultProperties(ViewportProperties: StackViewportProperties, imageId?: string): void;
|
|
92
91
|
clearDefaultProperties(imageId?: string): void;
|
|
@@ -120,7 +119,6 @@ declare class StackViewport extends Viewport {
|
|
|
120
119
|
private getTransferFunction;
|
|
121
120
|
private setVOIGPU;
|
|
122
121
|
private _addScalingToViewport;
|
|
123
|
-
private _getNumCompsFromPhotometricInterpretation;
|
|
124
122
|
getImageDataMetadata(image: IImage): ImageDataMetaData;
|
|
125
123
|
private matchImagesForOverlay;
|
|
126
124
|
getImagePlaneReferenceData(sliceIndex?: number): ViewReference;
|
|
@@ -8,6 +8,7 @@ import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice';
|
|
|
8
8
|
import { mat4, vec2, vec3 } from 'gl-matrix';
|
|
9
9
|
import eventTarget from '../eventTarget';
|
|
10
10
|
import * as metaData from '../metaData';
|
|
11
|
+
import { getImageDataMetadata as getImageDataMetadataUtil } from '../utilities/getImageDataMetadata';
|
|
11
12
|
import { coreLog } from '../utilities/logger';
|
|
12
13
|
import { actorIsA, isImageActor } from '../utilities/actorCheck';
|
|
13
14
|
import * as colormapUtils from '../utilities/colormap';
|
|
@@ -23,6 +24,7 @@ import imageRetrieveMetadataProvider from '../utilities/imageRetrieveMetadataPro
|
|
|
23
24
|
import imageIdToURI from '../utilities/imageIdToURI';
|
|
24
25
|
import Viewport from './Viewport';
|
|
25
26
|
import drawImageSync from './helpers/cpuFallback/drawImageSync';
|
|
27
|
+
import { getImagePlaneModule } from '../utilities/buildMetadata';
|
|
26
28
|
import { Events, InterpolationType, MetadataModules, RequestType, VOILUTFunctionType, ViewportStatus, } from '../enums';
|
|
27
29
|
import { loadAndCacheImage } from '../loaders/imageLoader';
|
|
28
30
|
import imageLoadPoolManager from '../requestPool/imageLoadPoolManager';
|
|
@@ -519,40 +521,6 @@ class StackViewport extends Viewport {
|
|
|
519
521
|
voxelManager: csImage?.voxelManager,
|
|
520
522
|
};
|
|
521
523
|
}
|
|
522
|
-
buildMetadata(image) {
|
|
523
|
-
const imageId = image.imageId;
|
|
524
|
-
const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel, } = metaData.get('imagePixelModule', imageId);
|
|
525
|
-
const { windowWidth, windowCenter, voiLUTFunction } = image;
|
|
526
|
-
const { modality } = metaData.get('generalSeriesModule', imageId);
|
|
527
|
-
const imageIdScalingFactor = metaData.get('scalingModule', imageId);
|
|
528
|
-
const calibration = metaData.get(MetadataModules.CALIBRATION, imageId);
|
|
529
|
-
if (modality === 'PT' && imageIdScalingFactor) {
|
|
530
|
-
this._addScalingToViewport(imageIdScalingFactor);
|
|
531
|
-
}
|
|
532
|
-
this.modality = modality;
|
|
533
|
-
const voiLUTFunctionEnum = this._getValidVOILUTFunction(voiLUTFunction);
|
|
534
|
-
this.VOILUTFunction = voiLUTFunctionEnum;
|
|
535
|
-
this.calibration = calibration;
|
|
536
|
-
let imagePlaneModule = this._getImagePlaneModule(imageId);
|
|
537
|
-
if (!this.useCPURendering) {
|
|
538
|
-
imagePlaneModule = this.calibrateIfNecessary(imageId, imagePlaneModule);
|
|
539
|
-
}
|
|
540
|
-
return {
|
|
541
|
-
imagePlaneModule,
|
|
542
|
-
imagePixelModule: {
|
|
543
|
-
bitsAllocated,
|
|
544
|
-
bitsStored,
|
|
545
|
-
samplesPerPixel,
|
|
546
|
-
highBit,
|
|
547
|
-
photometricInterpretation,
|
|
548
|
-
pixelRepresentation,
|
|
549
|
-
windowWidth,
|
|
550
|
-
windowCenter,
|
|
551
|
-
modality,
|
|
552
|
-
voiLUTFunction: voiLUTFunctionEnum,
|
|
553
|
-
},
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
524
|
calibrateIfNecessary(imageId, imagePlaneModule) {
|
|
557
525
|
const calibration = metaData.get('calibratedPixelSpacing', imageId);
|
|
558
526
|
const isUpdated = this.calibration !== calibration;
|
|
@@ -1015,46 +983,29 @@ class StackViewport extends Viewport {
|
|
|
1015
983
|
}
|
|
1016
984
|
this.scaling.PT = ptScaling;
|
|
1017
985
|
}
|
|
1018
|
-
_getNumCompsFromPhotometricInterpretation(photometricInterpretation) {
|
|
1019
|
-
let numberOfComponents = 1;
|
|
1020
|
-
if (photometricInterpretation === 'RGB' ||
|
|
1021
|
-
photometricInterpretation.includes('YBR') ||
|
|
1022
|
-
photometricInterpretation === 'PALETTE COLOR') {
|
|
1023
|
-
numberOfComponents = 3;
|
|
1024
|
-
}
|
|
1025
|
-
return numberOfComponents;
|
|
1026
|
-
}
|
|
1027
986
|
getImageDataMetadata(image) {
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
let
|
|
1039
|
-
if (
|
|
1040
|
-
|
|
987
|
+
const imageId = image.imageId;
|
|
988
|
+
const props = getImageDataMetadataUtil(image);
|
|
989
|
+
const { numberOfComponents, origin, direction, dimensions, spacing, numVoxels, imagePixelModule, voiLUTFunction, modality, scalingFactor, calibration, } = props;
|
|
990
|
+
if (modality === 'PT' && scalingFactor) {
|
|
991
|
+
this._addScalingToViewport(scalingFactor);
|
|
992
|
+
}
|
|
993
|
+
this.modality = modality;
|
|
994
|
+
const voiLUTFunctionEnum = this._getValidVOILUTFunction(voiLUTFunction);
|
|
995
|
+
this.VOILUTFunction = voiLUTFunctionEnum;
|
|
996
|
+
this.calibration = calibration;
|
|
997
|
+
let imagePlaneModule = this._getImagePlaneModule(imageId);
|
|
998
|
+
if (!this.useCPURendering) {
|
|
999
|
+
imagePlaneModule = this.calibrateIfNecessary(imageId, imagePlaneModule);
|
|
1041
1000
|
}
|
|
1042
|
-
const xSpacing = imagePlaneModule.columnPixelSpacing || image.columnPixelSpacing;
|
|
1043
|
-
const ySpacing = imagePlaneModule.rowPixelSpacing || image.rowPixelSpacing;
|
|
1044
|
-
const xVoxels = image.columns;
|
|
1045
|
-
const yVoxels = image.rows;
|
|
1046
|
-
const zSpacing = EPSILON;
|
|
1047
|
-
const zVoxels = 1;
|
|
1048
|
-
const numberOfComponents = image.numberOfComponents ||
|
|
1049
|
-
this._getNumCompsFromPhotometricInterpretation(imagePixelModule.photometricInterpretation);
|
|
1050
1001
|
return {
|
|
1051
1002
|
bitsAllocated: imagePixelModule.bitsAllocated,
|
|
1052
1003
|
numberOfComponents,
|
|
1053
1004
|
origin,
|
|
1054
|
-
direction
|
|
1055
|
-
dimensions
|
|
1056
|
-
spacing
|
|
1057
|
-
numVoxels
|
|
1005
|
+
direction,
|
|
1006
|
+
dimensions,
|
|
1007
|
+
spacing,
|
|
1008
|
+
numVoxels,
|
|
1058
1009
|
imagePlaneModule,
|
|
1059
1010
|
imagePixelModule,
|
|
1060
1011
|
};
|
|
@@ -1877,34 +1828,11 @@ class StackViewport extends Viewport {
|
|
|
1877
1828
|
throw new Error('unsetColormapGPU not implemented.');
|
|
1878
1829
|
}
|
|
1879
1830
|
_getImagePlaneModule(imageId) {
|
|
1880
|
-
const imagePlaneModule =
|
|
1831
|
+
const imagePlaneModule = getImagePlaneModule(imageId);
|
|
1881
1832
|
this.hasPixelSpacing =
|
|
1882
1833
|
!imagePlaneModule.usingDefaultValues || this.calibration?.scale > 0;
|
|
1883
1834
|
this.calibration ||= imagePlaneModule.calibration;
|
|
1884
|
-
|
|
1885
|
-
...imagePlaneModule,
|
|
1886
|
-
};
|
|
1887
|
-
if (!newImagePlaneModule.columnPixelSpacing) {
|
|
1888
|
-
newImagePlaneModule.columnPixelSpacing = 1;
|
|
1889
|
-
}
|
|
1890
|
-
if (!newImagePlaneModule.rowPixelSpacing) {
|
|
1891
|
-
newImagePlaneModule.rowPixelSpacing = 1;
|
|
1892
|
-
}
|
|
1893
|
-
if (!newImagePlaneModule.columnCosines) {
|
|
1894
|
-
newImagePlaneModule.columnCosines = [0, 1, 0];
|
|
1895
|
-
}
|
|
1896
|
-
if (!newImagePlaneModule.rowCosines) {
|
|
1897
|
-
newImagePlaneModule.rowCosines = [1, 0, 0];
|
|
1898
|
-
}
|
|
1899
|
-
if (!newImagePlaneModule.imagePositionPatient) {
|
|
1900
|
-
newImagePlaneModule.imagePositionPatient = [0, 0, 0];
|
|
1901
|
-
}
|
|
1902
|
-
if (!newImagePlaneModule.imageOrientationPatient) {
|
|
1903
|
-
newImagePlaneModule.imageOrientationPatient = new Float32Array([
|
|
1904
|
-
1, 0, 0, 0, 1, 0,
|
|
1905
|
-
]);
|
|
1906
|
-
}
|
|
1907
|
-
return newImagePlaneModule;
|
|
1835
|
+
return imagePlaneModule;
|
|
1908
1836
|
}
|
|
1909
1837
|
}
|
|
1910
1838
|
export default StackViewport;
|
|
@@ -5,7 +5,7 @@ export interface ImagePixelModule {
|
|
|
5
5
|
samplesPerPixel: number;
|
|
6
6
|
highBit: number;
|
|
7
7
|
photometricInterpretation: string;
|
|
8
|
-
pixelRepresentation:
|
|
8
|
+
pixelRepresentation: number;
|
|
9
9
|
windowWidth: number | number[];
|
|
10
10
|
windowCenter: number | number[];
|
|
11
11
|
voiLUTFunction: VOILUTFunctionType;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type Point2 from './Point2';
|
|
2
2
|
import type Point3 from './Point3';
|
|
3
|
+
import type IImageCalibration from './IImageCalibration';
|
|
3
4
|
export interface ImagePlaneModule {
|
|
4
5
|
columnCosines?: Point3;
|
|
5
6
|
columnPixelSpacing?: number;
|
|
@@ -13,4 +14,6 @@ export interface ImagePlaneModule {
|
|
|
13
14
|
frameOfReferenceUID: string;
|
|
14
15
|
columns: number;
|
|
15
16
|
rows: number;
|
|
17
|
+
usingDefaultValues?: boolean;
|
|
18
|
+
calibration?: IImageCalibration;
|
|
16
19
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VOILUTFunctionType } from '../enums';
|
|
2
|
+
import type IImage from '../types/IImage';
|
|
3
|
+
import type { ImagePlaneModule } from '../types';
|
|
4
|
+
import type IImageCalibration from '../types/IImageCalibration';
|
|
5
|
+
export interface BuildMetadataResult {
|
|
6
|
+
scalingFactor: number;
|
|
7
|
+
imagePlaneModule: ImagePlaneModule;
|
|
8
|
+
voiLUTFunction: VOILUTFunctionType;
|
|
9
|
+
modality: string;
|
|
10
|
+
calibration: IImageCalibration;
|
|
11
|
+
imagePixelModule: {
|
|
12
|
+
bitsAllocated: number;
|
|
13
|
+
bitsStored: number;
|
|
14
|
+
samplesPerPixel: number;
|
|
15
|
+
highBit: number;
|
|
16
|
+
photometricInterpretation: string;
|
|
17
|
+
pixelRepresentation: number;
|
|
18
|
+
windowWidth: number;
|
|
19
|
+
windowCenter: number;
|
|
20
|
+
modality: string;
|
|
21
|
+
voiLUTFunction: VOILUTFunctionType;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare function getValidVOILUTFunction(voiLUTFunction: VOILUTFunctionType | unknown): VOILUTFunctionType;
|
|
25
|
+
export declare function getImagePlaneModule(imageId: string): ImagePlaneModule;
|
|
26
|
+
export declare function calibrateImagePlaneModule(imageId: string, imagePlaneModule: ImagePlaneModule, currentCalibration: IImageCalibration): {
|
|
27
|
+
imagePlaneModule: ImagePlaneModule;
|
|
28
|
+
hasPixelSpacing: boolean;
|
|
29
|
+
calibrationEvent?: {
|
|
30
|
+
scale: number;
|
|
31
|
+
calibration: IImageCalibration;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare function buildMetadata(image: IImage): BuildMetadataResult;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as metaData from '../metaData';
|
|
2
|
+
import { MetadataModules, VOILUTFunctionType } from '../enums';
|
|
3
|
+
export function getValidVOILUTFunction(voiLUTFunction) {
|
|
4
|
+
if (!Object.values(VOILUTFunctionType).includes(voiLUTFunction)) {
|
|
5
|
+
return VOILUTFunctionType.LINEAR;
|
|
6
|
+
}
|
|
7
|
+
return voiLUTFunction;
|
|
8
|
+
}
|
|
9
|
+
export function getImagePlaneModule(imageId) {
|
|
10
|
+
const imagePlaneModule = metaData.get(MetadataModules.IMAGE_PLANE, imageId);
|
|
11
|
+
const newImagePlaneModule = {
|
|
12
|
+
...imagePlaneModule,
|
|
13
|
+
};
|
|
14
|
+
if (!newImagePlaneModule.columnPixelSpacing) {
|
|
15
|
+
newImagePlaneModule.columnPixelSpacing = 1;
|
|
16
|
+
}
|
|
17
|
+
if (!newImagePlaneModule.rowPixelSpacing) {
|
|
18
|
+
newImagePlaneModule.rowPixelSpacing = 1;
|
|
19
|
+
}
|
|
20
|
+
if (!newImagePlaneModule.columnCosines) {
|
|
21
|
+
newImagePlaneModule.columnCosines = [0, 1, 0];
|
|
22
|
+
}
|
|
23
|
+
if (!newImagePlaneModule.rowCosines) {
|
|
24
|
+
newImagePlaneModule.rowCosines = [1, 0, 0];
|
|
25
|
+
}
|
|
26
|
+
if (!newImagePlaneModule.imagePositionPatient) {
|
|
27
|
+
newImagePlaneModule.imagePositionPatient = [0, 0, 0];
|
|
28
|
+
}
|
|
29
|
+
if (!newImagePlaneModule.imageOrientationPatient) {
|
|
30
|
+
newImagePlaneModule.imageOrientationPatient = new Float32Array([
|
|
31
|
+
1, 0, 0, 0, 1, 0,
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
return newImagePlaneModule;
|
|
35
|
+
}
|
|
36
|
+
export function calibrateImagePlaneModule(imageId, imagePlaneModule, currentCalibration) {
|
|
37
|
+
const calibration = metaData.get('calibratedPixelSpacing', imageId);
|
|
38
|
+
const isUpdated = currentCalibration !== calibration;
|
|
39
|
+
const { scale } = calibration || {};
|
|
40
|
+
const hasPixelSpacing = scale > 0 || imagePlaneModule.rowPixelSpacing > 0;
|
|
41
|
+
imagePlaneModule.calibration = calibration;
|
|
42
|
+
if (!isUpdated) {
|
|
43
|
+
return { imagePlaneModule, hasPixelSpacing };
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
imagePlaneModule,
|
|
47
|
+
hasPixelSpacing,
|
|
48
|
+
calibrationEvent: {
|
|
49
|
+
scale,
|
|
50
|
+
calibration,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function buildMetadata(image) {
|
|
55
|
+
const imageId = image.imageId;
|
|
56
|
+
const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel, } = metaData.get('imagePixelModule', imageId);
|
|
57
|
+
const { windowWidth, windowCenter, voiLUTFunction } = image;
|
|
58
|
+
const { modality } = metaData.get('generalSeriesModule', imageId);
|
|
59
|
+
const imageIdScalingFactor = metaData.get('scalingModule', imageId);
|
|
60
|
+
const calibration = metaData.get(MetadataModules.CALIBRATION, imageId);
|
|
61
|
+
const voiLUTFunctionEnum = getValidVOILUTFunction(voiLUTFunction);
|
|
62
|
+
const imagePlaneModule = getImagePlaneModule(imageId);
|
|
63
|
+
return {
|
|
64
|
+
calibration,
|
|
65
|
+
scalingFactor: imageIdScalingFactor,
|
|
66
|
+
voiLUTFunction: voiLUTFunctionEnum,
|
|
67
|
+
modality,
|
|
68
|
+
imagePlaneModule,
|
|
69
|
+
imagePixelModule: {
|
|
70
|
+
bitsAllocated,
|
|
71
|
+
bitsStored,
|
|
72
|
+
samplesPerPixel,
|
|
73
|
+
highBit,
|
|
74
|
+
photometricInterpretation,
|
|
75
|
+
pixelRepresentation,
|
|
76
|
+
windowWidth: windowWidth,
|
|
77
|
+
windowCenter: windowCenter,
|
|
78
|
+
modality,
|
|
79
|
+
voiLUTFunction: voiLUTFunctionEnum,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Point3, Mat3, ImagePlaneModule, ImagePixelModule, IImageCalibration } from '../types';
|
|
2
|
+
import type IImage from '../types/IImage';
|
|
3
|
+
import type { VOILUTFunctionType } from '../enums';
|
|
4
|
+
type ReturnImageDataMetadata = {
|
|
5
|
+
imagePlaneModule: ImagePlaneModule;
|
|
6
|
+
imagePixelModule: ImagePixelModule;
|
|
7
|
+
bitsAllocated: number;
|
|
8
|
+
numVoxels: number;
|
|
9
|
+
numberOfComponents: number;
|
|
10
|
+
origin: Point3;
|
|
11
|
+
direction: Mat3;
|
|
12
|
+
dimensions: Point3;
|
|
13
|
+
spacing: Point3;
|
|
14
|
+
voiLUTFunction: VOILUTFunctionType;
|
|
15
|
+
modality: string;
|
|
16
|
+
scalingFactor: number;
|
|
17
|
+
calibration: IImageCalibration;
|
|
18
|
+
};
|
|
19
|
+
export declare function getImageDataMetadata(image: IImage): ReturnImageDataMetadata;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import { EPSILON } from '../constants';
|
|
3
|
+
import { buildMetadata } from './buildMetadata';
|
|
4
|
+
export function getImageDataMetadata(image) {
|
|
5
|
+
const { imagePlaneModule, imagePixelModule, voiLUTFunction, modality, scalingFactor, calibration, } = buildMetadata(image);
|
|
6
|
+
let { rowCosines, columnCosines } = imagePlaneModule;
|
|
7
|
+
if (rowCosines == null || columnCosines == null) {
|
|
8
|
+
rowCosines = [1, 0, 0];
|
|
9
|
+
columnCosines = [0, 1, 0];
|
|
10
|
+
}
|
|
11
|
+
const rowCosineVec = vec3.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]);
|
|
12
|
+
const colCosineVec = vec3.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
|
|
13
|
+
const scanAxisNormal = vec3.create();
|
|
14
|
+
vec3.cross(scanAxisNormal, rowCosineVec, colCosineVec);
|
|
15
|
+
let origin = imagePlaneModule.imagePositionPatient;
|
|
16
|
+
if (origin == null) {
|
|
17
|
+
origin = [0, 0, 0];
|
|
18
|
+
}
|
|
19
|
+
const xSpacing = imagePlaneModule.columnPixelSpacing || image.columnPixelSpacing;
|
|
20
|
+
const ySpacing = imagePlaneModule.rowPixelSpacing || image.rowPixelSpacing;
|
|
21
|
+
const xVoxels = image.columns;
|
|
22
|
+
const yVoxels = image.rows;
|
|
23
|
+
const zSpacing = EPSILON;
|
|
24
|
+
const zVoxels = 1;
|
|
25
|
+
const numberOfComponents = image.numberOfComponents ||
|
|
26
|
+
_getNumCompsFromPhotometricInterpretation(imagePixelModule.photometricInterpretation);
|
|
27
|
+
return {
|
|
28
|
+
numberOfComponents,
|
|
29
|
+
origin,
|
|
30
|
+
direction: [...rowCosineVec, ...colCosineVec, ...scanAxisNormal],
|
|
31
|
+
dimensions: [xVoxels, yVoxels, zVoxels],
|
|
32
|
+
spacing: [xSpacing, ySpacing, zSpacing],
|
|
33
|
+
numVoxels: xVoxels * yVoxels * zVoxels,
|
|
34
|
+
imagePlaneModule,
|
|
35
|
+
imagePixelModule,
|
|
36
|
+
bitsAllocated: imagePixelModule.bitsAllocated,
|
|
37
|
+
voiLUTFunction,
|
|
38
|
+
modality,
|
|
39
|
+
scalingFactor,
|
|
40
|
+
calibration,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function _getNumCompsFromPhotometricInterpretation(photometricInterpretation) {
|
|
44
|
+
let numberOfComponents = 1;
|
|
45
|
+
if (photometricInterpretation === 'RGB' ||
|
|
46
|
+
photometricInterpretation.includes('YBR') ||
|
|
47
|
+
photometricInterpretation === 'PALETTE COLOR') {
|
|
48
|
+
numberOfComponents = 3;
|
|
49
|
+
}
|
|
50
|
+
return numberOfComponents;
|
|
51
|
+
}
|
|
@@ -78,6 +78,8 @@ import { deepEqual } from './deepEqual';
|
|
|
78
78
|
import type { IViewport } from '../types/IViewport';
|
|
79
79
|
import FrameRange from './FrameRange';
|
|
80
80
|
import fnv1aHash from './fnv1aHash';
|
|
81
|
+
import { getImageDataMetadata } from './getImageDataMetadata';
|
|
82
|
+
import { buildMetadata } from './buildMetadata';
|
|
81
83
|
import getDynamicVolumeInfo from './getDynamicVolumeInfo';
|
|
82
84
|
import autoLoad from './autoLoad';
|
|
83
85
|
import scaleArray from './scaleArray';
|
|
@@ -91,4 +93,4 @@ import getVolumeDirectionVectors from './getVolumeDirectionVectors';
|
|
|
91
93
|
import calculateSpacingBetweenImageIds from './calculateSpacingBetweenImageIds';
|
|
92
94
|
export * as logger from './logger';
|
|
93
95
|
declare const getViewportModality: (viewport: IViewport, volumeId?: string) => string;
|
|
94
|
-
export { FrameRange, eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, fnv1aHash, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, 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, HistoryMemo, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, deepClone, splitImageIdsBy4DTags, pointInShapeCallback, deepEqual, jumpToSlice, scroll, clip, transformWorldToIndexContinuous, createSubVolume, getVolumeDirectionVectors, calculateSpacingBetweenImageIds, };
|
|
96
|
+
export { FrameRange, eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, fnv1aHash, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, 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, HistoryMemo, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, deepClone, splitImageIdsBy4DTags, pointInShapeCallback, deepEqual, jumpToSlice, scroll, clip, transformWorldToIndexContinuous, createSubVolume, getVolumeDirectionVectors, calculateSpacingBetweenImageIds, getImageDataMetadata, buildMetadata, };
|
|
@@ -77,6 +77,8 @@ import * as color from './color';
|
|
|
77
77
|
import { deepEqual } from './deepEqual';
|
|
78
78
|
import FrameRange from './FrameRange';
|
|
79
79
|
import fnv1aHash from './fnv1aHash';
|
|
80
|
+
import { getImageDataMetadata } from './getImageDataMetadata';
|
|
81
|
+
import { buildMetadata } from './buildMetadata';
|
|
80
82
|
import { _getViewportModality } from './getViewportModality';
|
|
81
83
|
import cache from '../cache/cache';
|
|
82
84
|
import getDynamicVolumeInfo from './getDynamicVolumeInfo';
|
|
@@ -92,4 +94,4 @@ import getVolumeDirectionVectors from './getVolumeDirectionVectors';
|
|
|
92
94
|
import calculateSpacingBetweenImageIds from './calculateSpacingBetweenImageIds';
|
|
93
95
|
export * as logger from './logger';
|
|
94
96
|
const getViewportModality = (viewport, volumeId) => _getViewportModality(viewport, volumeId, cache.getVolume);
|
|
95
|
-
export { FrameRange, eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, fnv1aHash, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, 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, HistoryMemo, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, deepClone, splitImageIdsBy4DTags, pointInShapeCallback, deepEqual, jumpToSlice, scroll, clip, transformWorldToIndexContinuous, createSubVolume, getVolumeDirectionVectors, calculateSpacingBetweenImageIds, };
|
|
97
|
+
export { FrameRange, eventListener, csUtils as invertRgbTransferFunction, createSigmoidRGBTransferFunction, getVoiFromSigmoidRGBTransferFunction, createLinearRGBTransferFunction, scaleRgbTransferFunction, triggerEvent, imageIdToURI, fnv1aHash, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, 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, HistoryMemo, generateVolumePropsFromImageIds, getBufferConfiguration, VoxelManager, RLEVoxelMap, convertStackToVolumeViewport, convertVolumeToStackViewport, roundNumber, roundToPrecision, getViewportImageIds, getRandomSampleFromArray, getVolumeId, color, hasFloatScalingParameters, getDynamicVolumeInfo, autoLoad, scaleArray, deepClone, splitImageIdsBy4DTags, pointInShapeCallback, deepEqual, jumpToSlice, scroll, clip, transformWorldToIndexContinuous, createSubVolume, getVolumeDirectionVectors, calculateSpacingBetweenImageIds, getImageDataMetadata, buildMetadata, };
|
|
@@ -6,7 +6,10 @@ function isValidVolume(imageIds) {
|
|
|
6
6
|
}
|
|
7
7
|
const imageId0 = imageIds[0];
|
|
8
8
|
const { modality, seriesInstanceUID } = metaData.get('generalSeriesModule', imageId0);
|
|
9
|
-
const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, } = metaData.get('imagePlaneModule', imageId0);
|
|
9
|
+
const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, usingDefaultValues, } = metaData.get('imagePlaneModule', imageId0);
|
|
10
|
+
if (usingDefaultValues) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
10
13
|
const baseMetadata = {
|
|
11
14
|
modality,
|
|
12
15
|
imageOrientationPatient,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"type": "individual",
|
|
83
83
|
"url": "https://ohif.org/donate"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "480e48c2a25ce79a4a90be6fe180d1bcdd1b831e"
|
|
86
86
|
}
|