JEMRIS  2.8.1
open-source MRI simulations
World.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 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 
41 using namespace std;
42 
43 //forward declarations
44 class AtomicSequence;
45 class ConcatSequence;
46 class SequenceTree;
47 class EddyPulse;
48 
50 
51 class World {
52 
53  public:
54 
58  virtual ~World ();
59 
63  static World* instance ();
64 
71  double ConcomitantField (double* G);
72 
78  void SetNoOfSpinProps (int n);
79 
85  int GetNoOfSpinProps () {return m_noofspinprops;};
86 
87 
91  double* Helper () {
92  return &helper[0];
93  };
94 
95 
101  void InitHelper (long size);
102 
103 
109  int GetNoOfCompartments ();
110 
111 
117  void SetNoOfCompartments (int n);
118 
119 
126  void (*saveEvolFunPtr)(long l, bool b) ;
127 
128  void* solverSettings ;
131  void* auxiliary;
133  //members for solution of a particular spin
134  long SpinNumber;
138  double* Values;
139  double time;
140  double total_time;
141  double phase;
142  double PhaseLock;
143  double deltaB;
144  std::vector<double> solution;
146  double RandNoise;
147  double GMAXoverB0;
150  //members for the current sequence
155  //members for saving the magnetization evolution of the spins
158  ofstream* saveEvolOfstream;
160  int m_myRank;
164  long m_startSpin;
167  int m_noofspincompartments;
169  std::vector<double> helper;
170  //double* helper; /** @brief Any additional data necessary for solving the model. (i.e. Global MT exchange matrix) */
171 
172  multimap<EddyPulse*,double> m_eddies;
174  private:
175 
179  World () {};
180 
181  static World* m_instance;
183 };
184 
185 #endif /*WORLD_H_*/
Implementation of JEMRIS Declarations.
double phase
Receiver phase taken from the TPOIs.
Definition: World.h:141
double deltaB
Any off-resonance terms.
Definition: World.h:143
Concat sequence prototype.
Definition: ConcatSequence.h:37
long m_startSpin
start calculation with this spin ( in case of restart)
Definition: World.h:164
Singleton with information about the simulation of the current spin.
Definition: World.h:51
void * auxiliary
Auxiliary data any kind of container needed for static methods can go here.
Definition: World.h:131
bool solverSuccess
true, if last calculation successful
Definition: World.h:129
double time
Current time point (in atom)
Definition: World.h:139
int m_noofspinprops
of spin properties
Definition: World.h:166
ofstream * saveEvolOfstream
Output stream for saving the evolutions.
Definition: World.h:158
AtomicSequence * pStaticAtom
Atomic sequence responsible for all time points.
Definition: World.h:153
multimap< EddyPulse *, double > m_eddies
map of remaining eddies still to be played out (duration,pointer)
Definition: World.h:172
World()
Default constructor.
Definition: World.h:179
double * Values
Values of the current spin (position and physical parameters)
Definition: World.h:138
long TotalADCNumber
Total number of spins.
Definition: World.h:136
int GetNoOfSpinProps()
Get number of spin properties.
Definition: World.h:85
double RandNoise
percentage of random noise added to the signal
Definition: World.h:146
long TotalSpinNumber
Total number of spins.
Definition: World.h:135
AtomicSequence * pAtom
Atomic sequence responsible for the current time point.
Definition: World.h:152
double PhaseLock
Locked Phase (the phase set by the last RF pulse)
Definition: World.h:142
void * solverSettings
Arbitrary solver settings.
Definition: World.h:128
int saveEvolStepSize
Step-size (in numbers of ADC) at which the evolution is stored.
Definition: World.h:156
int m_no_processes
number of parallel processes; used by load balancing
Definition: World.h:162
string saveEvolFileName
Filename in which the evolution is stored.
Definition: World.h:157
double GMAXoverB0
Constant for the concomitant field term.
Definition: World.h:147
double * Helper()
Reference to helper array.
Definition: World.h:91
Tree representation of the sequence.
Definition: SequenceTree.h:45
double NonLinGradField
Non-linear contribution to B_z from gradients.
Definition: World.h:148
double total_time
Current time point (absolut time)
Definition: World.h:140
SequenceTree * pSeqTree
The main sequence tree.
Definition: World.h:151
bool m_useLoadBalancing
use load balancing (send sample in small packages top slaves)
Definition: World.h:161
Prototype of an Eddy pulse.
Definition: EddyPulse.h:35
std::vector< double > helper
Definition: World.h:169
long SpinNumber
Number of the current spin.
Definition: World.h:134
int m_myRank
MPI rank of this process. if m_myRank<0 process is serial jemris.
Definition: World.h:160
std::vector< double > solution
Solution [M_r, phi, M_z] at the current time point.
Definition: World.h:144
Atomic sequence prototype.
Definition: AtomicSequence.h:40

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