JEMRIS 2.9.2
open-source MRI simulations
Loading...
Searching...
No Matches
World.h
Go to the documentation of this file.
1
5/*
6 * JEMRIS Copyright (C)
7 * 2006-2025 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 WORLD_H_
28#define WORLD_H_
29
30#include "Declarations.h"
31#include <string>
32#include <sstream>
33#include <iostream>
34#include <iomanip>
35#include <cstdlib>
36#include <fstream>
37#include <vector>
38#include <map>
39
40
41using namespace std;
42
43//forward declarations
44class AtomicSequence;
45class ConcatSequence;
46class SequenceTree;
47class EddyPulse;
48
50
51class World {
52
53 public:
54
55 //MODIF
59 bool logFile;
60
61
66
67
72
73
77 long getTrajBegin() { return m_trajBegin; };
78
79 long getTrajNumber() { return m_trajSize; };
80 //MODIF***
81
82
86 virtual ~World ();
87
91 static World* instance ();
92
99 double ConcomitantField (double* G);
100
106 void SetNoOfSpinProps (int n);
107
114
115
119 double* Helper () {
120 return &helper[0];
121 };
122
123
129 void InitHelper (long size);
130
131
137 int GetNoOfCompartments ();
138
139
145 void SetNoOfCompartments (int n);
146
147
154 void (*saveEvolFunPtr)(long l, bool b) ;
155
159 void* auxiliary;
161 //members for solution of a particular spin
166 double* Values;
167 double time;
168 double total_time;
169 double phase;
170 double PhaseLock;
171 double deltaB;
172 std::vector<double> solution;
173 double LargestM0;
174 double RandNoise;
175 double GMAXoverB0;
178 //members for the current sequence
183 //members for saving the magnetization evolution of the spins
192 //MODIF
195 //MODIF***
196
200 int m_noofspincompartments;
202 std::vector<double> helper;
203 //double* helper; /** @brief Any additional data necessary for solving the model. (i.e. Global MT exchange matrix) */
204
208 int m_set;
211 int m_shot;
218 private:
219
223 World () {};
224
227};
228
229#endif /*WORLD_H_*/
Implementation of JEMRIS Declarations.
Atomic sequence prototype.
Definition AtomicSequence.h:40
Concat sequence prototype.
Definition ConcatSequence.h:48
Prototype of an Eddy pulse.
Definition EddyPulse.h:35
Tree representation of the sequence.
Definition SequenceTree.h:45
Singleton with information about the simulation of the current spin.
Definition World.h:51
double LargestM0
largest equilibrium magnetization for noise scaling
Definition World.h:173
long SpinNumber
Number of the current spin.
Definition World.h:162
void InitHelper(long size)
Initilize helper array.
Definition World.cpp:127
double ConcomitantField(double *G)
Get concomitant field term for the current gradients.
Definition World.cpp:99
bool logFile
Write or not a log file.
Definition World.h:59
int m_average
average number
Definition World.h:210
double * Values
Values of the current spin (position and physical parameters)
Definition World.h:166
double RandNoise
percentage of random noise added to the signal
Definition World.h:174
double phase
Receiver phase taken from the TPOIs.
Definition World.h:169
long TotalSpinNumber
Total number of spins.
Definition World.h:163
int m_partitionmax
total number of partitions
Definition World.h:214
double GMAXoverB0
Constant for the concomitant field term.
Definition World.h:175
ofstream * saveEvolOfstream
Output stream for saving the evolutions.
Definition World.h:186
bool solverSuccess
true, if last calculation successful
Definition World.h:157
int m_contrast
contrast number
Definition World.h:209
long TotalADCNumber
Total number of spins.
Definition World.h:164
int m_shotmax
total number of shots
Definition World.h:212
double deltaB
Any off-resonance terms.
Definition World.h:171
void setTrajLoading(int firstSpin, int paketSize)
Set trajectory parameters for MPI current sample paket.
Definition World.h:71
static World * m_instance
Pointer to the sole instance of this implementation.
Definition World.h:225
SequenceTree * pSeqTree
The main sequence tree.
Definition World.h:179
long getTrajBegin()
Get trajectory parameters for MPI current sample paket.
Definition World.h:77
int m_slice
slice number
Definition World.h:207
long m_trajSize
Number of trajectories to load for current MPI sample paket.
Definition World.h:194
AtomicSequence * pStaticAtom
Atomic sequence responsible for all time points.
Definition World.h:181
std::vector< double > solution
Solution [M_r, phi, M_z] at the current time point.
Definition World.h:172
int m_partition
partition number
Definition World.h:213
int GetNoOfSpinProps()
Get number of spin properties.
Definition World.h:113
double total_time
Current time point (absolut time)
Definition World.h:168
double time
Current time point (in atom)
Definition World.h:167
void * solverSettings
Arbitrary solver settings
Definition World.h:156
int m_shot
shot number
Definition World.h:211
virtual ~World()
Default destructor.
Definition World.cpp:149
std::vector< double > helper
Definition World.h:202
string m_seqSignature
Sequence signature (md5 sum of Pulseq sequence file)
Definition World.h:216
string saveEvolFileName
Filename in which the evolution is stored.
Definition World.h:185
int m_no_processes
number of parallel processes; used by load balancing
Definition World.h:190
double * Helper()
Reference to helper array.
Definition World.h:119
int m_myRank
MPI rank of this process. if m_myRank<0 process is serial jemris.
Definition World.h:188
int m_set
set number
Definition World.h:208
int GetNoOfCompartments()
Number of compartments.
Definition World.cpp:133
int m_noofspinprops
# of spin properties
Definition World.h:199
static World * instance()
Get sole instance of the sequence tree.
Definition World.cpp:34
AtomicSequence * pAtom
Atomic sequence responsible for the current time point.
Definition World.h:180
double PhaseLock
Locked Phase (the phase set by the last RF pulse)
Definition World.h:170
int saveEvolStepSize
Step-size (in numbers of ADC) at which the evolution is stored.
Definition World.h:184
multimap< EddyPulse *, double > m_eddies
map of remaining eddies still to be played out (duration,pointer)
Definition World.h:205
void(* saveEvolFunPtr)(long l, bool b)
Pointer to the evolution saving function.
Definition World.h:154
long m_startSpin
start calculation with this spin ( in case of restart)
Definition World.h:197
void * auxiliary
Auxiliary data any kind of container needed for static methods can go here.
Definition World.h:159
long m_trajBegin
First trajectory to load for current MPI sample paket.
Definition World.h:193
void SetNoOfCompartments(int n)
Set number of compartments to.
Definition World.cpp:137
bool m_useLoadBalancing
use load balancing (send sample in small packages top slaves)
Definition World.h:189
bool logTrajectories
Write or not a log file for trajectories.
Definition World.h:65
void SetNoOfSpinProps(int n)
Set number of spinproperties.
Definition World.cpp:109
World()
Default constructor.
Definition World.h:223
double NonLinGradField
Non-linear contribution to B_z from gradients.
Definition World.h:176

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