JEMRIS 2.9.1
open-source MRI simulations
Loading...
Searching...
No Matches
Module.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 MODULE_H_
28#define MODULE_H_
29
30
31#include "Prototype.h"
32
33// Declaration to avoid inclusion of the header resulting in circular referentation
34class SequenceTree;
35class Parameters;
36class ConcatSequence;
37
38
40
41class Module : public Prototype {
42
43 public:
44
50 Module ();
51
57 virtual ~Module () {};
58
64 Module (const Module&);
65
71 virtual Module* Clone() const = 0;
72
84 virtual void GetValue (double * dAllVal, double const time) {};
85
86 /*
87 * @brief Get values for available Transmit coils for simulation only.
88 *
89 * Get the values for each Transmit channel in this atomic sequence. And
90 * return the in dAllVal.
91 *
92 * @param dAllVal represents the pointer to array where results are returned.
93 * @param time represents the time of invocation.
94 * @param pos represents the position in x, y, z.
95 */
96 //virtual void GetValue (double * dAllVal, double const time, double * pos[3]) {};
97
106 virtual bool Prepare (const PrepareMode mode);
107
108
118 void Initialize (DOMNode* node );
119
125 Module* GetParent ();
126
132 virtual double GetDuration () = 0;
133
139 virtual int GetNumOfTPOIs () { return m_tpoi.GetSize(); };
140
146 vector<Module*> GetChildren () const;
147
153 vector<Module*> GetChildrenDynamic () const;
154
160 Module* GetChild (unsigned int position) const;
161
167 int GetNumberOfChildren () const;
168
175 bool InsertChild (const string& name);
176
177 virtual Module* GetPrototypeByAttributeValue (string name, string attrib);
178
186 bool AddDOMattribute (const string attribute, const string value);
187
191 void AddAllDOMattributes (bool show_hidden = true);
192
198 virtual TPOI* GetTPOIs () { return &m_tpoi; }
199
208 void DumpTree (const string& file="", Module* mod=NULL, int ichild = 0, int level = 0) ;
209
215 int GetDepth (int depth = 0) ;
216
236
243 bool WriteStaticXML(const string& xml_file);
244
254 bool StaticDOM(DOMDocument* doc, DOMNode* node, bool append = true);
255
256
257 void SetSeqTree (SequenceTree* pST) { m_seq_tree= pST; };
258 SequenceTree* GetSeqTree ( ) { return m_seq_tree;};
259
260
261 protected:
262
268 virtual string GetInfo () { return ""; };
269
274 string m_info;
275 double m_duration;
279 private:
280
281
282};
283
284#endif
mode
Definition: Declarations.h:112
Implementation of JEMRIS Prototype.
Concat sequence prototype.
Definition: ConcatSequence.h:48
Module super class! ABC for all Objects in the sequence framework.
Definition: Module.h:41
void Initialize(DOMNode *node)
Initialize this module.
Definition: Module.cpp:47
virtual string GetInfo()
Get informations on this module.
Definition: Module.h:268
virtual Module * Clone() const =0
Clone a module.
bool WriteStaticXML(const string &xml_file)
Rewrite XML-tree where all expressions are evaluated (for IDEA)
Definition: Module.cpp:386
Module * GetParent()
Get Parent.
Definition: Module.cpp:82
vector< Module * > GetChildrenDynamic() const
Get Children dynamic (old non-cached version for dynamic events such as eddy currents)
Definition: Module.cpp:98
TPOI m_tpoi
Time points of interest are stored the referred repository.
Definition: Module.h:272
virtual int GetNumOfTPOIs()
Get the Number of TPOIs of this module.
Definition: Module.h:139
string m_info
Information string for this module.
Definition: Module.h:274
virtual ~Module()
Destructor.
Definition: Module.h:57
Module()
Constructor.
Definition: Module.cpp:36
virtual TPOI * GetTPOIs()
get the TPOIs of this module
Definition: Module.h:198
int GetHardwareMode()
Return the hardware mode of this module.
Definition: Module.h:235
int GetDepth(int depth=0)
Return tree depth from this module (including depth of Containers)
Definition: Module.cpp:257
virtual bool Prepare(const PrepareMode mode)
Prepare this pulse.
Definition: Module.cpp:66
virtual Module * GetPrototypeByAttributeValue(string name, string attrib)
Get a Prototype by value of an attribute.
Definition: Module.cpp:77
Module * GetChild(unsigned int position) const
Get Child.
Definition: Module.cpp:106
SequenceTree * m_seq_tree
Reference to the sequence tree.
Definition: Module.h:270
double m_duration
The duration of this module.
Definition: Module.h:275
void AddAllDOMattributes(bool show_hidden=true)
Definition: Module.cpp:154
void DumpTree(const string &file="", Module *mod=NULL, int ichild=0, int level=0)
Dump the sequence tree.
Definition: Module.cpp:280
bool StaticDOM(DOMDocument *doc, DOMNode *node, bool append=true)
Create a DOM tree where all expressions are evaluated (for IDEA)
Definition: Module.cpp:422
bool AddDOMattribute(const string attribute, const string value)
Add attribute and value to the DOM node of this module.
Definition: Module.cpp:142
Module(const Module &)
Copy constructor.
Parameters * m_parameters
Pointer to the sole instance of the Parameters.
Definition: Module.h:271
int m_calls
Number of calls of this module.
Definition: Module.h:276
virtual void GetValue(double *dAllVal, double const time)
Get the value of this element.
Definition: Module.h:84
vector< Module * > GetChildren() const
Get Children.
Definition: Module.cpp:90
int m_hardware_mode
Hardware mode (-1: simulation only; 0: both; 1: hardware only)
Definition: Module.h:277
bool InsertChild(const string &name)
Insert Child.
Definition: Module.cpp:122
virtual double GetDuration()=0
int GetNumberOfChildren() const
Get number of Children.
Definition: Module.cpp:114
World parameters provide the parametric data of the sequence.
Definition: Parameters.h:37
Prototype super class.
Definition: Prototype.h:71
Tree representation of the sequence.
Definition: SequenceTree.h:45
Definition: TPOI.h:61
int GetSize() const
Definition: TPOI.cpp:57

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