GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmType.h
Go to the documentation of this file.
1 /*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13 =========================================================================*/
14
15 #ifndef GDCMTYPE_H
16 #define GDCMTYPE_H
17
18 #include "gdcmTypes.h"
19
20 #include <iostream>
21
22 namespace gdcm
23 {
24
41 class GDCM_EXPORT Type
42 {
43 public:
44 typedef enum {
45 T1 = 0,
46 T1C,
47 T2,
48 T2C,
49 T3,
50 UNKNOWN
51 } TypeType;
52
53 Type(TypeType type = UNKNOWN) : TypeField(type) { }
54
55 operator TypeType () const { return TypeField; }
56 friend std::ostream &operator<<(std::ostream &os, const Type &vr);
57
58 static const char *GetTypeString(TypeType type);
59 static TypeType GetTypeType(const char *type);
60
61 private:
62 TypeType TypeField;
63 };
64 //-----------------------------------------------------------------------------
65 inline std::ostream &operator<<(std::ostream &_os, const Type &val)
66 {
67 _os << Type::GetTypeString(val.TypeField);
68 return _os;
69 }
70
71 } // end namespace gdcm
72
73 #endif //GDCMTYPE_H