JEMRIS  2.8.1
open-source MRI simulations
Simulator.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 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 
42 class Simulator {
43 
44 
45  public:
46 
57  Simulator (
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;
236  string m_output_dir;
239 };
240 
241 #endif /*SIMULATOR_H_*/
XML file-IO class.
Definition: XMLIO.h:61
DOMDocument * m_dom_doc
Simulation file.
Definition: Simulator.h:225
Implementation of JEMRIS k-space position for reconstruction purposes.
virtual ~Simulator()
Default destructor.
Definition: Simulator.cpp:335
Sample * GetSample()
Get the sample.
Definition: Simulator.h:128
string GetAtts(DOMElement *element, string *keys)
Get a array of attributes given by the array of key strings.
int GetEvolution() const
Get my evolution counter.
Definition: Simulator.h:79
void SetWorld()
Initialize my world singleton.
Definition: Simulator.cpp:89
Concat sequence prototype.
Definition: ConcatSequence.h:37
ConcatSequence * GetSequence()
Get the sequence.
Definition: Simulator.h:142
Singleton with information about the simulation of the current spin.
Definition: World.h:51
string GetAttr(DOMElement *element, const string &key)
Get a particular attribute value by a given key string.
Definition: Simulator.cpp:265
string m_signal_prefix
Signal prefix.
Definition: Simulator.h:237
XMLIO * m_xio
XML file handler.
Definition: Simulator.h:231
bool GetStatus() const
Get my status.
Definition: Simulator.h:74
The simulator.
Definition: Simulator.h:42
bool m_state
My status.
Definition: Simulator.h:222
void Simulate(bool bDumpSignal=true)
Start the simulation after every necessary credentials have been set.
Definition: Simulator.cpp:275
CoilArray * GetRxCoilArray()
Get the transmitting coil array.
Definition: Simulator.h:156
Implementation of JEMRIS World.
World * m_world
World to be simulated.
Definition: Simulator.h:227
Implementation of JEMRIS ConcatSequence.
void CheckRestart()
Checks if restart files present; sets jemris state.
Definition: Simulator.cpp:358
Coil configuration and sensitivities.
Definition: CoilArray.h:40
void SetSequence(string seq="")
Set my sequence according to XML configuration.
Definition: Simulator.cpp:315
Implementation of JEMRIS Sample.
string m_output_dir
Output directory.
Definition: Simulator.h:236
ConcatSequence * m_sequence
Sequence to be simulated.
Definition: Simulator.h:229
Implementation of JEMRIS CoilArray.
CoilArray * m_tx_coil_array
Transmit coil array.
Definition: Simulator.h:232
void SetParameter()
Set miscellaneous parameters according to XML configuration.
Definition: Simulator.cpp:184
Sample * m_sample
Sample.
Definition: Simulator.h:226
SequenceTree * m_seqtree
SequenceTree to be simulated.
Definition: Simulator.h:230
Base class for MR model solver.
Definition: Model.h:48
void SetRxCoilArray(string frxarray="")
Set up my recieve coils according to XML configuration.
Definition: Simulator.cpp:132
Tree representation of the sequence.
Definition: SequenceTree.h:45
KSpace< double, 4 > * m_kspace
K-Space.
Definition: Simulator.h:235
Model * GetModel()
Get the model.
Definition: Simulator.h:135
Implementation of JEMRIS Blo_CV_Model.h.
CoilArray * GetTxCoilArray()
Get the recieving coil array.
Definition: Simulator.h:149
Implementation of JEMRIS XMLIO.
void SetSignalPrefix(string prefix)
Set signal prefix.
Definition: Simulator.cpp:297
void SetTxCoilArray(string ftxarray="")
Set up my Transmit coils according to XML configuration.
Definition: Simulator.cpp:151
int m_evol
Evolution steps.
Definition: Simulator.h:223
DOMElement * GetElem(string name)
Get a particular element from my DOM document.
Definition: Simulator.cpp:270
void SetSample(std::string fsample)
Set my sample from XML.
Definition: Simulator.cpp:94
void SetModel(string fmodel="")
Set my solver model according to XML configuration.
Definition: Simulator.cpp:164
Simulator()
Default constructor.
Definition: Simulator.cpp:40
CoilArray * m_rx_coil_array
Receive coil array.
Definition: Simulator.h:233
void SetOutputDir(string output_dir)
Set output directory.
Definition: Simulator.cpp:306
Model * m_model
Model to be simulated.
Definition: Simulator.h:228
DOMTreeErrorReporter * m_domtree_error_rep
DOM tree error reporter.
Definition: Simulator.h:234
void MoveTmpFiles()
Definition: Simulator.cpp:372
The Sample is the object to simulate. It contains the spins.
Definition: Sample.h:282
void DeleteTmpFiles()
Definition: Simulator.cpp:349

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