JEMRIS  2.8.1
open-source MRI simulations
AtomicSequence.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 ATOMICSEQUENCE_H_
28 #define ATOMICSEQUENCE_H_
29 
30 #include "NDData.h"
31 
32 #include "Sequence.h"
33 #include "Pulse.h"
34 
35 using std::vector;
36 
40 class AtomicSequence : public Sequence {
41 
42  public:
43 
47  AtomicSequence() :m_theta(0.), m_non_lin_grad(0.), m_alpha(0.), m_phi(0.), m_eddy(false) {};
48 
53 
57  virtual ~AtomicSequence () {};
58 
62  inline AtomicSequence* Clone() const {return (new AtomicSequence(*this));};
63 
69  virtual bool Prepare (const PrepareMode mode);
70 
77  Pulse* GetPulse (int number) { return m_pulses.at(number); };
78 
84  int GetNumberOfPulses () { return m_pulses.size(); };
85 
89  virtual void GetValue (double * dAllVal, double const time) ;
90 
91 
95  double GetDuration ();
96 
97 
101  //virtual void GetValue (double * dAllVal, double const time, double * pos[3]) {};
102 
108  void Rotation (double * Grot);
109 
115  inline bool HasNonLinGrad () {return m_non_lin_grad;};
116 
122  inline void SetNonLinGrad (bool val) {m_non_lin_grad=val;};
123 
133  void CollectTPOIs ();
134 
138  virtual void CollectSeqData (NDData<double>& seqdata, double& t, long& offset);
139 
143  virtual void CollectSeqData (OutputSequenceData *seqdata);
144 
149  virtual long GetNumOfADCs ();
150 
151 
155  void GetValueLingeringEddyCurrents (double * dAllVal, double const time);
156 
160  void PrepareEddyCurrents ();
161 
165  void UpdateEddyCurrents ();
166 
171  bool HasEddyCurrents () {return m_eddy; };
172 
177  void SetEddyCurrents (bool val) {m_eddy = val; };
178 
179 protected:
185  virtual string GetInfo ();
186 
187 
188  private:
189 
190  vector<Pulse*> m_pulses;
193  double m_alpha;
194  double m_theta;
195  double m_phi;
196  bool m_eddy;
198 };
199 
200 #endif /*ATOMICSEQUENCE_H_*/
Implementation of JEMRIS Sequence.
Pulse * GetPulse(int number)
Get the pulse given by number.
Definition: AtomicSequence.h:77
void SetEddyCurrents(bool val)
true, if this atom contains eddy currents
Definition: AtomicSequence.h:177
bool m_non_lin_grad
A flag for nonlinear gradients.
Definition: AtomicSequence.h:192
Maintain libraries of hardware events and write sequence file.
Definition: OutputSequenceData.h:77
AtomicSequence * Clone() const
See Module::clone.
Definition: AtomicSequence.h:62
virtual void GetValue(double *dAllVal, double const time)
See Module::GetValue.
Definition: AtomicSequence.cpp:78
Implementation of JEMRIS Pulse.
double m_phi
Gradient Rotation matrix: azimutal phase measured from x-axis.
Definition: AtomicSequence.h:195
virtual bool Prepare(const PrepareMode mode)
Prepare the sequence.
Definition: AtomicSequence.cpp:37
void UpdateEddyCurrents()
update lingering eddy currents which are still alive after this atom
Definition: AtomicSequence.cpp:316
void Rotation(double *Grot)
See Module::GetValue.
Definition: AtomicSequence.cpp:125
Pulse Super Class. ABC for all RF and gradient pulses.
Definition: Pulse.h:41
void SetNonLinGrad(bool val)
Marh this atom, if nonlinear gradients are present.
Definition: AtomicSequence.h:122
double m_theta
Gradient Rotation matrix: polar inclination from z-axis.
Definition: AtomicSequence.h:194
bool m_eddy
A flag for eddy currents in this atom.
Definition: AtomicSequence.h:196
mode
Definition: Declarations.h:112
virtual string GetInfo()
Definition: AtomicSequence.cpp:206
virtual long GetNumOfADCs()
Get Number of ADCs in this atom.
Definition: AtomicSequence.cpp:272
void PrepareEddyCurrents()
prepare lingering eddy currents in this atom for GetValue in next atom
Definition: AtomicSequence.cpp:366
vector< Pulse * > m_pulses
vector of pointers to child pulses
Definition: AtomicSequence.h:190
void CollectTPOIs()
Collect the TPOIs of child pulses.
Definition: AtomicSequence.cpp:170
double m_alpha
Gradient Rotation matrix: Rotation angle.
Definition: AtomicSequence.h:193
int GetNumberOfPulses()
Get the number of nested pulses.
Definition: AtomicSequence.h:84
virtual ~AtomicSequence()
Default destructor.
Definition: AtomicSequence.h:57
bool HasNonLinGrad()
Check for nonlinear gradients in this atom.
Definition: AtomicSequence.h:115
bool HasEddyCurrents()
true, if this atom contains eddy currents
Definition: AtomicSequence.h:171
AtomicSequence()
Default constructor.
Definition: AtomicSequence.h:47
double GetDuration()
Definition: AtomicSequence.cpp:53
void GetValueLingeringEddyCurrents(double *dAllVal, double const time)
GetValue of lingering eddy currents.
Definition: AtomicSequence.cpp:283
virtual void CollectSeqData(NDData< double > &seqdata, double &t, long &offset)
Collect sequence data (for plotting the sequence diagram)
Definition: AtomicSequence.cpp:218
Super class for all sequence (non-pulse) modules.
Definition: Sequence.h:37
Atomic sequence prototype.
Definition: AtomicSequence.h:40

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