Adding Private Tag Data to the private.dic File
Moderator: Moderator Team
Adding Private Tag Data to the private.dic File
I need to add private tags to the data dictionary.
As I'm using the windows precompiled binaries, will I need to recompile the binaries after adding the entries, specifically dcm2xml.exe, or will this binary read from the external text files?
I read in one of the help documents that the binaries can either have the data dictionaries compiled into the application, read from the external files, or both.
I tried adding an entry into private.dic for a known private tag, but when converting to xml, the VR still equals ?? and the name still equals "Unknown Tag & Data" .
Thanks very much.
dave
As I'm using the windows precompiled binaries, will I need to recompile the binaries after adding the entries, specifically dcm2xml.exe, or will this binary read from the external text files?
I read in one of the help documents that the binaries can either have the data dictionaries compiled into the application, read from the external files, or both.
I tried adding an entry into private.dic for a known private tag, but when converting to xml, the VR still equals ?? and the name still equals "Unknown Tag & Data" .
Thanks very much.
dave
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Re: Adding Private Tag Data to the private.dic File
Dave,
Jörg
this is correct. Did you check that the environment variable DCMDICTPATH really points to your private dictionary?dave wrote:I read in one of the help documents that the binaries can either have the data dictionaries compiled into the application, read from the external files, or both.
Jörg
I will create the DCMDICTPATH environmental variable with the correct value, i.e., it will point to the private.dic file included with the download and where I have added new entries.
So without this variable set, were the windows binaries using compiled in data dictionaries?
Thanks for you help, Jörg.
So without this variable set, were the windows binaries using compiled in data dictionaries?
Thanks for you help, Jörg.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Dave,
under Windows the default is to have a built-in data dictionary, i.e. usually it is not required to set the environment variable. But if you set the variable the built-in dictionary is still used and the entries from the external dictionary file are added to it when the application starts.
Details can be found in the text document "datadict.txt" (apparently a little out-dated but most of the text is still correct).
Jörg
under Windows the default is to have a built-in data dictionary, i.e. usually it is not required to set the environment variable. But if you set the variable the built-in dictionary is still used and the entries from the external dictionary file are added to it when the application starts.
Details can be found in the text document "datadict.txt" (apparently a little out-dated but most of the text is still correct).
Jörg
Not having much luck here. But perhaps I'm making some faulty assumptions.
This is a tag from the dicom file I converted using dcm2xml.exe:
<element tag="300b,1001" vr="??" vm="1" len="2" name="Unknown Tag & Data" binary="yes">31\30</element>
and this is the tab separated entry I added to private.dic (the VR and NAME are bogus values...)
(300b,"MDACC",1001) PN TestElement 1
I've added the DCMDICTPATH env variable including the file name.
I've restarted the computer, but still no changes to the above tag information.
Anything obvious that I've missed?
This is a tag from the dicom file I converted using dcm2xml.exe:
<element tag="300b,1001" vr="??" vm="1" len="2" name="Unknown Tag & Data" binary="yes">31\30</element>
and this is the tab separated entry I added to private.dic (the VR and NAME are bogus values...)
(300b,"MDACC",1001) PN TestElement 1
I've added the DCMDICTPATH env variable including the file name.
I've restarted the computer, but still no changes to the above tag information.
Anything obvious that I've missed?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Nope. So I just took it out.
Now the data dictionary entry looks like this:
(300b,1001) DS TestElement 1
( the VR for this tag actually is "DS", I just checked )
and the XML output looks like this:
<element tag="300b,1001" vr="DS" vm="1" len="2" name="Unknown Tag & Data">10</element>
So some progress has been made in that the env var is set up correctly and the application is reading it.
I'm curious as to the change in the value '31\30' to '10' . This is the value associated with the element, isn't it? Any idea why this might have changed.
BTW, thanks so much, Jörg, for engaging an obvious newbie to DICOM like myself.
dave
Now the data dictionary entry looks like this:
(300b,1001) DS TestElement 1
( the VR for this tag actually is "DS", I just checked )
and the XML output looks like this:
<element tag="300b,1001" vr="DS" vm="1" len="2" name="Unknown Tag & Data">10</element>
So some progress has been made in that the env var is set up correctly and the application is reading it.
I'm curious as to the change in the value '31\30' to '10' . This is the value associated with the element, isn't it? Any idea why this might have changed.
BTW, thanks so much, Jörg, for engaging an obvious newbie to DICOM like myself.
dave
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Dave,
but without private creator element the private tag (300b,1001) is not properly reserved according to part 5 of the DICOM standard
Jörg
but without private creator element the private tag (300b,1001) is not properly reserved according to part 5 of the DICOM standard
If the VR is unknown DCMTK uses OB (Other Byte) for the output, i.e. a sequence of bytes. DS (Decimal String) is the string representation of a decimal number. In your case the number 10 is stored as the string "10". The binary representation of this string is 0x31 0x30 - voilàdave wrote:I'm curious as to the change in the value '31\30' to '10' . This is the value associated with the element, isn't it? Any idea why this might have changed.
Jörg
Would this be a concern for me? I am just converting the DICOM file with dcm2xml.exe to xml for web display. Wouldn't this be more important for the Application Entities that are actually creating the objects?but without private creator element the private tag (300b,1001) is not properly reserved according to part 5 of the DICOM standard
In this entry from private.dic included with the download:
(7003,"SIEMENS MED",10) LT Header 1
isn't "SIEMENS MED" assigned to this tag by whatever AE created the object?
dave
-
- DCMTK Developer
- Posts: 2049
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi David,
every private tag you use in your dicom file must have a reservation context. This reservation tag looks like gggg,00xx, where gggg is a private (=odd) group number and 10<xx<FF. The tag gggg,00xx then reserves a range of private tags from gggg,xx00-gggg,xxFF for the private creator, that you set with the value of the reservation tag.
In your case:
Your tag (300b,1001) is a private tag and therefore it needs a reservation. Following the rule above, the related reservation tag number is (300b,0010).
(300b,0010)="MDACC" reserves for private creator "MDACC" the tag range 300b,1000-300b,10FF. The reservation tag needs to be found in the dicom file, not in the dictionary.
E.g: This line from private.dic means:
(0027,"GEMS_IMAG_01",06) SL ImageArchiveFlag 1
0027,xx06 is a valid tag, if in the same file there is a reservation 0027,00xx="GEMS_IMAG_01"
When DCMTK sees a private tag in your file it looks for the related reservation tag. If it can be found, it reads the private creator name, that is set there. Next, it looks at your dictionary for private tags and checks all matching tags (same group/element numbers), whether it can find one with the same private creator name. If so, searching was successful.
Please read section 7.8 in part 5 of the DICOM standard (only 1 page).
Best Regards
Michael Onken
every private tag you use in your dicom file must have a reservation context. This reservation tag looks like gggg,00xx, where gggg is a private (=odd) group number and 10<xx<FF. The tag gggg,00xx then reserves a range of private tags from gggg,xx00-gggg,xxFF for the private creator, that you set with the value of the reservation tag.
In your case:
Your tag (300b,1001) is a private tag and therefore it needs a reservation. Following the rule above, the related reservation tag number is (300b,0010).
(300b,0010)="MDACC" reserves for private creator "MDACC" the tag range 300b,1000-300b,10FF. The reservation tag needs to be found in the dicom file, not in the dictionary.
E.g: This line from private.dic means:
(0027,"GEMS_IMAG_01",06) SL ImageArchiveFlag 1
0027,xx06 is a valid tag, if in the same file there is a reservation 0027,00xx="GEMS_IMAG_01"
When DCMTK sees a private tag in your file it looks for the related reservation tag. If it can be found, it reads the private creator name, that is set there. Next, it looks at your dictionary for private tags and checks all matching tags (same group/element numbers), whether it can find one with the same private creator name. If so, searching was successful.
Please read section 7.8 in part 5 of the DICOM standard (only 1 page).
Best Regards
Michael Onken
Who is online
Users browsing this forum: Ahrefs [Bot], George, rickf and 1 guest