vtk-dicom  0.8.17
vtkDICOMVM.h
1 /*=========================================================================
2 
3  Program: DICOM for VTK
4 
5  Copyright (c) 2012-2024 David Gobbi
6  All rights reserved.
7  See Copyright.txt or http://dgobbi.github.io/bsd3.txt 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 #ifndef vtkDICOMVM_h
15 #define vtkDICOMVM_h
16 
17 #include "vtkSystemIncludes.h"
18 #include "vtkDICOMModule.h" // For export macro
19 
21 class VTKDICOM_EXPORT vtkDICOMVM
22 {
23 public:
24  enum EnumType
25  {
26  M0 = 0x0000,
27  M0T1 = 0x0001,
28  M0T2 = 0x0002,
29  M0T3 = 0x0003,
30  M0T4 = 0x0004,
31  M0T5 = 0x0005,
32  M0T6 = 0x0006,
33  M0T7 = 0x0007,
34  M0T8 = 0x0008,
35  M0T9 = 0x0009,
36  M0T10 = 0x000A,
37  M0T11 = 0x000B,
38  M0T12 = 0x000C,
39  M0T13 = 0x000D,
40  M0T14 = 0x000E,
41  M0T15 = 0x000F,
42  M0T16 = 0x0010,
43  M0T17 = 0x0011,
44  M0T18 = 0x0012,
45  M0T19 = 0x0013,
46  M0T20 = 0x0014,
47  M0T21 = 0x0015,
48  M0T22 = 0x0016,
49  M0T23 = 0x0017,
50  M0T24 = 0x0018,
51  M0T25 = 0x0019,
52  M0T26 = 0x001A,
53  M0T27 = 0x001B,
54  M0T28 = 0x001C,
55  M0T29 = 0x001D,
56  M0T30 = 0x001E,
57  M0T31 = 0x001F,
58  M0T32 = 0x0020,
59  M0T63 = 0x003F,
60  M0T64 = 0x0040,
61  M0T99 = 0x0063,
62  M0T4N = 0x00FC,
63  M0T3N = 0x00FD,
64  M0T2N = 0x00FE,
65  M0TN = 0x00FF,
66  M1 = 0x0101,
67  M1T2 = 0x0102,
68  M1T3 = 0x0103,
69  M1T4 = 0x0104,
70  M1T5 = 0x0105,
71  M1T6 = 0x0106,
72  M1T7 = 0x0107,
73  M1T8 = 0x0108,
74  M1T9 = 0x0109,
75  M1T10 = 0x010A,
76  M1T11 = 0x010B,
77  M1T12 = 0x010C,
78  M1T13 = 0x010D,
79  M1T14 = 0x010E,
80  M1T15 = 0x010F,
81  M1T16 = 0x0110,
82  M1T17 = 0x0111,
83  M1T18 = 0x0112,
84  M1T19 = 0x0113,
85  M1T20 = 0x0114,
86  M1T21 = 0x0115,
87  M1T22 = 0x0116,
88  M1T23 = 0x0117,
89  M1T24 = 0x0118,
90  M1T25 = 0x0119,
91  M1T26 = 0x011A,
92  M1T27 = 0x011B,
93  M1T28 = 0x011C,
94  M1T29 = 0x011D,
95  M1T30 = 0x011E,
96  M1T31 = 0x011F,
97  M1T32 = 0x0120,
98  M1T63 = 0x013F,
99  M1T64 = 0x0140,
100  M1T99 = 0x0163,
101  M1TN = 0x01FF,
102  M2 = 0x0202,
103  M2T3 = 0x0203,
104  M2T4 = 0x0204,
105  M2T5 = 0x0205,
106  M2T6 = 0x0206,
107  M2T7 = 0x0207,
108  M2T8 = 0x0208,
109  M2T9 = 0x0209,
110  M2T10 = 0x020A,
111  M2T11 = 0x020B,
112  M2T12 = 0x020C,
113  M2T13 = 0x020D,
114  M2T14 = 0x020E,
115  M2T15 = 0x020F,
116  M2T16 = 0x0210,
117  M2T17 = 0x0211,
118  M2T18 = 0x0212,
119  M2T19 = 0x0213,
120  M2T20 = 0x0214,
121  M2T21 = 0x0215,
122  M2T22 = 0x0216,
123  M2T23 = 0x0217,
124  M2T24 = 0x0218,
125  M2T25 = 0x0219,
126  M2T26 = 0x021A,
127  M2T27 = 0x021B,
128  M2T28 = 0x021C,
129  M2T29 = 0x021D,
130  M2T30 = 0x021E,
131  M2T31 = 0x021F,
132  M2T32 = 0x0220,
133  M2T63 = 0x023F,
134  M2T64 = 0x0240,
135  M2T99 = 0x0263,
136  M2T2N = 0x02FE,
137  M2TN = 0x02FF,
138  M3 = 0x0303,
139  M3T4 = 0x0304,
140  M3T5 = 0x0305,
141  M3T6 = 0x0306,
142  M3T7 = 0x0307,
143  M3T8 = 0x0308,
144  M3T9 = 0x0309,
145  M3T10 = 0x030A,
146  M3T11 = 0x030B,
147  M3T12 = 0x030C,
148  M3T13 = 0x030D,
149  M3T14 = 0x030E,
150  M3T15 = 0x030F,
151  M3T16 = 0x0310,
152  M3T17 = 0x0311,
153  M3T18 = 0x0312,
154  M3T19 = 0x0313,
155  M3T20 = 0x0314,
156  M3T21 = 0x0315,
157  M3T22 = 0x0316,
158  M3T23 = 0x0317,
159  M3T24 = 0x0318,
160  M3T25 = 0x0319,
161  M3T26 = 0x031A,
162  M3T27 = 0x031B,
163  M3T28 = 0x031C,
164  M3T29 = 0x031D,
165  M3T30 = 0x031E,
166  M3T31 = 0x031F,
167  M3T32 = 0x0320,
168  M3T63 = 0x033F,
169  M3T64 = 0x0340,
170  M3T99 = 0x0363,
171  M3T3N = 0x03FD,
172  M3TN = 0x03FF,
173  M4 = 0x0404,
174  M4T5 = 0x0405,
175  M4T6 = 0x0406,
176  M4T7 = 0x0407,
177  M4T8 = 0x0408,
178  M4T9 = 0x0409,
179  M4T10 = 0x040A,
180  M4T11 = 0x040B,
181  M4T12 = 0x040C,
182  M4T13 = 0x040D,
183  M4T14 = 0x040E,
184  M4T15 = 0x040F,
185  M4T16 = 0x0410,
186  M4T17 = 0x0411,
187  M4T18 = 0x0412,
188  M4T19 = 0x0413,
189  M4T20 = 0x0414,
190  M4T21 = 0x0415,
191  M4T22 = 0x0416,
192  M4T23 = 0x0417,
193  M4T24 = 0x0418,
194  M4T25 = 0x0419,
195  M4T26 = 0x041A,
196  M4T27 = 0x041B,
197  M4T28 = 0x041C,
198  M4T29 = 0x041D,
199  M4T30 = 0x041E,
200  M4T31 = 0x041F,
201  M4T32 = 0x0420,
202  M4T63 = 0x043F,
203  M4T64 = 0x0440,
204  M4T99 = 0x0463,
205  M4T4N = 0x04FC,
206  M4TN = 0x04FF,
207  M5 = 0x0505,
208  M5T6 = 0x0506,
209  M5T7 = 0x0507,
210  M5T8 = 0x0508,
211  M5T9 = 0x0509,
212  M5T10 = 0x050A,
213  M5T11 = 0x050B,
214  M5T12 = 0x050C,
215  M5T13 = 0x050D,
216  M5T14 = 0x050E,
217  M5T15 = 0x050F,
218  M5T16 = 0x0510,
219  M5T17 = 0x0511,
220  M5T18 = 0x0512,
221  M5T19 = 0x0513,
222  M5T20 = 0x0514,
223  M5T21 = 0x0515,
224  M5T22 = 0x0516,
225  M5T23 = 0x0517,
226  M5T24 = 0x0518,
227  M5T25 = 0x0519,
228  M5T26 = 0x051A,
229  M5T27 = 0x051B,
230  M5T28 = 0x051C,
231  M5T29 = 0x051D,
232  M5T30 = 0x051E,
233  M5T31 = 0x051F,
234  M5T32 = 0x0520,
235  M5T63 = 0x053F,
236  M5T64 = 0x0540,
237  M5T99 = 0x0563,
238  M5T5N = 0x05FB,
239  M5TN = 0x05FF,
240  M6 = 0x0606,
241  M6T7 = 0x0607,
242  M6T8 = 0x0608,
243  M6T9 = 0x0609,
244  M6T10 = 0x060A,
245  M6T11 = 0x060B,
246  M6T12 = 0x060C,
247  M6T13 = 0x060D,
248  M6T14 = 0x060E,
249  M6T15 = 0x060F,
250  M6T16 = 0x0610,
251  M6T17 = 0x0611,
252  M6T18 = 0x0612,
253  M6T19 = 0x0613,
254  M6T20 = 0x0614,
255  M6T21 = 0x0615,
256  M6T22 = 0x0616,
257  M6T23 = 0x0617,
258  M6T24 = 0x0618,
259  M6T25 = 0x0619,
260  M6T26 = 0x061A,
261  M6T27 = 0x061B,
262  M6T28 = 0x061C,
263  M6T29 = 0x061D,
264  M6T30 = 0x061E,
265  M6T31 = 0x061F,
266  M6T32 = 0x0620,
267  M6T63 = 0x063F,
268  M6T64 = 0x0640,
269  M6T99 = 0x0663,
270  M6T6N = 0x06FA,
271  M6TN = 0x06FF,
272  M7 = 0x0707,
273  M7T8 = 0x0708,
274  M7T9 = 0x0709,
275  M7T10 = 0x070A,
276  M7T11 = 0x070B,
277  M7T12 = 0x070C,
278  M7T13 = 0x070D,
279  M7T14 = 0x070E,
280  M7T15 = 0x070F,
281  M7T16 = 0x0710,
282  M7T17 = 0x0711,
283  M7T18 = 0x0712,
284  M7T19 = 0x0713,
285  M7T20 = 0x0714,
286  M7T21 = 0x0715,
287  M7T22 = 0x0716,
288  M7T23 = 0x0717,
289  M7T24 = 0x0718,
290  M7T25 = 0x0719,
291  M7T26 = 0x071A,
292  M7T27 = 0x071B,
293  M7T28 = 0x071C,
294  M7T29 = 0x071D,
295  M7T30 = 0x071E,
296  M7T31 = 0x071F,
297  M7T32 = 0x0720,
298  M7T63 = 0x073F,
299  M7T64 = 0x0740,
300  M7T99 = 0x0763,
301  M7T7N = 0x07F9,
302  M7TN = 0x07FF,
303  M8 = 0x0808,
304  M8T9 = 0x0809,
305  M8T10 = 0x080A,
306  M8T11 = 0x080B,
307  M8T12 = 0x080C,
308  M8T13 = 0x080D,
309  M8T14 = 0x080E,
310  M8T15 = 0x080F,
311  M8T16 = 0x0810,
312  M8T17 = 0x0811,
313  M8T18 = 0x0812,
314  M8T19 = 0x0813,
315  M8T20 = 0x0814,
316  M8T21 = 0x0815,
317  M8T22 = 0x0816,
318  M8T23 = 0x0817,
319  M8T24 = 0x0818,
320  M8T25 = 0x0819,
321  M8T26 = 0x081A,
322  M8T27 = 0x081B,
323  M8T28 = 0x081C,
324  M8T29 = 0x081D,
325  M8T30 = 0x081E,
326  M8T31 = 0x081F,
327  M8T32 = 0x0820,
328  M8T63 = 0x083F,
329  M8T64 = 0x0840,
330  M8T99 = 0x0863,
331  M8T8N = 0x08F8,
332  M8TN = 0x08FF,
333  M9 = 0x0909,
334  M9T10 = 0x090A,
335  M9T11 = 0x090B,
336  M9T12 = 0x090C,
337  M9T13 = 0x090D,
338  M9T14 = 0x090E,
339  M9T15 = 0x090F,
340  M9T16 = 0x0910,
341  M9T17 = 0x0911,
342  M9T18 = 0x0912,
343  M9T19 = 0x0913,
344  M9T20 = 0x0914,
345  M9T21 = 0x0915,
346  M9T22 = 0x0916,
347  M9T23 = 0x0917,
348  M9T24 = 0x0918,
349  M9T25 = 0x0919,
350  M9T26 = 0x091A,
351  M9T27 = 0x091B,
352  M9T28 = 0x091C,
353  M9T29 = 0x091D,
354  M9T30 = 0x091E,
355  M9T31 = 0x091F,
356  M9T32 = 0x0920,
357  M9T63 = 0x093F,
358  M9T64 = 0x0940,
359  M9T99 = 0x0963,
360  M9T9N = 0x09F7,
361  M9TN = 0x09FF,
362  M10 = 0x0A0A,
363  M10TN = 0x0AFF,
364  M11 = 0x0B0B,
365  M11TN = 0x0BFF,
366  M12 = 0x0C0C,
367  M12TN = 0x0CFF,
368  M13 = 0x0D0D,
369  M13TN = 0x0DFF,
370  M14 = 0x0E0E,
371  M14TN = 0x0EFF,
372  M15 = 0x0F0F,
373  M15TN = 0x0FFF,
374  M16 = 0x1010,
375  M16TN = 0x10FF,
376  M17 = 0x1111,
377  M17TN = 0x11FF,
378  M18 = 0x1212,
379  M18TN = 0x12FF,
380  M19 = 0x1313,
381  M19TN = 0x13FF,
382  M20 = 0x1414,
383  M20TN = 0x14FF,
384  M21 = 0x1515,
385  M21TN = 0x15FF,
386  M22 = 0x1616,
387  M22TN = 0x16FF,
388  M23 = 0x1717,
389  M23TN = 0x17FF,
390  M24 = 0x1818,
391  M24TN = 0x18FF,
392  M25 = 0x1919,
393  M25TN = 0x19FF,
394  M26 = 0x1A1A,
395  M26TN = 0x1AFF,
396  M27 = 0x1B1B,
397  M27TN = 0x1BFF,
398  M28 = 0x1C1C,
399  M28TN = 0x1CFF,
400  M29 = 0x1D1D,
401  M29TN = 0x1DFF,
402  M30 = 0x1E1E,
403  M30TN = 0x1EFF,
404  M30T30N = 0x1EE2,
405  M31 = 0x1F1F,
406  M31TN = 0x1FFF,
407  M32 = 0x2020,
408  M32TN = 0x20FF,
409  M35 = 0x2323,
410  M35TN = 0x23FF,
411  M47 = 0x2F2F,
412  M47TN = 0x2FFF,
413  M47T47N = 0x2FD1,
414  M63 = 0x3F3F,
415  M63TN = 0x3FFF,
416  M64 = 0x4040,
417  M64TN = 0x40FF,
418  M99 = 0x6363,
419  M99TN = 0x63FF,
420  M100 = 0x6464,
421  M110 = 0x6E6E,
422  M127 = 0x7F7F,
423  M128 = 0x8080,
424  M255 = 0x80FF,
425  M256 = 0x8100,
426  M511 = 0x81FF,
427  M512 = 0x8200,
428  M768 = 0x8300,
429  M1024 = 0x8400,
430  M2048 = 0x8800,
431  M4096 = 0x9000,
432  M8192 = 0xA000
433  };
434 
436  vtkDICOMVM() : Key(0) {}
438 
440  vtkDICOMVM(EnumType vm) : Key(static_cast<unsigned short>(vm)) {}
442 
444  bool IsValid() const { return (this->Key != 0); }
446 
448  int GetMin() const {
449  if ((this->Key & 0x8000) != 0) { return (this->Key & 0x7fff); }
450  else { return (this->Key >> 8); } }
451 
453  int GetMax() const {
454  if ((this->Key & 0x8000) != 0) { return (this->Key & 0x7fff); }
455  else { return ((this->Key & 0x80) == 0 ? (this->Key & 0xff) : -1); } }
456 
458  int GetStep() const {
459  if ((this->Key & 0x8000) != 0) { return 1; }
460  else { return ((this->Key & 0x80) == 0 ? 1 : ((-this->Key) & 0xff)); } }
462 
464  bool operator==(vtkDICOMVM b) const { return (this->Key == b.Key); }
465  bool operator!=(vtkDICOMVM b) const { return (this->Key != b.Key); }
466  bool operator<=(vtkDICOMVM a) const { return (this->Key <= a.Key); }
467  bool operator>=(vtkDICOMVM a) const { return (this->Key >= a.Key); }
468  bool operator<(vtkDICOMVM a) const { return (this->Key < a.Key); }
469  bool operator>(vtkDICOMVM a) const { return (this->Key > a.Key); }
471 
472 private:
473  unsigned short Key;
474 };
475 
476 VTKDICOM_EXPORT ostream& operator<<(ostream& o, const vtkDICOMVM& a);
477 
478 #endif /* vtkDICOMVM_h */
479 // VTK-HeaderTest-Exclude: vtkDICOMVM.h
VMs (Value Multiplicities)
Definition: vtkDICOMVM.h:22
int GetMin() const
Get the minimum allowed number of values.
Definition: vtkDICOMVM.h:448
int GetMax() const
Get the maximum allowed number of values, -1 if unlimited.
Definition: vtkDICOMVM.h:453
int GetStep() const
Get the step between allowed values.
Definition: vtkDICOMVM.h:458
vtkDICOMVM(EnumType vm)
Construct a VM from a VM enum constant.
Definition: vtkDICOMVM.h:440