JEMRIS  2.8.1
open-source MRI simulations
Model.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 MODEL_H_
28 #define MODEL_H_
29 
30 #include <math.h>
31 
32 #include "World.h"
33 #include "Sample.h"
34 #include "Module.h"
35 #include "AtomicSequence.h"
36 #include "ConcatSequence.h"
37 #include "Container.h"
38 #include "ContainerSequence.h"
39 
40 using namespace std;
41 
42 //class declarations
43 class CoilArray;
44 
45 
47 
48 class Model {
49 
50  public:
51 
55  Model();
56 
60  virtual ~Model() {};
61 
70  void Prepare(CoilArray* pRxCoilArray, CoilArray* pTxCoilArray, ConcatSequence* pConcatSequence, Sample* pSample);
71 
75  inline void SetSequence(ConcatSequence* pConcatSequence){m_concat_sequence = pConcatSequence;};
76 
80  void Solve();
81 
88  static void saveEvolution (long index, bool close_files) ;
89 
90 
91  void SetDumpProgress(bool val) { m_do_dump_progress = val; };
92 
93  protected:
94 
98  virtual void InitSolver() = 0;
99 
103  virtual void FreeSolver() = 0;
104 
115  virtual bool Calculate(double next_tStop) = 0;
116 
126  void RunSequenceTree (double& dTimeShift, long& lIndexShift, Module* module);
127 
137  private:
138 
139  bool m_aux; //for debugging
140 
144  void UpdateProcessCounter (const long lSpin);
145 
149  void DumpRestartInfo(long lSpin);
150 
151 
152 
153 };
154 
155 #endif /*MODEL_H_*/
156 
virtual ~Model()
Default Destructor.
Definition: Model.h:60
Concat sequence prototype.
Definition: ConcatSequence.h:37
Singleton with information about the simulation of the current spin.
Definition: World.h:51
CoilArray * m_tx_coil_array
Transmit coil array.
Definition: Model.h:130
Implementation of JEMRIS World.
ConcatSequence * m_concat_sequence
Top node of the sequence tree for simulation.
Definition: Model.h:131
Implementation of JEMRIS ConcatSequence.
void SetSequence(ConcatSequence *pConcatSequence)
Set MR sequence.
Definition: Model.h:75
Coil configuration and sensitivities.
Definition: CoilArray.h:40
Sample * m_sample
Sample.
Definition: Model.h:132
Implementation of JEMRIS Sample.
CoilArray * m_rx_coil_array
Receive coil array.
Definition: Model.h:129
Module super class! ABC for all Objects in the sequence framework.
Definition: Module.h:41
Implementation of JEMRIS AtomicSequence.
Implementation of JEMRIS ContainerSequence.
bool m_do_dump_progress
If true, percentage progress during Solve() is written to .jemris_progress.out.
Definition: Model.h:135
Base class for MR model solver.
Definition: Model.h:48
Implementation of JEMRIS Module.
double m_accuracy_factor
increase accuracy by thid factor in case of numerical problems
Definition: Model.h:133
Implementation of JEMRIS Container.
World * m_world
Simulation world.
Definition: Model.h:128
The Sample is the object to simulate. It contains the spins.
Definition: Sample.h:282

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