OpendTect-6_4  6.4
valseriestracker.h
Go to the documentation of this file.
1 #ifndef valseriestracker_h
2 #define valseriestracker_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H.Bril
9  Date: Dec 2006
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "algomod.h"
16 #include "valseriesevent.h"
17 
18 template <class T> class ValueSeries;
19 
20 
27 {
28 public:
29  ValSeriesTracker();
30  virtual ~ValSeriesTracker() {}
31  virtual const char* type() = 0;
32 
33  virtual bool isOK() const;
36  virtual void setSource(const ValueSeries<float>*,int sz,float depth);
37  virtual void setTarget(const ValueSeries<float>*,int sz,
38  float initialdepth);
39 
40  virtual bool track() = 0;
43  virtual float targetValue() const { return targetvalue_; }
44  virtual float targetDepth() const { return targetdepth_; }
45  virtual float quality() const { return 1; }
46 
47  virtual void fillPar(IOPar& par) const {}
48  virtual bool usePar(const IOPar& par) { return true; }
49 
50 protected:
51 
53  float sourcedepth_;
56  float targetdepth_;
58  float targetvalue_;
59 };
60 
61 
67 {
68 public:
69  EventTracker();
70 
71  const char* type() { return sType(); }
72  static const char* sType() { return "EventTracker"; }
73 
74  enum CompareMethod { None, SeedTrace, AdjacentParent };
76 
77  void setCompareMethod(CompareMethod);
78  CompareMethod getCompareMethod() const;
79 
80  static const char** sEventNames();
81  static const VSEvent::Type* cEventTypes();
82  static int getEventTypeIdx(VSEvent::Type);
83 
84  virtual bool isOK() const;
85 
86  void setSeed(const ValueSeries<float>*,int sz,
87  float depth);
88 
89  void setRangeStep(float step) { rangestep_ = step; }
90  float getRangeStep() const { return rangestep_; }
91  void setPermittedRange(const Interval<float>& rg);
92  //<!Is divided by rangestep to get nrof samples
93  const Interval<float>& permittedRange() const;
94  void setTrackEvent(VSEvent::Type ev);
112  VSEvent::Type trackEvent() const;
113  void allowAmplitudeSignChange(bool);
117  bool isAmplitudeSignChangeAllowed() const;
118  bool snap(const Interval<float>& amplrg);
119  bool snap(float threshold);
125  void useSimilarity(bool yn);
126  bool usesSimilarity() const;
127  void normalizeSimilarityValues(bool yn);
128  bool normalizesSimilarityValues() const;
129 
130  void setUseAbsThreshold(bool abs);
138  bool useAbsThreshold() const;
139 
140  void setAmplitudeThreshold(float th);
142  float amplitudeThreshold() const;
143 
144  void setAmplitudeThresholds(const TypeSet<float>&);
145  TypeSet<float>& getAmplitudeThresholds();
146 
147  void setAllowedVariance(float v);
149  float allowedVariance() const;
150 
151  void setAllowedVariances(const TypeSet<float>& avs);
152  TypeSet<float>& getAllowedVariances();
153 
154  void setSimilarityWindow(const Interval<float>& rg);
155  const Interval<float>& similarityWindow() const;
156  void setSimilarityThreshold(float th);
157  float similarityThreshold() const;
158 
159  void setSnapToEvent(bool);
160  bool snapToEvent() const;
161 
162  bool track();
163  float quality() const { return quality_; }
164 
165  void fillPar(IOPar& par) const;
166  bool usePar(const IOPar& par);
167 
168 protected:
169 
172  const Interval<float>&,float,float&,bool&,float&) const;
175  const Interval<float>& zrg,
176  const Interval<float>& amplrg,float& avgampl,
177  bool& hasloopskips,float& troughampl) const;
178  bool findMaxSimilarity(int nrtests,int step,int nrgracetests,
179  float& res,float& maxsim,
180  bool& flatstart) const;
181  bool isTargetValueAllowed() const;
182 
188  float allowedvar_;
192  float rangestep_;
197  bool dosnap_;
198  float quality_;
200 
202  float seeddepth_;
204 
205  static const char* sKeyPermittedRange();
206  static const char* sKeyValueThreshold();
207  static const char* sKeyValueThresholds();
208  static const char* sKeyAllowedVariance();
209  static const char* sKeyAllowedVariances();
210  static const char* sKeyUseAbsThreshold();
211  static const char* sKeySimWindow();
212  static const char* sKeySimThreshold();
213  static const char* sKeyNormSimi();
214  static const char* sKeyTrackByValue();
215  static const char* sKeyTrackEvent();
216  static const char* sKeyCompareMethod();
217  static const char* sKeyAttribID();
218  static const char* sKeySnapToEvent();
219  static const char* sKeyAllowSignChg();
220 
221 };
222 
223 #endif
#define mExpClass(module)
Definition: commondefs.h:160
TypeSet< float > allowedvars_
Definition: valseriestracker.h:189
Definition: valseriestracker.h:74
bool dosnap_
Definition: valseriestracker.h:197
bool usesimilarity_
Definition: valseriestracker.h:194
Interval< float > similaritywin_
Definition: valseriestracker.h:191
float seeddepth_
Definition: valseriestracker.h:202
virtual bool usePar(const IOPar &par)
Definition: valseriestracker.h:48
float getRangeStep() const
Definition: valseriestracker.h:90
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
float targetvalue_
Definition: valseriestracker.h:58
float allowedvar_
Definition: valseriestracker.h:188
const char * type()
Definition: valseriestracker.h:71
virtual void fillPar(IOPar &par) const
Definition: valseriestracker.h:47
static const char * sType()
Definition: valseriestracker.h:72
const ValueSeries< float > * targetvs_
Definition: valseriestracker.h:55
Base class for a tracker that tracks something (e.g. min, max, a certain value)++ from one ValueSerie...
Definition: valseriestracker.h:26
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
FixedString None()
Definition: keystrs.h:90
float sourcedepth_
Definition: valseriestracker.h:53
float findExtreme(const FloatMathFunction &, bool minima, float x1, float x2, float tol=1e-5)
float ampthreshold_
Definition: valseriestracker.h:186
virtual bool isOK() const
Definition: valseries.h:41
bool normalizesimi_
Definition: valseriestracker.h:195
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
virtual float quality() const
Definition: valseriestracker.h:45
Event in value series.
Definition: valseriesevent.h:40
const ValueSeries< float > * sourcevs_
Definition: valseriestracker.h:52
Interface to a series of values.
Definition: odmemory.h:17
virtual float targetDepth() const
Definition: valseriestracker.h:44
Event finder in gate.
Definition: valseriesevent.h:65
virtual ~ValSeriesTracker()
Definition: valseriestracker.h:30
Tracker that tracks Min/Max & Zero crossings between valueseries.
Definition: valseriestracker.h:66
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
float quality() const
Definition: valseriestracker.h:163
bool allowamplsignchg_
Definition: valseriestracker.h:199
TypeSet< float > ampthresholds_
Definition: valseriestracker.h:187
int seedsize_
Definition: valseriestracker.h:203
bool useabsthreshold_
Definition: valseriestracker.h:190
CompareMethod comparemethod_
Definition: valseriestracker.h:185
float targetdepth_
Definition: valseriestracker.h:56
const ValueSeries< float > * seedvs_
Definition: valseriestracker.h:201
float compareampl_
Definition: valseriestracker.h:196
float quality_
Definition: valseriestracker.h:198
CompareMethod
Definition: valseriestracker.h:74
int targetsize_
Definition: valseriestracker.h:57
float rangestep_
Definition: valseriestracker.h:192
void setRangeStep(float step)
Definition: valseriestracker.h:89
Type
Definition: valseriesevent.h:26
VSEvent::Type evtype_
Definition: valseriestracker.h:183
int sourcesize_
Definition: valseriestracker.h:54
Interval< float > permrange_
Definition: valseriestracker.h:184
virtual float targetValue() const
Definition: valseriestracker.h:43
float similaritythreshold_
Definition: valseriestracker.h:193

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019