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 void common_init();
00134
00135
00136 OdinPulse& update();
00137 void update_B10andPower();
00138
00139 void create_rephgrads(bool recreate) const;
00140
00141 bool rephased_pulse;
00142 float rephaser_strength;
00143 bool attenuation_set;
00144 bool always_refresh;
00145
00146 float rephase_integral[n_directions];
00147 mutable SeqGradTrapez* reph_grad[n_directions];
00148
00149 static void register_pulse(SeqPulsar* pls);
00150 static void unregister_pulse(SeqPulsar* pls);
00151
00152
00153 struct PulsarList : public STD_list<const SeqPulsar*>, public Labeled {};
00154
00155 static SingletonHandler<PulsarList,false> active_pulsar_pulses;
00156
00157 };
00158
00159
00161
00169 class SeqPulsarReph : public SeqGradChanParallel {
00170
00171 public:
00176 SeqPulsarReph(const STD_string& object_label,const SeqPulsar& puls);
00177
00181 SeqPulsarReph(const SeqPulsarReph& spr);
00182
00186 SeqPulsarReph(const STD_string& object_label = "unnamedSeqPulsarReph");
00187
00191 ~SeqPulsarReph();
00192
00196 SeqPulsarReph& operator = (const SeqPulsarReph& spr);
00197
00198
00202 float get_onramp_duration() const;
00203
00207 float get_constgrad_duration() const;
00208
00212 float get_offramp_duration() const;
00213
00214
00215 private:
00216 void build_seq();
00217
00218 unsigned int dim;
00219
00220 SeqGradTrapez gxpulse;
00221 SeqGradTrapez gypulse;
00222 SeqGradTrapez gzpulse;
00223
00224 };
00225
00226
00227
00229
00237 class SeqPulsarSinc : public SeqPulsar {
00238
00239 public:
00249 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);
00250
00254 SeqPulsarSinc(const SeqPulsarSinc& sps);
00255
00259 SeqPulsarSinc& operator = (const SeqPulsarSinc& sps);
00260
00261 };
00262
00263
00265
00273 class SeqPulsarGauss : public SeqPulsar {
00274
00275 public:
00284 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);
00285
00289 SeqPulsarGauss(const SeqPulsarGauss& spg);
00290
00294 SeqPulsarGauss& operator = (const SeqPulsarGauss& spg);
00295
00296 };
00297
00298
00300
00308 class SeqPulsarBP : public SeqPulsar {
00309
00310 public:
00316 SeqPulsarBP(const STD_string& object_label="unnamedSeqPulsarBP", float duration=1.0, float flipangle=90.0, const STD_string& nucleus="");
00317
00321 SeqPulsarBP(const SeqPulsarBP& spb);
00322
00326 SeqPulsarBP& operator = (const SeqPulsarBP& spb);
00327
00328 };
00329
00330
00331
00332
00336 #endif