@cornerstonejs/adapters 4.11.1 → 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/adapters/Cornerstone/Bidirectional.js +0 -1
- package/dist/esm/adapters/Cornerstone/MeasurementReport.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/Angle.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/CircleROI.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/LabelData.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/Length.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.d.ts +23 -10
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +38 -48
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/Probe.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +10 -67
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +111 -119
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.d.ts +2 -2
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +1 -1
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.d.ts +3 -3
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.js +4 -4
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.d.ts +1 -11
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +10 -20
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.d.ts +1 -4
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +27 -26
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.d.ts +4 -3
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +5 -5
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +0 -1
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +7 -1
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +47 -10
- package/dist/esm/adapters/Cornerstone3D/constants/index.d.ts +44 -0
- package/dist/esm/adapters/Cornerstone3D/constants/index.js +41 -8
- package/dist/esm/adapters/Cornerstone3D/index.d.ts +18 -18
- package/dist/esm/adapters/helpers/copySeriesTags.d.ts +2 -4
- package/dist/esm/adapters/helpers/copySeriesTags.js +4 -7
- package/dist/esm/adapters/helpers/copyStudyTags.js +2 -2
- package/dist/esm/adapters/helpers/downloadDICOMData.js +6 -9
- package/dist/esm/adapters/index.js +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/utilities/createInstance.d.ts +2 -0
- package/dist/esm/utilities/createInstance.js +39 -0
- package/dist/esm/utilities/index.d.ts +3 -0
- package/dist/esm/utilities/index.js +2 -0
- package/dist/esm/utilities/referencedMetadataProvider.d.ts +65 -0
- package/dist/esm/utilities/referencedMetadataProvider.js +114 -0
- package/dist/esm/version.d.ts +1 -1
- package/package.json +86 -86
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.d.ts +0 -13
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js +0 -22
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.d.ts +0 -4
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.js +0 -9
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
const NO_IMAGE_ID =
|
|
2
|
-
const CS3D_DESIGNATOR =
|
|
1
|
+
const NO_IMAGE_ID = 'none';
|
|
2
|
+
const CS3D_DESIGNATOR = '99CS3D';
|
|
3
3
|
const TEXT_ANNOTATION_POSITION = {
|
|
4
4
|
schemeDesignator: CS3D_DESIGNATOR,
|
|
5
|
-
meaning:
|
|
6
|
-
value:
|
|
5
|
+
meaning: 'Text Annotation Position',
|
|
6
|
+
value: 'TextPosition'
|
|
7
7
|
};
|
|
8
8
|
const COMMENT_CODE = {
|
|
9
|
-
schemeDesignator:
|
|
10
|
-
meaning:
|
|
11
|
-
value:
|
|
9
|
+
schemeDesignator: 'DCM',
|
|
10
|
+
meaning: 'Comment',
|
|
11
|
+
value: '121106'
|
|
12
|
+
};
|
|
13
|
+
const fileMetaInformationVersionArray1 = new Uint8Array(2);
|
|
14
|
+
fileMetaInformationVersionArray1[1] = 1;
|
|
15
|
+
const fileMetaInformationVersionArray2 = new Uint8Array(2);
|
|
16
|
+
fileMetaInformationVersionArray2[1] = 2;
|
|
17
|
+
const ImplementationClassUidSRAnnotation = '2.25.2470123695996825859949881583571202391.1.0.1';
|
|
18
|
+
const ImplementationClassRtssContours = '2.25.2470123695996825859949881583571202391.2.0.1';
|
|
19
|
+
const fileMetaInformationVersionArray = new Uint8Array(2);
|
|
20
|
+
fileMetaInformationVersionArray[1] = 1;
|
|
21
|
+
const metaSRAnnotation = {
|
|
22
|
+
FileMetaInformationVersion: {
|
|
23
|
+
Value: [fileMetaInformationVersionArray2.buffer],
|
|
24
|
+
vr: 'OB'
|
|
25
|
+
},
|
|
26
|
+
TransferSyntaxUID: {
|
|
27
|
+
Value: ['1.2.840.10008.1.2'],
|
|
28
|
+
vr: 'UI'
|
|
29
|
+
},
|
|
30
|
+
ImplementationClassUID: {
|
|
31
|
+
Value: [ImplementationClassUidSRAnnotation],
|
|
32
|
+
vr: 'UI'
|
|
33
|
+
},
|
|
34
|
+
ImplementationVersionName: {
|
|
35
|
+
Value: ['cs3d-4.8.4'],
|
|
36
|
+
vr: 'SH'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const metaRTSSContour = {
|
|
40
|
+
...metaSRAnnotation,
|
|
41
|
+
ImplementationClassUID: {
|
|
42
|
+
Value: [ImplementationClassRtssContours],
|
|
43
|
+
vr: 'UI'
|
|
44
|
+
}
|
|
12
45
|
};
|
|
13
46
|
|
|
14
|
-
export { COMMENT_CODE, CS3D_DESIGNATOR, NO_IMAGE_ID, TEXT_ANNOTATION_POSITION };
|
|
47
|
+
export { COMMENT_CODE, CS3D_DESIGNATOR, ImplementationClassRtssContours, ImplementationClassUidSRAnnotation, NO_IMAGE_ID, TEXT_ANNOTATION_POSITION, fileMetaInformationVersionArray1, fileMetaInformationVersionArray2, metaRTSSContour, metaSRAnnotation };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import MeasurementReport from
|
|
2
|
-
import ArrowAnnotate from
|
|
3
|
-
import Bidirectional from
|
|
4
|
-
import Angle from
|
|
5
|
-
import CobbAngle from
|
|
6
|
-
import CircleROI from
|
|
7
|
-
import EllipticalROI from
|
|
8
|
-
import RectangleROI from
|
|
9
|
-
import Length from
|
|
10
|
-
import PlanarFreehandROI from
|
|
11
|
-
import Probe from
|
|
12
|
-
import UltrasoundDirectional from
|
|
13
|
-
import BaseAdapter3D from
|
|
14
|
-
import * as Segmentation from
|
|
15
|
-
import * as ParametricMap from
|
|
16
|
-
import * as RTSS from
|
|
17
|
-
import KeyImage from
|
|
1
|
+
import MeasurementReport from './MeasurementReport';
|
|
2
|
+
import ArrowAnnotate from './ArrowAnnotate';
|
|
3
|
+
import Bidirectional from './Bidirectional';
|
|
4
|
+
import Angle from './Angle';
|
|
5
|
+
import CobbAngle from './CobbAngle';
|
|
6
|
+
import CircleROI from './CircleROI';
|
|
7
|
+
import EllipticalROI from './EllipticalROI';
|
|
8
|
+
import RectangleROI from './RectangleROI';
|
|
9
|
+
import Length from './Length';
|
|
10
|
+
import PlanarFreehandROI from './PlanarFreehandROI';
|
|
11
|
+
import Probe from './Probe';
|
|
12
|
+
import UltrasoundDirectional from './UltrasoundDirectional';
|
|
13
|
+
import BaseAdapter3D from './BaseAdapter3D';
|
|
14
|
+
import * as Segmentation from './Segmentation';
|
|
15
|
+
import * as ParametricMap from './ParametricMap';
|
|
16
|
+
import * as RTSS from './RTStruct';
|
|
17
|
+
import KeyImage from './KeyImage';
|
|
18
18
|
declare const Cornerstone3DSR: {
|
|
19
19
|
BaseAdapter3D: typeof BaseAdapter3D;
|
|
20
20
|
Bidirectional: typeof Bidirectional;
|
|
@@ -58,4 +58,4 @@ declare const Cornerstone3DPMAP: {
|
|
|
58
58
|
declare const Cornerstone3DRT: {
|
|
59
59
|
RTSS: typeof RTSS;
|
|
60
60
|
};
|
|
61
|
-
export { Cornerstone3DSR, Cornerstone3DSEG, Cornerstone3DPMAP, Cornerstone3DRT };
|
|
61
|
+
export { Cornerstone3DSR, Cornerstone3DSEG, Cornerstone3DPMAP, Cornerstone3DRT, };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
1
2
|
export declare const seriesTags: string[];
|
|
2
|
-
export declare function copySeriesTags(src:
|
|
3
|
-
_meta: any;
|
|
4
|
-
_vrMap: any;
|
|
5
|
-
};
|
|
3
|
+
export declare function copySeriesTags(src: Types.NormalModule): Types.NormalModule;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
const seriesTags = [
|
|
1
|
+
const seriesTags = ['SeriesInstanceUID', 'SeriesNumber', 'SeriesDescription', 'Modality', 'SeriesDate', 'SeriesTime', '_meta', '_vrMap'];
|
|
2
2
|
function copySeriesTags(src) {
|
|
3
|
-
const
|
|
4
|
-
_meta: src._meta,
|
|
5
|
-
_vrMap: src._vrMap
|
|
6
|
-
};
|
|
3
|
+
const result = {};
|
|
7
4
|
for (const tagKey of seriesTags) {
|
|
8
5
|
const value = src[tagKey];
|
|
9
6
|
if (value === undefined) {
|
|
10
7
|
continue;
|
|
11
8
|
}
|
|
12
|
-
|
|
9
|
+
result[tagKey] = value;
|
|
13
10
|
}
|
|
14
|
-
return
|
|
11
|
+
return result;
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
export { copySeriesTags, seriesTags };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const patientTags = [
|
|
2
|
-
const studyTags = [
|
|
1
|
+
const patientTags = ['PatientName', 'PatientID', 'PatientBirthDate', 'PatientBirthTime', 'IssuerOfPatientID', 'OtherPatientIDs', 'OtherPatientIDsSequence', 'PatientSex', 'PatientIdentityRemoved', 'DeidentificationMethodCodeSequence'];
|
|
2
|
+
const studyTags = ['StudyDate', 'StudyTime', 'StudyStatusID', 'StudyPriorityID', 'StudyInstanceUID', 'StudyDescription', 'AccessionNumber', 'StudyID', 'ReferringPhysicianName', 'TimezoneOffsetFromUTC'];
|
|
3
3
|
const patientStudyTags = [...patientTags, ...studyTags];
|
|
4
4
|
function copyStudyTags(src) {
|
|
5
5
|
const study = {
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import { data } from 'dcmjs';
|
|
2
|
-
import { Buffer } from 'buffer';
|
|
3
2
|
|
|
4
3
|
const {
|
|
5
|
-
|
|
4
|
+
datasetToBlob
|
|
6
5
|
} = data;
|
|
7
6
|
function downloadDICOMData(bufferOrDataset, filename) {
|
|
8
7
|
let blob;
|
|
9
8
|
if (bufferOrDataset instanceof ArrayBuffer) {
|
|
10
9
|
blob = new Blob([bufferOrDataset], {
|
|
11
|
-
type:
|
|
10
|
+
type: 'application/dicom'
|
|
12
11
|
});
|
|
13
12
|
} else {
|
|
14
13
|
if (!bufferOrDataset._meta) {
|
|
15
|
-
throw new Error(
|
|
14
|
+
throw new Error('Dataset must have a _meta property');
|
|
16
15
|
}
|
|
17
|
-
|
|
18
|
-
blob = new Blob([buffer], {
|
|
19
|
-
type: "application/dicom"
|
|
20
|
-
});
|
|
16
|
+
blob = datasetToBlob(bufferOrDataset);
|
|
21
17
|
}
|
|
22
|
-
const link = document.createElement(
|
|
18
|
+
const link = document.createElement('a');
|
|
23
19
|
link.href = window.URL.createObjectURL(blob);
|
|
24
20
|
link.download = filename;
|
|
25
21
|
link.click();
|
|
22
|
+
URL.revokeObjectURL(link.href);
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
export { downloadDICOMData };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CornerstoneSR, CornerstoneSEG, CornerstonePMAP } from './Cornerstone/index.js';
|
|
2
2
|
import { Cornerstone3DSR, Cornerstone3DSEG, Cornerstone3DPMAP, Cornerstone3DRT } from './Cornerstone3D/index.js';
|
|
3
|
+
export { NO_IMAGE_ID } from './Cornerstone3D/constants/index.js';
|
|
3
4
|
import { VTKjsSEG } from './VTKjs/index.js';
|
|
4
5
|
import './enums/Events.js';
|
|
5
6
|
import 'dcmjs';
|
|
6
|
-
import 'buffer';
|
|
7
7
|
import '@cornerstonejs/core';
|
|
8
8
|
|
|
9
9
|
const adaptersSR = {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './adapters';
|
|
2
|
+
export * as utilities from './utilities';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { adaptersPMAP, adaptersRT, adaptersSEG, adaptersSR } from './adapters/index.js';
|
|
2
|
-
import * as index from './
|
|
3
|
-
export { index as
|
|
4
|
-
import * as index$1 from './adapters/
|
|
5
|
-
export { index$1 as
|
|
2
|
+
import * as index from './utilities/index.js';
|
|
3
|
+
export { index as utilities };
|
|
4
|
+
import * as index$1 from './adapters/enums/index.js';
|
|
5
|
+
export { index$1 as Enums };
|
|
6
|
+
import * as index$2 from './adapters/helpers/index.js';
|
|
7
|
+
export { index$2 as helpers };
|
|
6
8
|
export { NO_IMAGE_ID } from './adapters/Cornerstone3D/constants/index.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Enums, metaData } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
MetadataModules
|
|
5
|
+
} = Enums;
|
|
6
|
+
function assignDefined(dest, source, options) {
|
|
7
|
+
if (!source) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
for (const [key, value] of Object.entries(source)) {
|
|
11
|
+
if (value === undefined) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (dest[key] === undefined && options?.requireDestinationKey) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
dest[key] = value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createInstance(instanceKey, studyExemplarImageId, base, options) {
|
|
21
|
+
const {
|
|
22
|
+
metadataProvider = metaData,
|
|
23
|
+
predecessorImageId
|
|
24
|
+
} = options;
|
|
25
|
+
const result = {};
|
|
26
|
+
const instanceBase = metadataProvider.get(instanceKey, studyExemplarImageId);
|
|
27
|
+
Object.assign(result, instanceBase);
|
|
28
|
+
assignDefined(result, base);
|
|
29
|
+
assignDefined(result, options, {
|
|
30
|
+
requireDestinationKey: true
|
|
31
|
+
});
|
|
32
|
+
if (predecessorImageId) {
|
|
33
|
+
const predecessor = metadataProvider.get(MetadataModules.PREDECESSOR_SEQUENCE, predecessorImageId);
|
|
34
|
+
Object.assign(result, predecessor);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { assignDefined, createInstance };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Enums } from '@cornerstonejs/core';
|
|
2
|
+
export declare const STUDY_MODULES: Enums.MetadataModules[];
|
|
3
|
+
export declare const SERIES_MODULES: Enums.MetadataModules[];
|
|
4
|
+
export declare const IMAGE_MODULES: Enums.MetadataModules[];
|
|
5
|
+
export declare const metadataProvider: {
|
|
6
|
+
get: (type: string, imageId: string, options: any) => any;
|
|
7
|
+
ImageSopInstanceReference: (imageId: string) => {
|
|
8
|
+
ReferencedSOPClassUID: any;
|
|
9
|
+
ReferencedSOPInstanceUID: any;
|
|
10
|
+
ReferencedFrameNumber: any;
|
|
11
|
+
} | {
|
|
12
|
+
ReferencedSOPClassUID: any;
|
|
13
|
+
ReferencedSOPInstanceUID: any;
|
|
14
|
+
ReferencedFrameNumber?: undefined;
|
|
15
|
+
};
|
|
16
|
+
ReferencedSeriesReference: (imageId: any) => {
|
|
17
|
+
SeriesInstanceUID: any;
|
|
18
|
+
ReferencedInstanceSequence: {
|
|
19
|
+
ReferencedSOPClassUID: any;
|
|
20
|
+
ReferencedSOPInstanceUID: any;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
PredecessorSequence: (imageId: any) => any;
|
|
24
|
+
StudyData: (imageId: any) => {};
|
|
25
|
+
SeriesData: (imageId: any) => {};
|
|
26
|
+
ImageData: (imageId: any) => {};
|
|
27
|
+
RtssInstanceData: (imageId: any) => any;
|
|
28
|
+
NewInstanceData: (imageId: any) => any;
|
|
29
|
+
metaRTSSContour: () => {
|
|
30
|
+
ImplementationClassUID: {
|
|
31
|
+
Value: string[];
|
|
32
|
+
vr: string;
|
|
33
|
+
};
|
|
34
|
+
FileMetaInformationVersion: {
|
|
35
|
+
Value: ArrayBufferLike[];
|
|
36
|
+
vr: string;
|
|
37
|
+
};
|
|
38
|
+
TransferSyntaxUID: {
|
|
39
|
+
Value: string[];
|
|
40
|
+
vr: string;
|
|
41
|
+
};
|
|
42
|
+
ImplementationVersionName: {
|
|
43
|
+
Value: string[];
|
|
44
|
+
vr: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
metaSrAnnotation: () => {
|
|
48
|
+
FileMetaInformationVersion: {
|
|
49
|
+
Value: ArrayBufferLike[];
|
|
50
|
+
vr: string;
|
|
51
|
+
};
|
|
52
|
+
TransferSyntaxUID: {
|
|
53
|
+
Value: string[];
|
|
54
|
+
vr: string;
|
|
55
|
+
};
|
|
56
|
+
ImplementationClassUID: {
|
|
57
|
+
Value: string[];
|
|
58
|
+
vr: string;
|
|
59
|
+
};
|
|
60
|
+
ImplementationVersionName: {
|
|
61
|
+
Value: string[];
|
|
62
|
+
vr: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { metaData, Enums } from '@cornerstonejs/core';
|
|
2
|
+
import dcmjs from 'dcmjs';
|
|
3
|
+
import { metaRTSSContour, metaSRAnnotation } from '../adapters/Cornerstone3D/constants/index.js';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
DicomMetaDictionary
|
|
7
|
+
} = dcmjs.data;
|
|
8
|
+
const {
|
|
9
|
+
MetadataModules
|
|
10
|
+
} = Enums;
|
|
11
|
+
const STUDY_MODULES = [MetadataModules.GENERAL_STUDY, MetadataModules.PATIENT_STUDY, MetadataModules.PATIENT];
|
|
12
|
+
const SERIES_MODULES = [MetadataModules.GENERAL_SERIES];
|
|
13
|
+
const IMAGE_MODULES = [MetadataModules.GENERAL_IMAGE, MetadataModules.IMAGE_PLANE, MetadataModules.CINE, MetadataModules.VOI_LUT, MetadataModules.MODALITY_LUT, MetadataModules.SOP_COMMON];
|
|
14
|
+
const metadataProvider = {
|
|
15
|
+
get: function (type, imageId, options) {
|
|
16
|
+
return metadataProvider[type]?.(imageId, options);
|
|
17
|
+
},
|
|
18
|
+
[MetadataModules.IMAGE_SOP_INSTANCE_REFERENCE]: function (imageId) {
|
|
19
|
+
const frameModule = metaData.get(MetadataModules.FRAME_MODULE, imageId);
|
|
20
|
+
const {
|
|
21
|
+
sopClassUID,
|
|
22
|
+
sopInstanceUID,
|
|
23
|
+
frameNumber,
|
|
24
|
+
numberOfFrames
|
|
25
|
+
} = frameModule;
|
|
26
|
+
if (numberOfFrames > 1) {
|
|
27
|
+
return {
|
|
28
|
+
ReferencedSOPClassUID: sopClassUID,
|
|
29
|
+
ReferencedSOPInstanceUID: sopInstanceUID,
|
|
30
|
+
ReferencedFrameNumber: frameNumber
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
ReferencedSOPClassUID: frameModule.sopClassUID,
|
|
35
|
+
ReferencedSOPInstanceUID: frameModule.sopInstanceUID
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
[MetadataModules.REFERENCED_SERIES_REFERENCE]: imageId => {
|
|
39
|
+
const sopModule = metaData.get(MetadataModules.SOP_COMMON, imageId);
|
|
40
|
+
const seriesModule = metaData.get(MetadataModules.GENERAL_SERIES, imageId);
|
|
41
|
+
return {
|
|
42
|
+
SeriesInstanceUID: seriesModule.seriesInstanceUID,
|
|
43
|
+
ReferencedInstanceSequence: [{
|
|
44
|
+
ReferencedSOPClassUID: sopModule.sopClassUID,
|
|
45
|
+
ReferencedSOPInstanceUID: sopModule.sopInstanceUID
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
[MetadataModules.PREDECESSOR_SEQUENCE]: imageId => {
|
|
50
|
+
const result = {
|
|
51
|
+
...metaData.get(MetadataModules.SERIES_DATA, imageId)
|
|
52
|
+
};
|
|
53
|
+
const generalImage = metaData.get(MetadataModules.GENERAL_IMAGE, imageId);
|
|
54
|
+
const study = metaData.get(MetadataModules.GENERAL_STUDY, imageId);
|
|
55
|
+
result.InstanceNumber = 1 + Number(generalImage.instanceNumber);
|
|
56
|
+
result.PredecessorDocumentsSequence = {
|
|
57
|
+
StudyInstanceUID: study.studyInstanceUID,
|
|
58
|
+
ReferencedSeriesSequence: {
|
|
59
|
+
SeriesInstanceUID: result.SeriesInstanceUID,
|
|
60
|
+
ReferencedSOPSequence: {
|
|
61
|
+
ReferencedSOPClassUID: generalImage.sopClassUID,
|
|
62
|
+
ReferencedSOPInstanceUID: generalImage.sopInstanceUID
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return result;
|
|
67
|
+
},
|
|
68
|
+
[MetadataModules.STUDY_DATA]: imageId => {
|
|
69
|
+
return metaData.getNormalized(imageId, STUDY_MODULES);
|
|
70
|
+
},
|
|
71
|
+
[MetadataModules.SERIES_DATA]: imageId => {
|
|
72
|
+
return metaData.getNormalized(imageId, SERIES_MODULES);
|
|
73
|
+
},
|
|
74
|
+
[MetadataModules.IMAGE_DATA]: imageId => {
|
|
75
|
+
return metaData.getNormalized(imageId, IMAGE_MODULES);
|
|
76
|
+
},
|
|
77
|
+
[MetadataModules.RTSS_INSTANCE_DATA]: imageId => {
|
|
78
|
+
const newInstanceData = metaData.get(MetadataModules.NEW_INSTANCE_DATA, imageId);
|
|
79
|
+
return {
|
|
80
|
+
...newInstanceData,
|
|
81
|
+
SeriesNumber: '3201',
|
|
82
|
+
StructureSetROISequence: [],
|
|
83
|
+
ROIContourSequence: [],
|
|
84
|
+
RTROIObservationsSequence: [],
|
|
85
|
+
ReferencedFrameOfReferenceSequence: [],
|
|
86
|
+
Modality: 'RTSTRUCT',
|
|
87
|
+
SOPClassUID: '1.2.840.10008.5.1.4.1.1.481.3',
|
|
88
|
+
PositionReferenceIndicator: '',
|
|
89
|
+
StructureSetLabel: '',
|
|
90
|
+
StructureSetName: '',
|
|
91
|
+
StructureSetDate: DicomMetaDictionary.date(),
|
|
92
|
+
StructureSetTime: DicomMetaDictionary.time()
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
[MetadataModules.NEW_INSTANCE_DATA]: imageId => {
|
|
96
|
+
const studyData = metaData.get(MetadataModules.STUDY_DATA, imageId);
|
|
97
|
+
return {
|
|
98
|
+
...studyData,
|
|
99
|
+
SeriesNumber: '50000',
|
|
100
|
+
InstanceNumber: '1',
|
|
101
|
+
OperatorsName: '',
|
|
102
|
+
ReferringPhysicianName: '',
|
|
103
|
+
SpecificCharacterSet: 'ISO_IR 192',
|
|
104
|
+
Manufacturer: 'cs3d',
|
|
105
|
+
SOPInstanceUID: DicomMetaDictionary.uid(),
|
|
106
|
+
SeriesInstanceUID: DicomMetaDictionary.uid()
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
[MetadataModules.RTSS_CONTOUR]: () => metaRTSSContour,
|
|
110
|
+
[MetadataModules.SR_ANNOTATION]: () => metaSRAnnotation
|
|
111
|
+
};
|
|
112
|
+
metaData.addProvider(metadataProvider.get, 9023);
|
|
113
|
+
|
|
114
|
+
export { IMAGE_MODULES, SERIES_MODULES, STUDY_MODULES, metadataProvider };
|
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/package.json
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"name": "@cornerstonejs/adapters",
|
|
3
|
+
"version": "4.11.3",
|
|
4
|
+
"description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others",
|
|
5
|
+
"module": "./dist/esm/index.js",
|
|
6
|
+
"types": "./dist/esm/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"directories": {
|
|
11
|
+
"build": "dist"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/esm/index.js",
|
|
16
|
+
"types": "./dist/esm/index.d.ts"
|
|
12
17
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"types": "./dist/esm/index.d.ts"
|
|
17
|
-
},
|
|
18
|
-
"./cornerstone": {
|
|
19
|
-
"import": "./dist/esm/adapters/Cornerstone/index.js",
|
|
20
|
-
"types": "./dist/esm/adapters/Cornerstone/index.d.ts"
|
|
21
|
-
},
|
|
22
|
-
"./cornerstone/*": {
|
|
23
|
-
"import": "./dist/esm/adapters/Cornerstone/*.js",
|
|
24
|
-
"types": "./dist/esm/adapters/Cornerstone/*.d.ts"
|
|
25
|
-
},
|
|
26
|
-
"./cornerstone3D": {
|
|
27
|
-
"import": "./dist/esm/adapters/Cornerstone3D/index.js",
|
|
28
|
-
"types": "./dist/esm/adapters/Cornerstone3D/index.d.ts"
|
|
29
|
-
},
|
|
30
|
-
"./cornerstone3D/*": {
|
|
31
|
-
"import": "./dist/esm/adapters/Cornerstone3D/*.js",
|
|
32
|
-
"types": "./dist/esm/adapters/Cornerstone3D/*.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./enums": {
|
|
35
|
-
"import": "./dist/esm/adapters/enums/index.js",
|
|
36
|
-
"types": "./dist/esm/adapters/enums/index.d.ts"
|
|
37
|
-
},
|
|
38
|
-
"./enums/*": {
|
|
39
|
-
"import": "./dist/esm/adapters/enums/*.js",
|
|
40
|
-
"types": "./dist/esm/adapters/enums/*.d.ts"
|
|
41
|
-
},
|
|
42
|
-
"./helpers": {
|
|
43
|
-
"import": "./dist/esm/adapters/helpers/index.js",
|
|
44
|
-
"types": "./dist/esm/adapters/helpers/index.d.ts"
|
|
45
|
-
},
|
|
46
|
-
"./helpers/*": {
|
|
47
|
-
"import": "./dist/esm/adapters/helpers/*.js",
|
|
48
|
-
"types": "./dist/esm/adapters/helpers/*.d.ts"
|
|
49
|
-
},
|
|
50
|
-
"./version": {
|
|
51
|
-
"node": "./dist/esm/version.js",
|
|
52
|
-
"import": "./dist/esm/version.js",
|
|
53
|
-
"types": "./dist/esm/version.d.ts"
|
|
54
|
-
}
|
|
18
|
+
"./cornerstone": {
|
|
19
|
+
"import": "./dist/esm/adapters/Cornerstone/index.js",
|
|
20
|
+
"types": "./dist/esm/adapters/Cornerstone/index.d.ts"
|
|
55
21
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
22
|
+
"./cornerstone/*": {
|
|
23
|
+
"import": "./dist/esm/adapters/Cornerstone/*.js",
|
|
24
|
+
"types": "./dist/esm/adapters/Cornerstone/*.d.ts"
|
|
58
25
|
},
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"build:esm": "rollup -c rollup.config.mjs",
|
|
63
|
-
"build:esm:watch": "rollup --watch -c rollup.config.mjs",
|
|
64
|
-
"clean": "rm -rf node_modules/.cache/storybook && shx rm -rf dist",
|
|
65
|
-
"clean:deep": "yarn run clean && shx rm -rf node_modules",
|
|
66
|
-
"dev": "rollup --watch -c rollup.config.mjs",
|
|
67
|
-
"build:all": "yarn build",
|
|
68
|
-
"api-check": "echo 'No API check for this package'",
|
|
69
|
-
"start": "rollup --watch -c rollup.config.mjs",
|
|
70
|
-
"format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
|
|
71
|
-
"lint": "oxlint .",
|
|
72
|
-
"prebuild": "node ../../scripts/generate-version.js ./"
|
|
26
|
+
"./cornerstone3D": {
|
|
27
|
+
"import": "./dist/esm/adapters/Cornerstone3D/index.js",
|
|
28
|
+
"types": "./dist/esm/adapters/Cornerstone3D/index.d.ts"
|
|
73
29
|
},
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
30
|
+
"./cornerstone3D/*": {
|
|
31
|
+
"import": "./dist/esm/adapters/Cornerstone3D/*.js",
|
|
32
|
+
"types": "./dist/esm/adapters/Cornerstone3D/*.d.ts"
|
|
77
33
|
},
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"url": "https://github.com/cornerstonejs/cornerstone3D/issues"
|
|
34
|
+
"./enums": {
|
|
35
|
+
"import": "./dist/esm/adapters/enums/index.js",
|
|
36
|
+
"types": "./dist/esm/adapters/enums/index.d.ts"
|
|
82
37
|
},
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"buffer": "6.0.3",
|
|
87
|
-
"dcmjs": "0.43.1",
|
|
88
|
-
"gl-matrix": "3.4.3",
|
|
89
|
-
"ndarray": "1.0.19"
|
|
38
|
+
"./enums/*": {
|
|
39
|
+
"import": "./dist/esm/adapters/enums/*.js",
|
|
40
|
+
"types": "./dist/esm/adapters/enums/*.d.ts"
|
|
90
41
|
},
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
42
|
+
"./helpers": {
|
|
43
|
+
"import": "./dist/esm/adapters/helpers/index.js",
|
|
44
|
+
"types": "./dist/esm/adapters/helpers/index.d.ts"
|
|
94
45
|
},
|
|
95
|
-
"
|
|
46
|
+
"./helpers/*": {
|
|
47
|
+
"import": "./dist/esm/adapters/helpers/*.js",
|
|
48
|
+
"types": "./dist/esm/adapters/helpers/*.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./version": {
|
|
51
|
+
"node": "./dist/esm/version.js",
|
|
52
|
+
"import": "./dist/esm/version.js",
|
|
53
|
+
"types": "./dist/esm/version.d.ts"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"test": "jest --testTimeout 60000",
|
|
61
|
+
"build": "rollup -c rollup.config.mjs",
|
|
62
|
+
"build:esm": "rollup -c rollup.config.mjs",
|
|
63
|
+
"build:esm:watch": "rollup --watch -c rollup.config.mjs",
|
|
64
|
+
"clean": "rm -rf node_modules/.cache/storybook && shx rm -rf dist",
|
|
65
|
+
"clean:deep": "yarn run clean && shx rm -rf node_modules",
|
|
66
|
+
"dev": "rollup --watch -c rollup.config.mjs",
|
|
67
|
+
"build:all": "yarn build",
|
|
68
|
+
"api-check": "echo 'No API check for this package'",
|
|
69
|
+
"start": "rollup --watch -c rollup.config.mjs",
|
|
70
|
+
"format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
|
|
71
|
+
"lint": "oxlint .",
|
|
72
|
+
"prebuild": "node ../../scripts/generate-version.js ./"
|
|
73
|
+
},
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "git+https://github.com/cornerstonejs/cornerstone3D.git"
|
|
77
|
+
},
|
|
78
|
+
"author": "@cornerstonejs adapters package",
|
|
79
|
+
"license": "MIT",
|
|
80
|
+
"bugs": {
|
|
81
|
+
"url": "https://github.com/cornerstonejs/cornerstone3D/issues"
|
|
82
|
+
},
|
|
83
|
+
"homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md",
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"@babel/runtime-corejs2": "7.26.10",
|
|
86
|
+
"buffer": "6.0.3",
|
|
87
|
+
"dcmjs": "0.45.0",
|
|
88
|
+
"gl-matrix": "3.4.3",
|
|
89
|
+
"ndarray": "1.0.19"
|
|
90
|
+
},
|
|
91
|
+
"peerDependencies": {
|
|
92
|
+
"@cornerstonejs/core": "4.11.3",
|
|
93
|
+
"@cornerstonejs/tools": "4.11.3"
|
|
94
|
+
},
|
|
95
|
+
"gitHead": "e7b0cea10f4ceb71710d3f01eaead75152180b7a"
|
|
96
96
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default function getPatientModule(imageId: any, metadataProvider: any): {
|
|
2
|
-
Modality: any;
|
|
3
|
-
PatientID: any;
|
|
4
|
-
PatientName: any;
|
|
5
|
-
PatientBirthDate: string;
|
|
6
|
-
PatientAge: any;
|
|
7
|
-
PatientSex: any;
|
|
8
|
-
PatientWeight: any;
|
|
9
|
-
StudyDate: any;
|
|
10
|
-
StudyTime: any;
|
|
11
|
-
StudyID: string;
|
|
12
|
-
AccessionNumber: any;
|
|
13
|
-
};
|