Comparing version 0.22.0 to 0.23.0
{ | ||
"name": "dcmjs", | ||
"version": "0.22.0", | ||
"version": "0.23.0", | ||
"description": "Javascript implementation of DICOM manipulation", | ||
@@ -5,0 +5,0 @@ "main": "build/dcmjs.js", |
@@ -17,2 +17,3 @@ import "regenerator-runtime/runtime.js"; | ||
import arrayItem from "./arrayItem.json"; | ||
import { rawTags } from "./rawTags"; | ||
@@ -176,3 +177,4 @@ const { DicomMetaDictionary, DicomDict, DicomMessage, ReadBufferStream } = dcmjs.data; | ||
expect(naturalSequence.ProcedureCodeSequence).toMatchObject({ CodeValue: "IMG1332" }); | ||
// The match object needs to be done on the actual element, not the proxied value | ||
expect(naturalSequence.ProcedureCodeSequence[0]).toMatchObject({ CodeValue: "IMG1332" }); | ||
@@ -187,3 +189,3 @@ // tests that single element sequences have been converted | ||
expect(naturalSequence.ProcedureCodeSequence).toMatchObject({ | ||
expect(naturalSequence.ProcedureCodeSequence[0]).toMatchObject({ | ||
CodingSchemeDesignator: "L", | ||
@@ -239,2 +241,3 @@ CodeMeaning: "MRI SHOULDER WITHOUT IV CONTRAST LEFT", | ||
); | ||
datasets.push(dataset); | ||
@@ -311,2 +314,3 @@ }); | ||
); | ||
multiframe = dcmjs.normalizers.Normalizer.normalizeToDataset( | ||
@@ -319,2 +323,12 @@ [dataset] | ||
it("test_normalizer_smaller", () => { | ||
const naturalizedTags = dcmjs.data.DicomMetaDictionary.naturalizeDataset( | ||
rawTags | ||
); | ||
const rawTagsLen = JSON.stringify(rawTags).length; | ||
const naturalizedTagsLen = JSON.stringify(naturalizedTags).length; | ||
expect(naturalizedTagsLen).toBeLessThan(rawTagsLen); | ||
}) | ||
it("test_multiframe_us", () => { | ||
@@ -321,0 +335,0 @@ const file = fs.readFileSync("test/cine-test.dcm"); |
@@ -9,11 +9,25 @@ import dcmjs from '../src/index.js'; | ||
const arrValue = [baseValue]; | ||
addAccessors(arrValue, baseValue); | ||
expect(arrValue.a).toEqual(1); | ||
const val = addAccessors(arrValue, baseValue); | ||
expect(val.a).toEqual(1); | ||
baseValue.a = 3; | ||
expect(arrValue.a).toEqual(3); | ||
arrValue.b = 4; | ||
expect(val.a).toEqual(3); | ||
val.b = 4; | ||
expect(baseValue.b).toEqual(4); | ||
// Check that we can iterate as an array | ||
const forArr = []; | ||
arrValue.forEach(item => forArr.push(item)); | ||
val.forEach(item => forArr.push(item)); | ||
expect(forArr.length).toEqual(1); | ||
expect(forArr[0]).toEqual(baseValue); | ||
}); | ||
it("testAddAccessor-adds_children", () => { | ||
const baseValue = { a: 1, b: 2 }; | ||
const arrValue = [baseValue]; | ||
const val = addAccessors(arrValue, baseValue); | ||
val.push({ a: "two" }); | ||
expect(val.length).toBe(2); | ||
expect(val[1].a).toBe("two"); | ||
expect(val.a).toBe(1); | ||
expect(val[0].a).toBe(1); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14470595
33
53433