Mercurial > hg > orthanc
comparison OrthancServer/ToDcmtkBridge.cpp @ 2006:6301bbcbcaed
more generic support of value representations
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 09 Jun 2016 14:48:40 +0200 |
parents | b5d4f9c156ad |
children | 655489d9165d |
comparison
equal
deleted
inserted
replaced
2005:9e021b2b348b | 2006:6301bbcbcaed |
---|---|
34 #include "ToDcmtkBridge.h" | 34 #include "ToDcmtkBridge.h" |
35 | 35 |
36 #include <memory> | 36 #include <memory> |
37 #include <dcmtk/dcmnet/diutil.h> | 37 #include <dcmtk/dcmnet/diutil.h> |
38 | 38 |
39 #include "../Core/OrthancException.h" | |
40 | |
39 | 41 |
40 namespace Orthanc | 42 namespace Orthanc |
41 { | 43 { |
42 DcmDataset* ToDcmtkBridge::Convert(const DicomMap& map) | 44 DcmDataset* ToDcmtkBridge::Convert(const DicomMap& map) |
43 { | 45 { |
53 } | 55 } |
54 } | 56 } |
55 | 57 |
56 return result.release(); | 58 return result.release(); |
57 } | 59 } |
60 | |
61 | |
62 DcmEVR ToDcmtkBridge::Convert(ValueRepresentation vr) | |
63 { | |
64 switch (vr) | |
65 { | |
66 case ValueRepresentation_ApplicationEntity: | |
67 return EVR_AE; | |
68 | |
69 case ValueRepresentation_AgeString: | |
70 return EVR_AS; | |
71 | |
72 case ValueRepresentation_AttributeTag: | |
73 return EVR_AT; | |
74 | |
75 case ValueRepresentation_CodeString: | |
76 return EVR_CS; | |
77 | |
78 case ValueRepresentation_Date: | |
79 return EVR_DA; | |
80 | |
81 case ValueRepresentation_DecimalString: | |
82 return EVR_DS; | |
83 | |
84 case ValueRepresentation_DateTime: | |
85 return EVR_DT; | |
86 | |
87 case ValueRepresentation_FloatingPointSingle: | |
88 return EVR_FL; | |
89 | |
90 case ValueRepresentation_FloatingPointDouble: | |
91 return EVR_FD; | |
92 | |
93 case ValueRepresentation_IntegerString: | |
94 return EVR_IS; | |
95 | |
96 case ValueRepresentation_LongString: | |
97 return EVR_LO; | |
98 | |
99 case ValueRepresentation_LongText: | |
100 return EVR_LT; | |
101 | |
102 case ValueRepresentation_OtherByte: | |
103 return EVR_OB; | |
104 | |
105 // Not supported as of DCMTK 3.6.0 | |
106 /*case ValueRepresentation_OtherDouble: | |
107 return EVR_OD;*/ | |
108 | |
109 case ValueRepresentation_OtherFloat: | |
110 return EVR_OF; | |
111 | |
112 // Not supported as of DCMTK 3.6.0 | |
113 /*case ValueRepresentation_OtherLong: | |
114 return EVR_OL;*/ | |
115 | |
116 case ValueRepresentation_OtherWord: | |
117 return EVR_OW; | |
118 | |
119 case ValueRepresentation_PatientName: | |
120 return EVR_PN; | |
121 | |
122 case ValueRepresentation_ShortString: | |
123 return EVR_SH; | |
124 | |
125 case ValueRepresentation_SignedLong: | |
126 return EVR_SL; | |
127 | |
128 case ValueRepresentation_Sequence: | |
129 return EVR_SQ; | |
130 | |
131 case ValueRepresentation_SignedShort: | |
132 return EVR_SS; | |
133 | |
134 case ValueRepresentation_ShortText: | |
135 return EVR_ST; | |
136 | |
137 case ValueRepresentation_Time: | |
138 return EVR_TM; | |
139 | |
140 // Not supported as of DCMTK 3.6.0 | |
141 /*case ValueRepresentation_UnlimitedCharacters: | |
142 return EVR_UC;*/ | |
143 | |
144 case ValueRepresentation_UniqueIdentifier: | |
145 return EVR_UI; | |
146 | |
147 case ValueRepresentation_UnsignedLong: | |
148 return EVR_UL; | |
149 | |
150 case ValueRepresentation_Unknown: | |
151 return EVR_UN; | |
152 | |
153 // Not supported as of DCMTK 3.6.0 | |
154 /*case ValueRepresentation_UniversalResource: | |
155 return EVR_UR;*/ | |
156 | |
157 case ValueRepresentation_UnsignedShort: | |
158 return EVR_US; | |
159 | |
160 case ValueRepresentation_UnlimitedText: | |
161 return EVR_UT; | |
162 | |
163 default: | |
164 throw OrthancException(ErrorCode_ParameterOutOfRange); | |
165 } | |
166 } | |
58 } | 167 } |