seqgradwave.h
1 /***************************************************************************
2  seqgradwave.h - description
3  -------------------
4  begin : Tue Aug 13 2002
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 SEQGRADWAVE_H
19 #define SEQGRADWAVE_H
20 
21 #include <odinseq/seqgradchan.h>
22 
23 
36 class SeqGradWave : public SeqGradChan {
37 
38  public:
39 
47  SeqGradWave(const STD_string& object_label,direction gradchannel, double gradduration,
48  float maxgradstrength,const fvector& waveform);
49 
50 
54  SeqGradWave(const SeqGradWave& sgw);
55 
59  SeqGradWave(const STD_string& object_label = "unnamedSeqGradWave");
60 
64  SeqGradWave& set_wave(const fvector& waveform);
65 
69  const fvector& get_wave() const {return wave;}
70 
71 
75  float get_integral(double tmin, double tmax) const;
76 
77 
81  unsigned int get_npts() const;
82 
86  unsigned int size() const {return get_npts();}
87 
91  double get_timestep() const {return secureDivision(get_gradduration(),double(get_npts()));}
92 
96  float operator [] (unsigned int i) const {return wave[i];}
97 
98 
102  SeqGradWave& operator = (const SeqGradWave& sgw);
103 
104 
105  protected:
106  fvector wave;
107 
108  private:
109 
110  // overwriting virtual functions from SeqClass
111  bool prep();
112 
113  // overwriting virtual functions from SeqGradChan
114  int get_wavesize() const;
115  void resize(unsigned int newsize);
116  SeqGradChan& get_subchan(double starttime, double endtime) const;
117  STD_string get_grdpart(float matrixfactor) const;
118  float get_integral() const {return get_integral(0.0,get_gradduration());}
119 
120  void check_wave();
121 
122 };
123 
124 
128 #endif
SeqGradWave & operator=(const SeqGradWave &sgw)
unsigned int size() const
Definition: seqgradwave.h:86
double get_timestep() const
Definition: seqgradwave.h:91
float operator[](unsigned int i) const
Definition: seqgradwave.h:96
float get_integral(double tmin, double tmax) const
const fvector & get_wave() const
Definition: seqgradwave.h:69
Gradient Waveform.
Definition: seqgradwave.h:36
direction
Definition: odinpara.h:38
double secureDivision(double numerator, double denominator)
double get_gradduration() const
Definition: seqgradchan.h:139
SeqGradWave(const STD_string &object_label, direction gradchannel, double gradduration, float maxgradstrength, const fvector &waveform)
SeqGradWave & set_wave(const fvector &waveform)
unsigned int get_npts() const