Reputation: 617
i am trying to check if there is a way to extract VR (value representation) from a private DICOM tag.
i am aware that DicomObject.vROf:
http://www.dcm4che.org/docs/dcm4che2-apidocs/org/dcm4che2/data/DicomObject.html#vrOf(int)
returns UN if no a VRMap is configured for this private TAGS! i would like to do something like:
vR = dcmObj4.vrOf(0X0051100b).toString();
if("LO".equals(vR)) {
log.info("VR of acquisitionMatrix is: " + vR);
acquisitionMatrixX = dcmObj4.getString(0X0051100b, VR.LO);
} else if ("SH".equals(vR)) {
log.info("VR of acquisitionMatrix is: " + vR);
acquisitionMatrixX = dcmObj4.getString(0X0051100b, VR.SH);
} else if ("UN".equals(vR)) {
log.info("VR of acquisitionMatrix is: " + vR);
acquisitionMatrixX = dcmObj4.getString(0X0051100b, VR.UN);
} else {
log.info("VR of acquisitionMatrix is OTHER: " + vR);
}
The fact is that i am trying to parse dicom files from specific vendor/models and i can see that even for the same vendor/model combination different VRs can be used on the same private TAG!
Can i extract VR of a private dicom tag on dynamically?
Upvotes: 1
Views: 1135
Reputation: 2775
Yes, you should be able to extract the value in the private tag. Please note that Private Creator Data Elements VR is always be "LO". When VR is unknown, the Value Field is insensitive to Little/Big Endian byte ordering and shall not be ‘byteswapped’. So, you can assume that the Value Field of the Attribute is encoded in Little Endian byte ordering with implicit VR encoding, irrespective of the current Transfer Syntax.
Also note that the length field of the Value Representation of UN may contain the value of unknown length, in which case the contents can be assumed to be encoded with implicit VR and PS 3.5 section 7.5.1 has the information related to parsing Data Elements with an unknown length.
Also section 7.8 covers the Private Data Element encoding rules.
Upvotes: 1
Reputation: 1611
Well, there are rules in the Dicom Standard
for Private Tags
to avoid such conflicts.
See this explanation of usage of Private Creator/Tags: Overview Private Tag Elements
Upvotes: 1