DCMODIFY issues

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

DCMODIFY issues

#1 Post by martinrame »

Hi, I'm trying to change the value of tag (0008,1060) but I can't.

This is the command I'm using:

Code: Select all

dcmodify -d -m "(0008,1060)=AAAA" nico.dcm
But, instead of replacing 0008,1060 value with "AAAA" I get this:

Code: Select all

(0008,0090) PN (no value available)                     #   0, 0 ReferringPhysicianName
(0008,1010) SH [ru0]                                    #   4, 1 StationName
(0008,1048) PN (no value available)                     #   0, 0 PhysiciansOfRecord
(0008,1050) PN [DANIEL^PASINI]                          #  14, 1 PerformingPhysicianName
(0008,1060) UN 91\00                                    #   2, 1 NameOfPhysiciansReadingStudy  <-- HERE'S THE PROBLEM
(0008,1070) PN [ALTIERI, ANGELA]                        #  16, 1 OperatorsName
(0008,1110) SQ (Sequence with explicit length #=0)      #   0, 1 ReferencedStudySequence
I reproduced this using 3.6.0 and 3.6.1, both on Ubuntu 11.10 64bits, dcmtk compiled from source.

P.S.: I also tried with -i instead of -m and got the same result.

Regards,
Leonardo

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi Leonardo,

that looks very weird.

I tried your line on a current linux kubuntu system (32 bit installation) with 3.6.0 installed and it gives a line like this in the following dump:

Code: Select all

(0008,1060) PN [AAAA]                                   #   4, 1 NameOfPhysiciansReadingStudy
So it works for me just fine. The same for an old Debian system (amd64 kernel) compiling and running DCMTK 3.6.1.

It is very weird that in your case the characters are disturbed and even more, that the datatype is not recognized any more (lists UN instead of PN). Did you modify your dictionary (dicom.dic) in any way? Is your console operating in a crazy character set mode? What happens if you do the same insertion into (0010,0010) (patient's name)?

Best regards,
Michael

P.S: Or is your dictionary not loaded at all? Set your DCMDICTPATH environment variable to the location of the dicom.dic file, e.g.

Code: Select all

export DCMDICTPATH=/your/path/to/dicom.dic
By default, every DCMTK binary looks withing the right place, i.e. depending on the install prefix you have chosen during DCMTK build. Per default this is (on kubuntu, at least) /usr/share/dcmtk/dicom.dic.

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

#3 Post by martinrame »

There must be something wrong with images generated by this modality. If I delete the tag, then insert with new values, it works ok.

Code: Select all

dcmodify -d -e "(0008,1060)" -i "(0008,1060)=AAAA" nico.dcm

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

If you like, send the image for analysis to dicom at offis dot de. We're always interested in DICOM curiosities (and fixes, if reasonable) :-)

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

#5 Post by martinrame »

Thanks, I've sent the file.

nicolas_dicom
Posts: 19
Joined: Fri, 2010-10-29, 21:48

#6 Post by nicolas_dicom »

Hi all,

I had the same problem. I tried to OVERWRITE next tag

(0008,1060) UN 34\00 # 2, 1 NameOfPhysiciansReadingStudy

But for some reason when this tag has a value like "34\00", dcmodify shows an error

Code: Select all


nicolas@nicolas:~/Escritorio$ dcmodify -d -i "(0008,1060)=HOLA" CR_1.dcm
I: Processing file: CR_1.dcm
I: Loading file into dataset manager: CR_1.dcm
D: DcmItem::checkTransferSyntax() TransferSyntax="Little Endian Explicit"
I: Getting dataset from loaded file: CR_1.dcm
I: Executing (option|path|value): i|(0008,1060)|HOLA
E: modifying tag in file CR_1.dcm: Corrupted data
I: Renamed backup file to original
I: ------------------------------------
E: There was 1 error
Sometimes there is no error message and the option " -i " does not take effect.


So what I did is next :

Code: Select all

dcmodify -v  -e "(0008,1060)" -i "(0008,1060)=DR NICOLAS" CR_1.dcm

That way I will erase the TAG with the value 34\00 to be able to insert the new one with the new value "DR NICOLAS" . But ...... What happen If the tag "(0008,1060)" does not exist ? We will see an error "TAG NOT FOUND" , so to avoid this message we can use the option " -imt "

-imt means :

Code: Select all


 other processing options:
    -imt  --ignore-missing-tags  treat 'tag not found' as success
                                 when modifying or erasing in datasets
So the complete sentence is like next :

Code: Select all

dcmodify -v -imt  -e "(0008,1060)" -i "(0008,1060)=DR NICOLAS" CR_1.dcm

That worked pretty good to me : )

Anyway I would to know what is wrong with those kind of files.
What this value means "" 34\00 ""

Please notice that

The option -imt is not available in the next dcmtk version
dcmodify v3.5.4 2005-12-20


So I had to update to the next version
dcmodify v3.6.0 2011-01-06



Regards,

Nicolás

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#7 Post by Michael Onken »

Hi Nicolas,

thanks for sharing the information. However, I really wonder about the initial error when you insert the tag; I was not able to reproduce it on our systems. If you find out in the future what causes this issue, post it to this thread please.

Best regards,
Michael

nicolas_dicom
Posts: 19
Joined: Fri, 2010-10-29, 21:48

#8 Post by nicolas_dicom »

Hi Michael,

Ok.


Will have to read (Part 5: Data Structures and Encoding)


(0008,1060) UN 0a\00 # 2, 1 NameOfPhysiciansReadingStudy
(50f1,100a) UN 41\45\42\30\2e\35 # 6, 1 Unknown Tag & Data

UN means "Unknown"
A string of bytes where the encoding of the contents is unknown (see Section 6.2.2 of Digital Imaging and Communications in Medicine (DICOM) - Part 5: Data Structures and Encoding).

Regards,

Nicolás

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#9 Post by Michael Onken »

Hi Nicolas,

yes, I know, that is why I asked whether you have problems with your DICOM dictionary that is used by DCMTK applications (thus also by dcmoidfy) for knowing the data type of each attribute.

Best,
Michael

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#10 Post by J. Riesmeier »

I guess that if the data element with tag (0008,1060) already exists in the dataset with VR "UN", it is not replaced by the correct VR during "dcmodify" processing (at least not when modifying with option -m).

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#11 Post by Michael Onken »

Hi Jörg,

good idea; however this is at least not the case for the test images provided by Nicolas.

Michael

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest