JEMRIS  2.8.1
open-source MRI simulations
Declarations.h
Go to the documentation of this file.
1 
5 /*
6  * JEMRIS Copyright (C)
7  * 2006-2015 Tony Stoecker
8  * 2007-2015 Kaveh Vahedipour
9  * 2009-2015 Daniel Pflugfelder
10  *
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU 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, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 #ifndef DECLARATIONS_H_
28 #define DECLARATIONS_H_
29 
30 #include <string>
31 
32 // from FFTW
33 #define PI 3.141592653589793238462643383279502884197169399375105820974944592
34 #define TWOPI 6.283185307179586476925286766559005768394338798750211641949889185
35 const double TIME_ERR_TOL = 2.5e-6; // Avoid CVODE warnings. Doesn't affect physics.
36 
37 //#define SLAVE_GRADS
38 
42 //const int NO_SPIN_PROPERTIES = 10;
43 
47 enum fields {
48  XC=0,
49  YC,
50  ZC,
51  M0,
52  R1,
53  R2,
54  R2S,
55  DB,
56  ID,
60 };
61 
65 enum cylinder {
66  RC = 3,
67  RT,
68  RZ
69 };
70 
75 enum polar {
76  AMPL,
78 };
79 
84 enum seqval {
90 };
91 
92 const seqval MAX_SEQ_VAL = GRAD_Z;
93 
94 
95 enum PulseAxis {AXIS_RF, AXIS_GX, AXIS_GY, AXIS_GZ,
96  AXIS_VOID
97 };
98 
106  ONE_OVER_R
107 };
108 
112 enum mode {
113  RX,
114  TX
115 };
116 
120 enum MpiTag {
121  REQUEST_SPINS=66,
122  SEND_NO_SPINS,
123  SEND_SAMPLE,
124  SPINS_PROGRESS,
125  SIG_TP,
126  SIG_MX,
127  SIG_MY,
128  SIG_MZ
129 };
130 
131 
132 namespace IO {
133 
137  enum Strategy {
138  NONE = -1,
141  CDF,
143  };
144 
148  enum Status {
149  OK,
157  UNMATCHED_DIMENSIONS,
158  LAST_STATUS_ENTRY
159  };
160 
161  static std::string StatusMessage[LAST_STATUS_ENTRY] = {
162  std::string("IO notice: OK."),
163  std::string("IO error: Empty file name."),
164  std::string("IO error: File not found."),
165  std::string("IO error: Insufficient privileges."),
166  std::string("IO error: HDF5, general file excption."),
167  std::string("IO error: HDF5, dataset exception."),
168  std::string("IO error: HDF5, dataspace exception."),
169  std::string("IO error: HDF5, datatype exception.")
170  };
171 
172 
176  enum Mode {
177  IN,
178  OUT,
180  };
181 
182 }
183 
184 namespace Sim {
185 
186  /*enum Result {
187  OK,
188  NAN,
189  DIVISION_BY_ZERO
190  };*/
191 
192 }
193 
194 #include <algorithm>
195 
196 static inline std::string strtoupper (const std::string& str) {
197  std::string res = str;
198  std::transform(res.begin(), res.end(), res.begin(), ::toupper);
199  return res;
200 }
201 
202 static inline std::string strtolower (const std::string& str) {
203  std::string res = str;
204  std::transform(res.begin(), res.end(), res.begin(), ::tolower);
205  return res;
206 }
207 
208 static inline bool strcompare (const std::string& a, const std::string& b) {
209  return strtoupper(a).compare(strtoupper(b));
210 }
211 
212 
213 #endif /*DECLARATIONS_H_*/
MpiTag
Definition: Declarations.h:120
Definition: Declarations.h:114
fields
Definition: Declarations.h:47
X location.
Definition: Declarations.h:48
Amplitude.
Definition: Declarations.h:76
Definition: Declarations.h:151
Definition: Declarations.h:150
Relaxation rate 2: 1/T2.
Definition: Declarations.h:53
Definition: Declarations.h:156
polar
Definition: Declarations.h:75
Definition: XMLIO.h:49
Definition: Declarations.h:179
Amplitude.
Definition: Declarations.h:85
Mode
Definition: Declarations.h:176
Definition: Declarations.h:139
Biot-Savart integration for loop.
Definition: Declarations.h:105
Definition: Declarations.h:132
Definition: Declarations.h:154
Phase.
Definition: Declarations.h:88
cylinder
Definition: Declarations.h:65
Phase.
Definition: Declarations.h:77
Slice.
Definition: Declarations.h:89
Z location.
Definition: Declarations.h:50
seqval
Definition: Declarations.h:84
Definition: Declarations.h:113
Definition: Declarations.h:153
SensitivityMethod
Definition: Declarations.h:102
Definition: Declarations.h:142
counts number of entries to enum fields. must stay last element, other entries to &#39;fields&#39; may not be...
Definition: Declarations.h:57
mode
Definition: Declarations.h:112
Idealistic 1/r^2 snsitivity for each coil.
Definition: Declarations.h:104
Delta B (e.g. chemical-shift + susceptiblity-induced, ...)
Definition: Declarations.h:55
Strategy
Definition: Declarations.h:137
Definition: Declarations.h:184
Index of spin.
Definition: Declarations.h:56
Definition: Declarations.h:178
Heading.
Definition: Declarations.h:67
Phase.
Definition: Declarations.h:86
Definition: Declarations.h:141
Uniform idealistic sensitivity map equal 1.
Definition: Declarations.h:103
Equilibrium magnetisation.
Definition: Declarations.h:51
Status
Definition: Declarations.h:148
Azimuth.
Definition: Declarations.h:68
Definition: Declarations.h:140
Radius.
Definition: Declarations.h:66
Readout.
Definition: Declarations.h:87
Definition: Declarations.h:152
Y location.
Definition: Declarations.h:49
Relaxation rate 1: 1/T1.
Definition: Declarations.h:52
Definition: Declarations.h:155
Definition: Declarations.h:177
Relaxation rate 2: 1/T2S.
Definition: Declarations.h:54

-- last change 17.06.2016 | Tony Stoecker | Imprint --