Again, reading private tags from a dicom file

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
McGiulio
Posts: 2
Joined: Wed, 2016-05-04, 15:41

Again, reading private tags from a dicom file

#1 Post by McGiulio »

Hi all,

i want to read private tags eg. with dcmdump.exe from a dicom file.

I added in the dcmdump.cxx file the private tags to the data dictionary during runtime (as explained in http://support.dcmtk.org/redmine/projec ... rivatedata)

if (!dcmDataDict.isDictionaryLoaded())
{
CERR << "Warning: no data dictionary loaded, "
<< "check environment variable: "
<< DCM_DICT_ENVIRONMENT_VARIABLE;
}

DcmDataDictionary &dict = dcmDataDict.wrlock();
dict.addEntry(new DcmDictEntry(0x1111, 0x1016, EVR_UNKNOWN, ";M TAG", 1, 1, "private", OFTrue, "MYCOMPANY"));
dcmDataDict.unlock();


I expected that in the dump the tag is knew, but unfortunately the dump is like this

<element tag="1111,1016" vr="??" vm="1" len="6" name="Unknown Tag & Data" binary="hidden"></element>

and the value is not visible.

what's wrong?

Thanks in advance

McGiulio

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

Re: Again, reading private tags from a dicom file

#2 Post by J. Riesmeier »

The value is hidden because the VR is "??" (EVR_UNKNOWN), which is not a valid DICOM VR.

First question, in order to narrow down the issue: Does your DICOM dataset contain the required Private Creator element (1111,0010) = "MYCOMPANY"?

McGiulio
Posts: 2
Joined: Wed, 2016-05-04, 15:41

Re: Again, reading private tags from a dicom file

#3 Post by McGiulio »

Thanks!!!
now it works!!!
I changed the vr to EVR_LO (but I just tried with EVR_LO) and overall I used as private creator string in the DcmDictEntry the same string found in the Private Creator element.

Post Reply

Who is online

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