31 int first0=0,
int first1=0,
int first2=0);
33 int first0=0,
int first1=0,
int first2=0);
44 virtual bool executeParallel(
bool);
50 inline bool shouldFFT()
const;
72 template <
class T>
inline 89 template <
class T>
inline 91 int first0,
int first1,
int first2 )
100 template <
class T>
inline 111 #define mConvolver3DSetY( dim ) \ 112 const int firsty##dim = correlate_ \ 113 ? -xshift##dim##_-zvar[dim]+yshift##dim##_ \ 114 : zvar[dim]+xshift##dim##_+yshift##dim##_; \ 116 const char y##dim##inc = correlate_ ? 1 : -1 119 #define mConvolver3DSetIndex( dim ) \ 120 const int idy##dim = firsty##dim+idx##dim*y##dim##inc; \ 125 idx##dim += (-idy##dim)-1; \ 132 if ( idy##dim>=ysz##dim ) \ 137 const int diff = idy##dim-(ysz##dim-1); \ 138 idx##dim += diff-1; \ 143 template <
class T>
inline 146 const int xsz0 =
x_->info().getSize( 0 );
147 const int xsz1 =
x_->info().getSize( 1 );
148 const int xsz2 =
x_->info().getSize( 2 );
149 const int ysz0 =
y_->info().getSize( 0 );
150 const int ysz1 =
y_->info().getSize( 1 );
151 const int ysz2 =
y_->info().getSize( 2 );
155 if ( !
z_->info().getArrayPos( start, startpos ) )
159 iterator.
setPos( startpos );
162 const T* xptr_ =
x_->getData();
165 const T* yptr_ =
y_->getData();
167 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
169 const int* zvar = iterator.getPos();
182 for (
int idx1=0; idx1<xsz1; idx1++ )
186 const od_int64 yoffset = ystor_ || yptr_ ?
187 y_->info().getOffset( idy0, idy1, 0 ) : 0;
189 const od_int64 xoffset = xstor_ || xptr_ ?
190 x_->info().getOffset( idx0, idx1, 0 ) : 0;
192 for (
int idx2=0; idx2<xsz2; idx2++ )
197 ? yptr_[yoffset+idy2]
199 ? ystor_->
value( yoffset+idy2 )
200 :
y_->get( idy0, idy1, idy2 );
206 ? xptr_[xoffset+idx2]
208 ? xstor_->
value( xoffset+idx2 )
209 :
x_->get( idx0, idx1, idx2 );
221 if ( !nrsamples )
z_->setND( zvar, 0 );
223 z_->setND( zvar, sum/ysum );
224 else z_->setND( zvar, sum );
228 if ( !iterator.next() && idx!=stop )
236 template <
class T>
inline 246 template <
class T>
inline 254 template <
class T>
inline #define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
virtual T value(int64_t) const =0
bool correlate_
Definition: convolve3d.h:66
Convolves (or correlates) two 3D signals.
Definition: convolve3d.h:25
const Array3D< T > * y_
Definition: convolve3d.h:59
int yshift0_
Definition: convolve3d.h:60
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiString uiMessage() const
will be message() again in 7.x
Definition: convolve3d.h:46
void setY(const Array3D< T > &, int first0=0, int first1=0, int first2=0)
Definition: convolve3d.h:101
od_int64 nrIterations() const
Definition: convolve3d.h:54
#define mIsZero(x, eps)
Definition: commondefs.h:53
#define mCast(tp, v)
Definition: commondefs.h:124
#define od_int64
Definition: plftypes.h:36
int yshift1_
Definition: convolve3d.h:61
virtual bool shouldContinue()
Definition: uistring.h:89
int xshift1_
Definition: convolve3d.h:57
bool shouldFFT() const
Definition: convolve3d.h:255
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
int xshift0_
Definition: convolve3d.h:56
Array3D< T > * z_
Definition: convolve3d.h:64
bool normalize_
Definition: convolve3d.h:65
Convolver3D()
Definition: convolve3d.h:73
#define mConvolver3DSetIndex(dim)
Definition: convolve3d.h:119
void setPos(const T &idxabl)
Definition: arraynd.h:256
void setNormalize(bool n)
Definition: convolve3d.h:35
Interface to a series of values.
Definition: odmemory.h:17
int yshift2_
Definition: convolve3d.h:62
int xshift2_
Definition: convolve3d.h:58
void setCorrelate(bool yn)
Definition: convolve3d.h:38
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: convolve3d.h:47
virtual bool executeParallel(bool parallel)
#define mConvolver3DSetY(dim)
Definition: convolve3d.h:111
bool doFFT()
Definition: convolve3d.h:247
Iterates through all samples in an ArrayND.
Definition: arraynd.h:179
virtual bool executeParallel(bool)
Definition: convolve3d.h:237
void setX(const Array3D< T > &, int first0=0, int first1=0, int first2=0)
Definition: convolve3d.h:90
void setZ(Array3D< T > &z)
Definition: convolve3d.h:34
const Array3D< T > * x_
Definition: convolve3d.h:55
#define mClass(module)
Definition: commondefs.h:164
void setHasUdfs(bool yn)
Default is false.
Definition: convolve3d.h:41
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
void addToNrDone(int64_t increment)
bool doWork(od_int64, od_int64, int)
Definition: convolve3d.h:144
bool hasudfs_
Definition: convolve3d.h:68