JEMRIS  2.8.1
open-source MRI simulations
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
Module Class Referenceabstract

Module super class! ABC for all Objects in the sequence framework. More...

#include <Module.h>

+ Inheritance diagram for Module:
+ Collaboration diagram for Module:

Public Member Functions

 Module ()
 Constructor. More...
 
virtual ~Module ()
 Destructor. More...
 
 Module (const Module &)
 Copy constructor. More...
 
virtual ModuleClone () const =0
 Clone a module. More...
 
virtual void GetValue (double *dAllVal, double const time)
 Get the value of this element. More...
 
virtual bool Prepare (const PrepareMode mode)
 Prepare this pulse. More...
 
void Initialize (DOMNode *node)
 Initialize this module. More...
 
ModuleGetParent ()
 Get Parent. More...
 
virtual double GetDuration ()=0
 
virtual int GetNumOfTPOIs ()
 Get the Number of TPOIs of this module. More...
 
vector< Module * > GetChildren () const
 Get Children. More...
 
ModuleGetChild (unsigned int position) const
 Get Child. More...
 
int GetNumberOfChildren () const
 Get number of Children. More...
 
bool InsertChild (const string &name)
 Insert Child. More...
 
virtual ModuleGetPrototypeByAttributeValue (string name, string attrib)
 Get a Prototype by value of an attribute. More...
 
bool AddDOMattribute (const string attribute, const string value)
 Add attribute and value to the DOM node of this module. More...
 
void AddAllDOMattributes (bool show_hidden=true)
 
virtual TPOIGetTPOIs ()
 get the TPOIs of this module More...
 
void DumpTree (const string &file="", Module *mod=NULL, int ichild=0, int level=0)
 Dump the sequence tree. More...
 
int GetDepth (int depth=0)
 Return tree depth from this module (including depth of Containers) More...
 
int GetHardwareMode ()
 Return the hardware mode of this module. More...
 
bool WriteStaticXML (const string &xml_file)
 Rewrite XML-tree where all expressions are evaluated (for IDEA) More...
 
bool StaticDOM (DOMDocument *doc, DOMNode *node, bool append=true)
 Create a DOM tree where all expressions are evaluated (for IDEA) More...
 
void SetSeqTree (SequenceTree *pST)
 
SequenceTreeGetSeqTree ()
 
- Public Member Functions inherited from Prototype
 Prototype ()
 Constructor. More...
 
virtual ~Prototype ()
 Default destructor. More...
 
 Prototype (const Prototype &)
 Default copy constructor. More...
 
bool IsPrepared ()
 Check if the Prototype is prepared. More...
 
void SetName (string name)
 Set the name of this module. More...
 
DOMNode * GetNode ()
 Get the DOMNode of this module. More...
 
void SetNode (DOMNode *node)
 Set the DOMNode of this module. More...
 
string GetClassType ()
 Get the class type of this prototype. More...
 
Type GetType ()
 Get the module type of this module. More...
 
string GetDOMattribute (const string attribute)
 Get attribute value from the DOMNode. More...
 
bool HasDOMattribute (const string attribute)
 Check, if attribute exists in DOM node of this module. More...
 
AttributeGetAttribute (string name)
 Get an Attribute. More...
 
void CopyObservers (Attribute *a1, Attribute *a2)
 Copy observers from one attribute to another. More...
 
bool HasAttribute (string name)
 Check if an attribute exist. More...
 
void HideAttribute (string attrib, bool observable=true)
 Hide an attribute. More...
 
string GetName ()
 Get the name of this module. More...
 
bool Observe (Attribute *attrib, string prot_name, string attrib_name, bool verbose)
 Set up the list of observations. More...
 
bool Observe (Attribute *attrib, string prot_name, string attrib_name, string attrib_keyword, bool verbose)
 
template<typename T >
bool Notify (const T &val)
 Notify all observers of an attribute. More...
 
template<typename T >
bool NewState (const T &val)
 Check the state of an attribute. More...
 
