seqplot.h
1 /***************************************************************************
2  seqplot.h - description
3  -------------------
4  begin : Sat Sep 25 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 SEQPLOT_H
19 #define SEQPLOT_H
20 
21 #include <odinpara/odinpara.h> // for units
22 
23 class RotMatrix; // forward declaration
24 
30 enum plotChannel {B1re_plotchan=0, B1im_plotchan, rec_plotchan, signal_plotchan, freq_plotchan, phase_plotchan, Gread_plotchan, Gphase_plotchan, Gslice_plotchan, numof_plotchan};
31 
32 enum markType {no_marker=0, exttrigger_marker, halttrigger_marker, snapshot_marker, reset_marker, acquisition_marker, endacq_marker, excitation_marker, refocusing_marker, storeMagn_marker, recallMagn_marker, inversion_marker, saturation_marker, numof_markers };
33 static const char* markLabel[]={"none", "exttrigger", "halttrigger", "snapshot", "reset", "acquisition", "endacq", "excitation", "refocusing", "storeMagn", "recallMagn", "inversion", "saturation" };
34 AVOID_CC_WARNING(markLabel)
35 
36 enum timecourseMode {tcmode_curves=0, tcmode_plain, tcmode_slew_rate, tcmode_kspace, tcmode_M1, tcmode_M2, tcmode_b_trace, tcmode_backgr_kspace, tcmode_backgr_crossterm, tcmode_eddy_currents, numof_tcmodes};
37 static const char* timecourseLabel[]= {"Curves", "Plain", "Slew Rate", "k-Space", "1st Grad. Moment", "2nd Grad. Moment", "b-Value Trace", "Backgr. k-Space", "Backgr. Crossterm", "Eddy Currents"};
38 static const char* timecoursePrefix[]={"G", "G", "dG", "k", "M1", "M2", "b", "k", "c", "G"};
39 static const char* timecourseUnit[]= {ODIN_GRAD_UNIT, ODIN_GRAD_UNIT, ODIN_GRAD_UNIT "/" ODIN_TIME_UNIT, "rad/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT "/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT "^2/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT "/" ODIN_SPAT_UNIT "^2", "rad/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT "/" ODIN_SPAT_UNIT "^2", ODIN_GRAD_UNIT};
40 AVOID_CC_WARNING(timecourseLabel)
41 AVOID_CC_WARNING(timecoursePrefix)
42 AVOID_CC_WARNING(timecourseUnit)
43 
44 
45 
47 
51 struct Curve4Qwt {
52  Curve4Qwt() : size(0), x(0), y(0), spikes(false), has_freq_phase(false), gradmatrix(0) {}
53  bool operator == (const Curve4Qwt&) const {return false;} // dummy operator
54  bool operator < (const Curve4Qwt&) const {return false;} // dummy operator
55 
56  double get_bounds(bool endpoint) const {if(!size) return 0.0; if(endpoint) return x[size-1]; else return x[0];}
57 
58  const char* label;
59  plotChannel channel;
60 
61  int size;
62  double* x;
63  double* y;
64  bool spikes; // values will not be interpolated between points, draw sticks instead
65 
66  bool has_freq_phase;
67  double freq;
68  double phase;
69 
70  const RotMatrix* gradmatrix;
71 
72 };
73 
75 
76 
80 struct Marker4Qwt {
81  bool operator == (const Marker4Qwt&) const {return false;} // dummy operator
82  bool operator < (const Marker4Qwt&) const {return false;} // dummy operator
83  double get_bounds(bool) const {return x;}
84  const char* label;
85  double x;
86  markType type;
87 };
88 
90 
95  bool operator == (const TimecourseMarker4Qwt&) const {return false;} // dummy operator
96  bool operator < (const TimecourseMarker4Qwt&) const {return false;} // dummy operator
97  double get_bounds(bool) const {return x;}
98  double x;
99  double y[numof_plotchan];
100  markType type;
101 };
102 
104 
109  SeqTimecourseData() : size(0), x(0), n_rec_points(0) {for(int i=0; i<numof_plotchan; i++) y[i]=0;}
110 
111  unsigned int size;
112  double* x;
113  double* y[numof_plotchan];
114  unsigned int n_rec_points;
115 };
116 
118 
119 class SeqSimFeedbackAbstract {
120 
121  public:
122 
123  virtual void plot_vector(double timepoint, float M[3], float* dM) = 0;
124 
125 };
126 
128 
129 class ProgressMeter; // forward declaration
130 
135 
136  public:
137  virtual ~SeqPlotDataAbstract() {}
138 
139  virtual void reset() = 0;
140 
141  virtual void get_curves(STD_list<Curve4Qwt>::const_iterator& result_begin, STD_list<Curve4Qwt>::const_iterator& result_end, double starttime, double endtime, double max_highres_interval ) const = 0;
142 
143  virtual void get_signal_curves(STD_list<Curve4Qwt>::const_iterator& result_begin, STD_list<Curve4Qwt>::const_iterator& result_end, double starttime, double endtime ) const = 0;
144 
145  virtual void get_markers(STD_list<Marker4Qwt>::const_iterator& result_begin, STD_list<Marker4Qwt>::const_iterator& result_end, double starttime, double endtime ) const = 0;
146 
147  virtual bool timecourse_created(timecourseMode type) const = 0;
148 
149  virtual bool create_timecourses(timecourseMode type, const STD_string& nucleus, ProgressMeter* progmeter) const = 0;
150 
151  virtual const SeqTimecourseData* get_timecourse(timecourseMode type) const = 0;
152 
153  virtual const SeqTimecourseData* get_subtimecourse(timecourseMode type, double starttime, double endtime) const = 0;
154 
155  virtual void get_timecourse_markers(timecourseMode type, STD_list<TimecourseMarker4Qwt>::const_iterator& result_begin, STD_list<TimecourseMarker4Qwt>::const_iterator& result_end, double starttime, double endtime ) const = 0;
156 
157  virtual double get_total_duration() const = 0;
158 
159  virtual unsigned int n_frames() const = 0;
160 
161  virtual LDRblock& get_opts(bool timecourse_opts, bool simulation_opts) const = 0;
162 
163  virtual void set_coilsdir(const STD_string& coilsdir) const = 0;
164 
165  virtual void add_signal_curve(const Curve4Qwt& signal_curve) const = 0;
166 
167  virtual bool monitor_simulation() const = 0;
168 
169  virtual bool simulate(const STD_string& fidfile, const STD_string& samplefile, ProgressMeter* progmeter, SeqSimFeedbackAbstract* feedback) const = 0;
170 
171  virtual bool has_curves_on_channel(plotChannel chan) const = 0;
172 
173 };
174 
175 
176 
182 #endif
bool operator==(const TinyVector< T, N_rank > &t1, const TinyVector< T, N_rank > &t2)
Definition: utils.h:129
Rotation Matrix.
Definition: geometry.h:67
bool operator<(const STD_complex &c1, const STD_complex &c2)
Definition: tjcomplex.h:61
fvector phase(const cvector &cv)