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?
Help with private tag
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Help with private tag
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 */
Re: Help with private tag
Yep that did the trick.
Thanks!
Thanks!
Who is online
Users browsing this forum: Google [Bot] and 1 guest