vector< double > * GetVector ()
 Each Prototype has a double vector as a private member, which values can be filled through XML and accessed from attributes within the same Prototype. More...
 

Protected Member Functions

virtual string GetInfo ()
 Get informations on this module. More...
 

Protected Attributes

SequenceTreem_seq_tree
 Reference to the sequence tree.
 
Parametersm_parameters
 Pointer to the sole instance of the Parameters.
 
TPOI m_tpoi
 Time points of interest are stored the referred repository.
 
string m_info
 Information string for this module.
 
double m_duration
 The duration of this module.
 
int m_calls
 Number of calls of this module.
 
int m_hardware_mode
 Hardware mode (-1: simulation only; 0: both; 1: hardware only)
 
- Protected Attributes inherited from Prototype
bool m_aux
 auxiliary helper variable for debugging purposes
 
bool m_prepared
 True, after the first call to Prepare.
 
string m_name
 Name of this Prototype.
 
DOMNode * m_node
 The node configuring this Module.
 
Type m_type
 The type of the module: one of MOD_PULSE, MOD_ATOM, MOD_CONCAT.
 
vector< double > m_vector
 A vector which elements are accessible through loop counters.
 
map< string, Attribute * > m_attributes
 Map to connect a keyword with an Attribute.
 
vector< Attribute * > m_obs_attribs
 Vector of observed Attributes.
 
vector< string > m_obs_attrib_keyword
 Vector of user-defined Attribute names.
 

Additional Inherited Members

- Static Public Member Functions inherited from Prototype
static bool ReplaceString (string &str, const string &s1, const string &s2)
 A global sub-string replacer. More...
 
static bool ReplaceSymbolString (string &str, const string &s1, const string &s2)
 A global sub-string replacer which replaces only complete symbol strings.
 
static vector< string > Tokenize (const string &str, const string &delimiters=",")
 A global string tokenizer. More...
 

Detailed Description

Module super class! ABC for all Objects in the sequence framework.

Constructor & Destructor Documentation

Module::Module ( )

Constructor.

Default constructor

+ Here is the caller graph for this function:

virtual Module::~Module ( )
inlinevirtual

Destructor.

Default destrcutor

+ Here is the call graph for this function:

Module::Module ( const Module )

Copy constructor.

Default copy constructor.

Member Function Documentation

void Module::AddAllDOMattributes ( bool  show_hidden = true)

More elaborate desciption here please

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Module::AddDOMattribute ( const string  attribute,
const string  value 
)

Add attribute and value to the DOM node of this module.

Parameters
attributeThe new attribute of the DOMNode
valueThe corresponding value
Returns
False, if attribute already exists in DOM (XML)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual Module* Module::Clone ( ) const
pure virtual
void Module::DumpTree ( const string &  file = "",
Module mod = NULL,
int  ichild = 0,
int  level = 0 
)

Dump the sequence tree.

Parameters
fileOptional output file. If, NULL stdout is used.
modThe starting module from which the tree is dumped.
ichildMore elaborate description
levelMore elaborate description

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Module * Module::GetChild ( unsigned int  position) const

Get Child.

Parameters
positionThe position in the list of children.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vector< Module * > Module::GetChildren ( ) const

Get Children.

Returns
Vector of child modules.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Module::GetDepth ( int  depth = 0)

Return tree depth from this module (including depth of Containers)

Parameters
depththe depth so far

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual double Module::GetDuration ( )
pure virtual

Get the duration of this module.

Returns
Duration in ms

Implemented in AtomicSequence, Pulse, ConcatSequence, Container, and Parameters.

+ Here is the caller graph for this function:

int Module::GetHardwareMode ( )
inline

Return the hardware mode of this module.

The hardware mode defines whether the module is included in simulation and/or hardware instructions. Valid modes are: -1: simulation only 1: hardare only 0: both simulation and hardware

A module will be included in the output files as follows:

