comparison JavaSDK/be/uclouvain/orthanc/ValueRepresentation.java @ 0:3ecef5782f2c

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Oct 2023 17:59:44 +0200
parents
children 26c08ff926a3
comparison
equal deleted inserted replaced
-1:000000000000 0:3ecef5782f2c
1 package be.uclouvain.orthanc;
2
3 /**
4 * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
5 * SPDX-License-Identifier: GPL-3.0-or-later
6 */
7
8 /**
9 * Java plugin for Orthanc
10 * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
11 *
12 * This program is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see http://www.gnu.org/licenses/.
24 **/
25
26
27 /**
28 * The value representations present in the DICOM standard (version 2013).
29 **/
30 public enum ValueRepresentation {
31 /**
32 * Application Entity
33 **/
34 AE(1),
35 /**
36 * Age String
37 **/
38 AS(2),
39 /**
40 * Attribute Tag
41 **/
42 AT(3),
43 /**
44 * Code String
45 **/
46 CS(4),
47 /**
48 * Date
49 **/
50 DA(5),
51 /**
52 * Decimal String
53 **/
54 DS(6),
55 /**
56 * Date Time
57 **/
58 DT(7),
59 /**
60 * Floating Point Double
61 **/
62 FD(8),
63 /**
64 * Floating Point Single
65 **/
66 FL(9),
67 /**
68 * Integer String
69 **/
70 IS(10),
71 /**
72 * Long String
73 **/
74 LO(11),
75 /**
76 * Long Text
77 **/
78 LT(12),
79 /**
80 * Other Byte String
81 **/
82 OB(13),
83 /**
84 * Other Float String
85 **/
86 OF(14),
87 /**
88 * Other Word String
89 **/
90 OW(15),
91 /**
92 * Person Name
93 **/
94 PN(16),
95 /**
96 * Short String
97 **/
98 SH(17),
99 /**
100 * Signed Long
101 **/
102 SL(18),
103 /**
104 * Sequence of Items
105 **/
106 SQ(19),
107 /**
108 * Signed Short
109 **/
110 SS(20),
111 /**
112 * Short Text
113 **/
114 ST(21),
115 /**
116 * Time
117 **/
118 TM(22),
119 /**
120 * Unique Identifier (UID)
121 **/
122 UI(23),
123 /**
124 * Unsigned Long
125 **/
126 UL(24),
127 /**
128 * Unknown
129 **/
130 UN(25),
131 /**
132 * Unsigned Short
133 **/
134 US(26),
135 /**
136 * Unlimited Text
137 **/
138 UT(27);
139
140 private int value;
141
142 private ValueRepresentation(int value) {
143 this.value = value;
144 }
145
146 /**
147 * Return the enumeration value that corresponds to an integer value of interest.
148 * @param value The integer value.
149 * @return The enumeration value.
150 **/
151 protected static ValueRepresentation getInstance(int value) {
152 if (value == 1) {
153 return AE;
154 }
155 if (value == 2) {
156 return AS;
157 }
158 if (value == 3) {
159 return AT;
160 }
161 if (value == 4) {
162 return CS;
163 }
164 if (value == 5) {
165 return DA;
166 }
167 if (value == 6) {
168 return DS;
169 }
170 if (value == 7) {
171 return DT;
172 }
173 if (value == 8) {
174 return FD;
175 }
176 if (value == 9) {
177 return FL;
178 }
179 if (value == 10) {
180 return IS;
181 }
182 if (value == 11) {
183 return LO;
184 }
185 if (value == 12) {
186 return LT;
187 }
188 if (value == 13) {
189 return OB;
190 }
191 if (value == 14) {
192 return OF;
193 }
194 if (value == 15) {
195 return OW;
196 }
197 if (value == 16) {
198 return PN;
199 }
200 if (value == 17) {
201 return SH;
202 }
203 if (value == 18) {
204 return SL;
205 }
206 if (value == 19) {
207 return SQ;
208 }
209 if (value == 20) {
210 return SS;
211 }
212 if (value == 21) {
213 return ST;
214 }
215 if (value == 22) {
216 return TM;
217 }
218 if (value == 23) {
219 return UI;
220 }
221 if (value == 24) {
222 return UL;
223 }
224 if (value == 25) {
225 return UN;
226 }
227 if (value == 26) {
228 return US;
229 }
230 if (value == 27) {
231 return UT;
232 }
233
234 throw new IllegalArgumentException("Value out of range for enumeration ValueRepresentation: " + value);
235 }
236
237 /**
238 * Get the integer value corresponding to this enumeration value.
239 * @return The integer value.
240 **/
241 public int getValue() {
242 return value;
243 }
244 }