17 #ifndef __itkFFTShiftImageFilter_txx
18 #define __itkFFTShiftImageFilter_txx
21 #include "itkNumericTraits.h"
28 template <
class TInputImage,
class TOutputImage>
36 template <
class TInputImage,
class TOutputImage>
42 Superclass::GenerateInputRequestedRegion();
48 input->SetRequestedRegion( input->GetLargestPossibleRegion() );
52 template<
class TInputImage,
class TOutputImage>
59 ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels() );
62 const IndexType oIdx = this->GetOutput()->GetLargestPossibleRegion().GetIndex();
63 const SizeType oSize = this->GetOutput()->GetLargestPossibleRegion().GetSize();
70 for(
int i=0; i<ImageDimension; i++)
72 if( oSize[i] % 2 == 1 )
76 seg1Size[i] = oSize[i] / 2 + 1;
77 seg2Size[i] = oSize[i] / 2;
81 seg1Size[i] = oSize[i] / 2;
82 seg2Size[i] = oSize[i] / 2 + 1;
87 seg1Size[i] = oSize[i] / 2;
88 seg2Size[i] = oSize[i] / 2;
98 for(
int i=0; i<ImageDimension; i++ )
100 if( idx[i] < (
int)(oIdx[i] + seg2Size[i]) )
102 idx[i] = idx[i] + seg1Size[i];
106 idx[i] = idx[i] - seg2Size[i];
110 oIt.
Set( static_cast< OutputImagePixelType >( this->GetInput()->GetPixel( idx ) ) );
111 progress.CompletedPixel();
118 template<
class TInputImage,
class TOutputImage>
123 Superclass::PrintSelf(os, indent);
125 os << indent <<
"Inverse: " << m_Inverse << std::endl;