@cornerstonejs/adapters 0.1.2 → 0.1.4
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/package.json +14 -5
- package/src/adapters/Cornerstone/Angle.js +92 -0
- package/src/adapters/Cornerstone/ArrowAnnotate.js +106 -0
- package/src/adapters/Cornerstone/Bidirectional.js +187 -0
- package/src/adapters/Cornerstone/CircleRoi.js +109 -0
- package/src/adapters/Cornerstone/CobbAngle.js +96 -0
- package/src/adapters/Cornerstone/EllipticalRoi.js +149 -0
- package/src/adapters/Cornerstone/FreehandRoi.js +82 -0
- package/src/adapters/Cornerstone/Length.js +80 -0
- package/src/adapters/Cornerstone/MeasurementReport.js +352 -0
- package/src/adapters/Cornerstone/RectangleRoi.js +92 -0
- package/src/adapters/Cornerstone/Segmentation.js +118 -0
- package/src/adapters/Cornerstone/Segmentation_3X.js +632 -0
- package/src/adapters/Cornerstone/Segmentation_4X.js +1543 -0
- package/src/adapters/Cornerstone/cornerstone4Tag.js +1 -0
- package/src/adapters/Cornerstone/index.js +27 -0
- package/src/adapters/Cornerstone3D/ArrowAnnotate.js +155 -0
- package/src/adapters/Cornerstone3D/Bidirectional.js +196 -0
- package/src/adapters/Cornerstone3D/CodingScheme.js +16 -0
- package/src/adapters/Cornerstone3D/EllipticalROI.js +204 -0
- package/src/adapters/Cornerstone3D/Length.js +113 -0
- package/src/adapters/Cornerstone3D/MeasurementReport.js +445 -0
- package/src/adapters/Cornerstone3D/PlanarFreehandROI.js +137 -0
- package/src/adapters/Cornerstone3D/Probe.js +106 -0
- package/src/adapters/Cornerstone3D/cornerstone3DTag.js +1 -0
- package/src/adapters/Cornerstone3D/index.js +24 -0
- package/src/adapters/VTKjs/Segmentation.js +223 -0
- package/src/adapters/VTKjs/index.js +7 -0
- package/src/adapters/helpers.js +19 -0
- package/src/adapters/index.js +11 -0
- package/src/index.js +4 -0
- package/.babelrc +0 -9
- package/.eslintrc.json +0 -18
- package/.prettierrc +0 -5
- package/CHANGELOG.md +0 -106
- package/generate-dictionary.js +0 -145
- package/netlify.toml +0 -20
- package/rollup.config.js +0 -37
- package/test/adapters.test.js +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { utilities } from "dcmjs";
|
|
2
|
+
import CORNERSTONE_3D_TAG from "./cornerstone3DTag";
|
|
3
|
+
import MeasurementReport from "./MeasurementReport";
|
|
4
|
+
|
|
5
|
+
const { Point: TID300Point } = utilities.TID300;
|
|
6
|
+
|
|
7
|
+
const PROBE = "Probe";
|
|
8
|
+
const trackingIdentifierTextValue = `${CORNERSTONE_3D_TAG}:${PROBE}`;
|
|
9
|
+
|
|
10
|
+
class Probe {
|
|
11
|
+
static getMeasurementData(
|
|
12
|
+
MeasurementGroup,
|
|
13
|
+
sopInstanceUIDToImageIdMap,
|
|
14
|
+
imageToWorldCoords,
|
|
15
|
+
metadata
|
|
16
|
+
) {
|
|
17
|
+
const { defaultState, SCOORDGroup, ReferencedFrameNumber } =
|
|
18
|
+
MeasurementReport.getSetupMeasurementData(
|
|
19
|
+
MeasurementGroup,
|
|
20
|
+
sopInstanceUIDToImageIdMap,
|
|
21
|
+
metadata,
|
|
22
|
+
Probe.toolType
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const referencedImageId =
|
|
26
|
+
defaultState.annotation.metadata.referencedImageId;
|
|
27
|
+
|
|
28
|
+
const { GraphicData } = SCOORDGroup;
|
|
29
|
+
|
|
30
|
+
const worldCoords = [];
|
|
31
|
+
for (let i = 0; i < GraphicData.length; i += 2) {
|
|
32
|
+
const point = imageToWorldCoords(referencedImageId, [
|
|
33
|
+
GraphicData[i],
|
|
34
|
+
GraphicData[i + 1]
|
|
35
|
+
]);
|
|
36
|
+
worldCoords.push(point);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const state = defaultState;
|
|
40
|
+
|
|
41
|
+
state.annotation.data = {
|
|
42
|
+
handles: {
|
|
43
|
+
points: worldCoords,
|
|
44
|
+
activeHandleIndex: null,
|
|
45
|
+
textBox: {
|
|
46
|
+
hasMoved: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
frameNumber: ReferencedFrameNumber
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return state;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static getTID300RepresentationArguments(tool, worldToImageCoords) {
|
|
56
|
+
const { data, metadata } = tool;
|
|
57
|
+
let { finding, findingSites } = tool;
|
|
58
|
+
const { referencedImageId } = metadata;
|
|
59
|
+
|
|
60
|
+
if (!referencedImageId) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"Probe.getTID300RepresentationArguments: referencedImageId is not defined"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { points } = data.handles;
|
|
67
|
+
|
|
68
|
+
const pointsImage = points.map(point => {
|
|
69
|
+
const pointImage = worldToImageCoords(referencedImageId, point);
|
|
70
|
+
return {
|
|
71
|
+
x: pointImage[0],
|
|
72
|
+
y: pointImage[1]
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const TID300RepresentationArguments = {
|
|
77
|
+
points: pointsImage,
|
|
78
|
+
trackingIdentifierTextValue,
|
|
79
|
+
findingSites: findingSites || [],
|
|
80
|
+
finding
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return TID300RepresentationArguments;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Probe.toolType = PROBE;
|
|
88
|
+
Probe.utilityToolType = PROBE;
|
|
89
|
+
Probe.TID300Representation = TID300Point;
|
|
90
|
+
Probe.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
|
|
91
|
+
if (!TrackingIdentifier.includes(":")) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const [cornerstone3DTag, toolType] = TrackingIdentifier.split(":");
|
|
96
|
+
|
|
97
|
+
if (cornerstone3DTag !== CORNERSTONE_3D_TAG) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return toolType === PROBE;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
MeasurementReport.registerTool(Probe);
|
|
105
|
+
|
|
106
|
+
export default Probe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default "Cornerstone3DTools@^0.1.0";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import MeasurementReport from "./MeasurementReport";
|
|
2
|
+
import CodeScheme from "./CodingScheme";
|
|
3
|
+
import CORNERSTONE_3D_TAG from "./cornerstone3DTag";
|
|
4
|
+
|
|
5
|
+
import ArrowAnnotate from "./ArrowAnnotate";
|
|
6
|
+
import Bidirectional from "./Bidirectional";
|
|
7
|
+
import EllipticalROI from "./EllipticalROI";
|
|
8
|
+
import Length from "./Length";
|
|
9
|
+
import PlanarFreehandROI from "./PlanarFreehandROI";
|
|
10
|
+
import Probe from "./Probe";
|
|
11
|
+
|
|
12
|
+
const Cornerstone3D = {
|
|
13
|
+
Bidirectional,
|
|
14
|
+
Length,
|
|
15
|
+
EllipticalROI,
|
|
16
|
+
ArrowAnnotate,
|
|
17
|
+
Probe,
|
|
18
|
+
PlanarFreehandROI,
|
|
19
|
+
MeasurementReport,
|
|
20
|
+
CodeScheme,
|
|
21
|
+
CORNERSTONE_3D_TAG
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Cornerstone3D;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import {data} from 'dcmjs';
|
|
2
|
+
|
|
3
|
+
const {Colors, BitArray} = data;
|
|
4
|
+
|
|
5
|
+
// TODO: Is there a better name for this? RGBAInt?
|
|
6
|
+
// Should we move it to Colors.js
|
|
7
|
+
function dicomlab2RGBA(cielab) {
|
|
8
|
+
const rgba = Colors.dicomlab2RGB(cielab).map(x => Math.round(x * 255));
|
|
9
|
+
rgba.push(255);
|
|
10
|
+
|
|
11
|
+
return rgba;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// TODO: Copied these functions in from VTK Math so we don't need a dependency.
|
|
15
|
+
// I guess we should put them somewhere
|
|
16
|
+
// https://github.com/Kitware/vtk-js/blob/master/Sources/Common/Core/Math/index.js
|
|
17
|
+
function cross(x, y, out) {
|
|
18
|
+
const Zx = x[1] * y[2] - x[2] * y[1];
|
|
19
|
+
const Zy = x[2] * y[0] - x[0] * y[2];
|
|
20
|
+
const Zz = x[0] * y[1] - x[1] * y[0];
|
|
21
|
+
out[0] = Zx;
|
|
22
|
+
out[1] = Zy;
|
|
23
|
+
out[2] = Zz;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function norm(x, n = 3) {
|
|
27
|
+
switch (n) {
|
|
28
|
+
case 1:
|
|
29
|
+
return Math.abs(x);
|
|
30
|
+
case 2:
|
|
31
|
+
return Math.sqrt(x[0] * x[0] + x[1] * x[1]);
|
|
32
|
+
case 3:
|
|
33
|
+
return Math.sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
|
|
34
|
+
default: {
|
|
35
|
+
let sum = 0;
|
|
36
|
+
for (let i = 0; i < n; i++) {
|
|
37
|
+
sum += x[i] * x[i];
|
|
38
|
+
}
|
|
39
|
+
return Math.sqrt(sum);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function normalize(x) {
|
|
45
|
+
const den = norm(x);
|
|
46
|
+
if (den !== 0.0) {
|
|
47
|
+
x[0] /= den;
|
|
48
|
+
x[1] /= den;
|
|
49
|
+
x[2] /= den;
|
|
50
|
+
}
|
|
51
|
+
return den;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function subtract(a, b, out) {
|
|
55
|
+
out[0] = a[0] - b[0];
|
|
56
|
+
out[1] = a[1] - b[1];
|
|
57
|
+
out[2] = a[2] - b[2];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// TODO: This is a useful utility on its own. We should move it somewhere?
|
|
61
|
+
// dcmjs.adapters.vtk.Multiframe? dcmjs.utils?
|
|
62
|
+
function geometryFromFunctionalGroups(dataset, PerFrameFunctionalGroups) {
|
|
63
|
+
const geometry = {};
|
|
64
|
+
const pixelMeasures =
|
|
65
|
+
dataset.SharedFunctionalGroupsSequence.PixelMeasuresSequence;
|
|
66
|
+
const planeOrientation =
|
|
67
|
+
dataset.SharedFunctionalGroupsSequence.PlaneOrientationSequence;
|
|
68
|
+
|
|
69
|
+
// Find the origin of the volume from the PerFrameFunctionalGroups' ImagePositionPatient values
|
|
70
|
+
//
|
|
71
|
+
// TODO: assumes sorted frames. This should read the ImagePositionPatient from each frame and
|
|
72
|
+
// sort them to obtain the first and last position along the acquisition axis.
|
|
73
|
+
const firstFunctionalGroup = PerFrameFunctionalGroups[0];
|
|
74
|
+
const lastFunctionalGroup =
|
|
75
|
+
PerFrameFunctionalGroups[PerFrameFunctionalGroups.length - 1];
|
|
76
|
+
const firstPosition =
|
|
77
|
+
firstFunctionalGroup.PlanePositionSequence.ImagePositionPatient.map(
|
|
78
|
+
Number
|
|
79
|
+
);
|
|
80
|
+
const lastPosition =
|
|
81
|
+
lastFunctionalGroup.PlanePositionSequence.ImagePositionPatient.map(
|
|
82
|
+
Number
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
geometry.origin = firstPosition;
|
|
86
|
+
|
|
87
|
+
// NB: DICOM PixelSpacing is defined as Row then Column,
|
|
88
|
+
// unlike ImageOrientationPatient
|
|
89
|
+
geometry.spacing = [
|
|
90
|
+
pixelMeasures.PixelSpacing[1],
|
|
91
|
+
pixelMeasures.PixelSpacing[0],
|
|
92
|
+
pixelMeasures.SpacingBetweenSlices
|
|
93
|
+
].map(Number);
|
|
94
|
+
|
|
95
|
+
geometry.dimensions = [
|
|
96
|
+
dataset.Columns,
|
|
97
|
+
dataset.Rows,
|
|
98
|
+
PerFrameFunctionalGroups.length
|
|
99
|
+
].map(Number);
|
|
100
|
+
|
|
101
|
+
const orientation = planeOrientation.ImageOrientationPatient.map(Number);
|
|
102
|
+
const columnStepToPatient = orientation.slice(0, 3);
|
|
103
|
+
const rowStepToPatient = orientation.slice(3, 6);
|
|
104
|
+
|
|
105
|
+
geometry.planeNormal = [];
|
|
106
|
+
|
|
107
|
+
cross(columnStepToPatient, rowStepToPatient, geometry.planeNormal);
|
|
108
|
+
|
|
109
|
+
geometry.sliceStep = [];
|
|
110
|
+
subtract(lastPosition, firstPosition, geometry.sliceStep);
|
|
111
|
+
normalize(geometry.sliceStep);
|
|
112
|
+
geometry.direction = columnStepToPatient
|
|
113
|
+
.concat(rowStepToPatient)
|
|
114
|
+
.concat(geometry.sliceStep);
|
|
115
|
+
|
|
116
|
+
return geometry;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export default class Segmentation {
|
|
120
|
+
constructor() {}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Produces an array of Segments from an input DICOM Segmentation dataset
|
|
124
|
+
*
|
|
125
|
+
* Segments are returned with Geometry values that can be used to create
|
|
126
|
+
* VTK Image Data objects.
|
|
127
|
+
*
|
|
128
|
+
* @example Example usage to create VTK Volume actors from each segment:
|
|
129
|
+
*
|
|
130
|
+
* const actors = [];
|
|
131
|
+
* const segments = generateToolState(dataset);
|
|
132
|
+
* segments.forEach(segment => {
|
|
133
|
+
* // now make actors using the segment information
|
|
134
|
+
* const scalarArray = vtk.Common.Core.vtkDataArray.newInstance({
|
|
135
|
+
* name: "Scalars",
|
|
136
|
+
* numberOfComponents: 1,
|
|
137
|
+
* values: segment.pixelData,
|
|
138
|
+
* });
|
|
139
|
+
*
|
|
140
|
+
* const imageData = vtk.Common.DataModel.vtkImageData.newInstance();
|
|
141
|
+
* imageData.getPointData().setScalars(scalarArray);
|
|
142
|
+
* imageData.setDimensions(geometry.dimensions);
|
|
143
|
+
* imageData.setSpacing(geometry.spacing);
|
|
144
|
+
* imageData.setOrigin(geometry.origin);
|
|
145
|
+
* imageData.setDirection(geometry.direction);
|
|
146
|
+
*
|
|
147
|
+
* const mapper = vtk.Rendering.Core.vtkVolumeMapper.newInstance();
|
|
148
|
+
* mapper.setInputData(imageData);
|
|
149
|
+
* mapper.setSampleDistance(2.);
|
|
150
|
+
*
|
|
151
|
+
* const actor = vtk.Rendering.Core.vtkVolume.newInstance();
|
|
152
|
+
* actor.setMapper(mapper);
|
|
153
|
+
*
|
|
154
|
+
* actors.push(actor);
|
|
155
|
+
* });
|
|
156
|
+
*
|
|
157
|
+
* @param dataset
|
|
158
|
+
* @return {{}}
|
|
159
|
+
*/
|
|
160
|
+
static generateSegments(dataset) {
|
|
161
|
+
if (dataset.SegmentSequence.constructor.name !== "Array") {
|
|
162
|
+
dataset.SegmentSequence = [dataset.SegmentSequence];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
dataset.SegmentSequence.forEach(segment => {
|
|
166
|
+
// TODO: other interesting fields could be extracted from the segment
|
|
167
|
+
// TODO: Read SegmentsOverlay field
|
|
168
|
+
// http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.20.2.html
|
|
169
|
+
|
|
170
|
+
// TODO: Looks like vtkColor only wants RGB in 0-1 values.
|
|
171
|
+
// Why was this example converting to RGBA with 0-255 values?
|
|
172
|
+
const color = dicomlab2RGBA(segment.RecommendedDisplayCIELabValue);
|
|
173
|
+
|
|
174
|
+
segments[segment.SegmentNumber] = {
|
|
175
|
+
color,
|
|
176
|
+
functionalGroups: [],
|
|
177
|
+
offset: null,
|
|
178
|
+
size: null,
|
|
179
|
+
pixelData: null
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// make a list of functional groups per segment
|
|
184
|
+
dataset.PerFrameFunctionalGroupsSequence.forEach(functionalGroup => {
|
|
185
|
+
const segmentNumber =
|
|
186
|
+
functionalGroup.SegmentIdentificationSequence
|
|
187
|
+
.ReferencedSegmentNumber;
|
|
188
|
+
|
|
189
|
+
segments[segmentNumber].functionalGroups.push(functionalGroup);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// determine per-segment index into the pixel data
|
|
193
|
+
// TODO: only handles one-bit-per pixel
|
|
194
|
+
const frameSize = Math.ceil((dataset.Rows * dataset.Columns) / 8);
|
|
195
|
+
let nextOffset = 0;
|
|
196
|
+
|
|
197
|
+
Object.keys(segments).forEach(segmentNumber => {
|
|
198
|
+
const segment = segments[segmentNumber];
|
|
199
|
+
|
|
200
|
+
segment.numberOfFrames = segment.functionalGroups.length;
|
|
201
|
+
segment.size = segment.numberOfFrames * frameSize;
|
|
202
|
+
segment.offset = nextOffset;
|
|
203
|
+
|
|
204
|
+
nextOffset = segment.offset + segment.size;
|
|
205
|
+
|
|
206
|
+
const packedSegment = dataset.PixelData.slice(
|
|
207
|
+
segment.offset,
|
|
208
|
+
nextOffset
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
segment.pixelData = BitArray.unpack(packedSegment);
|
|
212
|
+
|
|
213
|
+
const geometry = geometryFromFunctionalGroups(
|
|
214
|
+
dataset,
|
|
215
|
+
segment.functionalGroups
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
segment.geometry = geometry;
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
return segments;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const toArray = function (x) {
|
|
2
|
+
return Array.isArray(x) ? x : [x];
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
const codeMeaningEquals = codeMeaningName => {
|
|
6
|
+
return contentItem => {
|
|
7
|
+
return (
|
|
8
|
+
contentItem.ConceptNameCodeSequence.CodeMeaning === codeMeaningName
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const graphicTypeEquals = graphicType => {
|
|
14
|
+
return contentItem => {
|
|
15
|
+
return contentItem && contentItem.GraphicType === graphicType;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { toArray, codeMeaningEquals, graphicTypeEquals };
|
package/src/index.js
ADDED
package/.babelrc
DELETED
package/.eslintrc.json
DELETED
package/.prettierrc
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [0.1.2](https://github.com/dcmjs-org/dcmjs/compare/@cornerstonejs/adapters@0.1.1...@cornerstonejs/adapters@0.1.2) (2023-01-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* **build:** fixing publish of adapters in package json ([#396](https://github.com/dcmjs-org/dcmjs/issues/396)) ([5a45b2f](https://github.com/dcmjs-org/dcmjs/commit/5a45b2f9ebeca9b800642d2735720a8d8400cd12))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [0.1.1](https://github.com/dcmjs-org/dcmjs/compare/@cornerstonejs/adapters@0.1.0...@cornerstonejs/adapters@0.1.1) (2023-01-27)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* **build:** try to publish adapters ([#395](https://github.com/dcmjs-org/dcmjs/issues/395)) ([191a17b](https://github.com/dcmjs-org/dcmjs/commit/191a17b690d2ac60ad98a4b8ecb8379a92638d67))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# 0.1.0 (2023-01-27)
|
|
29
|
-
|
|
30
|
-
### Bug Fixes
|
|
31
|
-
|
|
32
|
-
- 🐛 adding readme notes ([#191](https://github.com/dcmjs-org/dcmjs/issues/191)) ([459260d](https://github.com/dcmjs-org/dcmjs/commit/459260d6e2a6f905729ddf68b1f12d3140b53849))
|
|
33
|
-
- 🐛 fix array format regression from commit 70b24332783d63c9db2ed21d512d9f7b526c5222 ([#236](https://github.com/dcmjs-org/dcmjs/issues/236)) ([5441063](https://github.com/dcmjs-org/dcmjs/commit/5441063d0395ede6d9f8bd3ac0d92ee14f6ef209))
|
|
34
|
-
- 🐛 Fix rotation mapping for SEG cornerstone adapter ([#151](https://github.com/dcmjs-org/dcmjs/issues/151)) ([3fab68c](https://github.com/dcmjs-org/dcmjs/commit/3fab68cbfd95f82820663b9fc99a2b0cd07e43c8))
|
|
35
|
-
- 🐛 Harden Segmentation import for different possible SEGs ([#146](https://github.com/dcmjs-org/dcmjs/issues/146)) ([c4952bc](https://github.com/dcmjs-org/dcmjs/commit/c4952bc5842bab80a5d928de0d860f89afc8f400))
|
|
36
|
-
- 🐛 IDC Re [#2003](https://github.com/dcmjs-org/dcmjs/issues/2003): fix regression in parsing segmentation orietations ([#220](https://github.com/dcmjs-org/dcmjs/issues/220)) ([5c0c6a8](https://github.com/dcmjs-org/dcmjs/commit/5c0c6a85e67b25ce5f39412ced37d8e825691481))
|
|
37
|
-
- 🐛 IDC2733: find segmentations reference source image Ids ([#253](https://github.com/dcmjs-org/dcmjs/issues/253)) ([f3e7101](https://github.com/dcmjs-org/dcmjs/commit/f3e71016dffa233bf0fb912cc7cf413718b8a1a9))
|
|
38
|
-
- 🐛 ignore frames without SourceImageSequence information when loading a segmentation ([#198](https://github.com/dcmjs-org/dcmjs/issues/198)) ([82709c4](https://github.com/dcmjs-org/dcmjs/commit/82709c4a8a317aa1354244010300ab9b902802dd))
|
|
39
|
-
- 🐛 indentation in nearlyEqual ([#202](https://github.com/dcmjs-org/dcmjs/issues/202)) ([989d6c9](https://github.com/dcmjs-org/dcmjs/commit/989d6c9a80686425563c55424ac1795e6a06cd7b))
|
|
40
|
-
- 🐛 relax condition in nearlyEquals check for detecting numbers near to zero ([#304](https://github.com/dcmjs-org/dcmjs/issues/304)) ([974cddd](https://github.com/dcmjs-org/dcmjs/commit/974cddd785c076f1ac0211b534a7c0b82a4ba68a))
|
|
41
|
-
- 🐛 When converting to multiframe, fix IPP issues ([#152](https://github.com/dcmjs-org/dcmjs/issues/152)) ([80496e4](https://github.com/dcmjs-org/dcmjs/commit/80496e422152c1a3dfd850a145011dd3dc632964))
|
|
42
|
-
- **adapter:** Removed comment around getTID300RepresentationArguments 'tool' parameter ([#322](https://github.com/dcmjs-org/dcmjs/issues/322)) ([d8f05ff](https://github.com/dcmjs-org/dcmjs/commit/d8f05ffb9ef1b5cce254980a597b4c428ffdfb6e)), closes [#306](https://github.com/dcmjs-org/dcmjs/issues/306)
|
|
43
|
-
- **add check for nullable numeric string vrs:** adds a check for nullable numeric strinv vrs ([#150](https://github.com/dcmjs-org/dcmjs/issues/150)) ([75046c4](https://github.com/dcmjs-org/dcmjs/commit/75046c4e1b2830dd3a32dc8d6938f6def71940a5))
|
|
44
|
-
- **anonymizer:** [FIX & TESTS] cleanTags : check if param is undefined. Add 3 test ([#308](https://github.com/dcmjs-org/dcmjs/issues/308)) ([44d23d6](https://github.com/dcmjs-org/dcmjs/commit/44d23d6a9e347fcf049053129d4d7323a9258b71))
|
|
45
|
-
- ArrowAnnotateTool adapter in Cornerstone3D parsing label ([#270](https://github.com/dcmjs-org/dcmjs/issues/270)) ([cb84979](https://github.com/dcmjs-org/dcmjs/commit/cb84979be6eef8835cc7ced006625751a04356aa))
|
|
46
|
-
- avoid using replaceAll() which isn't available in Node.js 14 ([#296](https://github.com/dcmjs-org/dcmjs/issues/296)) ([7aac3ab](https://github.com/dcmjs-org/dcmjs/commit/7aac3ab05fdedfe1a7a159097690bec00c0bcd2b))
|
|
47
|
-
- bug tolerance parameter was not propagated ([#241](https://github.com/dcmjs-org/dcmjs/issues/241)) ([c2ed627](https://github.com/dcmjs-org/dcmjs/commit/c2ed6275ccb80fbbab3c0f9c67893d6b681b0bab))
|
|
48
|
-
- checking the length before writing a DS and using exponential if ([#176](https://github.com/dcmjs-org/dcmjs/issues/176)) ([601aa9e](https://github.com/dcmjs-org/dcmjs/commit/601aa9e8a6df26876b08da739451e538d46aa37b))
|
|
49
|
-
- **coding-scheme:** Fix coding scheme for updated standard ([ae3f0b5](https://github.com/dcmjs-org/dcmjs/commit/ae3f0b5bcd398a4230c8fba2954e225fda97cc2f))
|
|
50
|
-
- **cornerstone:** exceptions caused by undefined cached stats in adapters. Safe programming fix only ([#301](https://github.com/dcmjs-org/dcmjs/issues/301)) ([893be43](https://github.com/dcmjs-org/dcmjs/commit/893be433af05f11a03cfce0a572b448303b9334b))
|
|
51
|
-
- **cs:** [#318](https://github.com/dcmjs-org/dcmjs/issues/318) - check instance's NumberOfFrames property to see if it is a multi-frame file or not ([#320](https://github.com/dcmjs-org/dcmjs/issues/320)) ([0b030a4](https://github.com/dcmjs-org/dcmjs/commit/0b030a45dd48f22a61a90dfe5bbb5848425960ca))
|
|
52
|
-
- **cs:** Resolves [#316](https://github.com/dcmjs-org/dcmjs/issues/316) Cornerstone3D adaptor - Multiframe support - add "frameNumber" to the Annotation.data ([#317](https://github.com/dcmjs-org/dcmjs/issues/317)) ([5fe862e](https://github.com/dcmjs-org/dcmjs/commit/5fe862e22653d30bfc78e5be5de3669610887727))
|
|
53
|
-
- **dcmjs:** Add a set of accessors to the sequence list so the API is more consistent ([#224](https://github.com/dcmjs-org/dcmjs/issues/224)) ([9dad6c5](https://github.com/dcmjs-org/dcmjs/commit/9dad6c549cb4dd5c351caa13386998cbe48a1ba6))
|
|
54
|
-
- **DicomMessage:** Fix readFile after options were added ([c2b62a1](https://github.com/dcmjs-org/dcmjs/commit/c2b62a13b3afc78516f39b906ca7576537037c20))
|
|
55
|
-
- **encoding:** encapsulation is applied for only PixelData ([#199](https://github.com/dcmjs-org/dcmjs/issues/199)) ([ede2950](https://github.com/dcmjs-org/dcmjs/commit/ede2950d530fb189bb5817db6b5285e2be74ffee)), closes [#194](https://github.com/dcmjs-org/dcmjs/issues/194)
|
|
56
|
-
- Ensure DS and IS Value Representations are returned as arrays ([#83](https://github.com/dcmjs-org/dcmjs/issues/83)) ([a264661](https://github.com/dcmjs-org/dcmjs/commit/a264661d5a0a899b761c58492955f6d18cc03a4d))
|
|
57
|
-
- exception writing NaN and Infinity values of FD tags ([#325](https://github.com/dcmjs-org/dcmjs/issues/325)) ([e86daaa](https://github.com/dcmjs-org/dcmjs/commit/e86daaad4c47e7ec2c135b94f0b0de622de69310))
|
|
58
|
-
- Export loglevelnext logger as dcmjs.log for configuration ([#156](https://github.com/dcmjs-org/dcmjs/issues/156)) ([33515e5](https://github.com/dcmjs-org/dcmjs/commit/33515e5fe3f581d71278674860834ee1ea932faa))
|
|
59
|
-
- Fix UN & AT VR processing logic ([#167](https://github.com/dcmjs-org/dcmjs/issues/167)) ([#168](https://github.com/dcmjs-org/dcmjs/issues/168)) ([7cb975a](https://github.com/dcmjs-org/dcmjs/commit/7cb975af106d2e3e943881a7dac06f1fe391809c))
|
|
60
|
-
- force a release for commit caaac4b ([#240](https://github.com/dcmjs-org/dcmjs/issues/240)) ([f53b630](https://github.com/dcmjs-org/dcmjs/commit/f53b6306ce138c5ad3106015c4751b63fbcca362))
|
|
61
|
-
- **fragment:** Refactor and fragment bug ([#283](https://github.com/dcmjs-org/dcmjs/issues/283)) ([307d60a](https://github.com/dcmjs-org/dcmjs/commit/307d60a6ffecf7d96bc729a37a45775c6b6e189c)), closes [#282](https://github.com/dcmjs-org/dcmjs/issues/282)
|
|
62
|
-
- **fragment:** write padding to even length on final fragments of encapsulated frame data ([#294](https://github.com/dcmjs-org/dcmjs/issues/294)) ([34b7561](https://github.com/dcmjs-org/dcmjs/commit/34b7561fa48870a87b948eb427d4e32808b4d40e)), closes [#293](https://github.com/dcmjs-org/dcmjs/issues/293)
|
|
63
|
-
- **idc-02252:** typo + release ([#180](https://github.com/dcmjs-org/dcmjs/issues/180)) ([3f5cb24](https://github.com/dcmjs-org/dcmjs/commit/3f5cb24fd0e50668d36dc21390a1ff527505a8db))
|
|
64
|
-
- **image-comments:** Move ImageComments to DerivedPixels ([da11200](https://github.com/dcmjs-org/dcmjs/commit/da112001e3c1c01b30acbd634fd9b2f46a9d3a63))
|
|
65
|
-
- **import:** missing import for addAccessors ([#295](https://github.com/dcmjs-org/dcmjs/issues/295)) ([6b631b6](https://github.com/dcmjs-org/dcmjs/commit/6b631b6c8bdb2a7a70637308c9ebfe849fe9ccaf))
|
|
66
|
-
- infinite loop on dcm with no meta length ([#331](https://github.com/dcmjs-org/dcmjs/issues/331)) ([51b156b](https://github.com/dcmjs-org/dcmjs/commit/51b156bf1278fc0f9476de70c89697576c0f4b55))
|
|
67
|
-
- Invalid VR of the private creator tag of the "Implicit VR Endian" typed DICOM file ([#242](https://github.com/dcmjs-org/dcmjs/issues/242)) ([#243](https://github.com/dcmjs-org/dcmjs/issues/243)) ([6d0552f](https://github.com/dcmjs-org/dcmjs/commit/6d0552fb96c59dcf3e39b3306a50004b24128330))
|
|
68
|
-
- issues in binary tag parsing ([#276](https://github.com/dcmjs-org/dcmjs/issues/276)) ([60c3af1](https://github.com/dcmjs-org/dcmjs/commit/60c3af1654b8f64baea1cd47f1049fd16ea2fee8))
|
|
69
|
-
- **measurement-report:** Fix issues with Measurement Report for Bidirectional measurements ([25cf222](https://github.com/dcmjs-org/dcmjs/commit/25cf222e9d80bbe5b68854362383ac4fcaec7f6c))
|
|
70
|
-
- **measurement-report:** Fix ReferencedFrameNumber usage in MeasurementReport ([b80cd2a](https://github.com/dcmjs-org/dcmjs/commit/b80cd2af070d0280295e88ee24d7e4d43c4af861))
|
|
71
|
-
- **naturalize:** revert single element sequence ([#223](https://github.com/dcmjs-org/dcmjs/issues/223)) ([0743ed3](https://github.com/dcmjs-org/dcmjs/commit/0743ed34f657b622d4868fe5db37015ad1aa7850))
|
|
72
|
-
- **naturalizing:** Fix the exception on naturalize twice ([#237](https://github.com/dcmjs-org/dcmjs/issues/237)) ([abced98](https://github.com/dcmjs-org/dcmjs/commit/abced980dccbabce7c4b159600f89c25ba747076))
|
|
73
|
-
- **parsing:** can't read an encapsulated frame whose size is greater than fragment size ([#205](https://github.com/dcmjs-org/dcmjs/issues/205)) ([176875d](https://github.com/dcmjs-org/dcmjs/commit/176875d0c9c34704302512d2c27103db205b1c8f)), closes [#204](https://github.com/dcmjs-org/dcmjs/issues/204)
|
|
74
|
-
- Re IDC [#2761](https://github.com/dcmjs-org/dcmjs/issues/2761) fix loading of segmentations ([#258](https://github.com/dcmjs-org/dcmjs/issues/258)) ([ceaf09a](https://github.com/dcmjs-org/dcmjs/commit/ceaf09af74f5727205e5d5869c97114b2c283ae5))
|
|
75
|
-
- **Segmentation_4X:** Update tag name in getSegmentIndex method for segs ([#183](https://github.com/dcmjs-org/dcmjs/issues/183)) ([1e96ee3](https://github.com/dcmjs-org/dcmjs/commit/1e96ee3ce3280900d56f1887da81471f9b128d30))
|
|
76
|
-
- **seg:** Use ReferencedSegmentNumber in shared fg ([#166](https://github.com/dcmjs-org/dcmjs/issues/166)) ([0ed3347](https://github.com/dcmjs-org/dcmjs/commit/0ed33477bb1c13b05d682c342edaf0a901fe0f7a))
|
|
77
|
-
- several issues with character set handling ([#299](https://github.com/dcmjs-org/dcmjs/issues/299)) ([8e22107](https://github.com/dcmjs-org/dcmjs/commit/8e221074179b6d33b82ab5c6f1ae4c06c5522d6b))
|
|
78
|
-
- **tests:** unified test data loading ([#292](https://github.com/dcmjs-org/dcmjs/issues/292)) ([c34f398](https://github.com/dcmjs-org/dcmjs/commit/c34f39813755227b79f7a0958a81a5e5c0935b73))
|
|
79
|
-
- **update jsdocs, cut release:** release ([#203](https://github.com/dcmjs-org/dcmjs/issues/203)) ([307974c](https://github.com/dcmjs-org/dcmjs/commit/307974cb399d07152e0f6d4dd9f40fe1c17f076e))
|
|
80
|
-
- update readme to trigger release ([#257](https://github.com/dcmjs-org/dcmjs/issues/257)) ([554f50d](https://github.com/dcmjs-org/dcmjs/commit/554f50d838fbcbeed25460c7384e14dc46bebb11))
|
|
81
|
-
- update variable name for frame index ([#332](https://github.com/dcmjs-org/dcmjs/issues/332)) ([5515d6e](https://github.com/dcmjs-org/dcmjs/commit/5515d6e0abe11dee04f9b75272d3fbb5d00b2bd7))
|
|
82
|
-
- use metadataProvider option instead of cornerstone.metaData ([#280](https://github.com/dcmjs-org/dcmjs/issues/280)) ([3a0e484](https://github.com/dcmjs-org/dcmjs/commit/3a0e484d203770cd309e2bd9f78946a733e79d0c))
|
|
83
|
-
- **utilities:** Export Bidirectional and Polyline inside TID300 ([75e0e29](https://github.com/dcmjs-org/dcmjs/commit/75e0e29f771843a80bfa32532d2186a4e7cdbd57))
|
|
84
|
-
- **VR:** added support for specific character set ([#291](https://github.com/dcmjs-org/dcmjs/issues/291)) ([f103d19](https://github.com/dcmjs-org/dcmjs/commit/f103d1918d02780c4881db5c8aa30f653c4da6b6))
|
|
85
|
-
- **vr:** Convert empty DecimalString and NumberString to null instead of to zero ([#278](https://github.com/dcmjs-org/dcmjs/issues/278)) ([43cd8ea](https://github.com/dcmjs-org/dcmjs/commit/43cd8eaa316a08ff1a025b1267fedda239526acb))
|
|
86
|
-
- **writeBytes:** create release from commit ([d9a4105](https://github.com/dcmjs-org/dcmjs/commit/d9a41050e756f9b7e56ef4ae3d5000ce86ea39eb))
|
|
87
|
-
|
|
88
|
-
### Features
|
|
89
|
-
|
|
90
|
-
- **adapters:** Add adapter for exporting polylines from dicom-microscopy-viewer to DICOM-SR ([#44](https://github.com/dcmjs-org/dcmjs/issues/44)) ([7a1947c](https://github.com/dcmjs-org/dcmjs/commit/7a1947c6ec164da4e9f66e90c1bbf1055978b173))
|
|
91
|
-
- **adapters:** Add adapter to generate segments & geometry from SEG for easier use in VTKjs (migrated from vtkDisplay example) ([398b74d](https://github.com/dcmjs-org/dcmjs/commit/398b74d70deb32824a74e98210127326887dfa77))
|
|
92
|
-
- **adapters:** First steps for DICOM-SR read support for polylines with dicom-microscopy-viewer ([#49](https://github.com/dcmjs-org/dcmjs/issues/49)) ([37f1888](https://github.com/dcmjs-org/dcmjs/commit/37f18881dd7369818de4aa22c5730012c2829616))
|
|
93
|
-
- Add Cornerstone3D adapter for Length tool ([#261](https://github.com/dcmjs-org/dcmjs/issues/261)) ([2cab0d9](https://github.com/dcmjs-org/dcmjs/commit/2cab0d9edba20e99b11407d41ed2a4bf60a6ab9b))
|
|
94
|
-
- Add overlapping segment check to Cornerstone 4.x DICOM SEG adapter ([#155](https://github.com/dcmjs-org/dcmjs/issues/155)) ([df44e27](https://github.com/dcmjs-org/dcmjs/commit/df44e27b3b1c26082bf3d7a9477ab7f0d5ca1d19))
|
|
95
|
-
- Allow backslashes in UIDs in order to support DICOM Q&R ([#277](https://github.com/dcmjs-org/dcmjs/issues/277)) ([6d2d5c6](https://github.com/dcmjs-org/dcmjs/commit/6d2d5c60f500174abb1be7757094178ec6a1d144))
|
|
96
|
-
- **anonymizer:** export Array tagNamesToEmpty and modify cleanTags ([#303](https://github.com/dcmjs-org/dcmjs/issues/303)) ([e960085](https://github.com/dcmjs-org/dcmjs/commit/e960085ca08fb28a0a8134fbfee7d450722d8c64))
|
|
97
|
-
- Bidirectional Arrow and EllipticalROI adapters for CS3D ([#264](https://github.com/dcmjs-org/dcmjs/issues/264)) ([1fc7932](https://github.com/dcmjs-org/dcmjs/commit/1fc7932e3eed85fa1a0f857d84bab35a2e62d80d))
|
|
98
|
-
- **cornerstone:** Feature add cornerstone adapters ([#225](https://github.com/dcmjs-org/dcmjs/issues/225)) ([23c0877](https://github.com/dcmjs-org/dcmjs/commit/23c08777f7a93d4c0576a5e583113029a1a1e05f))
|
|
99
|
-
- **deflated:** Added support for reading datasets with deflated transfer syntax ([#312](https://github.com/dcmjs-org/dcmjs/issues/312)) ([ee8f8f2](https://github.com/dcmjs-org/dcmjs/commit/ee8f8f21babbbd8eac2b19e8e957db2cc5a09325))
|
|
100
|
-
- **mem:** Zero Copy ArrayBuffer ([#279](https://github.com/dcmjs-org/dcmjs/issues/279)) ([a17f2d7](https://github.com/dcmjs-org/dcmjs/commit/a17f2d75bc102cc789289f0eae51e5b416ce1567))
|
|
101
|
-
- Move adapters from dcmjs for Cornerstone/3d and VTK ([b136a21](https://github.com/dcmjs-org/dcmjs/commit/b136a21fb96bb28c3a10a63b6b78083b897f4e19))
|
|
102
|
-
- **npm:** bump minor version (minor readme edits) ([b48f665](https://github.com/dcmjs-org/dcmjs/commit/b48f665893f5e4b643c68ddc2fc3b13c641b6b29))
|
|
103
|
-
- **readme:** stress need for a PR for npm package ([#310](https://github.com/dcmjs-org/dcmjs/issues/310)) ([dafd78d](https://github.com/dcmjs-org/dcmjs/commit/dafd78d004ccb9d0b505f0b7e0fd461eda9c3710))
|
|
104
|
-
- **sr:** export TID300 - Point class ([#323](https://github.com/dcmjs-org/dcmjs/issues/323)) ([d2aebc3](https://github.com/dcmjs-org/dcmjs/commit/d2aebc3166c23e14dce4d7a8b7f1e2fc933f6328))
|
|
105
|
-
- **structured-reports:** Add initial work on Adapters / Utilities for Imaging Measurement Structured Report input / output ([#17](https://github.com/dcmjs-org/dcmjs/issues/17)) ([941ad75](https://github.com/dcmjs-org/dcmjs/commit/941ad75320eece3368104d08247fdc371497c7cd))
|
|
106
|
-
- **testing:** Use the Jest testing framework and switch to GitHub Actions ([#254](https://github.com/dcmjs-org/dcmjs/issues/254)) ([a91ff2b](https://github.com/dcmjs-org/dcmjs/commit/a91ff2babd2c6a44f20ecbd954ab38901276cf41))
|