seqpulsar.h
1 /***************************************************************************
2  seqpulsar.h - description
3  -------------------
4  begin : Wed Aug 8 2001
5  copyright : (C) 2000-2015 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef SEQPULSAR_H
19 #define SEQPULSAR_H
20 
21 #include <tjutils/tjhandler.h>
22 
23 #include <odinseq/seqpulsndim.h>
24 #include <odinseq/odinpulse.h>
25 #include <odinseq/seqgradtrapez.h>
26 
27 
28 
41 class SeqPulsar : public SeqPulsNdim, public OdinPulse, public StaticHandler<SeqPulsar> {
42 
43  public:
44 
52  SeqPulsar(const STD_string& object_label = "unnamedSeqPulsar", bool rephased=false, bool interactive=true);
53 
57  SeqPulsar(const SeqPulsar& sp);
58 
62  ~SeqPulsar();
63 
70  SeqPulsar& set_rephased(bool rephased, float strength=0.0);
71 
76 
80  SeqPulsar& operator = (const SeqPulsar& sp);
81 
85  SeqPulsar& refresh();
86 
91  SeqPulsar& set_interactive(bool flag);
92 
93 
94  // overloading virtual function from SeqGradInterface
95  float get_strength() const {return OdinPulse::get_G0();} // always return strength of pulse, and not that of rephasers
96 
97 
98  // reimplemented virtual functions from SeqPulsNdim
99  int get_dims() const;
100 
101  // reimplemented virtual functions from SeqFreqChanInterface
102  SeqFreqChanInterface& set_nucleus(const STD_string& nucleus);
103 
104  // reimplemented virtual functions from SeqPulsInterface
105  float get_flipangle() const {return OdinPulse::get_flipangle(); }
106  SeqPulsInterface& set_flipangle(float flipangle);
107  SeqPulsInterface& set_pulsduration(float pulsduration);
108  SeqPulsInterface& set_power(float pulspower);
111 
112 
113  // overloading virtual function from SeqTreeObj
114  STD_string get_properties() const;
115 
116 
117  // initialize/destroy static members via StaticHandler
118  static void init_static();
119  static void destroy_static();
120 
121  // Dummy operators for vector of pulsars with STL replacement
122  bool operator == (const SeqPulsar& sp) const {return STD_string(get_label())==STD_string(sp.get_label());}
123  bool operator < (const SeqPulsar& sp) const {return STD_string(get_label())<STD_string(sp.get_label());}
124  bool operator != (const SeqPulsar& sp) const {return !(*this==sp);}
125 
126 
127  private:
128 
129  friend class SeqPulsarReph;
130  friend class SeqMethod;
131  friend class SeqMethodProxy;
132 
133  void common_init();
134 
135  // virtual functions of OdinPulse
136  OdinPulse& update();
137  void update_B10andPower();
138 
139  void create_rephgrads(bool recreate) const; // const to be used in SeqPulsarReph constructor
140 
141  bool rephased_pulse;
142  float rephaser_strength;
143  bool attenuation_set;
144  bool always_refresh;
145 
146  float rephase_integral[n_directions]; // cache for get_reph_gradintegral()
147  mutable SeqGradTrapez* reph_grad[n_directions];
148 
149  static void register_pulse(SeqPulsar* pls);
150  static void unregister_pulse(SeqPulsar* pls);
151 
152  // struct to store references to all pulses which are currently active
153  struct PulsarList : public STD_list<const SeqPulsar*>, public Labeled {};
154 
155  static SingletonHandler<PulsarList,false> active_pulsar_pulses;
156 
157 };
158 
159 
161 
170 
171  public:
176  SeqPulsarReph(const STD_string& object_label,const SeqPulsar& puls);
177 
181  SeqPulsarReph(const SeqPulsarReph& spr);
182 
186  SeqPulsarReph(const STD_string& object_label = "unnamedSeqPulsarReph");
187 
191  ~SeqPulsarReph();
192 
197 
198 
202  float get_onramp_duration() const;
203 
207  float get_constgrad_duration() const;
208 
212  float get_offramp_duration() const;
213 
214 
215  private:
216  void build_seq();
217 
218  unsigned int dim;
219 
220  SeqGradTrapez gxpulse;
221  SeqGradTrapez gypulse;
222  SeqGradTrapez gzpulse;
223 
224 };
225 
226 
227 
229 
237 class SeqPulsarSinc : public SeqPulsar {
238 
239  public:
249  SeqPulsarSinc(const STD_string& object_label="unnamedSeqPulsarSinc", float slicethickness=5.0, bool rephased=true, float duration=2.0, float flipangle=90.0, float resolution=1.5, unsigned int npoints=256);
250 
254  SeqPulsarSinc(const SeqPulsarSinc& sps);
255 
260 
261 };
262 
263 
265 
273 class SeqPulsarGauss : public SeqPulsar {
274 
275  public:
284  SeqPulsarGauss(const STD_string& object_label="unnamedSeqPulsarGauss", float slicethickness=5.0, bool rephased=true, float duration=1.0, float flipangle=90.0, unsigned int npoints=128);
285 
289  SeqPulsarGauss(const SeqPulsarGauss& spg);
290 
295 
296 };
297 
298 
300 
308 class SeqPulsarBP : public SeqPulsar {
309 
310  public:
316  SeqPulsarBP(const STD_string& object_label="unnamedSeqPulsarBP", float duration=1.0, float flipangle=90.0, const STD_string& nucleus="");
317 
321  SeqPulsarBP(const SeqPulsarBP& spb);
322 
326  SeqPulsarBP& operator = (const SeqPulsarBP& spb);
327 
328 };
329 
330 
331 
332 
336 #endif
int get_dims() const
Trapezoidal gradient.
virtual pulseType get_pulse_type() const
Definition: seqpuls.h:139
Const pulse.
Definition: seqpulsar.h:308
SeqFreqChanInterface & set_nucleus(const STD_string &nucleus)
pulseType
Definition: seqpuls.h:42
SeqPulsar & set_rephased(bool rephased, float strength=0.0)
SeqPulsInterface & set_pulsduration(float pulsduration)
float get_strength() const
Definition: seqpulsar.h:95
SeqPulsInterface & set_pulse_type(pulseType type)
Gauss pulse.
Definition: seqpulsar.h:273
Sinc pulse.
Definition: seqpulsar.h:237
SeqPulsar & set_interactive(bool flag)
STD_string get_properties() const
fvector get_reph_gradintegral() const
SeqPulsar & refresh()
SeqPulsInterface & set_flipangle(float flipangle)
const STD_string & get_label() const
Definition: tjlabel.h:48
pulseType get_pulse_type() const
Definition: seqpulsar.h:110
SeqPulsar(const STD_string &object_label="unnamedSeqPulsar", bool rephased=false, bool interactive=true)
Pulsar pulses, combines OdinPulse and SeqPulsNdim.
Definition: seqpulsar.h:41
RF Pulse + gradients.
Definition: seqpulsndim.h:41
float get_flipangle() const
Definition: seqpulsar.h:105
Advandced RF pulses.
Definition: odinpulse.h:121
SeqPulsInterface & set_power(float pulspower)
Base class for methods (sequences)
Definition: seqmeth.h:155
Post-pulse rephaser.
Definition: seqpulsar.h:169
SeqPulsar & operator=(const SeqPulsar &sp)
double get_G0() const
double get_flipangle() const