seqparallel.h
1 /***************************************************************************
2  seqparallel.h - description
3  -------------------
4  begin : Fri Apr 16 2004
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 SEQPARALLEL_H
19 #define SEQPARALLEL_H
20 
21 #include <tjutils/tjhandler.h>
22 
23 
24 #include <odinseq/seqgradobj.h>
25 #include <odinseq/seqobj.h>
26 #include <odinseq/seqdriver.h>
27 
28 
37 class SeqParallelDriver : public SeqDriverBase {
38 
39  public:
41  virtual ~SeqParallelDriver() {}
42 
43  virtual STD_string get_program(programContext& context, const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0;
44 
45  virtual double get_duration (const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0;
46  virtual double get_predelay (const SeqObjBase* soa, const SeqGradObjInterface* sgoa) const = 0;
47 
48  virtual SeqParallelDriver* clone_driver() const = 0;
49 };
50 
52 
53 
58 class SeqParallel : public SeqObjBase, public virtual SeqGradInterface {
59 
60  public:
61 
65  SeqParallel(const STD_string& object_label="unnamedSeqParallel");
66 
70  SeqParallel(const SeqParallel& sgp);
71 
72 
76  SeqParallel& operator = (const SeqParallel& sgp);
77 
78 
79 
83  SeqParallel& operator /= (SeqGradChan& sgc);
84 
85 
89  SeqParallel& operator /= (SeqGradChanList& sgcl);
90 
94  SeqParallel& operator /= (SeqGradChanParallel& sgcp);
95 
99  SeqParallel& operator /= (SeqGradObjInterface& sgoa);
100 
101 
102 
106  SeqParallel& operator /= (const SeqObjBase& soa);
107 
108 
109 
110 
111 
112  // overloading virtual function from SeqTreeObj
113  STD_string get_program(programContext& context) const {return pardriver->get_program(context,get_pulsptr(),get_const_gradptr());}
114  double get_duration() const;
115  STD_string get_properties() const;
116  unsigned int event(eventContext& context) const;
117  SeqValList get_freqvallist(freqlistAction action) const;
118  SeqValList get_delayvallist() const;
119  void query(queryContext& context) const;
120  RecoValList get_recovallist(unsigned int reptimes, LDRkSpaceCoords& coords) const;
121  double get_rf_energy() const;
122 
123 
124  // overloading virtual function from SeqGradInterface
125  SeqGradInterface& set_strength(float gradstrength);
126  SeqGradInterface& invert_strength();
127  float get_strength() const;
128  fvector get_gradintegral() const;
129  double get_gradduration() const;
130  SeqGradInterface& set_gradrotmatrix(const RotMatrix& matrix);
131 
132 
136  double get_pulprogduration() const;
137 
138 
139 
143  void clear();
144 
145  protected:
146  SeqParallel& set_pulsptr(const SeqObjBase* pptr);
147  const SeqObjBase* get_pulsptr() const;
148 
149  SeqParallel& set_gradptr(SeqGradObjInterface* gptr);
150  SeqParallel& set_gradptr(const SeqGradObjInterface* gptr);
151  SeqParallel& clear_gradptr();
152  SeqGradObjInterface* get_gradptr() const;
153  const SeqGradObjInterface* get_const_gradptr() const;
154 
155 
156  private:
157  friend class SeqOperator;
158  friend class SeqObjList;
159  friend class SeqObjVector;
160  friend class SeqGradObjInterface;
161  friend class SeqGradChanList;
162  friend class SeqEpiDriverParavision;
163 
164  // overloading virtual function from SeqClass
165  void clear_container() {clear();}
166 
167 
168  mutable SeqDriverInterface<SeqParallelDriver> pardriver;
169 
170  Handler<const SeqObjBase* > pulsptr;
171  Handler<SeqGradObjInterface* > gradptr;
172  Handler<const SeqGradObjInterface* > const_gradptr;
173 
174 };
175 
176 
177 
178 
183 #endif
Container for sequence objects.
Definition: seqlist.h:86
virtual void clear_container()
Definition: seqclass.h:102
Vector to loop over sequence objects.
Definition: seqobjvec.h:48
Rotation Matrix.
Definition: geometry.h:67
STD_string get_program(programContext &context) const
Definition: seqparallel.h:113
freqlistAction
Definition: seqtree.h:102