Help with private tag

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Help with private tag

#1 Post by st80rules »

Hi,

I need to interpret a private tag but am having a hard time. If I access it so:

DcmElement* elem = myDataset->getElement(nIndex);
elem->getOFStringArray(sVal, 0);

sVal has values like "30\2e\30\30\30\35\34\31"

Which is not what I'm looking for, it should be a floating point value. If I ask the elem getFloat32() or getFloat64() it returns an error.

According to the conformance statement, it has a VR of DS. So I tried this:

DcmDataDictionary &dict = dcmDataDict.wrlock();
dict.addEntry(new DcmDictEntry(0x7053, 0x1000, EVR_DS, "SUVScaleFactor", 1, 1, "private", OFTrue, "Philips PET Private Group"));
dcmDataDict.unlock();

Yet I cannot get the correct interpretation of the element. In the above element, it has a VR of EVS_UN.

What am I doing wrong?

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

Re: Help with private tag

#2 Post by J. Riesmeier »

If the DICOM dataset is stored with explicit VR and uses "UN" (Unknown) for the respective private Attribute then you need to enable the "unknown VR conversion" as it is done with "dcmconv --convert-un". In your program, you should call "dcmEnableUnknownVRConversion.set(OFTrue);" for this purpose:

Code: Select all

/** Global flag to enable/disable the automatic re-conversion of defined
 *  length UN elements read in an explicit VR transfer syntax, if the real
 *  VR is defined in the data dictionary.
 */
extern DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableUnknownVRConversion; /* default OFFalse */

st80rules
Posts: 190
Joined: Tue, 2007-05-08, 17:45

Re: Help with private tag

#3 Post by st80rules »

Yep that did the trick.

Thanks!

Post Reply

Who is online

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