00001 /*************************************************************************** 00002 seqparallel.h - description 00003 ------------------- 00004 begin : Fri Apr 16 2004 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef SEQPARALLEL_H 00019 #define SEQPARALLEL_H 00020 00021 #include <tjutils/tjhandler.h> 00022 00023 00024 #include <odinseq/seqgradobj.h> 00025 #include <odinseq/seqobj.h> 00026 #include <odinseq/seqdriver.h> 00027 00028 00037 class SeqParallelDriver : public SeqDriverBase { 00038 00039 public: 00040 SeqParallelDriver() {} 00041 virtual ~SeqParallelDriver() {} 00042 00043 virtual STD_string get_program(programContext& context, const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0; 00044 00045 virtual double get_duration (const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0; 00046 virtual double get_predelay (const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0; 00047 00048 virtual SeqParallelDriver* clone_driver() const = 0; 00049 }; 00050 00052 00053 00058 class SeqParallel : public SeqObjBase, public virtual SeqGradInterface { 00059 00060 public: 00061 00065 SeqParallel(const STD_string& object_label="unnamedSeqParallel"); 00066 00070 SeqParallel(const SeqParallel& sgp); 00071 00072 00076 SeqParallel& operator = (const SeqParallel& sgp); 00077 00078 00079 00083 SeqParallel& operator /= (SeqGradChan& sgc); 00084 00085 00089 SeqParallel& operator /= (SeqGradChanList& sgcl); 00090 00094 SeqParallel& operator /= (SeqGradChanParallel& sgcp); 00095 00099 SeqParallel& operator /= (SeqGradObjInterface& sgoa); 00100 00101 00102 00106 SeqParallel& operator /= (const SeqObjBase& soa); 00107 00108 00109 00110 00111 00112 // overloading virtual function from SeqTreeObj 00113 STD_string get_program(programContext& context) const {return pardriver->get_program(context,get_pulsptr(),get_const_gradptr());} 00114 double get_duration() const; 00115 STD_string get_properties() const; 00116 unsigned int event(eventContext& context) const; 00117 SeqValList get_freqvallist(freqlistAction action) const; 00118 SeqValList get_delayvallist() const; 00119 void query(queryContext& context) const; 00120 RecoValList get_recovallist(unsigned int reptimes, JDXkSpaceCoords& coords) const; 00121 double get_rf_energy() const; 00122 00123 00124 // overloading virtual function from SeqGradInterface 00125 SeqGradInterface& set_strength(float gradstrength); 00126 SeqGradInterface& invert_strength(); 00127 float get_strength() const; 00128 fvector get_gradintegral() const; 00129 double get_gradduration() const; 00130 SeqGradInterface& set_gradrotmatrix(const RotMatrix& matrix); 00131 00132 00136 double get_pulprogduration() const; 00137 00138 00139 00143 void clear(); 00144 00145 protected: 00146 SeqParallel& set_pulsptr(const SeqObjBase* pptr); 00147 const SeqObjBase* get_pulsptr() const; 00148 00149 SeqParallel& set_gradptr(SeqGradObjInterface* gptr); 00150 SeqParallel& set_gradptr(const SeqGradObjInterface* gptr); 00151 SeqParallel& clear_gradptr(); 00152 SeqGradObjInterface* get_gradptr() const; 00153 const SeqGradObjInterface* get_const_gradptr() const; 00154 00155 00156 private: 00157 friend class SeqOperator; 00158 friend class SeqObjList; 00159 friend class SeqObjVector; 00160 friend class SeqGradObjInterface; 00161 friend class SeqGradChanList; 00162 friend class SeqEpiDriverParavision; 00163 00164 // overloading virtual function from SeqClass 00165 void clear_container() {clear();} 00166 00167 00168 mutable SeqDriverInterface<SeqParallelDriver> pardriver; 00169 00170 Handler<const SeqObjBase* > pulsptr; 00171 Handler<SeqGradObjInterface* > gradptr; 00172 Handler<const SeqGradObjInterface* > const_gradptr; 00173 00174 }; 00175 00176 00177 00178 00183 #endif
1.5.6