@cornerstonejs/adapters 2.0.0-beta.2 → 2.0.0-beta.21
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/_virtual/_rollupPluginBabelHelpers.js +493 -0
- package/dist/esm/adapters/Cornerstone/Angle.d.ts +45 -0
- package/dist/esm/adapters/Cornerstone/Angle.js +93 -0
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.d.ts +49 -0
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.js +97 -0
- package/dist/esm/adapters/Cornerstone/Bidirectional.d.ts +89 -0
- package/dist/esm/adapters/Cornerstone/Bidirectional.js +170 -0
- package/dist/esm/adapters/Cornerstone/CircleRoi.d.ts +65 -0
- package/dist/esm/adapters/Cornerstone/CircleRoi.js +115 -0
- package/dist/esm/adapters/Cornerstone/CobbAngle.d.ts +49 -0
- package/dist/esm/adapters/Cornerstone/CobbAngle.js +98 -0
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.d.ts +57 -0
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.js +178 -0
- package/dist/esm/adapters/Cornerstone/FreehandRoi.d.ts +42 -0
- package/dist/esm/adapters/Cornerstone/FreehandRoi.js +89 -0
- package/dist/esm/adapters/Cornerstone/Length.d.ts +39 -0
- package/dist/esm/adapters/Cornerstone/Length.js +82 -0
- package/dist/esm/adapters/Cornerstone/MeasurementReport.d.ts +36 -0
- package/dist/esm/adapters/Cornerstone/MeasurementReport.js +276 -0
- package/dist/esm/adapters/Cornerstone/RectangleRoi.d.ts +44 -0
- package/dist/esm/adapters/Cornerstone/RectangleRoi.js +97 -0
- package/dist/esm/adapters/Cornerstone/Segmentation.d.ts +44 -0
- package/dist/esm/adapters/Cornerstone/Segmentation.js +79 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.d.ts +45 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.js +428 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.d.ts +54 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +1200 -0
- package/dist/esm/adapters/Cornerstone/cornerstone4Tag.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone/cornerstone4Tag.js +3 -0
- package/dist/esm/adapters/Cornerstone/index.d.ts +34 -0
- package/dist/esm/adapters/Cornerstone/index.js +29 -0
- package/dist/esm/adapters/Cornerstone3D/Angle.js +110 -0
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.d.ts +35 -0
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +123 -0
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +146 -0
- package/dist/esm/adapters/Cornerstone3D/CircleROI.js +103 -0
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +113 -0
- package/dist/esm/adapters/Cornerstone3D/CodingScheme.d.ts +9 -0
- package/dist/esm/adapters/Cornerstone3D/CodingScheme.js +15 -0
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +170 -0
- package/dist/esm/adapters/Cornerstone3D/Length.d.ts +41 -0
- package/dist/esm/adapters/Cornerstone3D/Length.js +101 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/MeasurementReport.d.ts +1 -1
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +314 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +9 -2
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +129 -0
- package/dist/esm/adapters/Cornerstone3D/Probe.d.ts +33 -0
- package/dist/esm/adapters/Cornerstone3D/Probe.js +87 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +90 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +250 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +6 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.d.ts +13 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js +22 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.d.ts +6 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.js +10 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.js +9 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.d.ts +11 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +22 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +27 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.d.ts +7 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +12 -0
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +92 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +45 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +47 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +25 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/index.js +3 -0
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.d.ts +36 -0
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +93 -0
- package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.js +3 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/index.d.ts +20 -6
- package/dist/esm/adapters/Cornerstone3D/index.js +41 -0
- package/dist/esm/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.js +20 -0
- package/dist/esm/adapters/VTKjs/Segmentation.d.ts +41 -0
- package/dist/esm/adapters/VTKjs/Segmentation.js +186 -0
- package/dist/esm/adapters/VTKjs/index.d.ts +5 -0
- package/dist/esm/adapters/VTKjs/index.js +7 -0
- package/dist/esm/adapters/enums/Events.js +13 -0
- package/dist/esm/adapters/enums/index.js +1 -0
- package/dist/esm/adapters/helpers/codeMeaningEquals.js +14 -0
- package/dist/{types → esm}/adapters/helpers/downloadDICOMData.d.ts +1 -1
- package/dist/esm/adapters/helpers/downloadDICOMData.js +31 -0
- package/dist/esm/adapters/helpers/graphicTypeEquals.js +12 -0
- package/dist/esm/adapters/helpers/index.js +4 -0
- package/dist/esm/adapters/helpers/toArray.js +5 -0
- package/dist/esm/adapters/index.d.ts +62 -0
- package/dist/esm/adapters/index.js +20 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +5 -0
- package/dist/umd/adapters.umd.js +5738 -0
- package/dist/umd/adapters.umd.js.map +1 -0
- package/package.json +14 -10
- package/dist/adapters.es.js +0 -5194
- package/dist/adapters.es.js.map +0 -1
- package/dist/types/adapters/Cornerstone/index.d.ts +0 -16
- package/dist/types/adapters/VTKjs/index.d.ts +0 -4
- package/dist/types/adapters/index.d.ts +0 -43
- package/dist/types/index.d.ts +0 -2
- /package/dist/{types → esm}/adapters/Cornerstone3D/Angle.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Bidirectional.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/CircleROI.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/CobbAngle.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/EllipticalROI.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/RectangleROI.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.d.ts +0 -0
- /package/dist/{types → esm}/adapters/enums/Events.d.ts +0 -0
- /package/dist/{types → esm}/adapters/enums/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/codeMeaningEquals.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/graphicTypeEquals.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/toArray.d.ts +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { utilities } from '@cornerstonejs/tools';
|
|
3
|
+
import dcmjs from 'dcmjs';
|
|
4
|
+
import getPatientModule from './utilities/getPatientModule.js';
|
|
5
|
+
import getReferencedFrameOfReferenceSequence from './utilities/getReferencedFrameOfReferenceSequence.js';
|
|
6
|
+
import getReferencedSeriesSequence from './utilities/getReferencedSeriesSequence.js';
|
|
7
|
+
import getRTROIObservationsSequence from './utilities/getRTROIObservationsSequence.js';
|
|
8
|
+
import getRTSeriesModule from './utilities/getRTSeriesModule.js';
|
|
9
|
+
import getStructureSetModule from './utilities/getStructureSetModule.js';
|
|
10
|
+
|
|
11
|
+
var _utilities$contours = utilities.contours,
|
|
12
|
+
generateContourSetsFromLabelmap = _utilities$contours.generateContourSetsFromLabelmap,
|
|
13
|
+
AnnotationToPointData = _utilities$contours.AnnotationToPointData;
|
|
14
|
+
var DicomMetaDictionary = dcmjs.data.DicomMetaDictionary;
|
|
15
|
+
/**
|
|
16
|
+
* Convert handles to RTSS report containing the dcmjs dicom dataset.
|
|
17
|
+
*
|
|
18
|
+
* Note: current WIP and using segmentation to contour conversion,
|
|
19
|
+
* routine that is not fully tested
|
|
20
|
+
*
|
|
21
|
+
* @param segmentations - Cornerstone tool segmentations data
|
|
22
|
+
* @param metadataProvider - Metadata provider
|
|
23
|
+
* @param DicomMetadataStore - metadata store instance
|
|
24
|
+
* @param cs - cornerstone instance
|
|
25
|
+
* @param csTools - cornerstone tool instance
|
|
26
|
+
* @returns Report object containing the dataset
|
|
27
|
+
*/
|
|
28
|
+
function generateRTSSFromSegmentations(segmentations, metadataProvider, DicomMetadataStore) {
|
|
29
|
+
// Convert segmentations to ROIContours
|
|
30
|
+
var roiContours = [];
|
|
31
|
+
var contourSets = generateContourSetsFromLabelmap({
|
|
32
|
+
segmentations: segmentations
|
|
33
|
+
});
|
|
34
|
+
contourSets.forEach(function (contourSet, segIndex) {
|
|
35
|
+
// Check contour set isn't undefined
|
|
36
|
+
if (contourSet) {
|
|
37
|
+
var contourSequence = [];
|
|
38
|
+
contourSet.sliceContours.forEach(function (sliceContour) {
|
|
39
|
+
/**
|
|
40
|
+
* addContour - Adds a new ROI with related contours to ROIContourSequence
|
|
41
|
+
*
|
|
42
|
+
* @param newContour - cornerstoneTools `ROIContour` object
|
|
43
|
+
*
|
|
44
|
+
* newContour = {
|
|
45
|
+
* name: string,
|
|
46
|
+
* description: string,
|
|
47
|
+
* contourSequence: array[contour]
|
|
48
|
+
* color: array[number],
|
|
49
|
+
* metadata: {
|
|
50
|
+
* referencedImageId: string,
|
|
51
|
+
* FrameOfReferenceUID: string
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* contour = {
|
|
56
|
+
* ContourImageSequence: array[
|
|
57
|
+
* { ReferencedSOPClassUID: string, ReferencedSOPInstanceUID: string}
|
|
58
|
+
* ]
|
|
59
|
+
* ContourGeometricType: string,
|
|
60
|
+
* NumberOfContourPoints: number,
|
|
61
|
+
* ContourData: array[number]
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
// Note: change needed if support non-planar contour representation is needed
|
|
65
|
+
var sopCommon = metadataProvider.get("sopCommonModule", sliceContour.referencedImageId);
|
|
66
|
+
var ReferencedSOPClassUID = sopCommon.sopClassUID;
|
|
67
|
+
var ReferencedSOPInstanceUID = sopCommon.sopInstanceUID;
|
|
68
|
+
var ContourImageSequence = [{
|
|
69
|
+
ReferencedSOPClassUID: ReferencedSOPClassUID,
|
|
70
|
+
ReferencedSOPInstanceUID: ReferencedSOPInstanceUID
|
|
71
|
+
} // NOTE: replace in dcmjs?
|
|
72
|
+
];
|
|
73
|
+
var sliceContourPolyData = sliceContour.polyData;
|
|
74
|
+
sliceContour.contours.forEach(function (contour, index) {
|
|
75
|
+
var ContourGeometricType = contour.type;
|
|
76
|
+
var NumberOfContourPoints = contour.contourPoints.length;
|
|
77
|
+
var ContourData = [];
|
|
78
|
+
contour.contourPoints.forEach(function (point) {
|
|
79
|
+
var pointData = sliceContourPolyData.points[point];
|
|
80
|
+
pointData[0] = +pointData[0].toFixed(2);
|
|
81
|
+
pointData[1] = +pointData[1].toFixed(2);
|
|
82
|
+
pointData[2] = +pointData[2].toFixed(2);
|
|
83
|
+
ContourData.push(pointData[0]);
|
|
84
|
+
ContourData.push(pointData[1]);
|
|
85
|
+
ContourData.push(pointData[2]);
|
|
86
|
+
});
|
|
87
|
+
contourSequence.push({
|
|
88
|
+
ContourImageSequence: ContourImageSequence,
|
|
89
|
+
ContourGeometricType: ContourGeometricType,
|
|
90
|
+
NumberOfContourPoints: NumberOfContourPoints,
|
|
91
|
+
ContourNumber: index + 1,
|
|
92
|
+
ContourData: ContourData
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
var segLabel = contourSet.label || "Segment ".concat(segIndex + 1);
|
|
97
|
+
var ROIContour = {
|
|
98
|
+
name: segLabel,
|
|
99
|
+
description: segLabel,
|
|
100
|
+
contourSequence: contourSequence,
|
|
101
|
+
color: contourSet.color,
|
|
102
|
+
metadata: contourSet.metadata
|
|
103
|
+
};
|
|
104
|
+
roiContours.push(ROIContour);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
var rtMetadata = {
|
|
108
|
+
name: segmentations.label,
|
|
109
|
+
label: segmentations.label
|
|
110
|
+
};
|
|
111
|
+
var dataset = _initializeDataset(rtMetadata, roiContours[0].metadata, metadataProvider);
|
|
112
|
+
roiContours.forEach(function (contour, index) {
|
|
113
|
+
var roiContour = {
|
|
114
|
+
ROIDisplayColor: contour.color || [255, 0, 0],
|
|
115
|
+
ContourSequence: contour.contourSequence,
|
|
116
|
+
ReferencedROINumber: index + 1
|
|
117
|
+
};
|
|
118
|
+
dataset.StructureSetROISequence.push(getStructureSetModule(contour, index));
|
|
119
|
+
dataset.ROIContourSequence.push(roiContour);
|
|
120
|
+
// ReferencedSeriesSequence
|
|
121
|
+
dataset.ReferencedSeriesSequence = getReferencedSeriesSequence(contour.metadata, index, metadataProvider, DicomMetadataStore);
|
|
122
|
+
// ReferencedFrameOfReferenceSequence
|
|
123
|
+
dataset.ReferencedFrameOfReferenceSequence = getReferencedFrameOfReferenceSequence(contour.metadata, metadataProvider, dataset);
|
|
124
|
+
});
|
|
125
|
+
var fileMetaInformationVersionArray = new Uint8Array(2);
|
|
126
|
+
fileMetaInformationVersionArray[1] = 1;
|
|
127
|
+
var _meta = {
|
|
128
|
+
FileMetaInformationVersion: {
|
|
129
|
+
Value: [fileMetaInformationVersionArray.buffer],
|
|
130
|
+
vr: "OB"
|
|
131
|
+
},
|
|
132
|
+
TransferSyntaxUID: {
|
|
133
|
+
Value: ["1.2.840.10008.1.2.1"],
|
|
134
|
+
vr: "UI"
|
|
135
|
+
},
|
|
136
|
+
ImplementationClassUID: {
|
|
137
|
+
Value: [DicomMetaDictionary.uid()],
|
|
138
|
+
// TODO: could be git hash or other valid id
|
|
139
|
+
vr: "UI"
|
|
140
|
+
},
|
|
141
|
+
ImplementationVersionName: {
|
|
142
|
+
Value: ["dcmjs"],
|
|
143
|
+
vr: "SH"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
dataset._meta = _meta;
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
dataset.SpecificCharacterSet = "ISO_IR 192";
|
|
149
|
+
return dataset;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Convert handles to RTSSReport report object containing the dcmjs dicom dataset.
|
|
153
|
+
*
|
|
154
|
+
* Note: The tool data needs to be formatted in a specific way, and currently
|
|
155
|
+
* it is limited to the RectangleROIStartEndTool in the Cornerstone.
|
|
156
|
+
*
|
|
157
|
+
* @param annotations - Array of Cornerstone tool annotation data
|
|
158
|
+
* @param metadataProvider - Metadata provider
|
|
159
|
+
* @returns Report object containing the dataset
|
|
160
|
+
*/
|
|
161
|
+
function generateRTSSFromAnnotations(annotations, metadataProvider, DicomMetadataStore) {
|
|
162
|
+
var rtMetadata = {
|
|
163
|
+
name: "RTSS from Annotations",
|
|
164
|
+
label: "RTSS from Annotations"
|
|
165
|
+
};
|
|
166
|
+
var dataset = _initializeDataset(rtMetadata, annotations[0].metadata, metadataProvider);
|
|
167
|
+
annotations.forEach(function (annotation, index) {
|
|
168
|
+
var ContourSequence = AnnotationToPointData.convert(annotation, index, metadataProvider);
|
|
169
|
+
dataset.StructureSetROISequence.push(getStructureSetModule(annotation, index));
|
|
170
|
+
dataset.ROIContourSequence.push(ContourSequence);
|
|
171
|
+
dataset.RTROIObservationsSequence.push(getRTROIObservationsSequence(annotation, index));
|
|
172
|
+
// ReferencedSeriesSequence
|
|
173
|
+
// Todo: handle more than one series
|
|
174
|
+
dataset.ReferencedSeriesSequence = getReferencedSeriesSequence(annotation.metadata, index, metadataProvider, DicomMetadataStore);
|
|
175
|
+
// ReferencedFrameOfReferenceSequence
|
|
176
|
+
dataset.ReferencedFrameOfReferenceSequence = getReferencedFrameOfReferenceSequence(annotation.metadata, metadataProvider, dataset);
|
|
177
|
+
});
|
|
178
|
+
var fileMetaInformationVersionArray = new Uint8Array(2);
|
|
179
|
+
fileMetaInformationVersionArray[1] = 1;
|
|
180
|
+
var _meta = {
|
|
181
|
+
FileMetaInformationVersion: {
|
|
182
|
+
Value: [fileMetaInformationVersionArray.buffer],
|
|
183
|
+
vr: "OB"
|
|
184
|
+
},
|
|
185
|
+
TransferSyntaxUID: {
|
|
186
|
+
Value: ["1.2.840.10008.1.2.1"],
|
|
187
|
+
vr: "UI"
|
|
188
|
+
},
|
|
189
|
+
ImplementationClassUID: {
|
|
190
|
+
Value: [DicomMetaDictionary.uid()],
|
|
191
|
+
// TODO: could be git hash or other valid id
|
|
192
|
+
vr: "UI"
|
|
193
|
+
},
|
|
194
|
+
ImplementationVersionName: {
|
|
195
|
+
Value: ["dcmjs"],
|
|
196
|
+
vr: "SH"
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
dataset._meta = _meta;
|
|
200
|
+
//@ts-ignore
|
|
201
|
+
dataset.SpecificCharacterSet = "ISO_IR 192";
|
|
202
|
+
return dataset;
|
|
203
|
+
}
|
|
204
|
+
// /**
|
|
205
|
+
// * Generate Cornerstone tool state from dataset
|
|
206
|
+
// * @param {object} dataset dataset
|
|
207
|
+
// * @param {object} hooks
|
|
208
|
+
// * @param {function} hooks.getToolClass Function to map dataset to a tool class
|
|
209
|
+
// * @returns
|
|
210
|
+
// */
|
|
211
|
+
// //static generateToolState(_dataset, _hooks = {}) {
|
|
212
|
+
// function generateToolState() {
|
|
213
|
+
// // Todo
|
|
214
|
+
// console.warn("RTSS.generateToolState not implemented");
|
|
215
|
+
// }
|
|
216
|
+
function _initializeDataset(rtMetadata, imgMetadata, metadataProvider) {
|
|
217
|
+
var rtSOPInstanceUID = DicomMetaDictionary.uid();
|
|
218
|
+
// get the first annotation data
|
|
219
|
+
var imageId = imgMetadata.referencedImageId,
|
|
220
|
+
FrameOfReferenceUID = imgMetadata.FrameOfReferenceUID;
|
|
221
|
+
var _metadataProvider$get = metadataProvider.get("generalSeriesModule", imageId),
|
|
222
|
+
studyInstanceUID = _metadataProvider$get.studyInstanceUID;
|
|
223
|
+
var patientModule = getPatientModule(imageId, metadataProvider);
|
|
224
|
+
var rtSeriesModule = getRTSeriesModule(DicomMetaDictionary);
|
|
225
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({
|
|
226
|
+
StructureSetROISequence: [],
|
|
227
|
+
ROIContourSequence: [],
|
|
228
|
+
RTROIObservationsSequence: [],
|
|
229
|
+
ReferencedSeriesSequence: [],
|
|
230
|
+
ReferencedFrameOfReferenceSequence: []
|
|
231
|
+
}, patientModule), rtSeriesModule), {}, {
|
|
232
|
+
StudyInstanceUID: studyInstanceUID,
|
|
233
|
+
SOPClassUID: "1.2.840.10008.5.1.4.1.1.481.3",
|
|
234
|
+
// RT Structure Set Storage
|
|
235
|
+
SOPInstanceUID: rtSOPInstanceUID,
|
|
236
|
+
Manufacturer: "dcmjs",
|
|
237
|
+
Modality: "RTSTRUCT",
|
|
238
|
+
FrameOfReferenceUID: FrameOfReferenceUID,
|
|
239
|
+
PositionReferenceIndicator: "",
|
|
240
|
+
StructureSetLabel: rtMetadata.label || "",
|
|
241
|
+
StructureSetName: rtMetadata.name || "",
|
|
242
|
+
ReferringPhysicianName: "",
|
|
243
|
+
OperatorsName: "",
|
|
244
|
+
StructureSetDate: DicomMetaDictionary.date(),
|
|
245
|
+
StructureSetTime: DicomMetaDictionary.time(),
|
|
246
|
+
_meta: null
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { generateRTSSFromAnnotations, generateRTSSFromSegmentations };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { utilities } from "@cornerstonejs/tools";
|
|
2
|
+
import { generateRTSSFromAnnotations, generateRTSSFromSegmentations } from "./RTSS";
|
|
3
|
+
declare const generateContourSetsFromLabelmap: typeof utilities.contours.generateContourSetsFromLabelmap;
|
|
4
|
+
export { generateContourSetsFromLabelmap, generateRTSSFromAnnotations, generateRTSSFromSegmentations };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { utilities } from '@cornerstonejs/tools';
|
|
2
|
+
export { generateRTSSFromAnnotations, generateRTSSFromSegmentations } from './RTSS.js';
|
|
3
|
+
|
|
4
|
+
var generateContourSetsFromLabelmap = utilities.contours.generateContourSetsFromLabelmap;
|
|
5
|
+
|
|
6
|
+
export { generateContourSetsFromLabelmap };
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function getPatientModule(imageId, metadataProvider) {
|
|
2
|
+
var generalSeriesModule = metadataProvider.get("generalSeriesModule", imageId);
|
|
3
|
+
var generalStudyModule = metadataProvider.get("generalStudyModule", imageId);
|
|
4
|
+
var patientStudyModule = metadataProvider.get("patientStudyModule", imageId);
|
|
5
|
+
var patientModule = metadataProvider.get("patientModule", imageId);
|
|
6
|
+
var patientDemographicModule = metadataProvider.get("patientDemographicModule", imageId);
|
|
7
|
+
return {
|
|
8
|
+
Modality: generalSeriesModule.modality,
|
|
9
|
+
PatientID: patientModule.patientId,
|
|
10
|
+
PatientName: patientModule.patientName,
|
|
11
|
+
PatientBirthDate: "",
|
|
12
|
+
PatientAge: patientStudyModule.patientAge,
|
|
13
|
+
PatientSex: patientDemographicModule.patientSex,
|
|
14
|
+
PatientWeight: patientStudyModule.patientWeight,
|
|
15
|
+
StudyDate: generalStudyModule.studyDate,
|
|
16
|
+
StudyTime: generalStudyModule.studyTime,
|
|
17
|
+
StudyID: "ToDo",
|
|
18
|
+
AccessionNumber: generalStudyModule.accessionNumber
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { getPatientModule as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function getRTROIObservationsSequence(toolData, index) {
|
|
2
|
+
return {
|
|
3
|
+
ObservationNumber: index + 1,
|
|
4
|
+
ReferencedROINumber: index + 1,
|
|
5
|
+
RTROIInterpretedType: "Todo: type",
|
|
6
|
+
ROIInterpreter: "Todo: interpreter"
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { getRTROIObservationsSequence as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function getRTSeriesModule(DicomMetaDictionary) {
|
|
2
|
+
return {
|
|
3
|
+
SeriesInstanceUID: DicomMetaDictionary.uid(),
|
|
4
|
+
// generate a new series instance uid
|
|
5
|
+
SeriesNumber: "99" // Todo:: what should be the series number?
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { getRTSeriesModule as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function getReferencedFrameOfReferenceSequence(metadata: any, metadataProvider: any, dataset: any): {
|
|
2
|
+
FrameOfReferenceUID: any;
|
|
3
|
+
RTReferencedStudySequence: {
|
|
4
|
+
ReferencedSOPClassUID: any;
|
|
5
|
+
ReferencedSOPInstanceUID: any;
|
|
6
|
+
RTReferencedSeriesSequence: {
|
|
7
|
+
SeriesInstanceUID: any;
|
|
8
|
+
ContourImageSequence: any[];
|
|
9
|
+
}[];
|
|
10
|
+
}[];
|
|
11
|
+
}[];
|
package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { toConsumableArray as _toConsumableArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
|
|
3
|
+
function getReferencedFrameOfReferenceSequence(metadata, metadataProvider, dataset) {
|
|
4
|
+
var imageId = metadata.referencedImageId,
|
|
5
|
+
FrameOfReferenceUID = metadata.FrameOfReferenceUID;
|
|
6
|
+
var instance = metadataProvider.get("instance", imageId);
|
|
7
|
+
var SeriesInstanceUID = instance.SeriesInstanceUID;
|
|
8
|
+
var ReferencedSeriesSequence = dataset.ReferencedSeriesSequence;
|
|
9
|
+
return [{
|
|
10
|
+
FrameOfReferenceUID: FrameOfReferenceUID,
|
|
11
|
+
RTReferencedStudySequence: [{
|
|
12
|
+
ReferencedSOPClassUID: dataset.SOPClassUID,
|
|
13
|
+
ReferencedSOPInstanceUID: dataset.SOPInstanceUID,
|
|
14
|
+
RTReferencedSeriesSequence: [{
|
|
15
|
+
SeriesInstanceUID: SeriesInstanceUID,
|
|
16
|
+
ContourImageSequence: _toConsumableArray(ReferencedSeriesSequence[0].ReferencedInstanceSequence)
|
|
17
|
+
}]
|
|
18
|
+
}]
|
|
19
|
+
}];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { getReferencedFrameOfReferenceSequence as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function getReferencedSeriesSequence(metadata, _index, metadataProvider, DicomMetadataStore) {
|
|
2
|
+
// grab imageId from toolData
|
|
3
|
+
var imageId = metadata.referencedImageId;
|
|
4
|
+
var instance = metadataProvider.get("instance", imageId);
|
|
5
|
+
var SeriesInstanceUID = instance.SeriesInstanceUID,
|
|
6
|
+
StudyInstanceUID = instance.StudyInstanceUID;
|
|
7
|
+
var ReferencedSeriesSequence = [];
|
|
8
|
+
if (SeriesInstanceUID) {
|
|
9
|
+
var series = DicomMetadataStore.getSeries(StudyInstanceUID, SeriesInstanceUID);
|
|
10
|
+
var ReferencedSeries = {
|
|
11
|
+
SeriesInstanceUID: SeriesInstanceUID,
|
|
12
|
+
ReferencedInstanceSequence: []
|
|
13
|
+
};
|
|
14
|
+
series.instances.forEach(function (instance) {
|
|
15
|
+
var SOPInstanceUID = instance.SOPInstanceUID,
|
|
16
|
+
SOPClassUID = instance.SOPClassUID;
|
|
17
|
+
ReferencedSeries.ReferencedInstanceSequence.push({
|
|
18
|
+
ReferencedSOPClassUID: SOPClassUID,
|
|
19
|
+
ReferencedSOPInstanceUID: SOPInstanceUID
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
ReferencedSeriesSequence.push(ReferencedSeries);
|
|
23
|
+
}
|
|
24
|
+
return ReferencedSeriesSequence;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { getReferencedSeriesSequence as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function getStructureSetModule(contour, index) {
|
|
2
|
+
var FrameOfReferenceUID = contour.metadata.FrameOfReferenceUID;
|
|
3
|
+
return {
|
|
4
|
+
ROINumber: index + 1,
|
|
5
|
+
ROIName: contour.name || "Todo: name ".concat(index + 1),
|
|
6
|
+
ROIDescription: "Todo: description ".concat(index + 1),
|
|
7
|
+
ROIGenerationAlgorithm: "Todo: algorithm",
|
|
8
|
+
ReferencedFrameOfReferenceUID: FrameOfReferenceUID
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { getStructureSetModule as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineProperty as _defineProperty, createClass as _createClass, slicedToArray as _slicedToArray, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { utilities } from 'dcmjs';
|
|
3
|
+
import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
|
|
4
|
+
import MeasurementReport from './MeasurementReport.js';
|
|
5
|
+
|
|
6
|
+
var TID300Polyline = utilities.TID300.Polyline;
|
|
7
|
+
var TOOLTYPE = "RectangleROI";
|
|
8
|
+
var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(TOOLTYPE);
|
|
9
|
+
var RectangleROI = /*#__PURE__*/function () {
|
|
10
|
+
function RectangleROI() {
|
|
11
|
+
_classCallCheck(this, RectangleROI);
|
|
12
|
+
}
|
|
13
|
+
return _createClass(RectangleROI, null, [{
|
|
14
|
+
key: "getMeasurementData",
|
|
15
|
+
value: function getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
|
|
16
|
+
var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, RectangleROI.toolType),
|
|
17
|
+
defaultState = _MeasurementReport$ge.defaultState,
|
|
18
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
19
|
+
SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
|
|
20
|
+
ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
|
|
21
|
+
var referencedImageId = defaultState.annotation.metadata.referencedImageId;
|
|
22
|
+
var GraphicData = SCOORDGroup.GraphicData;
|
|
23
|
+
var worldCoords = [];
|
|
24
|
+
for (var i = 0; i < GraphicData.length; i += 2) {
|
|
25
|
+
var point = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
|
|
26
|
+
worldCoords.push(point);
|
|
27
|
+
}
|
|
28
|
+
var state = defaultState;
|
|
29
|
+
state.annotation.data = {
|
|
30
|
+
handles: {
|
|
31
|
+
points: [worldCoords[0], worldCoords[1], worldCoords[3], worldCoords[2]],
|
|
32
|
+
activeHandleIndex: 0,
|
|
33
|
+
textBox: {
|
|
34
|
+
hasMoved: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
cachedStats: _defineProperty({}, "imageId:".concat(referencedImageId), {
|
|
38
|
+
area: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : null
|
|
39
|
+
}),
|
|
40
|
+
frameNumber: ReferencedFrameNumber
|
|
41
|
+
};
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
key: "getTID300RepresentationArguments",
|
|
46
|
+
value: function getTID300RepresentationArguments(tool, worldToImageCoords) {
|
|
47
|
+
var data = tool.data,
|
|
48
|
+
finding = tool.finding,
|
|
49
|
+
findingSites = tool.findingSites,
|
|
50
|
+
metadata = tool.metadata;
|
|
51
|
+
var _data$cachedStats = data.cachedStats,
|
|
52
|
+
cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
|
|
53
|
+
handles = data.handles;
|
|
54
|
+
var referencedImageId = metadata.referencedImageId;
|
|
55
|
+
if (!referencedImageId) {
|
|
56
|
+
throw new Error("CobbAngle.getTID300RepresentationArguments: referencedImageId is not defined");
|
|
57
|
+
}
|
|
58
|
+
var corners = handles.points.map(function (point) {
|
|
59
|
+
return worldToImageCoords(referencedImageId, point);
|
|
60
|
+
});
|
|
61
|
+
var area = cachedStats.area,
|
|
62
|
+
perimeter = cachedStats.perimeter;
|
|
63
|
+
return {
|
|
64
|
+
points: [corners[0], corners[1], corners[3], corners[2], corners[0]],
|
|
65
|
+
area: area,
|
|
66
|
+
perimeter: perimeter,
|
|
67
|
+
trackingIdentifierTextValue: trackingIdentifierTextValue,
|
|
68
|
+
finding: finding,
|
|
69
|
+
findingSites: findingSites || []
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
}();
|
|
74
|
+
_defineProperty(RectangleROI, "toolType", TOOLTYPE);
|
|
75
|
+
_defineProperty(RectangleROI, "utilityToolType", TOOLTYPE);
|
|
76
|
+
_defineProperty(RectangleROI, "TID300Representation", TID300Polyline);
|
|
77
|
+
_defineProperty(RectangleROI, "isValidCornerstoneTrackingIdentifier", function (TrackingIdentifier) {
|
|
78
|
+
if (!TrackingIdentifier.includes(":")) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
|
|
82
|
+
_TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
|
|
83
|
+
cornerstone3DTag = _TrackingIdentifier$s2[0],
|
|
84
|
+
toolType = _TrackingIdentifier$s2[1];
|
|
85
|
+
if (cornerstone3DTag !== CORNERSTONE_3D_TAG) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return toolType === TOOLTYPE;
|
|
89
|
+
});
|
|
90
|
+
MeasurementReport.registerTool(RectangleROI);
|
|
91
|
+
|
|
92
|
+
export { RectangleROI as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates 2D label maps from a 3D label map.
|
|
3
|
+
* @param labelmap3D - The 3D label map object to generate 2D label maps from. It is derived
|
|
4
|
+
* from the volume labelmap.
|
|
5
|
+
* @returns The label map object containing the 2D label maps and segments on label maps.
|
|
6
|
+
*/
|
|
7
|
+
function generateLabelMaps2DFrom3D(labelmap3D) {
|
|
8
|
+
// 1. we need to generate labelmaps2D from labelmaps3D, a labelmap2D is for each
|
|
9
|
+
// slice
|
|
10
|
+
var scalarData = labelmap3D.scalarData,
|
|
11
|
+
dimensions = labelmap3D.dimensions;
|
|
12
|
+
// scalarData is a flat array of all the pixels in the volume.
|
|
13
|
+
var labelmaps2D = [];
|
|
14
|
+
var segmentsOnLabelmap3D = new Set();
|
|
15
|
+
// X-Y are the row and column dimensions, Z is the number of slices.
|
|
16
|
+
for (var z = 0; z < dimensions[2]; z++) {
|
|
17
|
+
var pixelData = scalarData.slice(z * dimensions[0] * dimensions[1], (z + 1) * dimensions[0] * dimensions[1]);
|
|
18
|
+
var segmentsOnLabelmap = [];
|
|
19
|
+
for (var i = 0; i < pixelData.length; i++) {
|
|
20
|
+
var segment = pixelData[i];
|
|
21
|
+
if (!segmentsOnLabelmap.includes(segment) && segment !== 0) {
|
|
22
|
+
segmentsOnLabelmap.push(segment);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
var labelmap2D = {
|
|
26
|
+
segmentsOnLabelmap: segmentsOnLabelmap,
|
|
27
|
+
pixelData: pixelData,
|
|
28
|
+
rows: dimensions[1],
|
|
29
|
+
columns: dimensions[0]
|
|
30
|
+
};
|
|
31
|
+
if (segmentsOnLabelmap.length === 0) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
segmentsOnLabelmap.forEach(function (segmentIndex) {
|
|
35
|
+
segmentsOnLabelmap3D.add(segmentIndex);
|
|
36
|
+
});
|
|
37
|
+
labelmaps2D[dimensions[2] - 1 - z] = labelmap2D;
|
|
38
|
+
}
|
|
39
|
+
// remove segment 0 from segmentsOnLabelmap3D
|
|
40
|
+
labelmap3D.segmentsOnLabelmap = Array.from(segmentsOnLabelmap3D);
|
|
41
|
+
labelmap3D.labelmaps2D = labelmaps2D;
|
|
42
|
+
return labelmap3D;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { generateLabelMaps2DFrom3D };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { normalizers, derivations } from 'dcmjs';
|
|
3
|
+
import { fillSegmentation } from '../../Cornerstone/Segmentation_4X.js';
|
|
4
|
+
|
|
5
|
+
var Normalizer = normalizers.Normalizer;
|
|
6
|
+
var SegmentationDerivation = derivations.Segmentation;
|
|
7
|
+
/**
|
|
8
|
+
* generateSegmentation - Generates a DICOM Segmentation object given cornerstoneTools data.
|
|
9
|
+
*
|
|
10
|
+
* @param images - An array of the cornerstone image objects, which includes imageId and metadata
|
|
11
|
+
* @param labelmaps - An array of the 3D Volumes that contain the segmentation data.
|
|
12
|
+
*/
|
|
13
|
+
function generateSegmentation(images, labelmaps, metadata) {
|
|
14
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
15
|
+
var segmentation = _createMultiframeSegmentationFromReferencedImages(images, metadata, options);
|
|
16
|
+
return fillSegmentation(segmentation, labelmaps, options);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* _createMultiframeSegmentationFromReferencedImages - description
|
|
20
|
+
*
|
|
21
|
+
* @param images - An array of the cornerstone image objects related to the reference
|
|
22
|
+
* series that the segmentation is derived from. You can use methods such as
|
|
23
|
+
* volume.getCornerstoneImages() to get this array.
|
|
24
|
+
*
|
|
25
|
+
* @param options - the options object for the SegmentationDerivation.
|
|
26
|
+
* @returns The Seg derived dataSet.
|
|
27
|
+
*/
|
|
28
|
+
function _createMultiframeSegmentationFromReferencedImages(images, metadata, options) {
|
|
29
|
+
var datasets = images.map(function (image) {
|
|
30
|
+
// add the sopClassUID to the dataset
|
|
31
|
+
var instance = metadata.get("instance", image.imageId);
|
|
32
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, image), instance), {}, {
|
|
33
|
+
// Todo: move to dcmjs tag style
|
|
34
|
+
SOPClassUID: instance.SopClassUID || instance.SOPClassUID,
|
|
35
|
+
SOPInstanceUID: instance.SopInstanceUID || instance.SOPInstanceUID,
|
|
36
|
+
PixelData: image.voxelManager.getScalarData(),
|
|
37
|
+
_vrMap: {
|
|
38
|
+
PixelData: "OW"
|
|
39
|
+
},
|
|
40
|
+
_meta: {}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
var multiframe = Normalizer.normalizeToDataset(datasets);
|
|
44
|
+
return new SegmentationDerivation([multiframe], options);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { generateSegmentation };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CornerstoneSEG } from '../../Cornerstone/index.js';
|
|
2
|
+
|
|
3
|
+
var Segmentation = CornerstoneSEG.Segmentation;
|
|
4
|
+
var generateToolStateCornerstoneLegacy = Segmentation.generateToolState;
|
|
5
|
+
/**
|
|
6
|
+
* generateToolState - Given a set of cornerstoneTools imageIds and a Segmentation buffer,
|
|
7
|
+
* derive cornerstoneTools toolState and brush metadata.
|
|
8
|
+
*
|
|
9
|
+
* @param imageIds - An array of the imageIds.
|
|
10
|
+
* @param arrayBuffer - The SEG arrayBuffer.
|
|
11
|
+
* @param skipOverlapping - skip checks for overlapping segs, default value false.
|
|
12
|
+
* @param tolerance - default value 1.e-3.
|
|
13
|
+
*
|
|
14
|
+
* @returns a list of array buffer for each labelMap
|
|
15
|
+
* an object from which the segment metadata can be derived
|
|
16
|
+
* list containing the track of segments per frame
|
|
17
|
+
* list containing the track of segments per frame for each labelMap (available only for the overlapping case).
|
|
18
|
+
*/
|
|
19
|
+
function generateToolState(imageIds, arrayBuffer, metadataProvider) {
|
|
20
|
+
var skipOverlapping = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
21
|
+
var tolerance = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1e-3;
|
|
22
|
+
return generateToolStateCornerstoneLegacy(imageIds, arrayBuffer, metadataProvider, skipOverlapping, tolerance);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { generateToolState };
|