00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SEQPLOT_H
00019 #define SEQPLOT_H
00020
00021 #include <odinpara/odinpara.h>
00022
00023 class RotMatrix;
00024
00025
00031 enum plotChannel {B1re_plotchan=0, B1im_plotchan, rec_plotchan, signal_plotchan, freq_plotchan, phase_plotchan, Gread_plotchan, Gphase_plotchan, Gslice_plotchan, numof_plotchan};
00032
00033 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 };
00034 static const char* markLabel[]={"none", "exttrigger", "halttrigger", "snapshot", "reset", "acquisition", "endacq", "excitation", "refocusing", "storeMagn", "recallMagn", "inversion", "saturation" };
00035
00036 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};
00037 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"};
00038 static const char* timecoursePrefix[]={"G", "G", "dG", "k", "M1", "M2", "b", "k", "c", "G"};
00039 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};
00040
00041
00042
00044
00048 struct Curve4Qwt {
00049 Curve4Qwt() : size(0), x(0), y(0), spikes(false), has_freq_phase(false), gradmatrix(0) {}
00050 bool operator == (const Curve4Qwt&) const {return false;}
00051 bool operator < (const Curve4Qwt&) const {return false;}
00052
00053 double get_bounds(bool endpoint) const {if(!size) return 0.0; if(endpoint) return x[size-1]; else return x[0];}
00054
00055 const char* label;
00056 plotChannel channel;
00057
00058 int size;
00059 double* x;
00060 double* y;
00061 bool spikes;
00062
00063 bool has_freq_phase;
00064 double freq;
00065 double phase;
00066
00067 const RotMatrix* gradmatrix;
00068
00069 };
00070
00072
00073
00077 struct Marker4Qwt {
00078 bool operator == (const Marker4Qwt&) const {return false;}
00079 bool operator < (const Marker4Qwt&) const {return false;}
00080 double get_bounds(bool) const {return x;}
00081 const char* label;
00082 double x;
00083 markType type;
00084 };
00085
00087
00091 struct TimecourseMarker4Qwt {
00092 bool operator == (const TimecourseMarker4Qwt&) const {return false;}
00093 bool operator < (const TimecourseMarker4Qwt&) const {return false;}
00094 double get_bounds(bool) const {return x;}
00095 double x;
00096 double y[numof_plotchan];
00097 markType type;
00098 };
00099
00101
00105 struct SeqTimecourseData {
00106 SeqTimecourseData() : size(0), x(0), n_rec_points(0) {for(int i=0; i<numof_plotchan; i++) y[i]=0;}
00107
00108 unsigned int size;
00109 double* x;
00110 double* y[numof_plotchan];
00111 unsigned int n_rec_points;
00112 };
00113
00115
00116 class SeqSimFeedbackAbstract {
00117
00118 public:
00119
00120 virtual void plot_vector(double timepoint, float M[3], float* dM) = 0;
00121
00122 };
00123
00125
00126 class ProgressMeter;
00127
00131 class SeqPlotDataAbstract {
00132
00133 public:
00134 virtual ~SeqPlotDataAbstract() {}
00135
00136 virtual void reset() = 0;
00137
00138 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;
00139
00140 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;
00141
00142 virtual void get_markers(STD_list<Marker4Qwt>::const_iterator& result_begin, STD_list<Marker4Qwt>::const_iterator& result_end, double starttime, double endtime ) const = 0;
00143
00144 virtual bool timecourse_created(timecourseMode type) const = 0;
00145
00146 virtual bool create_timecourses(timecourseMode type, const STD_string& nucleus, ProgressMeter* progmeter) const = 0;
00147
00148 virtual const SeqTimecourseData* get_timecourse(timecourseMode type) const = 0;
00149
00150 virtual const SeqTimecourseData* get_subtimecourse(timecourseMode type, double starttime, double endtime) const = 0;
00151
00152 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;
00153
00154 virtual double get_total_duration() const = 0;
00155
00156 virtual unsigned int n_frames() const = 0;
00157
00158 virtual JcampDxBlock& get_opts(bool timecourse_opts, bool simulation_opts) const = 0;
00159
00160 virtual void set_coilsdir(const STD_string& coilsdir) const = 0;
00161
00162 virtual void add_signal_curve(const Curve4Qwt& signal_curve) const = 0;
00163
00164 virtual bool monitor_simulation() const = 0;
00165
00166 virtual bool simulate(const STD_string& fidfile, const STD_string& samplefile, ProgressMeter* progmeter, SeqSimFeedbackAbstract* feedback) const = 0;
00167
00168 virtual bool has_curves_on_channel(plotChannel chan) const = 0;
00169
00170 };
00171
00172
00173
00179 #endif