Comparing version 0.29.6 to 0.29.7
{ | ||
"name": "dcmjs", | ||
"version": "0.29.6", | ||
"version": "0.29.7", | ||
"description": "Javascript implementation of DICOM manipulation", | ||
@@ -30,4 +30,9 @@ "main": "build/dcmjs.js", | ||
"@babel/core": "^7.17.8", | ||
"@babel/plugin-transform-runtime": "^7.22.5", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/register": "^7.13.0", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-commonjs": "^25.0.1", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^15.1.0", | ||
"acorn": "^7.1.0", | ||
@@ -42,14 +47,8 @@ "acorn-jsx": "^5.2.0", | ||
"prettier": "^2.6.2", | ||
"rollup": "^1.31.1", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^9.3.4", | ||
"rollup-plugin-json": "^3.1.0", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-node-resolve": "^4.2.4", | ||
"unzipper": "^0.10.9", | ||
"rollup": "^3.25.1", | ||
"xml2js": "^0.4.23" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime-corejs2": "^7.17.8", | ||
"@babel/runtime-corejs3": "^7.22.5", | ||
"adm-zip": "^0.5.10", | ||
"gl-matrix": "^3.1.0", | ||
@@ -56,0 +55,0 @@ "lodash.clonedeep": "^4.5.0", |
import dcmjs from "../src/index.js"; | ||
import fs from "fs"; | ||
import { validationLog } from "./../src/log.js"; | ||
// Ignore validation errors | ||
validationLog.level = 5; | ||
const { DicomMessage } = dcmjs.data; | ||
@@ -5,0 +9,0 @@ const { cleanTags, getTagsNameToEmpty } = dcmjs.anonymizer; |
@@ -6,3 +6,2 @@ import "regenerator-runtime/runtime.js"; | ||
import path from "path"; | ||
import os from "os"; | ||
import { promisify } from "util"; | ||
@@ -14,5 +13,3 @@ import fsPromises from "fs/promises"; | ||
DicomMetaDictionary, | ||
DicomDict, | ||
DicomMessage, | ||
ReadBufferStream | ||
} = dcmjs.data; | ||
@@ -19,0 +16,0 @@ |
import "regenerator-runtime/runtime.js"; | ||
import { getZippedTestDataset, getTestDataset } from "./testUtils.js"; | ||
import { jest } from "@jest/globals"; | ||
import dcmjs from "../src/index.js"; | ||
import { WriteBufferStream } from "../src/BufferStream"; | ||
import fs from "fs"; | ||
import fsPromises from "fs/promises"; | ||
import os from "os"; | ||
import path from "path"; | ||
import { WriteBufferStream } from "../src/BufferStream"; | ||
import dcmjs from "../src/index.js"; | ||
import { getTestDataset, getZippedTestDataset } from "./testUtils.js"; | ||
import { log } from "./../src/log.js"; | ||
import { promisify } from "util"; | ||
import arrayItem from "./arrayItem.json"; | ||
import minimalDataset from "./mocks/minimal_fields_dataset.json"; | ||
import datasetWithNullNumberVRs from "./mocks/null_number_vrs_dataset.json"; | ||
import minimalDataset from "./mocks/minimal_fields_dataset.json"; | ||
import arrayItem from "./arrayItem.json"; | ||
import { rawTags } from "./rawTags"; | ||
import { promisify } from "util"; | ||
import { EXPLICIT_LITTLE_ENDIAN, IMPLICIT_LITTLE_ENDIAN } from "./../src/constants/dicom.js"; | ||
const { | ||
@@ -25,5 +27,2 @@ DicomMetaDictionary, | ||
const IMPLICIT_LITTLE_ENDIAN = "1.2.840.10008.1.2"; | ||
const EXPLICIT_LITTLE_ENDIAN = "1.2.840.10008.1.2.1"; | ||
const fileMetaInformationVersionArray = new Uint8Array(2); | ||
@@ -246,3 +245,3 @@ fileMetaInformationVersionArray[1] = 1; | ||
const segFileName = "Lesion1_onesliceSEG.dcm" | ||
const ctPelvisPath = path.join( | ||
@@ -457,4 +456,4 @@ unzipPath, | ||
const stream = new ReadBufferStream( | ||
dicomDict.write({ fragmentMultiframe: false }) | ||
), | ||
dicomDict.write({ fragmentMultiframe: false }) | ||
), | ||
useSyntax = EXPLICIT_LITTLE_ENDIAN; | ||
@@ -635,7 +634,7 @@ | ||
const expected = [ | ||
{ file: "image_dfl", tags: { Modality: "OT", Rows: 512, Columns: 512 }}, | ||
{ file: "report_dfl", tags: { Modality: "SR", VerificationFlag: "UNVERIFIED", ContentDate: "20001110" }}, | ||
{ file: "wave_dfl", tags: { Modality: "ECG", SynchronizationTrigger: "NO TRIGGER", ContentDate: "19991223" }} | ||
{ file: "image_dfl", tags: { Modality: "OT", Rows: 512, Columns: 512 } }, | ||
{ file: "report_dfl", tags: { Modality: "SR", VerificationFlag: "UNVERIFIED", ContentDate: "20001110" } }, | ||
{ file: "wave_dfl", tags: { Modality: "ECG", SynchronizationTrigger: "NO TRIGGER", ContentDate: "19991223" } } | ||
]; | ||
expected.forEach(e => { | ||
@@ -646,3 +645,3 @@ const buffer = fs.readFileSync(path.join(deflatedPath, e.file)); | ||
buffer.byteOffset + buffer.byteLength | ||
)); | ||
)); | ||
const dataset = DicomMetaDictionary.naturalizeDataset(dicomDict.dict); | ||
@@ -679,2 +678,3 @@ Object.keys(e.tags).forEach(t => { | ||
it("Throws an exception on an unsupported character set", async () => { | ||
log.level = 5; | ||
expect(() => readEncodedLongString("nope", [])).toThrow( | ||
@@ -686,2 +686,3 @@ new Error("Unsupported character set: nope") | ||
it("Doesn't throw an exception on an unsupported character set when ignoring errors", async () => { | ||
log.level = 5; | ||
expect( | ||
@@ -688,0 +689,0 @@ readEncodedLongString("nope", [0x68, 0x69], { ignoreErrors: true }) |
import fs from 'fs'; | ||
import path from 'path'; | ||
import dcmjs from "../../src/index.js"; | ||
import { validationLog } from "./../../src/log.js"; | ||
// Ignore validation errors | ||
validationLog.level = 5; | ||
const { DicomMessage } = dcmjs.data; | ||
@@ -6,0 +10,0 @@ |
import fs from "fs"; | ||
import fsPromises from "fs/promises"; | ||
import os from "os"; | ||
import path from "path"; | ||
import unzipper from "unzipper"; | ||
import followRedirects from "follow-redirects"; | ||
import { promisify } from "util"; | ||
import AdmZip from 'adm-zip'; | ||
import { validationLog } from "./../src/log.js"; | ||
const { https } = followRedirects; | ||
// Don't show validation errors, as those are normally tested | ||
validationLog.level = 5; | ||
function downloadToFile(url, filePath) { | ||
@@ -26,7 +28,21 @@ return new Promise((resolve, reject) => { | ||
function unzip(zipFilePath, targetPath) { | ||
return new Promise(resolve => { | ||
fs.createReadStream(zipFilePath).pipe( | ||
unzipper.Extract({ path: targetPath }).on("close", resolve) | ||
); | ||
}); | ||
return new Promise( (resolve,reject) => { | ||
try { | ||
// reading archives | ||
var zip = new AdmZip(zipFilePath); | ||
var zipEntries = zip.getEntries(); // an array of ZipEntry records | ||
// extracts everything | ||
zip.extractAllTo(targetPath, true); | ||
resolve(); | ||
} catch(e) { | ||
reject(e); | ||
} | ||
}); | ||
// This code is broken in Node 18+, creating garbage output | ||
// return new Promise(resolve => { | ||
// fs.createReadStream(zipFilePath).pipe( | ||
// unzipper.Extract({ path: targetPath }).on("close", resolve) | ||
// ); | ||
// }); | ||
} | ||
@@ -33,0 +49,0 @@ |
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
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 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
19
11
11545845
7
51032
+ Addedadm-zip@^0.5.10
+ Added@babel/runtime-corejs3@7.26.0(transitive)
+ Addedadm-zip@0.5.16(transitive)
+ Addedcore-js-pure@3.39.0(transitive)
- Removed@babel/runtime-corejs2@^7.17.8
- Removed@babel/runtime-corejs2@7.26.0(transitive)
- Removedcore-js@2.6.12(transitive)