- if ( ! Count(tested) )
- {
- dbg.Verbose(0, "gdcmVR::IsVROfGdcmStringRepresentable: tested not a VR!");
- return false;
- }
-
- if (tested == "AE" || tested == "AS" || tested == "DA" || tested == "PN" ||
- tested == "UI" || tested == "TM" || tested == "SH" || tested == "LO" ||
- tested == "CS" || tested == "IS" || tested == "LO" || tested == "LT" ||
- tested == "SH" || tested == "ST" || tested == "DS" || tested == "SL" ||
- tested == "SS" || tested == "UL" || tested == "US" || tested == "UN")
- {
- return true;
- }
- return false;
+unsigned short VR::GetAtomicElementLength(VRKey const &vr)
+{
+ // Unsigned & signed short
+ if( vr == "US" || vr == "SS" )
+ return 2;
+ // Unsigned & signed long
+ if( vr == "UL" || vr == "SL" )
+ return 4;
+ // Float
+ if( vr == "FL" )
+ return 4;
+ // Double
+ if( vr == "FD" )
+ return 8;
+ // Word string
+ if( vr == "OW" )
+ return 2;
+ return 1;