diff --git a/config/default.js b/config/default.js index 6be12c5..15f8027 100644 --- a/config/default.js +++ b/config/default.js @@ -14,7 +14,21 @@ config.target = { port: "5678" }; -// transfer syntax (e.g. compression of dicom files) used for transmission via wado + +/* +Supported Transfer Syntaxes: +1.2.840.10008.1.2 Implicit VR Endian: Default Transfer Syntax for DICOM +1.2.840.10008.1.2.1 Explicit VR Little Endian +1.2.840.10008.1.2.2 Explicit VR Big Endian +1.2.840.10008.1.2.4.50 JPEG Baseline (Process 1) - Lossy JPEG 8-bit Image Compression +1.2.840.10008.1.2.4.51 JPEG Baseline (Processes 2 & 4) - Lossy JPEG 12-bit Image Compression +1.2.840.10008.1.2.4.70 JPEG Lossless, Nonhierarchical, First- Order Prediction +1.2.840.10008.1.2.4.80 JPEG-LS Lossless Image Compression <-- recommended +1.2.840.10008.1.2.4.81 JPEG-LS Lossy (Near- Lossless) Image Compression +1.2.840.10008.1.2.5 RLE Lossless +*/ + +// transfer syntax (e.g. compression of dicom files) used for transmission via wado and proposed to pacs config.transferSyntax = '1.2.840.10008.1.2.4.80'; // log directory diff --git a/package-lock.json b/package-lock.json index b2771c4..cb5ee6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "config": "^3.3.4", "dicom-data-dictionary": "^0.3.1", - "dicom-dimse-native": "^1.2.11", + "dicom-dimse-native": "^1.2.12", "dicom-parser": "^1.8.7", "fastify": "^3.12.0", "fastify-cors": "^4.1.0", @@ -1024,9 +1024,9 @@ "integrity": "sha1-zG61akFkObWLd819uTNbqvCGJYk=" }, "node_modules/dicom-dimse-native": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/dicom-dimse-native/-/dicom-dimse-native-1.2.11.tgz", - "integrity": "sha512-CQeI/vIoxf6zW9rroXPdhOoedZhB1NmKSuTBOYTeyCVl+EwgYpTQ38eEGXwVFcZhYrmOVuDO5QqN/DzufLF5Vw==", + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/dicom-dimse-native/-/dicom-dimse-native-1.2.12.tgz", + "integrity": "sha512-Q8600iZuMs7jJiKds4XwauD/hK0wYStbjuvydK8CW5jHxgH1hBGzvfnjijdlG571FE+4Xss20LUipHUJIEP4dA==", "hasInstallScript": true, "dependencies": { "bindings": "^1.5.0", @@ -5481,9 +5481,9 @@ "integrity": "sha1-zG61akFkObWLd819uTNbqvCGJYk=" }, "dicom-dimse-native": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/dicom-dimse-native/-/dicom-dimse-native-1.2.11.tgz", - "integrity": "sha512-CQeI/vIoxf6zW9rroXPdhOoedZhB1NmKSuTBOYTeyCVl+EwgYpTQ38eEGXwVFcZhYrmOVuDO5QqN/DzufLF5Vw==", + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/dicom-dimse-native/-/dicom-dimse-native-1.2.12.tgz", + "integrity": "sha512-Q8600iZuMs7jJiKds4XwauD/hK0wYStbjuvydK8CW5jHxgH1hBGzvfnjijdlG571FE+4Xss20LUipHUJIEP4dA==", "requires": { "bindings": "^1.5.0", "cmake-js": "^6.1.0", diff --git a/package.json b/package.json index e669121..e5edbdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dicomweb-proxy", - "version": "1.0.18", + "version": "1.1.0", "description": "A proxy to translate between dicomweb and dimse", "main": "app.js", "scripts": { @@ -28,7 +28,7 @@ "dependencies": { "config": "^3.3.4", "dicom-data-dictionary": "^0.3.1", - "dicom-dimse-native": "^1.2.11", + "dicom-dimse-native": "^1.2.12", "dicom-parser": "^1.8.7", "fastify": "^3.12.0", "fastify-cors": "^4.1.0", diff --git a/src/app.js b/src/app.js index 693630d..d3df508 100644 --- a/src/app.js +++ b/src/app.js @@ -105,7 +105,7 @@ fastify.get('/viewer/wadouri', async (req, reply) => { } const storagePath = config.get('storagePath'); const studyPath = path.join(storagePath, studyUid) - const pathname = path.join(storagePath, studyUid, imageUid); + const pathname = path.join(studyPath, imageUid); try { await utils.fileExists(pathname); } catch (error) { diff --git a/src/utils.js b/src/utils.js index 7495ae7..4d25763 100644 --- a/src/utils.js +++ b/src/utils.js @@ -62,6 +62,10 @@ const fetchData = async (studyUid, seriesUid) => { }; // set source and target from config + const ts = config.get('transferSyntax'); + j.netTransferPrefer = ts; + j.netTransferPropose = ts; + j.writeTransfer = ts; j.source = config.get("source"); j.target = config.get("target"); j.verbose = config.get("verboseLogging"); @@ -123,10 +127,14 @@ const utils = { await storage.init({ dir: storagePath }); }, startScp: () => { + const ts = config.get('transferSyntax'); const j = {}; j.source = config.get("source"); j.storagePath = config.get("storagePath"); j.verbose = config.get("verboseLogging"); + j.netTransferPrefer = ts; + j.netTransferPropose = ts; + j.writeTransfer = ts; j.peers = [config.get("target")]; j.permissive = false; @@ -215,8 +223,6 @@ const utils = { verbose: config.get('verboseLogging'), }; - console.log(j); - // run find scu and return json response return new Promise((resolve, reject) => { dimse.recompress(JSON.stringify(j), (result) => {