fix(metadata): stop fabricating display metadata and add DICOM JSON converter

Replace the hand-built metadata subset in parseMeta with a VR-aware
DICOM-to-DICOM-JSON converter. Window Center/Width, Rescale Intercept/Slope
are only emitted when the source element exists; multi-values are preserved
in source order. VOI/LUT, Presentation LUT and Pixel Padding tags are
preserved and Pixel Data is excluded.

- add src/dimse/dicomJson.ts (dictionary-aware converter)
- rewrite src/dimse/parseMeta.ts to use the converter
- add synthetic non-PHI DICOM writer and metadata tests
- add npm test script (node:test + ts-node) and skipLibCheck
This commit is contained in:
padmanto
2026-09-18 14:16:11 +07:00
parent ac162cd2a3
commit 0c680b680f
6 changed files with 595 additions and 130 deletions

View File

@@ -7,6 +7,7 @@
"start": "ts-node src/app.ts",
"format": "npx prettier ./src",
"build": "tsc --p ./tsconfig.json",
"test": "node --test -r ts-node/register/transpile-only tests/*.test.ts",
"pkg:win": "npm run build && npx pkg --targets node16-win-x64 package.json"
},
"repository": {