Problem with inserting private tag

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
new2009
Posts: 14
Joined: Tue, 2009-06-02, 10:04

Problem with inserting private tag

#1 Post by new2009 »

I am using dcmodify.exe (Windows) version 3.6.0 and trying to insert private tag (1041,1010) with value "AR".

From what I read in the dcmodify manual, I need to add this (reserve) in the "data dictionary".

But, I do not know how to do this for the Windows version of DCMTk.

Is that even possible? How?

Right now, I can force the insertion using --no-reserv-check, but then I got "UN" VR and the inserted value was set as 0a\00.

Thanks.
Last edited by new2009 on Thu, 2014-11-06, 14:37, edited 1 time in total.

new2009
Posts: 14
Joined: Tue, 2009-06-02, 10:04

Re: Problem with inserting private tag

#2 Post by new2009 »

After I read the instruction to create additional data dictionary from:
http://support.dcmtk.org/docs/file_datadict.html

I created one in C:\TEMP\data.dic

Containing this single line:
(1041,"PHILIPS",1010) SH Unknown 1

All fields are separated by TAB characters.

The data dictionary was loaded properly, but the error is still there:

Code: Select all

C:\Temp>set DCMDICTPATH=C:\TEMP\data.dic

C:\Temp>dcmodify -i "(1041,1010)="AR"" IM_0001.dcm
I: DcmDataDictionary: Loading file: C:\TEMP\data.dic
E: modifying tag in file IM_0001.dcm: Invalid path: No private reservation found for tag: (1041,1010)
E: There was 1 error
What is wrong here?

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

Re: Problem with inserting private tag

#3 Post by J. Riesmeier »

I think the error message is quite obvious: "No private reservation found for tag: (1041,1010)"

That means you also have to add the private creator element (1041,0010) with a value of "PHILIPS".
If you don't understand this, please read the relevant sections of part 5 of the DICOM standard!

new2009
Posts: 14
Joined: Tue, 2009-06-02, 10:04

Re: Problem with inserting private tag

#4 Post by new2009 »

How do you add that in the data dictionary?

Is it not possible?
J. Riesmeier wrote:I think the error message is quite obvious: "No private reservation found for tag: (1041,1010)"

That means you also have to add the private creator element (1041,0010) with a value of "PHILIPS".
If you don't understand this, please read the relevant sections of part 5 of the DICOM standard!
Last edited by new2009 on Thu, 2014-11-06, 15:08, edited 2 times in total.

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

Re: Problem with inserting private tag

#5 Post by J. Riesmeier »

No, the private creator element should be added to the DICOM dataset, of course :wink:

new2009
Posts: 14
Joined: Tue, 2009-06-02, 10:04

Re: Problem with inserting private tag

#6 Post by new2009 »

You said here: viewtopic.php?f=1&t=3415&p=13623&hilit=private#p13623

"Btw, you could also add your private tags to a loadable data dictionary (see "private.dic")."

And that's what I am trying to do, with no success :(
J. Riesmeier wrote:No, the private creator element should be added to the DICOM dataset, of course :wink:

new2009
Posts: 14
Joined: Tue, 2009-06-02, 10:04

Re: Problem with inserting private tag

#7 Post by new2009 »

Ah, OK! Understand.

I did this:

Code: Select all

C:\Temp>dcmodify -i "(1041,0010)=PHILIPS" IM_0001.dcm
I: DcmDataDictionary: Loading file: C:\TEMP\data.dic

C:\Temp>dcmodify -i "(1041,1010)=AR" IM_0001.dcm
I: DcmDataDictionary: Loading file: C:\TEMP\data.dic
And it works! :)

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

Re: Problem with inserting private tag

#8 Post by J. Riesmeier »

Great :D

Btw, you can insert multiple data elements with a single call using option -i multiple times.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest