dcmjs 0.35.0 → 0.36.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 +18 -2
- package/build/dcmjs.es.js.map +1 -1
- package/build/dcmjs.js +18 -2
- package/build/dcmjs.js.map +1 -1
- package/package.json +1 -1
- package/test/normalizers.test.js +22 -3
package/package.json
CHANGED
package/test/normalizers.test.js
CHANGED
|
@@ -2,6 +2,7 @@ import "regenerator-runtime/runtime.js";
|
|
|
2
2
|
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import { jest } from "@jest/globals";
|
|
5
|
+
import { getTestDataset } from "./testUtils";
|
|
5
6
|
import { DicomMessage } from "../src/DicomMessage";
|
|
6
7
|
import { DicomMetaDictionary } from "../src/DicomMetaDictionary";
|
|
7
8
|
import dcmjs from "../src";
|
|
@@ -10,12 +11,30 @@ import dcmjs from "../src";
|
|
|
10
11
|
jest.setTimeout(60000);
|
|
11
12
|
|
|
12
13
|
it("test_normalizer_op", async () => {
|
|
13
|
-
const file = fs.readFileSync(
|
|
14
|
+
const file = fs.readFileSync("test/sample-op.dcm");
|
|
14
15
|
const dicomDict = DicomMessage.readFile(file.buffer);
|
|
15
16
|
|
|
16
17
|
const dataset = DicomMetaDictionary.naturalizeDataset(dicomDict.dict);
|
|
17
|
-
const multiframe = dcmjs.normalizers.Normalizer.normalizeToDataset([
|
|
18
|
+
const multiframe = dcmjs.normalizers.Normalizer.normalizeToDataset([
|
|
19
|
+
dataset
|
|
20
|
+
]);
|
|
18
21
|
|
|
19
22
|
expect(dataset.NumberOfFrames).toEqual(1);
|
|
20
23
|
expect(multiframe.NumberOfFrames).toEqual(1);
|
|
21
|
-
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("test_normalizer_oct", async () => {
|
|
27
|
+
const url =
|
|
28
|
+
"https://github.com/dcmjs-org/data/releases/download/oct/oct.dcm";
|
|
29
|
+
const dcmPath = await getTestDataset(url, "oct.dcm");
|
|
30
|
+
const file = fs.readFileSync(dcmPath);
|
|
31
|
+
const dicomDict = DicomMessage.readFile(file.buffer);
|
|
32
|
+
|
|
33
|
+
const dataset = DicomMetaDictionary.naturalizeDataset(dicomDict.dict);
|
|
34
|
+
const multiframe = dcmjs.normalizers.Normalizer.normalizeToDataset([
|
|
35
|
+
dataset
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
expect(dataset.NumberOfFrames).toEqual(97);
|
|
39
|
+
expect(multiframe.NumberOfFrames).toEqual(97);
|
|
40
|
+
});
|