From 8d605b6b541abc50c791105e52f6a59187db87a1 Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Wed, 1 Jan 2025 19:20:10 +0100 Subject: [PATCH 1/2] rewrite: add rewrite command --- bin/dcmjs.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/dcmjs.js b/bin/dcmjs.js index 3a65263..8b24d35 100755 --- a/bin/dcmjs.js +++ b/bin/dcmjs.js @@ -44,4 +44,15 @@ program.command('modify') writeDicom(options.out, dicomDict); }) + program.command('rewrite') + .description('Change values in the dicom header') + .argument('', 'part 10 input file path') + .option('-l, --logLevel ', 'logging level, TRACE, DEBUG, INFO, WARN, ERROR, default: WARN') + .option('-o, --out ', 'part 10 output file path') + .requiredOption('-r, --replace =', 'Replace or add tag value', assignment) + .action(async (fileName, options) => { + let dicomDict = readDicom(fileName); + writeDicom(options.out, dicomDict); + }) + program.parse(); From c583ba8b75be30d44c89cde70f478b1727bfc75b Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Wed, 1 Jan 2025 19:36:35 +0100 Subject: [PATCH 2/2] remove replace option for rewite --- bin/dcmjs.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/dcmjs.js b/bin/dcmjs.js index 8b24d35..8232c95 100755 --- a/bin/dcmjs.js +++ b/bin/dcmjs.js @@ -49,7 +49,6 @@ program.command('modify') .argument('', 'part 10 input file path') .option('-l, --logLevel ', 'logging level, TRACE, DEBUG, INFO, WARN, ERROR, default: WARN') .option('-o, --out ', 'part 10 output file path') - .requiredOption('-r, --replace =', 'Replace or add tag value', assignment) .action(async (fileName, options) => { let dicomDict = readDicom(fileName); writeDicom(options.out, dicomDict);