I need to extract a list of binary numbers from a tag that's deprecated in the standard. I'm encountering strange behavior that I was hoping someone can clarify. Here's a code snippet:
Code: Select all
//note I'm not freeing the pointers here because they point to internal DCMTK structures
DcmElement * rawElement = NULL;
OFCondition cond = dataset.findAndGetElement(DcmTagKey(GROUP_NUM,ELEMENT_NUM), rawElement );
if (cond.good() && rawData != NULL)
{
rawElement ->loadAllDataIntoMemory();
Uint8 * byteArray = NULL;
cond = rawElement ->getUint8Array(byteArray);
}
Code: Select all
OFCondition DcmOtherByteOtherWord::getUint8Array(Uint8 *&byteVals)
{
errorFlag = EC_Normal;
if (getTag().getEVR() != EVR_OW && getTag().getEVR() != EVR_lt)
byteVals = OFstatic_cast(Uint8 *, getValue());
else
errorFlag = EC_IllegalCall;
return errorFlag;
My last set of questions is regarding endianess. Why is DcmElement::getByteOrder() a protected method? I need this information because the data type is one of - Uint16, Sint16, Float32, Float64 - and encoded in different tag. The stored bytes may be big endian while I'm reading it on a little endian machine. Any way to determine byte order or do I have to modify DCMTK source and set that method to be public?
Thanks very much for your time.
I'm sure it's an esoteric question.