seqgradramp.h
1 /***************************************************************************
2  seqgradramp.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 SEQGRADRAMP_H
19 #define SEQGRADRAMP_H
20 
21 #include <odinseq/seqgradwave.h>
22 
23 
24 
25 
42 enum rampType {linear, sinusoidal, half_sinusoidal};
43 
44 
46 
52 class SeqGradRamp : public SeqGradWave {
53 
54  public:
55 
68  SeqGradRamp(const STD_string& object_label,direction gradchannel,
69  float initgradstrength, float finalgradstrength, double timestep,rampType type = linear,
70  float steepnessfactor=1.0, bool reverse = false);
71 
82  SeqGradRamp(const STD_string& object_label,direction gradchannel,double gradduration,
83  float initgradstrength, float finalgradstrength, double timestep,
84  rampType type = linear, bool reverse = false);
85 
86 
90  SeqGradRamp(const SeqGradRamp& sgr);
91 
95  SeqGradRamp(const STD_string& object_label = "unnamedSeqGradRamp");
96 
108  SeqGradRamp& set_ramp(float initgradstrength, float finalgradstrength,
109  double timestep,rampType type = linear,float steepnessfactor=1.0, bool reverse = false);
110 
111 
121  SeqGradRamp& set_ramp(double gradduration,float initgradstrength,
122  float finalgradstrength, double timestep,rampType type = linear, bool reverse = false);
123 
127  rampType get_ramptype() const {return ramptype;}
128 
129 
133  SeqGradRamp& operator = (const SeqGradRamp& sgr);
134 
135 
136  // helper functions
137  static fvector makeGradRamp(rampType type, float beginVal, float endVal, unsigned int n_vals, bool reverseramp);
138  static unsigned int npts4ramp(rampType type, float beginVal, float endVal, float maxIncrement);
139  static unsigned int npts4ramp(double totaldur, double timestep);
140 
141 
142  // overloading functions from SeqGradInterface
143  SeqGradInterface& set_strength(float gradstrength);
144 
145  private:
146  void generate_ramp();
147 
148  float initstrength;
149  float finalstrength;
150  double dt;
151  float steepness;
152  bool steepcontrol;
153  rampType ramptype;
154  bool reverseramp;
155 
156 };
157 
161 #endif
rampType get_ramptype() const
Definition: seqgradramp.h:127
SeqGradRamp(const STD_string &object_label, direction gradchannel, float initgradstrength, float finalgradstrength, double timestep, rampType type=linear, float steepnessfactor=1.0, bool reverse=false)
SeqGradRamp & set_ramp(float initgradstrength, float finalgradstrength, double timestep, rampType type=linear, float steepnessfactor=1.0, bool reverse=false)
SeqGradInterface & set_strength(float gradstrength)
Gradient Ramp.
Definition: seqgradramp.h:52
rampType
Definition: seqgradramp.h:42
Gradient Waveform.
Definition: seqgradwave.h:36
direction
Definition: odinpara.h:38
SeqGradRamp & operator=(const SeqGradRamp &sgr)