89 US_SS_OW = US | SS | OW,
91 VL16 = AE | AS | AT | CS | DA | DS | DT | FD | FL | IS |
LO | LT | PN | SH | SL | SS | ST | TM |
UI | UL | US,
92 VL32 = OB | OW | OF | SQ | UN | UT,
93 VRASCII = AE | AS | CS | DA | DS | DT | IS |
LO | LT | PN | SH | ST | TM |
UI | UT,
94 VRBINARY = AT | FL | FD | OB | OF | OW | SL | SQ | SS | UL | UN | US,
98 VR_VM1 = AS | LT | ST | UT | SQ | OF | OW | OB | UN,
103 static const char *GetVRString(VRType vr);
106 static VRType GetVRTypeFromFile(
const char *vr);
109 static VRType GetVRType(
const char *vr);
110 static const char *GetVRStringFromFile(VRType vr);
112 static bool IsValid(
const char *vr);
115 static bool IsValid(
const char *vr1, VRType vr2);
118 static bool IsSwap(
const char *vr);
125 unsigned int GetSizeof()
const;
137 static bool IsBinary(VRType vr);
138 static bool IsASCII(VRType vr);
140 static bool CanDisplay(VRType vr);
142 static bool IsBinary2(VRType vr);
144 static bool IsASCII2(VRType vr);
148 std::istream &Read(std::istream &is)
152 VRField = GetVRTypeFromFile(vr);
160 is.seekg(2, std::ios::cur );
164 if( !(dum[0] == 0 && dum[1] == 0 ))
174 const std::ostream &Write(std::ostream &os)
const
182 const char *vr = GetVRString(vrfield);
184 assert( vr[0] && vr[1] && vr[2] == 0 );
189 const char dum[2] = {0, 0};
194 friend std::ostream &
operator<<(std::ostream &os,
const VR &vr);
196 operator VRType ()
const {
return VRField; }
198 unsigned int GetSize()
const;
200 bool Compatible(
VR const &vr)
const;
202 bool IsVRFile()
const;
208 static int GetIndex(VRType vr);
223 template<
int T>
struct VRToEncoding;
225 template<
int T>
struct VRToType;
226 #define TYPETOENCODING(type,rep, rtype) \
227 template<> struct VRToEncoding<VR::type> \
228 { enum { Mode = VR::rep }; }; \
229 template<> struct VRToType<VR::type> \
230 { typedef rtype Type; };
235 friend std::ostream&
operator<<(std::ostream &_os,
const UI &_val);
287 #define VRTypeTemplateCase(type) \
289 return sizeof ( VRToType<VR::type>::Type );
325 assert( 0 &&
"should not" );