JEMRIS  2.8.1
open-source MRI simulations
ConcatSequence.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 CONCATSEQUENCE_H_
28 #define CONCATSEQUENCE_H_
29 
30 #include "Sequence.h"
31 #include "RepIter.h"
32 
37 class ConcatSequence : public Sequence {
38 
39  public:
40 
45 
50 
55 
59  inline ConcatSequence* Clone () const { return (new ConcatSequence(*this)); };
60 
67  virtual bool Prepare (const PrepareMode mode) ;
68 
72  virtual void GetValue (double * dAllVal, double const time) ;
73 
77  virtual void GetValue (double * dAllVal, double const time, double * pos[3]) {};
78 
82  double GetDuration ();
83 
87  virtual int GetNumOfTPOIs ();
88 
94  inline virtual unsigned int GetMyRepetitions () { return m_repetitions; };
95 
101  void SetRepetitions (unsigned int val);
102 
109  void SetRepCounter (unsigned int val, bool record=false);
110 
116  inline unsigned int GetMyRepCounter () {return m_counter;};
117 
123  inline RepIter begin() {m_counter=-1; NewState(m_counter); SetRepCounter(0); return RepIter(this,0);}
124 
130  RepIter end() { return RepIter(this,m_repetitions); }
131 
132  /*
133  * @brief Create a DOM tree where all expressions are evaluated (for IDEA)
134  *
135  * @param doc Document
136  * @param node Node
137  *
138  * @return success or failure
139  */
140  //virtual bool StaticDOM(DOMDocument* doc, DOMNode* node);
141 
147  virtual long GetNumOfADCs ();
148 
152  virtual void CollectSeqData (NDData<double>& seqdata, double& t, long& offset);
153 
157  virtual void CollectSeqData (OutputSequenceData *seqdata);
158 
159  protected:
160 
161 
167  virtual string GetInfo ();
168 
169  unsigned int m_repetitions;
170  unsigned int m_counter;
171 };
172 
173 #endif /*CONCATSEQUENCE_H_*/
Implementation of JEMRIS Sequence.
virtual bool Prepare(const PrepareMode mode)
Prepare the sequence.
Definition: ConcatSequence.cpp:37
A super-simple iterator for counting the repetitions of a concat sequence.
Definition: RepIter.h:41
Maintain libraries of hardware events and write sequence file.
Definition: OutputSequenceData.h:77
bool NewState(const T &val)
Check the state of an attribute.
Definition: Prototype.h:309
virtual void CollectSeqData(NDData< double > &seqdata, double &t, long &offset)
Recursively collect sequence data (for plotting the sequence diagram)
Definition: ConcatSequence.cpp:144
Concat sequence prototype.
Definition: ConcatSequence.h:37
virtual void GetValue(double *dAllVal, double const time)
Definition: ConcatSequence.cpp:101
ConcatSequence * Clone() const
Definition: ConcatSequence.h:59
virtual void GetValue(double *dAllVal, double const time, double *pos[3])
Definition: ConcatSequence.h:77
ConcatSequence()
Default constructor.
Definition: ConcatSequence.h:44
unsigned int m_repetitions
The number of repetitions for this container.
Definition: ConcatSequence.h:169
virtual int GetNumOfTPOIs()
Default destructor.
Definition: ConcatSequence.cpp:87
virtual string GetInfo()
Definition: ConcatSequence.cpp:137
unsigned int m_counter
Current value of the repetition counter for this container.
Definition: ConcatSequence.h:170
mode
Definition: Declarations.h:112
Implementation of JEMRIS RepIter.
virtual unsigned int GetMyRepetitions()
Get the number of repetitions.
Definition: ConcatSequence.h:94
~ConcatSequence()
Default destructor.
Definition: ConcatSequence.h:54
void SetRepCounter(unsigned int val, bool record=false)
Set the current repetition counter of this ConcatSequence.
Definition: ConcatSequence.cpp:52
RepIter begin()
Definition: ConcatSequence.h:123
double GetDuration()
Definition: ConcatSequence.cpp:65
virtual long GetNumOfADCs()
Definition: ConcatSequence.cpp:123
unsigned int GetMyRepCounter()
Get the current repetition counter of this ConcatSequence.
Definition: ConcatSequence.h:116
void SetRepetitions(unsigned int val)
Set the number of repetitions.
Definition: ConcatSequence.cpp:59
Super class for all sequence (non-pulse) modules.
Definition: Sequence.h:37
RepIter end()
Definition: ConcatSequence.h:130

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