17 #ifndef __itkDftImageFilter_txx
18 #define __itkDftImageFilter_txx
25 #include <itkImageRegionConstIterator.h>
26 #include <itkImageRegionConstIteratorWithIndex.h>
27 #include <itkImageRegionIterator.h>
29 #define _USE_MATH_DEFINES
34 template<
class TPixelType >
38 this->SetNumberOfRequiredInputs( 1 );
41 template<
class TPixelType >
48 template<
class TPixelType >
54 ImageRegionIterator< OutputImageType > oit(outputImage, outputRegionForThread);
56 typedef ImageRegionConstIterator< InputImageType > InputIteratorType;
60 int szy = outputImage->GetLargestPossibleRegion().GetSize(1);
62 while( !oit.IsAtEnd() )
64 double kx = oit.GetIndex()[0];
65 double ky = oit.GetIndex()[1];
88 vcl_complex<double> s(0,0);
89 InputIteratorType it(inputImage, inputImage->GetLargestPossibleRegion() );
90 while( !it.IsAtEnd() )
92 int x = it.GetIndex()[0];
93 int y = it.GetIndex()[1];
106 vcl_complex<double> f(it.Get().real(), it.Get().imag());
108 s += f * exp( std::complex<double>(0, -2 *
M_PI * (kx*(
double)x/szx + ky*(
double)y/szy) ) );
itk::SmartPointer< Self > Pointer
Superclass::OutputImageType OutputImageType
Superclass::OutputImageRegionType OutputImageRegionType
Image class for storing images.
const RegionType & GetLargestPossibleRegion() const
void BeforeThreadedGenerateData()
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)