Hi everyone. This is what I need to do
- I need to retrieve some dicom files from a pacs, for which I am using the movescu+storescp command line tool. This part works OK.
- Then I need to change some values from the dicom header. My doubt is about this step.
- And finally I need to send the modified file to another pacs. I will use the storescu command line tool. This part works OK.
I am trying to do all this steps usying the command line tools inside a linux shell script. I do not have a very good knowledge of the library so I am not considering writing a java tools to achieve this. I am using dcm command line tools version 3.3.8
I am wondering if there is a dcm4che tool which allows me to do this change.
I have been trying the json2dcm/dcm2json tool. And this is my first test
There is one dicom file called original.dcm
[]$ ls
original.dcm
Then I extract all its headers into a json file called original.json
[]$ /opt/dcm4che/bin/dcm2json original.dcm > original.json
And finally I use the reverse tool hoping the resulting file will be exacly the same as I have not change anything into the dicom/headers/json
[]$ /opt/dcm4che/bin/json2dcm -i original.dcm -j original.json -o result.dcm
But the checksum says they are not the same. Almost the same in size though.
[]$ sha1sum original.dcm
b21468feaa74153a2c07dfefb4e765418f633e02 original.dcm
[]$ sha1sum result.dcm
bc2093cc967c829ac79ca23f6f01ab9907ef890a result.dcm
[]$ ls -l
8357 jul 5 16:37 origina.json
4384 jul 5 16:20 original.dcm
4378 jul 5 16:38 result.dcm
My idea is changing the intermediate json file into the correct values using shell script as I need to retrieve the new values from a database. And the merging the modified json file with the original dicom file.
dcmdumping the original and resulting dicom file, I can see little differences. dots (...) stands for headers with the same value in the original and in the result file
---------------------------------original --------------------
...
1274: (0010,4000) LT #12 [Insurance=] PatientComments
...
3640: (0032,1032) PN #14 [DESCONOCIDO^^^] RequestingPhysician
---------------------------------original --------------------
...
1274: (0010,4000) LT #10 [Insurance=] PatientComments
...
3638: (0032,1032) PN #12 [DESCONOCIDO] RequestingPhysician
The dcm2jpg output for both original.dcm and result.dcm is exactly the same
With all this information, can I asume this process will not lose or change any header/information other than the ones I will replace in the json file
Am I doing something wrong with the parameters of the tools, is there a better/simple way to achieve this using the dcm4che command line tools ?
Thank you very much in advance.