ITK  4.8.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  itkSetMacro(SizeGreatestPrimeFactor, SizeValueType);
106  itkGetMacro(SizeGreatestPrimeFactor, SizeValueType);
107 
108 protected:
111 
120 
128  void GenerateInputRequestedRegion() ITK_OVERRIDE;
129 
131  void GenerateData() ITK_OVERRIDE;
132 
137  void PrepareInputs(const InputImageType * input,
138  const KernelImageType * kernel,
139  InternalComplexImagePointerType & preparedInput,
140  InternalComplexImagePointerType & preparedKernel,
141  ProgressAccumulator * progress, float progressWeight);
142 
145  void PrepareInput(const InputImageType * input,
146  InternalComplexImagePointerType & preparedInput,
147  ProgressAccumulator * progress, float progressWeight);
148 
150  void PadInput(const InputImageType * input,
151  InternalImagePointerType & paddedInput,
152  ProgressAccumulator * progress, float progressWeight);
153 
155  void TransformPaddedInput(const InternalImageType * paddedInput,
156  InternalComplexImagePointerType & transformedInput,
157  ProgressAccumulator * progress, float progressWeight);
158 
162  void PrepareKernel(const KernelImageType * kernel,
163  InternalComplexImagePointerType & preparedKernel,
164  ProgressAccumulator * progress, float progressWeight);
165 
167  void ProduceOutput(InternalComplexImageType * paddedOutput,
168  ProgressAccumulator * progress,
169  float progressWeight);
170 
172  void CropOutput(InternalImageType * paddedOutput,
173  ProgressAccumulator * progress,
174  float progressWeight);
175 
183 
185  InputSizeType GetPadSize() const;
186 
188  bool GetXDimensionIsOdd() const;
189 
190  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
191 
192 private:
193  FFTConvolutionImageFilter(const Self &); //purposely not implemented
194  void operator=(const Self &); //purposely not implemented
195 
197 };
198 }
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 #include "itkFFTConvolutionImageFilter.hxx"
202 #endif
203 
204 #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 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
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void CropOutput(InternalImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)
KernelImageType::IndexType KernelIndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for specialized real-to-complex forward Fast Fourier Transform.
KernelImageType::PixelType KernelPixelType
Image< TInternalPrecision, TInputImage::ImageDimension > InternalImageType
void GenerateInputRequestedRegion() override
Templated n-dimensional image class.
Definition: itkImage.h:75
std::complex< TInternalPrecision > InternalComplexType
ImageBoundaryCondition< TInputImage > BoundaryConditionType
void ProduceOutput(InternalComplexImageType *paddedOutput, ProgressAccumulator *progress, float progressWeight)