@cornerstonejs/core 4.11.2 → 4.11.3
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/enums/MetadataModules.d.ts +14 -1
- package/dist/esm/enums/MetadataModules.js +13 -0
- package/dist/esm/metaData.d.ts +3 -0
- package/dist/esm/metaData.js +40 -0
- package/dist/esm/types/InstanceTypes.d.ts +35 -0
- package/dist/esm/types/InstanceTypes.js +0 -0
- package/dist/esm/types/MetadataModuleTypes.d.ts +4 -0
- package/dist/esm/types/index.d.ts +4 -3
- package/dist/esm/utilities/getPixelSpacingInformation.js +5 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +2 -2
|
@@ -19,6 +19,19 @@ declare enum MetadataModules {
|
|
|
19
19
|
SOP_COMMON = "sopCommonModule",
|
|
20
20
|
ULTRASOUND_ENHANCED_REGION = "ultrasoundEnhancedRegionModule",
|
|
21
21
|
VOI_LUT = "voiLutModule",
|
|
22
|
-
|
|
22
|
+
FRAME_MODULE = "frameModule",
|
|
23
|
+
WADO_WEB_CLIENT = "wadoWebClient",
|
|
24
|
+
INSTANCE = "instance",
|
|
25
|
+
IMAGE_SOP_INSTANCE_REFERENCE = "ImageSopInstanceReference",
|
|
26
|
+
REFERENCED_SERIES_REFERENCE = "ReferencedSeriesReference",
|
|
27
|
+
PREDECESSOR_SEQUENCE = "PredecessorSequence",
|
|
28
|
+
STUDY_DATA = "StudyData",
|
|
29
|
+
SERIES_DATA = "SeriesData",
|
|
30
|
+
IMAGE_DATA = "ImageData",
|
|
31
|
+
RTSS_INSTANCE_DATA = "RtssInstanceData",
|
|
32
|
+
NEW_INSTANCE_DATA = "NewInstanceData",
|
|
33
|
+
RTSS_CONTOUR = "metaRTSSContour",
|
|
34
|
+
SEG_BIT = "metaSegBitmap",
|
|
35
|
+
SR_ANNOTATION = "metaSrAnnotation"
|
|
23
36
|
}
|
|
24
37
|
export default MetadataModules;
|
|
@@ -20,6 +20,19 @@ var MetadataModules;
|
|
|
20
20
|
MetadataModules["SOP_COMMON"] = "sopCommonModule";
|
|
21
21
|
MetadataModules["ULTRASOUND_ENHANCED_REGION"] = "ultrasoundEnhancedRegionModule";
|
|
22
22
|
MetadataModules["VOI_LUT"] = "voiLutModule";
|
|
23
|
+
MetadataModules["FRAME_MODULE"] = "frameModule";
|
|
23
24
|
MetadataModules["WADO_WEB_CLIENT"] = "wadoWebClient";
|
|
25
|
+
MetadataModules["INSTANCE"] = "instance";
|
|
26
|
+
MetadataModules["IMAGE_SOP_INSTANCE_REFERENCE"] = "ImageSopInstanceReference";
|
|
27
|
+
MetadataModules["REFERENCED_SERIES_REFERENCE"] = "ReferencedSeriesReference";
|
|
28
|
+
MetadataModules["PREDECESSOR_SEQUENCE"] = "PredecessorSequence";
|
|
29
|
+
MetadataModules["STUDY_DATA"] = "StudyData";
|
|
30
|
+
MetadataModules["SERIES_DATA"] = "SeriesData";
|
|
31
|
+
MetadataModules["IMAGE_DATA"] = "ImageData";
|
|
32
|
+
MetadataModules["RTSS_INSTANCE_DATA"] = "RtssInstanceData";
|
|
33
|
+
MetadataModules["NEW_INSTANCE_DATA"] = "NewInstanceData";
|
|
34
|
+
MetadataModules["RTSS_CONTOUR"] = "metaRTSSContour";
|
|
35
|
+
MetadataModules["SEG_BIT"] = "metaSegBitmap";
|
|
36
|
+
MetadataModules["SR_ANNOTATION"] = "metaSrAnnotation";
|
|
24
37
|
})(MetadataModules || (MetadataModules = {}));
|
|
25
38
|
export default MetadataModules;
|
package/dist/esm/metaData.d.ts
CHANGED
|
@@ -2,4 +2,7 @@ export declare function addProvider(provider: (type: string, ...query: string[])
|
|
|
2
2
|
export declare function removeProvider(provider: (type: string, query: unknown) => unknown): void;
|
|
3
3
|
export declare function removeAllProviders(): void;
|
|
4
4
|
declare function getMetaData(type: string, ...queries: any[]): any;
|
|
5
|
+
export declare function getNormalized(imageId: string, types: string[], metaDataProvider?: typeof getMetaData): {};
|
|
6
|
+
export declare const toUpperCamelTag: (tag: string) => string;
|
|
7
|
+
export declare const toLowerCamelTag: (tag: string) => string;
|
|
5
8
|
export { getMetaData as get };
|
package/dist/esm/metaData.js
CHANGED
|
@@ -32,4 +32,44 @@ function getMetaData(type, ...queries) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
export function getNormalized(imageId, types, metaDataProvider = getMetaData) {
|
|
36
|
+
const result = {};
|
|
37
|
+
for (const t of types) {
|
|
38
|
+
try {
|
|
39
|
+
const data = metaDataProvider(t, imageId);
|
|
40
|
+
if (data) {
|
|
41
|
+
const capitalizedData = {};
|
|
42
|
+
for (const key in data) {
|
|
43
|
+
if (key in data) {
|
|
44
|
+
const capitalizedKey = toUpperCamelTag(key);
|
|
45
|
+
capitalizedData[capitalizedKey] = data[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
Object.assign(result, capitalizedData);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error(`Error retrieving ${t} data:`, error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
export const toUpperCamelTag = (tag) => {
|
|
58
|
+
if (tag.startsWith('sop')) {
|
|
59
|
+
return `SOP${tag.substring(3)}`;
|
|
60
|
+
}
|
|
61
|
+
if (tag.endsWith('Id')) {
|
|
62
|
+
tag = `${tag.substring(0, tag.length - 2)}ID`;
|
|
63
|
+
}
|
|
64
|
+
return tag.charAt(0).toUpperCase() + tag.slice(1);
|
|
65
|
+
};
|
|
66
|
+
export const toLowerCamelTag = (tag) => {
|
|
67
|
+
if (tag.startsWith('SOP')) {
|
|
68
|
+
return `sop${tag.substring(3)}`;
|
|
69
|
+
}
|
|
70
|
+
if (tag.endsWith('ID')) {
|
|
71
|
+
tag = `${tag.substring(0, tag.length - 2)}Id`;
|
|
72
|
+
}
|
|
73
|
+
return tag.charAt(0).toLowerCase() + tag.slice(1);
|
|
74
|
+
};
|
|
35
75
|
export { getMetaData as get };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type SimpleData = string | number | null | undefined | boolean;
|
|
2
|
+
export type SimpleModule = {
|
|
3
|
+
StudyInstanceUID?: string;
|
|
4
|
+
SeriesInstanceUID?: string;
|
|
5
|
+
SeriesDescription?: string;
|
|
6
|
+
SeriesNumber?: number | string;
|
|
7
|
+
SeriesDate?: string;
|
|
8
|
+
SeriesTime?: string;
|
|
9
|
+
Modality?: string;
|
|
10
|
+
SOPInstanceUID?: string;
|
|
11
|
+
SOPClassUID?: string;
|
|
12
|
+
InstanceNumber?: string | number;
|
|
13
|
+
FrameOfReferenceUID?: string;
|
|
14
|
+
[key: string]: SimpleData;
|
|
15
|
+
};
|
|
16
|
+
export type FunctionalGroups = {
|
|
17
|
+
[key: string]: NormalModule;
|
|
18
|
+
};
|
|
19
|
+
export type NormalModule = SimpleModule & {
|
|
20
|
+
PerFrameFunctionalGroupsSequence?: FunctionalGroups[];
|
|
21
|
+
SharedFunctionalGroupsSequence?: FunctionalGroups;
|
|
22
|
+
};
|
|
23
|
+
export type RtssModule = NormalModule & {
|
|
24
|
+
StructureSetROISequence: NormalModule[];
|
|
25
|
+
ROIContourSequence: NormalModule[];
|
|
26
|
+
RTROIObservationsSequence: NormalModule[];
|
|
27
|
+
ReferencedSeriesSequence: NormalModule[];
|
|
28
|
+
ReferencedFrameOfReferenceSequence: NormalModule[];
|
|
29
|
+
Modality: 'RTSTRUCT';
|
|
30
|
+
PositionReferenceIndicator: string;
|
|
31
|
+
StructureSetLabel: string;
|
|
32
|
+
StructureSetName: string;
|
|
33
|
+
StructureSetDate: string;
|
|
34
|
+
StructureSetTime: string;
|
|
35
|
+
};
|
|
File without changes
|
|
@@ -61,6 +61,10 @@ export interface SopCommonModuleMetadata {
|
|
|
61
61
|
sopClassUID: string;
|
|
62
62
|
sopInstanceUID: string;
|
|
63
63
|
}
|
|
64
|
+
export interface FrameMetadata extends SopCommonModuleMetadata {
|
|
65
|
+
frameNumber: number;
|
|
66
|
+
numberOfFrames: number;
|
|
67
|
+
}
|
|
64
68
|
export interface TransferSyntaxMetadata {
|
|
65
69
|
transferSyntaxUID: string;
|
|
66
70
|
}
|
|
@@ -80,7 +80,7 @@ import type { PixelDataTypedArray, PixelDataTypedArrayString } from './PixelData
|
|
|
80
80
|
import type { ImagePixelModule } from './ImagePixelModule';
|
|
81
81
|
import type { ImagePlaneModule } from './ImagePlaneModule';
|
|
82
82
|
import type { AffineMatrix } from './AffineMatrix';
|
|
83
|
-
export type
|
|
83
|
+
export type * from './IRetrieveConfiguration';
|
|
84
84
|
import type { ImageLoadListener } from './ImageLoadListener';
|
|
85
85
|
import type { Color, ColorLUT } from './Color';
|
|
86
86
|
import type VideoViewportProperties from './VideoViewportProperties';
|
|
@@ -94,7 +94,6 @@ import type { VolumeProps } from './VolumeProps';
|
|
|
94
94
|
import type { BoundsLPS } from './BoundsLPS';
|
|
95
95
|
import type { IPointsManager, PolyDataPointConfiguration } from './IPointsManager';
|
|
96
96
|
import type IImageFrame from './IImageFrame';
|
|
97
|
-
import type { DicomDateObject, DicomTimeObject, GeneralSeriesModuleMetadata, ImagePlaneModuleMetadata, SopCommonModuleMetadata, ImagePixelModuleMetadata, PatientStudyModuleMetadata, TransferSyntaxMetadata } from './MetadataModuleTypes';
|
|
98
97
|
import type { IVoxelManager } from './IVoxelManager';
|
|
99
98
|
import type { IRLEVoxelMap, RLERun } from './IRLEVoxelMap';
|
|
100
99
|
import type ImageLoadRequests from './ImageLoadRequests';
|
|
@@ -104,4 +103,6 @@ import type JumpToSliceOptions from './JumpToSliceOptions';
|
|
|
104
103
|
import type GeometryLoaderFn from './GeometryLoaderFn';
|
|
105
104
|
import type { RenderingEngineModeType } from './RenderingEngineMode';
|
|
106
105
|
import type { VtkOffscreenMultiRenderWindow } from './VtkOffscreenMultiRenderWindow';
|
|
107
|
-
export type
|
|
106
|
+
export type * from './MetadataModuleTypes';
|
|
107
|
+
export type * from './InstanceTypes';
|
|
108
|
+
export type { Cornerstone3DConfig, IBaseStreamingImageVolume, 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, PublicMeshData, MeshData, IMesh, RGB, ColormapPublic, ColormapRegistration, PixelDataTypedArray, PixelDataTypedArrayString, ImagePixelModule, ImagePlaneModule, AffineMatrix, ImageLoadListener, InternalVideoCamera, VideoViewportInput, BoundsIJK, BoundsLPS, Color, ColorLUT, VolumeProps, IImageFrame, LocalVolumeOptions, IVoxelManager, IRLEVoxelMap, RLERun, ViewportInput, ImageLoadRequests, IBaseVolumeViewport, GeometryLoaderFn, ScrollOptions, JumpToSliceOptions, Memo, HistoryMemo, VoxelManager, RLEVoxelMap, RenderingEngineModeType, VtkOffscreenMultiRenderWindow, };
|
|
@@ -14,6 +14,7 @@ const projectionRadiographSOPClassUIDs = new Set([
|
|
|
14
14
|
'1.2.840.10008.5.1.4.1.1.12.2.1',
|
|
15
15
|
'1.2.840.10008.5.1.4.1.1.12.3',
|
|
16
16
|
]);
|
|
17
|
+
const alreadySeenWarn = new Set();
|
|
17
18
|
function calculateRadiographicPixelSpacing(instance) {
|
|
18
19
|
const { PixelSpacing, ImagerPixelSpacing, EstimatedRadiographicMagnificationFactor, PixelSpacingCalibrationType, PixelSpacingCalibrationDescription, } = instance;
|
|
19
20
|
const isProjection = true;
|
|
@@ -26,7 +27,10 @@ function calculateRadiographicPixelSpacing(instance) {
|
|
|
26
27
|
}
|
|
27
28
|
if (!PixelSpacing) {
|
|
28
29
|
if (!EstimatedRadiographicMagnificationFactor) {
|
|
29
|
-
|
|
30
|
+
if (!alreadySeenWarn.has(instance.SeriesInstanceUID)) {
|
|
31
|
+
console.warn('EstimatedRadiographicMagnificationFactor was not present on series', instance.SeriesInstanceUID, ' Unable to correct ImagerPixelSpacing.');
|
|
32
|
+
alreadySeenWarn.add(instance.SeriesInstanceUID);
|
|
33
|
+
}
|
|
30
34
|
return {
|
|
31
35
|
PixelSpacing: ImagerPixelSpacing,
|
|
32
36
|
type: CalibrationTypes.PROJECTION,
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.11.
|
|
1
|
+
export declare const version = "4.11.3";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.11.
|
|
1
|
+
export const version = '4.11.3';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.3",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"type": "individual",
|
|
98
98
|
"url": "https://ohif.org/donate"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e7b0cea10f4ceb71710d3f01eaead75152180b7a"
|
|
101
101
|
}
|