Developer documentation
Version 3.0.3-105-gd3941f44
definitions.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __file_dicom_dict_h__
18#define __file_dicom_dict_h__
19
20#define VR_OB 0x4F42U
21#define VR_OW 0x4F57U
22#define VR_OF 0x4F46U
23#define VR_SQ 0x5351U
24#define VR_UN 0x554EU
25#define VR_AE 0x4145U
26#define VR_AS 0x4153U
27#define VR_AT 0x4154U
28#define VR_CS 0x4353U
29#define VR_DA 0x4441U
30#define VR_DS 0x4453U
31#define VR_DT 0x4454U
32#define VR_FD 0x4644U
33#define VR_FL 0x464CU
34#define VR_IS 0x4953U
35#define VR_LO 0x4C4FU
36#define VR_LT 0x4C54U
37#define VR_PN 0x504EU
38#define VR_SH 0x5348U
39#define VR_SL 0x534CU
40#define VR_SS 0x5353U
41#define VR_ST 0x5354U
42#define VR_TM 0x544DU
43#define VR_UI 0x5549U
44#define VR_UL 0x554CU
45#define VR_US 0x5553U
46#define VR_UT 0x5554U
47
48#define LENGTH_UNDEFINED 0xFFFFFFFFUL
49
50#define GROUP_BYTE_ORDER 0x0002U
51#define GROUP_BYTE_ORDER_SWAPPED 0x0200U
52#define GROUP_SEQUENCE 0xFFFEU
53#define GROUP_DATA 0x7FE0U
54
55#define ELEMENT_TRANSFER_SYNTAX_UID 0x0010U
56#define ELEMENT_SEQUENCE_ITEM 0xE000U
57#define ELEMENT_SEQUENCE_DELIMITATION_ITEM 0xE0DDU
58#define ELEMENT_DATA 0x0010U
59
60
61
62namespace MR {
63 namespace File {
64 namespace Dicom {
65
66 inline std::string format_date (const std::string& date)
67 {
68 if (date.empty() || date.size() < 8)
69 return date;
70 return date.substr(6,2) + "/" + date.substr(4,2) + "/" + date.substr(0,4);
71 }
72
73
74
75 inline std::string format_time (const std::string& time)
76 {
77 if (time.empty())
78 return time;
79 return time.substr(0,2) + ":" + time.substr(2,2) + ":" + time.substr(4,2);
80 }
81
82
83
84 inline std::string format_ID (const std::string& ID)
85 {
86 if (ID.empty())
87 return ID;
88 return "(" + ID + ")";
89 }
90
91
92 }
93 }
94}
95
96
97#endif
std::string format_time(const std::string &time)
Definition: definitions.h:75
std::string format_ID(const std::string &ID)
Definition: definitions.h:84
std::string format_date(const std::string &date)
Definition: definitions.h:66
Definition: base.h:24