Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modify subcommand for editing dicom tags #3

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

pieper
Copy link

@pieper pieper commented Dec 15, 2024

This is a work-in-progress effort to provide some useful utility functions.

Tested with this example:

dcmjs modify /Users/pieper/data/vhp/radiological/normalCT/c_vf2130.dcm --out /tmp/out.dcm  --replace PatientAge=039Y; dcmjs dump /tmp/out.dcm | grep PatientAge
Test with a commandline like this:
```
python testscripts/walk.py ~/data/vhp/radiological/normalCT /tmp/outCT
```

Requires pydicom be already installed.
@pieper pieper marked this pull request as draft December 15, 2024 20:45
@pieper pieper self-assigned this Dec 15, 2024
* Update to latest dcmjs to handle error listed below
* add `--logLevel` option to suppress warnings
* update walk.py testscript to use --logLevel option


```
C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:8419
                  if (isString) log.log(errmsg);else throw new Error(errmsg);
                                                           ^

Error: Value exceeds max length, vr: CS, value: [object ArrayBuffer], length: undefined
    at CodeString.writeBytes (C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:8419:53)
    at CodeString.writeBytes (C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:8496:94)
    at Tag.write (C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:8083:27)
    at C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:10170:25
    at Array.forEach (<anonymous>)
    at Function.write (C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:10165:19)
    at DicomDict.write (C:\TelixTools\dcmjs-commands\node_modules\dcmjs\build\dcmjs.js:10310:21)
    at writeDicom (file:///C:/TelixTools/dcmjs-commands/src/index.js:15:33)
    at Command.<anonymous> (file:///C:/TelixTools/dcmjs-commands/bin/dcmjs.js:43:5)
    at Command.listener [as _actionHandler] (C:\TelixTools\dcmjs-commands\node_modules\commander\lib\command.js:542:17)

Node.js v18.19.0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant