ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkFFTConvolutionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkFFTConvolutionImageFilter_h
19 #define __itkFFTConvolutionImageFilter_h
20 
22 
23 #include "itkProgressAccumulator.h"
27 
28 namespace itk
29 {
53 template< typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage, typename TInternalPrecision=double >
55  public ConvolutionImageFilterBase< TInputImage, TKernelImage, TOutputImage >
56 
57 {
58 public:
60  typedef ConvolutionImageFilterBase< TInputImage,
61  TKernelImage,
62  TOutputImage >
66 
68  itkNewMacro(Self);
69 
72 
74  itkStaticConstMacro(ImageDimension, unsigned int,
75  TInputImage::ImageDimension);
76 
77  typedef TInputImage InputImageType;
78  typedef TOutputImage OutputImageType;
79  typedef TKernelImage KernelImageType;
80  typedef typename InputImageType::PixelType InputPixelType;
81  typedef typename OutputImageType::PixelType OutputPixelType;
82  typedef typename KernelImageType::PixelType KernelPixelType;
83  typedef typename InputImageType::IndexType InputIndexType;
84  typedef typename OutputImageType::IndexType OutputIndexType;
85  typedef typename KernelImageType::IndexType KernelIndexType;
86  typedef typename InputImageType::SizeType InputSizeType;
87  typedef typename OutputImageType::SizeType OutputSizeType;
88  typedef typename KernelImageType::SizeType KernelSizeType;
90  typedef typename InputImageType::RegionType InputRegionType;
91  typedef typename OutputImageType::RegionType OutputRegionType;
92  typedef typename KernelImageType::RegionType KernelRegionType;
93 
97  typedef std::complex< TInternalPrecision > InternalComplexType;
100 
104 
105 protected:
108 
117 
126 
128  void GenerateData();
129 
134  void PrepareInputs(const InputImageType * input,
135  const KernelImageType * kernel,
136  InternalComplexImagePointerType & preparedInput,
137  InternalComplexImagePointerType & preparedKernel,
138  ProgressAccumulator * progress, float progressWeight);
139 
142  void PrepareInput(const InputImageType * input,
143  InternalComplexImagePointerType & preparedInput,
144  ProgressAccumulator * progress, float progressWeight);
145 
147  void PadInput(const InputImageType * input,
148  InternalImagePointerType & paddedInput,
149  ProgressAccumulator * progress, float progressWeight);
150 
152  void TransformPaddedInput(const InternalImageType * paddedInput,
153  InternalComplexImagePointerType & transformedInput,
154  ProgressAccumulator * progress, float progressWeight);
155 
159  void PrepareKernel(const KernelImageType * kernel,
160  InternalComplexImagePointerType & preparedKernel,
161  ProgressAccumulator * progress, float progressWeight);
162 
164  void ProduceOutput(InternalComplexImageType * paddedOutput,
165  ProgressAccumulator * progress,
166  float progressWeight);
167 
169  void CropOutput(InternalImageType * paddedOutput,
170  ProgressAccumulator * progress,
171  float progressWeight);
172 
180 
182  InputSizeType GetPadSize() const;
183 
185  bool GetXDimensionIsOdd() const;
186 
187 private:
188  FFTConvolutionImageFilter(const Self &); //purposely not implemented
189  void operator=(const Self &); //purposely not implemented
190 };
191 }
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkFFTConvolutionImageFilter.hxx"
195 #endif
196 
197 #endif
OutputImageType::RegionType OutputRegionType
InputImageType::RegionType InputRegionType
RealToHalfHermitianForwardFFTImageFilter< InternalImageType, InternalComplexImageType > FFTFilterType
Superclass::BoundaryConditionType BoundaryConditionType
HalfHermitianToRealInverseFFTImageFilter< InternalComplexImageType, InternalImageType > IFFTFilterType
InternalComplexImageType::Pointer InternalComplexImagePointerType
InputSizeType::SizeValueType SizeValueType
void PadInput(const InputImageType *input, InternalImagePointerType &paddedInput, ProgressAccumulator *progress, float progressWeight)
Abstract base class for the convolution image filters.
void operator=(const Self &)
void TransformPaddedInput(const InternalImageType *paddedInput, InternalComplexImagePointerType &transformedInput, ProgressAccumulator *progress, float progressWeight)
Superclass::BoundaryConditionPointerType BoundaryConditionPointerType
Base class for all process objects that output image data.
InternalImageType::Pointer InternalImagePointerType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Convolve a given image with an arbitrary image kernel using multiplication in the Fourier domain...
Base class for specialized complex-to-real inverse Fast Fourier Transform.
BoundaryConditionType * BoundaryConditionPointerType
void PrepareInput(const InputImageType *input, InternalComplexImagePointerType &preparedInput, ProgressAccumulator *progress, float progressWeight)
Image< InternalComplexType, TInputImage::ImageDimension > InternalComplexImageType
KernelImageType::RegionType KernelRegionType
InputSizeType GetPadLowerBound() const
void PrepareKernel(const KernelImageType *kernel, InternalComplexImagePointerType &preparedKernel, ProgressAccumulator *progress, float progressWeight)
Facilitates progress reporting for filters that wrap around multiple other filters.
OutputImageType::PixelType OutputPixelType
void PrepareInputs(const InputImageType *input, const KernelImageType *kernel, InternalComplexImagePointerType &preparedInput, InternalComplexImagePointerType &preparedKernel, ProgressAccumulator *progress, float progressWeight)
ConvolutionImageFilterBase< TInputImage, TKernelImage, TOutputImage > Superclass
InputSizeType GetPadSize() const
OutputImageType::IndexType OutputIndexType
void CropOutput(InternalImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)
KernelImageType::IndexType KernelIndexType
Base class for specialized real-to-complex forward Fast Fourier Transform.
KernelImageType::PixelType KernelPixelType
Image< TInternalPrecision, TInputImage::ImageDimension > InternalImageType
Templated n-dimensional image class.
Definition: itkImage.h:75
std::complex< TInternalPrecision > InternalComplexType
ImageBoundaryCondition< TInputImage > BoundaryConditionType
void ProduceOutput(InternalComplexImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)