I've successfully created a DCM from a PDF using
Code: Select all
pdf2dcm +st /var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7 ./test.dcm
Using the same source DICOM file that I used to create the PDF, I've tried the following commands:
- dcmodify -nb -if "(0008,0050)=/var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7" ./test.dcm
- E: DcmObject: Length of element AccessionNumber (0008,0050) exceeds maximum of 16-bit length field
- dcmodify -nb -if "0008,0050=/var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7" ./test.dcm
- dcmodify -nb -if "AccessionNumber=/var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7" ./test.dcm
- dcmodify -nb -if 'AccessionNumber=/var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7' ./test.dcm
- 2. 3. 4. all return the following E: unable to load file ./test.dcm: I/O suspension or premature end of stream
Code: Select all
cp /var/lib/dicom/e5/b4/e5b4906c-e5c4-4441-afc0-09f37123e2b7 ./source.dcm dcmodify -nb -if "AccessionNumber=./source.dcm" ./test.dcm
I guess from (1) above I shouldn't use the parentheses, which is fine, and of course I could pull the values from the source file, hold them in memory and then use dcmodify -i "(0008,0050)=valueFromSourceFile" ./test.dcm but wanted to see if there was something that I'm missing when using the -if parameter?
PS. To check that the test.dcm file was OK, I was successfully able to run dcmodify -i "(0008,0050)=TESTVALUE" ./test.dcm.
PPS. I also realize that the version for this version of Ubuntu is 4 years old. If this is a bug(?) it may well have been addressed in a later version, but I wanted to ensure I was using the command correctly before moving to a later version (which has it's own issues...)