JEMRIS 2.9.1
open-source MRI simulations
Loading...
Searching...
No Matches
Model.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 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
40using namespace std;
41
42//class declarations
43class CoilArray;
44
45
47
48class 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
125 void RunSequenceTree (double& dTimeShift, long& lIndexShift, Module* module);
126
136 private:
137
138 bool m_aux; //for debugging
139
143 void UpdateProcessCounter (const long lSpin);
144
148 void DumpRestartInfo(long lSpin);
149
150
151
152};
153
154#endif /*MODEL_H_*/
155
Implementation of JEMRIS AtomicSequence.
Implementation of JEMRIS ConcatSequence.
Implementation of JEMRIS ContainerSequence.
Implementation of JEMRIS Container.
Implementation of JEMRIS Module.
Implementation of JEMRIS Sample.
Implementation of JEMRIS World.
Coil configuration and sensitivities.
Definition: CoilArray.h:40
Concat sequence prototype.
Definition: ConcatSequence.h:48
Base class for MR model solver.
Definition: Model.h:48
virtual void InitSolver()=0
Initialise solver.
bool m_do_dump_progress
If true, percentage progress during Solve() is written to .jemris_progress.out.
Definition: Model.h:134
void RunSequenceTree(double &dTimeShift, long &lIndexShift, Module *module)
Definition: Model.cpp:122
CoilArray * m_tx_coil_array
Transmit coil array
Definition: Model.h:129
void Solve()
Solve differential equations.
Definition: Model.cpp:62
virtual bool Calculate(double next_tStop)=0
Calculate specific solution.
Sample * m_sample
Sample
Definition: Model.h:131
ConcatSequence * m_concat_sequence
Top node of the sequence tree for simulation.
Definition: Model.h:130
double m_accuracy_factor
increase accuracy by this factor in case of numerical problems
Definition: Model.h:132
World * m_world
Simulation world
Definition: Model.h:127
void UpdateProcessCounter(const long lSpin)
Definition: Model.cpp:373
void DumpRestartInfo(long lSpin)
Definition: Model.cpp:343
void SetSequence(ConcatSequence *pConcatSequence)
Set MR sequence.
Definition: Model.h:75
virtual void FreeSolver()=0
Free solver.
void Prepare(CoilArray *pRxCoilArray, CoilArray *pTxCoilArray, ConcatSequence *pConcatSequence, Sample *pSample)
Prepare for simulations.
Definition: Model.cpp:52
Model()
Constructor.
Definition: Model.cpp:42
CoilArray * m_rx_coil_array
Receive coil array
Definition: Model.h:128
virtual ~Model()
Default Destructor.
Definition: Model.h:60
static void saveEvolution(long index, bool close_files)
Save time evolution to disk.
Definition: Model.cpp:289
Module super class! ABC for all Objects in the sequence framework.
Definition: Module.h:41
The Sample is the object to simulate. It contains the spins.
Definition: Sample.h:301
Singleton with information about the simulation of the current spin.
Definition: World.h:51

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