 |
OpendTect
6.6
|
Go to the documentation of this file.
30 int first0=0,
int first1=0,
int first2=0);
32 int first0=0,
int first1=0,
int first2=0);
71 template <
class T>
inline
88 template <
class T>
inline
90 int first0,
int first1,
int first2 )
99 template <
class T>
inline
110 #define mConvolver3DSetY( dim ) \
111 const int firsty##dim = correlate_ \
112 ? -xshift##dim##_-zvar[dim]+yshift##dim##_ \
113 : zvar[dim]+xshift##dim##_+yshift##dim##_; \
115 const char y##dim##inc = correlate_ ? 1 : -1
118 #define mConvolver3DSetIndex( dim ) \
119 const int idy##dim = firsty##dim+idx##dim*y##dim##inc; \
124 idx##dim += (-idy##dim)-1; \
131 if ( idy##dim>=ysz##dim ) \
136 const int diff = idy##dim-(ysz##dim-1); \
137 idx##dim += diff-1; \
142 template <
class T>
inline
145 const int xsz0 = x_->info().getSize( 0 );
146 const int xsz1 = x_->info().getSize( 1 );
147 const int xsz2 = x_->info().getSize( 2 );
148 const int ysz0 = y_->info().getSize( 0 );
149 const int ysz1 = y_->info().getSize( 1 );
150 const int ysz2 = y_->info().getSize( 2 );
154 if ( !z_->info().getArrayPos( start, startpos ) )
158 iterator.
setPos( startpos );
161 const T* xptr_ = x_->getData();
164 const T* yptr_ = y_->getData();
166 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
168 const int* zvar = iterator.
getPos();
177 for (
int idx0=0; idx0<xsz0 && shouldContinue(); idx0++ )
181 for (
int idx1=0; idx1<xsz1; idx1++ )
185 const od_int64 yoffset = ystor_ || yptr_ ?
186 y_->info().getOffset( idy0, idy1, 0 ) : 0;
188 const od_int64 xoffset = xstor_ || xptr_ ?
189 x_->info().getOffset( idx0, idx1, 0 ) : 0;
191 for (
int idx2=0; idx2<xsz2; idx2++ )
196 ? yptr_[yoffset+idy2]
198 ? ystor_->
value( yoffset+idy2 )
199 : y_->get( idy0, idy1, idy2 );
205 ? xptr_[xoffset+idx2]
207 ? xstor_->
value( xoffset+idx2 )
208 : x_->get( idx0, idx1, idx2 );
220 if ( !nrsamples ) z_->setND( zvar, 0 );
221 else if ( normalize_ && !
mIsZero(ysum,1e-8) )
222 z_->setND( zvar, sum/ysum );
223 else z_->setND( zvar, sum );
227 if ( !iterator.
next() && idx!=stop )
235 template <
class T>
inline
245 template <
class T>
inline
253 template <
class T>
inline
Interface to a series of values.
Definition: odmemory.h:16
const Array3D< T > * x_
Definition: convolve3d.h:54
virtual bool executeParallel(bool parallel)
void setZ(Array3D< T > &z)
Definition: convolve3d.h:33
bool doWork(od_int64, od_int64, int)
Definition: convolve3d.h:143
virtual T value(int64_t) const =0
int xshift1_
Definition: convolve3d.h:56
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:289
#define od_int64
Definition: plftypes.h:35
#define mConvolver3DSetY(dim)
Definition: convolve3d.h:110
int xshift0_
Definition: convolve3d.h:55
bool hasudfs_
Definition: convolve3d.h:67
const Array3D< T > * y_
Definition: convolve3d.h:58
Array3D< T > * z_
Definition: convolve3d.h:63
bool normalize_
Definition: convolve3d.h:64
mODTextTranslationClass(Convolver3D)
int yshift1_
Definition: convolve3d.h:60
#define mConvolver3DSetIndex(dim)
Definition: convolve3d.h:118
int yshift2_
Definition: convolve3d.h:61
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:162
void setPos(const T &idxabl)
Definition: arraynd.h:285
#define mIsZero(x, eps)
Definition: commondefs.h:66
void setX(const Array3D< T > &, int first0=0, int first1=0, int first2=0)
Definition: convolve3d.h:89
uiString uiMessage() const
will be message() again in 7.x
Definition: convolve3d.h:45
#define mClass(module)
Definition: commondefs.h:181
const int * getPos() const
Definition: arraynd.h:220
Iterates through all samples in an ArrayND.
Definition: arraynd.h:209
void setHasUdfs(bool yn)
Default is false.
Definition: convolve3d.h:40
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: convolve3d.h:46
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mCast(tp, v)
Definition: commondefs.h:137
Convolver3D()
Definition: convolve3d.h:72
bool shouldFFT() const
Definition: convolve3d.h:254
int xshift2_
Definition: convolve3d.h:57
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
void setNormalize(bool n)
Definition: convolve3d.h:34
bool correlate_
Definition: convolve3d.h:65
virtual bool executeParallel(bool)
Definition: convolve3d.h:236
void setCorrelate(bool yn)
Definition: convolve3d.h:37
od_int64 nrIterations() const
Definition: convolve3d.h:53
int yshift0_
Definition: convolve3d.h:59
bool doFFT()
Definition: convolve3d.h:246
void setY(const Array3D< T > &, int first0=0, int first1=0, int first2=0)
Definition: convolve3d.h:100
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