00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SEQPULSAR_H
00019 #define SEQPULSAR_H
00020
00021 #include <tjutils/tjhandler.h>
00022
00023 #include <odinseq/seqpulsndim.h>
00024 #include <odinseq/odinpulse.h>
00025 #include <odinseq/seqgradtrapez.h>
00026
00027
00028
00041 class SeqPulsar : public SeqPulsNdim, public OdinPulse, public StaticHandler<SeqPulsar> {
00042
00043 public:
00044
00052 SeqPulsar(const STD_string& object_label = "unnamedSeqPulsar", bool rephased=false, bool interactive=true);
00053
00057 SeqPulsar(const SeqPulsar& sp);
00058
00062 ~SeqPulsar();
00063
00070 SeqPulsar& set_rephased(bool rephased, float strength=0.0);
00071
00075 fvector get_reph_gradintegral() const;
00076
00080 SeqPulsar& operator = (const SeqPulsar& sp);
00081
00085 SeqPulsar& refresh();
00086
00091 SeqPulsar& set_interactive(bool flag);
00092
00093
00094
00095 float get_strength() const {return OdinPulse::get_G0();}
00096
00097
00098
00099 int get_dims() const;
00100
00101
00102 SeqFreqChanInterface& set_nucleus(const STD_string& nucleus);
00103
00104
00105 float get_flipangle() const {return OdinPulse::get_flipangle(); }
00106 SeqPulsInterface& set_flipangle(float flipangle);
00107 SeqPulsInterface& set_pulsduration(float pulsduration);
00108 SeqPulsInterface& set_power(float pulspower);
00109 SeqPulsInterface& set_pulse_type(pulseType type);
00110 pulseType get_pulse_type() const { return SeqPulsNdim::get_pulse_type();}
00111
00112
00113
00114 STD_string get_properties() const;
00115
00116
00117
00118 static void init_static();
00119 static void destroy_static();
00120
00121
00122 bool operator == (const SeqPulsar& sp) const {return STD_string(get_label())==STD_string(sp.get_label());}
00123 bool operator < (const SeqPulsar& sp) const {return STD_string(get_label())<STD_string(sp.get_label());}
00124 bool operator != (const SeqPulsar& sp) const {return !(*this==sp);}
00125
00126
00127 private:
00128
00129 friend class SeqPulsarReph;
00130 friend class SeqMethod;
00131 friend class SeqMethodProxy;
00132
00133
00134 OdinPulse& update();
00135 void update_B10andPower();
00136
00137 bool rephased_pulse;
00138 float rephaser_strength;
00139 bool attenuation_set;
00140 bool always_refresh;
00141
00142 SeqGradTrapez* reph_grad[n_directions];
00143
00144 static void register_pulse(SeqPulsar* pls);
00145 static void unregister_pulse(SeqPulsar* pls);
00146
00147
00148 struct PulsarList : public STD_list<const SeqPulsar*>, public Labeled {};
00149
00150 static SingletonHandler<PulsarList,false> active_pulsar_pulses;
00151
00152 };
00153
00154
00156
00164 class SeqPulsarReph : public SeqGradChanParallel {
00165
00166 public:
00171 SeqPulsarReph(const STD_string& object_label,const SeqPulsar& puls);
00172
00176 SeqPulsarReph(const SeqPulsarReph& spr);
00177
00181 SeqPulsarReph(const STD_string& object_label = "unnamedSeqPulsarReph");
00182
00186 ~SeqPulsarReph();
00187
00191 SeqPulsarReph& operator = (const SeqPulsarReph& spr);
00192
00193
00197 float get_onramp_duration() const;
00198
00202 float get_constgrad_duration() const;
00203
00207 float get_offramp_duration() const;
00208
00209
00210 private:
00211 void build_seq();
00212
00213 unsigned int dim;
00214
00215 SeqGradTrapez gxpulse;
00216 SeqGradTrapez gypulse;
00217 SeqGradTrapez gzpulse;
00218
00219 };
00220
00221
00222
00224
00232 class SeqPulsarSinc : public SeqPulsar {
00233
00234 public:
00244 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);
00245
00249 SeqPulsarSinc(const SeqPulsarSinc& sps);
00250
00254 SeqPulsarSinc& operator = (const SeqPulsarSinc& sps);
00255
00256 };
00257
00258
00260
00268 class SeqPulsarGauss : public SeqPulsar {
00269
00270 public:
00279 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);
00280
00284 SeqPulsarGauss(const SeqPulsarGauss& spg);
00285
00289 SeqPulsarGauss& operator = (const SeqPulsarGauss& spg);
00290
00291 };
00292
00293
00295
00303 class SeqPulsarBP : public SeqPulsar {
00304
00305 public:
00311 SeqPulsarBP(const STD_string& object_label="unnamedSeqPulsarBP", float duration=1.0, float flipangle=90.0, const STD_string& nucleus="");
00312
00316 SeqPulsarBP(const SeqPulsarBP& spb);
00317
00321 SeqPulsarBP& operator = (const SeqPulsarBP& spb);
00322
00323 };
00324
00325
00326
00327
00331 #endif