00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SEQACQ_H
00019 #define SEQACQ_H
00020
00021 #include <tjutils/tjhandler.h>
00022
00023 #include <odinseq/seqobj.h>
00024 #include <odinseq/seqfreq.h>
00025 #include <odinseq/seqvec.h>
00026 #include <odinseq/seqdriver.h>
00027
00028
00029 class SeqGradChanParallel;
00030
00031
00033
00039 class SeqAcqInterface : public virtual SeqFreqChanInterface {
00040
00041 public:
00042
00046 virtual double get_acquisition_duration() const {if(marshall) return marshall->get_acquisition_duration(); else marshall_error(); return 0.0;}
00047
00052 virtual double get_acquisition_center() const {if(marshall) return marshall->get_acquisition_center(); else marshall_error(); return 0.0;}
00053
00059 virtual double get_acquisition_start() const {if(marshall) return marshall->get_acquisition_start(); else marshall_error(); return 0.0;}
00060
00061
00065 virtual unsigned int get_npts() const {if(marshall) return marshall->get_npts(); else marshall_error(); return 0;}
00066
00067
00068
00069
00073 virtual SeqAcqInterface& set_sweepwidth(double sw, float os_factor) {if(marshall) marshall->set_sweepwidth(sw,os_factor); else marshall_error(); return *this;}
00074
00075
00079 virtual double get_sweepwidth() const {if(marshall) return marshall->get_sweepwidth(); else marshall_error(); return 0.0;}
00080
00084 virtual float get_oversampling() const {if(marshall) return marshall->get_oversampling(); else marshall_error(); return 0.0;}
00085
00086
00087
00091 virtual SeqAcqInterface& set_readout_shape(const fvector& shape, unsigned int dstsize) {if(marshall) marshall->set_readout_shape(shape, dstsize); else marshall_error(); return *this;}
00092
00093
00102 virtual SeqAcqInterface& set_reco_vector(recoDim dim, const SeqVector& vec, const dvector& valvec=dvector()) {if(marshall) marshall->set_reco_vector(dim, vec, valvec); else marshall_error(); return *this;}
00103
00104
00105
00110 virtual SeqAcqInterface& set_default_reco_index(recoDim dim, unsigned int index) {if(marshall) marshall->set_default_reco_index(dim, index); else marshall_error(); return *this;}
00111
00112
00117 virtual SeqAcqInterface& set_template_type(templateType type) {if(marshall) marshall->set_template_type(type); return set_default_reco_index(templtype,type);}
00118
00119
00124 virtual SeqAcqInterface& set_reflect_flag(bool flag) {if(marshall) marshall->set_reflect_flag(flag); else marshall_error(); return *this;}
00125
00126
00127
00128 protected:
00129 SeqAcqInterface() : marshall(0) {}
00130 virtual ~SeqAcqInterface() {}
00131
00132 void set_marshall(SeqAcqInterface* mymarshall) {marshall=mymarshall;}
00133
00134 private:
00135 friend class SeqAcqDeph;
00136
00137
00138
00139
00140 virtual const SeqVector* get_dephgrad(SeqGradChanParallel& dephobj, bool rephase) const {if(marshall) return marshall->get_dephgrad(dephobj,rephase); return 0;}
00141
00142 SeqAcqInterface* marshall;
00143
00144 };
00145
00146
00147
00149
00150
00155 class SeqAcqDriver : public SeqDriverBase {
00156
00157 public:
00158 SeqAcqDriver() {}
00159 virtual ~SeqAcqDriver() {}
00160
00164 virtual double adjust_sweepwidth(double desired_sweep_widht) const = 0;
00165
00169 virtual bool prep_driver(kSpaceCoord& recoindex, double sweepwidth, unsigned int nAcqPoints, double acqcenter, int freqchannel) = 0;
00170
00174 virtual double get_predelay() const = 0;
00175
00179 virtual double get_postdelay(double sweepwidth) const = 0;
00180
00181 virtual void event(eventContext& context, double start) const = 0;
00182
00183 virtual STD_string get_program(programContext& context, unsigned int phaselistindex) const = 0;
00184
00185 virtual STD_string get_instr_label() const = 0;
00186
00187 virtual unsigned int get_numof_channels() const = 0;
00188
00189 virtual SeqAcqDriver* clone_driver() const = 0;
00190 };
00191
00192
00194
00195
00206 class SeqAcq : public virtual SeqAcqInterface, public SeqObjBase, public SeqFreqChan {
00207
00208 public:
00209
00224 SeqAcq(const STD_string& object_label, unsigned int nAcqPoints, double sweepwidth,
00225 float os_factor=1.0, const STD_string& nucleus="",
00226 const dvector& phaselist=0,const dvector& freqlist=0);
00227
00228
00229
00233 SeqAcq(const SeqAcq& sa);
00234
00238 SeqAcq(const STD_string& object_label="unnamedSeqAcq");
00239
00243 ~SeqAcq();
00244
00245
00249 SeqAcq& set_npts(unsigned int nAcqPoints);
00250
00251
00255 double get_sweep_width() const {return sweep_width;}
00256
00257
00261 SeqAcq& operator = (const SeqAcq& sa);
00262
00263
00267 void set_kspace_traj(const farray& kspaceTraj);
00268
00269
00273 void set_weight_vec(const cvector& weightVec);
00274
00275
00280 SeqAcq& set_rel_center(double relative_kspace_center) {rel_center=relative_kspace_center; return *this;}
00281
00282
00286 const kSpaceCoord& get_kcoord() const;
00287
00288
00289
00290 double get_acquisition_duration() const {return secureDivision(npts,sweep_width);}
00291 double get_acquisition_center() const;
00292 double get_acquisition_start() const {return acqdriver->get_predelay();}
00293 unsigned int get_npts() const {return npts;}
00294 SeqAcqInterface& set_sweepwidth(double sw, float os_factor);
00295 double get_sweepwidth() const {return sweep_width;}
00296 float get_oversampling() const {return oversampl;}
00297 SeqAcqInterface& set_readout_shape(const fvector& shape, unsigned int dstsize);
00298 SeqAcqInterface& set_reco_vector(recoDim dim, const SeqVector& vec, const dvector& valvec=dvector());
00299 SeqAcqInterface& set_default_reco_index(recoDim dim, unsigned int index);
00300 SeqAcqInterface& set_reflect_flag(bool flag) {reflect_flag=flag; return *this;}
00301
00302
00303
00304 STD_string get_program(programContext& context) const;
00305 double get_duration() const;
00306 SeqValList get_freqvallist(freqlistAction action) const;
00307 void query(queryContext& context) const {SeqTreeObj::query(context); context.numof_acqs=1;}
00308 RecoValList get_recovallist(unsigned int reptimes, JDXkSpaceCoords& coords) const;
00309 unsigned int event(eventContext& context) const;
00310 STD_string get_properties() const;
00311
00312 private:
00313 friend class SeqMethod;
00314 friend class SeqEpiDriverParavision;
00315 friend class SeqEpiDriverEpic;
00316
00317 void common_init();
00318
00319
00320
00321 double get_freqchan_duration() const {return get_acquisition_duration();}
00322 STD_string get_driver_instr_label() const {return acqdriver->get_instr_label();}
00323
00324
00325
00326 bool prep();
00327
00328
00329 mutable kSpaceCoord kcoord;
00330
00331 mutable SeqDriverInterface<SeqAcqDriver> acqdriver;
00332
00333 double sweep_width;
00334 unsigned int npts;
00335 float oversampl;
00336 double rel_center;
00337 bool reflect_flag;
00338 int readoutIndex;
00339 int trajIndex;
00340 int weightIndex;
00341
00342
00343
00344 Handler<const SeqVector*>** dimvec;
00345
00346 int default_recoindex[n_recoIndexDims];
00347
00348
00349 };
00350
00354 #endif