Mode In seq.h5 In external.seq
-1 Yes No
0 Yes Yes
1 No Yes
Returns
hardware mode (-1, 0 or 1)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual string Module::GetInfo ( )
inlineprotectedvirtual

Get informations on this module.

Returns
Some useful information of a specific module

Reimplemented in AtomicSequence, RFPulse, Pulse, ConcatSequence, EddyPulse, GradPulse, Container, DelayAtomicSequence, TrapGradPulse, ContainerSequence, AnalyticRFPulse, ExternalRFPulse, SincRFPulse, ExternalGradPulse, EmptyPulse, AnalyticGradPulse, TriangleGradPulse, SpiralGradPulse, and ConstantGradPulse.

+ Here is the caller graph for this function:

int Module::GetNumberOfChildren ( ) const

Get number of Children.

Returns
Number of child modules.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual int Module::GetNumOfTPOIs ( )
inlinevirtual

Get the Number of TPOIs of this module.

Returns
The size of the member m_tpoi

Reimplemented in ConcatSequence, and Container.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Module * Module::GetParent ( )
virtual

Get Parent.

Returns
Parent module.

Reimplemented from Prototype.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Module * Module::GetPrototypeByAttributeValue ( string  name,
string  attrib 
)
virtual

Get a Prototype by value of an attribute.

Parameters
nameAttribute name
attribAttribute value
Returns
Found Prototype

Reimplemented from Prototype.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual TPOI* Module::GetTPOIs ( )
inlinevirtual

get the TPOIs of this module

Returns
Pointer to the private member TPOI.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void Module::GetValue ( double *  dAllVal,
double const  time 
)
inlinevirtual

Get the value of this element.

Calculate the value of the particular pulse at a given time in a given cycle and put the values put the values in dAllVal. Successors must implements this method.

Parameters
dAllValis an array of 5 doubles. {amplitude, phase, Gx, Gy, Gz} Gx, Gy, Gz equal to 1.0 for the direction of the Axis. 0.0 else.
timeconstant double value of the time of invocation.

Reimplemented in EddyPulse, AtomicSequence, DelayAtomicSequence, Container, ConcatSequence, RFPulse, Sequence, and GradPulse.

+ Here is the call graph for this function:

void Module::Initialize ( DOMNode *  node)
virtual

Initialize this module.

The first step after cloning! The method sets the Name of the Module, and pointers to the referring node and the (unique) SequenceTree.

Parameters
nodeThe DOMNode referring to this module.

Implements Prototype.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Module::InsertChild ( const string &  name)

Insert Child.

Parameters
nameThe name of the module from the ModulePrototypeFactory
Returns
Success

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Module::Prepare ( const PrepareMode  mode)
virtual

Prepare this pulse.

Called twice when root node prepares. First time not verbose. Successors must overload this method.

Parameters
modeSets the preparation mode, one of enum PrepareMode {PREP_INIT,PREP_VERBOSE,PREP_UPDATE}.

Implements Prototype.

Reimplemented in DelayAtomicSequence, Pulse, Container, RFPulse, ContainerSequence, EddyPulse, Parameters, AtomicSequence, GradPulse, TriangleGradPulse, AnalyticRFPulse, ConcatSequence, ExternalGradPulse, Sequence, EmptyPulse, ExternalRFPulse, HardRFPulse, SpiralGradPulse, TrapGradPulse, AnalyticGradPulse, GaussianRFPulse, SechRFPulse, SincRFPulse, and ConstantGradPulse.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Module::StaticDOM ( DOMDocument *  doc,
DOMNode *  node,
bool  append = true 
)

Create a DOM tree where all expressions are evaluated (for IDEA)

Parameters
docDocument
nodeNode
appendAppend to node?
Returns
success or failure

+ Here is the caller graph for this function:

bool Module::WriteStaticXML ( const string &  xml_file)

Rewrite XML-tree where all expressions are evaluated (for IDEA)

Parameters
xml_filename of XML file
Returns
success or failure

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files:

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