JEMRIS 2.9.1
open-source MRI simulations
Loading...
Searching...
No Matches
ConcatSequence.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 CONCATSEQUENCE_H_
28#define CONCATSEQUENCE_H_
29
30#include "Sequence.h"
31#include "RepIter.h"
32#include "TPOI.h"
33
34
35// LOOP counter bitmask (for recon purposes)
36static const size_t SLICE_L (0); // 1 : slice loop
37static const size_t PHASE_L (1); // 2 : phase encoding loop
38static const size_t PARTITION_L (2); // 4 : partition loop
39static const size_t SET_L (3); // 8 : set loop
40static const size_t CONTRAST_L (4); // 16 : contrast loop
41static const size_t AVERAGE_L (5); // 32 : average loop
42
43
48class ConcatSequence : public Sequence {
49
50 public:
51
56
61
66
70 inline ConcatSequence* Clone () const { return (new ConcatSequence(*this)); };
71
78 virtual bool Prepare (const PrepareMode mode) ;
79
83 virtual void GetValue (double * dAllVal, double const time) ;
84
88 virtual void GetValue (double * dAllVal, double const time, double * pos[3]) {};
89
93 double GetDuration ();
94
98 virtual int GetNumOfTPOIs ();
99
105 inline virtual unsigned int GetMyRepetitions () { return m_repetitions; };
106
112 void SetRepetitions (unsigned int val);
113
120 void SetRepCounter (unsigned int val, bool record=false);
121
127 inline unsigned int GetMyRepCounter () {return m_counter;};
128
129
130 bool IsSliceLoop () const {return check_bit (m_mask, SLICE_L); }
131 bool IsPhaseLoop () const {return check_bit (m_mask, PHASE_L); }
132 bool IsPartitionLoop () const {return check_bit (m_mask, PARTITION_L); }
133 bool IsSetLoop () const {return check_bit (m_mask, SET_L); }
134 bool IsContrastLoop () const {return check_bit (m_mask, CONTRAST_L); }
135 bool IsAvgLoop () const {return check_bit (m_mask, AVERAGE_L); }
136
137
143 inline RepIter begin() {m_counter=-1; NewState(m_counter); SetRepCounter(0); return RepIter(this,0);}
144
150 RepIter end() { return RepIter(this,m_repetitions); }
151
152 /*
153 * @brief Create a DOM tree where all expressions are evaluated (for IDEA)
154 *
155 * @param doc Document
156 * @param node Node
157 *
158 * @return success or failure
159 */
160 //virtual bool StaticDOM(DOMDocument* doc, DOMNode* node);
161
167 virtual long GetNumOfADCs ();
168
172 virtual void CollectSeqData (NDData<double>& seqdata, double& t, long& offset);
173
177 virtual void CollectSeqData (OutputSequenceData *seqdata);
178
179 protected:
180
181
187 virtual string GetInfo ();
188
189 unsigned int m_repetitions;
190 unsigned int m_counter;
192 size_t m_mask;
193};
194
195#endif /*CONCATSEQUENCE_H_*/
mode
Definition: Declarations.h:112
Implementation of JEMRIS RepIter.
Implementation of JEMRIS Sequence.
Implementation of JEMRIS TPOI.
Concat sequence prototype.
Definition: ConcatSequence.h:48
virtual int GetNumOfTPOIs()
Default destructor.
Definition: ConcatSequence.cpp:93
virtual void GetValue(double *dAllVal, double const time)
Definition: ConcatSequence.cpp:107
int m_loop_flag
Definition: ConcatSequence.h:191
double GetDuration()
Definition: ConcatSequence.cpp:71
virtual long GetNumOfADCs()
Definition: ConcatSequence.cpp:129
virtual unsigned int GetMyRepetitions()
Get the number of repetitions.
Definition: ConcatSequence.h:105
unsigned int m_repetitions
The number of repetitions for this container.
Definition: ConcatSequence.h:189
size_t m_mask
Definition: ConcatSequence.h:192
virtual void CollectSeqData(NDData< double > &seqdata, double &t, long &offset)
Recursively collect sequence data (for plotting the sequence diagram)
Definition: ConcatSequence.cpp:151
void SetRepetitions(unsigned int val)
Set the number of repetitions.
Definition: ConcatSequence.cpp:65
~ConcatSequence()
Default destructor.
Definition: ConcatSequence.h:65
virtual void GetValue(double *dAllVal, double const time, double *pos[3])
Definition: ConcatSequence.h:88
ConcatSequence()
Default constructor.
Definition: ConcatSequence.h:55
RepIter begin()
Definition: ConcatSequence.h:143
virtual bool Prepare(const PrepareMode mode)
Prepare the sequence.
Definition: ConcatSequence.cpp:39
void SetRepCounter(unsigned int val, bool record=false)
Set the current repetition counter of this ConcatSequence.
Definition: ConcatSequence.cpp:58
unsigned int GetMyRepCounter()
Get the current repetition counter of this ConcatSequence.
Definition: ConcatSequence.h:127
ConcatSequence * Clone() const
Definition: ConcatSequence.h:70
virtual string GetInfo()
Definition: ConcatSequence.cpp:143
RepIter end()
Definition: ConcatSequence.h:150
unsigned int m_counter
Current value of the repetition counter for this container.
Definition: ConcatSequence.h:190
Simple nd-data structure.
Definition: NDData.h:53
Maintain libraries of hardware events and write sequence file.
Definition: OutputSequenceData.h:78
bool NewState(const T &val)
Check the state of an attribute.
Definition: Prototype.h:309
A super-simple iterator for counting the repetitions of a concat sequence.
Definition: RepIter.h:41
Super class for all sequence (non-pulse) modules.
Definition: Sequence.h:43

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