JEMRIS 2.9.1
open-source MRI simulations
Loading...
Searching...
No Matches
Declarations.h
Go to the documentation of this file.
1
5/*
6 * JEMRIS Copyright (C)
7 * 2006-2023 Tony Stoecker
8 * 2007-2018 Kaveh Vahedipour
9 * 2009-2019 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
35const 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
47enum fields {
48 XC=0,
60};
61
66 RC = 3,
68 RZ
69};
70
75enum polar {
77 PHASE
78};
79
84enum seqval {
90};
91
92const seqval MAX_SEQ_VAL = GRAD_Z;
93
94
95enum PulseAxis {AXIS_RF, AXIS_GX, AXIS_GY, AXIS_GZ,
96 AXIS_VOID
97};
98
106 ONE_OVER_R
107};
108
112enum mode {
114 TX
116
120enum MpiTag {
121 REQUEST_SPINS=66,
122 SEND_NO_SPINS,
123 SEND_TOTAL_NO_SPINS, //MODIF
124 SEND_BEGIN_SPIN, //MODIF
125 SEND_SAMPLE,
126 SPINS_PROGRESS,
127 SIG_TP,
128 SIG_MX,
129 SIG_MY,
130 SIG_MZ
131};
132
133
134namespace IO {
135
139 enum Strategy {
140 NONE = -1,
145 };
146
150 enum Status {
159 UNMATCHED_DIMENSIONS,
160 LAST_STATUS_ENTRY
161 };
162
163 static std::string StatusMessage[LAST_STATUS_ENTRY] = {
164 std::string("IO notice: OK."),
165 std::string("IO error: Empty file name."),
166 std::string("IO error: File not found."),
167 std::string("IO error: Insufficient privileges."),
168 std::string("IO error: HDF5, general file excption."),
169 std::string("IO error: HDF5, dataset exception."),
170 std::string("IO error: HDF5, dataspace exception."),
171 std::string("IO error: HDF5, datatype exception.")
172 };
173
174
178 enum Mode {
181 APPEND
182 };
183
184}
185
186namespace Sim {
187
188 /*enum Result {
189 OK,
190 NAN,
191 DIVISION_BY_ZERO
192 };*/
193
194}
195
196#include <algorithm>
197
198static inline std::string strtoupper (const std::string& str) {
199 std::string res = str;
200 std::transform(res.begin(), res.end(), res.begin(), ::toupper);
201 return res;
202}
203
204static inline std::string strtolower (const std::string& str) {
205 std::string res = str;
206 std::transform(res.begin(), res.end(), res.begin(), ::tolower);
207 return res;
208}
209
210static inline bool strcompare (const std::string& a, const std::string& b) {
211 return strtoupper(a).compare(strtoupper(b));
212}
213
214
215#endif /*DECLARATIONS_H_*/
fields
Definition: Declarations.h:47
@ ID
Index of spin
Definition: Declarations.h:56
@ R2S
Relaxation rate 2: 1/T2S
Definition: Declarations.h:54
@ YC
Y location
Definition: Declarations.h:49
@ M0
Equilibrium magnetisation.
Definition: Declarations.h:51
@ R2
Relaxation rate 2: 1/T2
Definition: Declarations.h:53
@ DB
Delta B (e.g. chemical-shift + susceptiblity-induced, ...)
Definition: Declarations.h:55
@ NO_SPIN_PROPERTIES
counts number of entries to enum fields. must stay last element, other entries to 'fields' may not be...
Definition: Declarations.h:57
@ ZC
Z location
Definition: Declarations.h:50
@ XC
X location
Definition: Declarations.h:48
@ R1
Relaxation rate 1: 1/T1
Definition: Declarations.h:52
mode
Definition: Declarations.h:112
@ RX
Definition: Declarations.h:113
@ TX
Definition: Declarations.h:114
Strategy
Definition: Declarations.h:139
@ IOSTRATEGIES
Definition: Declarations.h:144
@ HDF5
Definition: Declarations.h:142
@ SIMPLE
Definition: Declarations.h:141
@ CDF
Definition: Declarations.h:143
SensitivityMethod
Definition: Declarations.h:102
@ BIOT_SAVART_LOOP
Biot-Savart integration for loop
Definition: Declarations.h:105
@ ONE_OVER_R_SQUARE
Idealistic 1/r^2 snsitivity for each coil.
Definition: Declarations.h:104
@ UNIFORM
Uniform idealistic sensitivity map equal 1.
Definition: Declarations.h:103
polar
Definition: Declarations.h:75
@ PHASE
Phase
Definition: Declarations.h:77
@ AMPL
Amplitude.
Definition: Declarations.h:76
Status
Definition: Declarations.h:150
@ HDF5_DATASPACE_I_EXCEPTION
Definition: Declarations.h:157
@ HDF5_FILE_I_EXCEPTION
Definition: Declarations.h:155
@ HDF5_DATASET_I_EXCEPTION
Definition: Declarations.h:156
@ OK
Definition: Declarations.h:151
@ EMPTY_FILE_NAME
Definition: Declarations.h:152
@ FILE_NOT_FOUND
Definition: Declarations.h:153
@ INSUFFICIENT_PRIVILEGES
Definition: Declarations.h:154
@ HDF5_DATATYPE_I_EXCEPTION
Definition: Declarations.h:158
MpiTag
Definition: Declarations.h:120
seqval
Definition: Declarations.h:84
@ GRAD_Y
Phase
Definition: Declarations.h:88
@ GRAD_Z
Slice
Definition: Declarations.h:89
@ RF_AMP
Amplitude.
Definition: Declarations.h:85
@ RF_PHS
Phase
Definition: Declarations.h:86
@ GRAD_X
Readout
Definition: Declarations.h:87
cylinder
Definition: Declarations.h:65
@ RC
Radius
Definition: Declarations.h:66
@ RZ
Azimuth.
Definition: Declarations.h:68
@ RT
Heading.
Definition: Declarations.h:67
Mode
Definition: Declarations.h:178
@ APPEND
Definition: Declarations.h:181
@ IN
Definition: Declarations.h:179
@ OUT
Definition: Declarations.h:180

-- last change 03.10.2023 | Tony Stoecker | Imprint | Data Protection --