dcmjs 0.34.4 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dcmjs.es.js +19 -8
- package/build/dcmjs.es.js.map +1 -1
- package/build/dcmjs.js +19 -8
- package/build/dcmjs.js.map +1 -1
- package/jest.setup.js +1 -1
- package/package.json +2 -1
- package/rollup.config.mjs +34 -27
- package/test/anonymizer.test.js +1 -1
- package/test/data.test.js +2 -2
- package/test/integration/DicomMessage.readFile.test.js +1 -1
- package/test/normalizers.test.js +21 -1
- package/test/testUtils.js +1 -1
package/jest.setup.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcmjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Javascript implementation of DICOM manipulation",
|
|
5
5
|
"main": "build/dcmjs.js",
|
|
6
6
|
"module": "build/dcmjs.es.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
36
36
|
"@rollup/plugin-json": "^6.1.0",
|
|
37
37
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
38
|
+
"@rollup/plugin-replace": "^6.0.1",
|
|
38
39
|
"acorn": "^7.1.0",
|
|
39
40
|
"acorn-jsx": "^5.2.0",
|
|
40
41
|
"eslint": "^8.17.0",
|
package/rollup.config.mjs
CHANGED
|
@@ -5,34 +5,41 @@ import resolve from "@rollup/plugin-node-resolve";
|
|
|
5
5
|
import commonjs from "@rollup/plugin-commonjs";
|
|
6
6
|
// import babelRuntime from "@rollup/plugin-transform-runtime"
|
|
7
7
|
import json from "@rollup/plugin-json";
|
|
8
|
+
import replace from "@rollup/plugin-replace";
|
|
8
9
|
import pkg from "./package.json" assert { type: "json" };
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
input: "src/index.js",
|
|
13
|
+
output: [
|
|
14
|
+
{
|
|
15
|
+
file: pkg.main,
|
|
16
|
+
format: "umd",
|
|
17
|
+
name: "dcmjs",
|
|
18
|
+
sourcemap: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
file: pkg.module,
|
|
22
|
+
format: "es",
|
|
23
|
+
sourcemap: true
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
plugins: [
|
|
27
|
+
replace({
|
|
28
|
+
"process.env.LOG_LEVEL": JSON.stringify(
|
|
29
|
+
process.env.LOG_LEVEL || "warn"
|
|
30
|
+
),
|
|
31
|
+
preventAssignment: true
|
|
32
|
+
}),
|
|
33
|
+
resolve({
|
|
34
|
+
browser: true
|
|
35
|
+
}),
|
|
36
|
+
commonjs(),
|
|
37
|
+
// globals(),
|
|
38
|
+
//builtins(),
|
|
39
|
+
// babelRuntime(),
|
|
40
|
+
babel({
|
|
41
|
+
exclude: "node_modules/**"
|
|
42
|
+
}),
|
|
43
|
+
json()
|
|
44
|
+
]
|
|
38
45
|
};
|
package/test/anonymizer.test.js
CHANGED
package/test/data.test.js
CHANGED
|
@@ -723,14 +723,14 @@ describe("With a SpecificCharacterSet tag", () => {
|
|
|
723
723
|
});
|
|
724
724
|
|
|
725
725
|
it("Throws an exception on an unsupported character set", async () => {
|
|
726
|
-
log.
|
|
726
|
+
log.setLevel(5);
|
|
727
727
|
expect(() => readEncodedLongString("nope", [])).toThrow(
|
|
728
728
|
new Error("Unsupported character set: nope")
|
|
729
729
|
);
|
|
730
730
|
});
|
|
731
731
|
|
|
732
732
|
it("Doesn't throw an exception on an unsupported character set when ignoring errors", async () => {
|
|
733
|
-
log.
|
|
733
|
+
log.setLevel(5);
|
|
734
734
|
expect(
|
|
735
735
|
readEncodedLongString("nope", [0x68, 0x69], { ignoreErrors: true })
|
|
736
736
|
).toEqual("hi");
|
package/test/normalizers.test.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import "regenerator-runtime/runtime.js";
|
|
2
|
+
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import { jest } from "@jest/globals";
|
|
5
|
+
import { DicomMessage } from "../src/DicomMessage";
|
|
6
|
+
import { DicomMetaDictionary } from "../src/DicomMetaDictionary";
|
|
7
|
+
import dcmjs from "../src";
|
|
8
|
+
|
|
9
|
+
// The asset downloads in this file might take some time on a slower connection
|
|
10
|
+
jest.setTimeout(60000);
|
|
11
|
+
|
|
12
|
+
it("test_normalizer_op", async () => {
|
|
13
|
+
const file = fs.readFileSync('test/sample-op.dcm');
|
|
14
|
+
const dicomDict = DicomMessage.readFile(file.buffer);
|
|
15
|
+
|
|
16
|
+
const dataset = DicomMetaDictionary.naturalizeDataset(dicomDict.dict);
|
|
17
|
+
const multiframe = dcmjs.normalizers.Normalizer.normalizeToDataset([dataset]);
|
|
18
|
+
|
|
19
|
+
expect(dataset.NumberOfFrames).toEqual(1);
|
|
20
|
+
expect(multiframe.NumberOfFrames).toEqual(1);
|
|
21
|
+
});
|
package/test/testUtils.js
CHANGED
|
@@ -8,7 +8,7 @@ import { validationLog } from "./../src/log.js";
|
|
|
8
8
|
const { https } = followRedirects;
|
|
9
9
|
|
|
10
10
|
// Don't show validation errors, as those are normally tested
|
|
11
|
-
validationLog.
|
|
11
|
+
validationLog.setLevel(5);
|
|
12
12
|
|
|
13
13
|
function downloadToFile(url, filePath) {
|
|
14
14
|
return new Promise((resolve, reject) => {
|