 |
OpendTect
6.6
|
Go to the documentation of this file.
36 int sz0,
int sz1,
int sz2);
50 static const char*
sKeyWinFunc() {
return "Window function"; }
64 template <
class T>
inline
66 : windowparam_(
mUdf(float) )
75 template <
class T>
inline
77 {
return window_.info().getSize( dim ); }
80 template <
class T>
inline
82 {
return windowname_.buf(); }
85 template <
class T>
inline
87 {
return windowparam_; }
90 template <
class T>
inline
93 convolver_.setX( ni, 0, 0, 0 );
97 template <
class T>
inline
100 convolver_.setZ( no );
104 template <
class T>
inline
106 int sz0,
int sz1,
int sz2 )
115 if ( sz0<=0 || sz1<=0 || sz2<=0 )
118 window_.setSize( sz0, sz1, sz2 );
119 if ( !window_.isOK() )
122 const int hsz0 = sz0/2;
const int hsz1 = sz1/2;
const int hsz2 = sz2/2;
125 for (
int idx0=0; idx0<sz0; idx0++ )
127 pos[0] = hsz0 ? ((double)(idx0-hsz0))/hsz0 : 0;
128 for (
int idx1=0; idx1<sz1; idx1++ )
130 pos[1] = hsz1 ? ((double)(idx1-hsz1))/hsz1 : 0;
131 for (
int idx2=0; idx2<sz2; idx2++ )
133 pos[2] = hsz2 ? ((double)(idx2-hsz2))/hsz2 : 0;
135 window_.set( idx0, idx1, idx2,
141 convolver_.setY( window_, hsz0, hsz1, hsz2 );
144 windowparam_ = (float) ( wf->
hasVariable() ? param : 1e30 );
150 template <
class T>
inline
153 par.
set( sKeyWinFunc(), windowname_ );
154 if ( !
mIsUdf(windowparam_) )
155 par.
set( sKeyWinParam(), windowparam_ );
156 par.
set( sKeyWinSize(), window_.info().getSize(0),window_.info().getSize(1),
157 window_.info().getSize(2) );
161 template <
class T>
inline
165 if ( !par.
get(sKeyWinSize(), sz0, sz1, sz2 ) )
168 const char* wn = par.
find( sKeyWinFunc() );
169 float var =
mUdf(
float);
170 par.
get( sKeyWinParam(), var );
172 return setWindow( wn, var, sz0, sz1, sz2 );
176 #define mImplSetFunc( func, vartype ) \
177 template <class T> inline void Smoother3D<T>::func( vartype var ) \
178 { convolver_.func( var ); }
184 template <
class T>
inline
187 if ( !window_.isOK() )
190 return convolver_.execute();
194 template <
class T>
inline
196 {
return convolver_.getState(); }
void set(const char *ky, const char *val)
A cartesian coordinate in 3D space.
Definition: coord.h:72
void enableWorkControl(bool)
Must be called before execute()
Definition: smoother3d.h:181
const char * getWindowName() const
Definition: smoother3d.h:81
bool get(const char *, short &) const
Convolver3D< T > convolver_
Definition: smoother3d.h:56
bool setWindow(const char *nm, float param, int sz0, int sz1, int sz2)
Definition: smoother3d.h:105
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
static const char * sKeyWinFunc()
Definition: smoother3d.h:50
is an interface where processes can report their progress.
Definition: progressmeter.h:21
virtual bool hasVariable() const
Definition: windowfunction.h:30
Implementation of Array3D.
Definition: arrayndimpl.h:151
Control
Definition: task.h:55
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:162
int getWindowSize(int dim) const
Definition: smoother3d.h:76
static const char * sKeyWinParam()
Definition: smoother3d.h:51
Task::Control getState() const
Definition: smoother3d.h:195
Generalization of something (e.g. a computation) that needs to be done in multiple steps.
Definition: task.h:28
#define mClass(module)
Definition: commondefs.h:181
bool execute()
Definition: smoother3d.h:185
void controlWork(Task::Control)
Definition: smoother3d.h:182
#define mImplSetFunc(func, vartype)
Definition: smoother3d.h:176
Smoothes a 3d signal with an operator.
Definition: smoother3d.h:27
virtual bool setVariable(float)
Definition: windowfunction.h:32
void fillPar(IOPar &) const
Definition: smoother3d.h:151
BufferString windowname_
Definition: smoother3d.h:59
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
void setProgressMeter(ProgressMeter *pm)
Must be called before execute()
Definition: smoother3d.h:180
bool usePar(const IOPar &)
Definition: smoother3d.h:162
static const char * sKeyWinSize()
Definition: smoother3d.h:52
const char * find(const char *) const
returns null if not found
virtual RT getValue(PT) const =0
void setInput(const Array3D< T > &)
Definition: smoother3d.h:91
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
float getWindowParam() const
Definition: smoother3d.h:86
Array3DImpl< T > window_
Definition: smoother3d.h:58
void setOutput(Array3D< T > &)
Definition: smoother3d.h:98
Smoother3D()
Definition: smoother3d.h:65
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:55
float windowparam_
Definition: smoother3d.h:60
Convolves (or correlates) two 3D signals.
Definition: convolve3d.h:25
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021