JEMRIS 2.9.1
open-source MRI simulations
Loading...
Searching...
No Matches
Simulator.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 SIMULATOR_H_
28#define SIMULATOR_H_
29
30#include "ConcatSequence.h"
31#include "XMLIO.h"
32#include "World.h"
33#include "Sample.h"
34#include "CoilArray.h"
35#include "Bloch_CV_Model.h"
36#include "KSpace.h"
37
42class Simulator {
43
44
45 public:
46
58 const std::string& fname,
59 const std::string& fsample = "",
60 const std::string& frxarray = "",
61 const std::string& ftxarray = "",
62 const std::string& fsequence = "",
63 const std::string& fmodel = "");
64
65
69 virtual ~Simulator ();
70
74 bool GetStatus () const { return m_state; }
75
79 int GetEvolution () const { return m_evol; }
80
89 string GetAttr (DOMElement* element, const string& key);
90
99 string GetAtts (DOMElement* element, string* keys);
100
106 DOMElement* GetElem (string name);
107
111 void Simulate (bool bDumpSignal = true);
112
116 void SetSample (std::string fsample);
117
121 void SetSample (Sample* sample);
122
128 Sample* GetSample () { return m_sample; };
129
135 Model* GetModel () { return m_model; };
136
143
150
157
161 void SetSequence (string seq="");
162
166 void CheckRestart();
167
171 void DeleteTmpFiles();
172
173 //protected:
174
178 Simulator ();
179
183 void SetWorld ();
184
188 void SetRxCoilArray (string frxarray="");
189
193 void SetTxCoilArray (string ftxarray="");
194
198 void SetModel (string fmodel="");
199
203 void SetParameter ();
204
208 void SetOutputDir(string output_dir);
209
213 void SetSignalPrefix(string prefix);
214
215 private:
216
220 void MoveTmpFiles();
221
222 bool m_state;
223 int m_evol;
225 DOMDocument* m_dom_doc;
234 DOMTreeErrorReporter* m_domtree_error_rep;
239};
240
241#endif /*SIMULATOR_H_*/
Implementation of JEMRIS Blo_CV_Model.h.
Implementation of JEMRIS CoilArray.
Implementation of JEMRIS ConcatSequence.
Implementation of JEMRIS k-space position for reconstruction purposes.
Implementation of JEMRIS Sample.
Implementation of JEMRIS World.
Implementation of JEMRIS XMLIO.
Coil configuration and sensitivities.
Definition: CoilArray.h:40
Concat sequence prototype.
Definition: ConcatSequence.h:48
K-space.
Definition: KSpace.h:41
Base class for MR model solver.
Definition: Model.h:48
The Sample is the object to simulate. It contains the spins.
Definition: Sample.h:301
Tree representation of the sequence.
Definition: SequenceTree.h:45
The simulator.
Definition: Simulator.h:42
Simulator()
Default constructor.
Definition: Simulator.cpp:43
DOMTreeErrorReporter * m_domtree_error_rep
DOM tree error reporter
Definition: Simulator.h:234
bool GetStatus() const
Get my status.
Definition: Simulator.h:74
virtual ~Simulator()
Default destructor.
Definition: Simulator.cpp:366
void SetSequence(string seq="")
Set my sequence according to XML configuration.
Definition: Simulator.cpp:346
void CheckRestart()
Checks if restart files present; sets jemris state.
Definition: Simulator.cpp:389
void SetParameter()
Set miscellaneous parameters according to XML configuration.
Definition: Simulator.cpp:187
ConcatSequence * m_sequence
Sequence to be simulated
Definition: Simulator.h:229
Model * m_model
Model to be simulated
Definition: Simulator.h:228
int GetEvolution() const
Get my evolution counter.
Definition: Simulator.h:79
void SetOutputDir(string output_dir)
Set output directory.
Definition: Simulator.cpp:337
int m_evol
Evolution steps
Definition: Simulator.h:223
Model * GetModel()
Get the model.
Definition: Simulator.h:135
void SetSample(std::string fsample)
Set my sample from XML.
Definition: Simulator.cpp:97
DOMElement * GetElem(string name)
Get a particular element from my DOM document.
Definition: Simulator.cpp:293
void SetTxCoilArray(string ftxarray="")
Set up my Transmit coils according to XML configuration.
Definition: Simulator.cpp:154
string GetAtts(DOMElement *element, string *keys)
Get a array of attributes given by the array of key strings.
string GetAttr(DOMElement *element, const string &key)
Get a particular attribute value by a given key string.
Definition: Simulator.cpp:288
SequenceTree * m_seqtree
SequenceTree to be simulated.
Definition: Simulator.h:230
void SetRxCoilArray(string frxarray="")
Set up my recieve coils according to XML configuration.
Definition: Simulator.cpp:135
KSpace< double, 4 > * m_kspace
K-Space
Definition: Simulator.h:235
CoilArray * m_rx_coil_array
Receive coil array
Definition: Simulator.h:233
Simulator(const std::string &fname, const std::string &fsample="", const std::string &frxarray="", const std::string &ftxarray="", const std::string &fsequence="", const std::string &fmodel="")
Construct a new simulator with given XML descriptor.
void SetModel(string fmodel="")
Set my solver model according to XML configuration.
Definition: Simulator.cpp:167
string m_output_dir
Output directory
Definition: Simulator.h:236
string m_signal_prefix
Signal prefix
Definition: Simulator.h:237
DOMDocument * m_dom_doc
Simulation file
Definition: Simulator.h:225
void Simulate(bool bDumpSignal=true)
Start the simulation after every necessary credentials have been set.
Definition: Simulator.cpp:298
XMLIO * m_xio
XML file handler
Definition: Simulator.h:231
CoilArray * GetRxCoilArray()
Get the transmitting coil array.
Definition: Simulator.h:156
bool m_state
My status
Definition: Simulator.h:222
CoilArray * m_tx_coil_array
Transmit coil array
Definition: Simulator.h:232
Sample * m_sample
Sample
Definition: Simulator.h:226
CoilArray * GetTxCoilArray()
Get the recieving coil array.
Definition: Simulator.h:149
void MoveTmpFiles()
Definition: Simulator.cpp:403
void DeleteTmpFiles()
Definition: Simulator.cpp:380
World * m_world
World to be simulated
Definition: Simulator.h:227
Sample * GetSample()
Get the sample.
Definition: Simulator.h:128
ConcatSequence * GetSequence()
Get the sequence.
Definition: Simulator.h:142
void SetSignalPrefix(string prefix)
Set signal prefix.
Definition: Simulator.cpp:328
void SetWorld()
Initialize my world singleton.
Definition: Simulator.cpp:92
Singleton with information about the simulation of the current spin.
Definition: World.h:51
XML file-IO class.
Definition: XMLIO.h:61

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