ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFFTWInverseFFTImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkFFTWInverseFFTImageFilter_h
00019 #define __itkFFTWInverseFFTImageFilter_h
00020 
00021 #include "itkInverseFFTImageFilter.h"
00022 
00023 #include "itkFFTWCommon.h"
00024 
00025 namespace itk
00026 {
00048 template< class TInputImage, class TOutputImage=Image< typename TInputImage::PixelType::value_type, TInputImage::ImageDimension> >
00049 class ITK_EXPORT FFTWInverseFFTImageFilter:
00050   public InverseFFTImageFilter< TInputImage, TOutputImage >
00051 {
00052 public:
00054   typedef TInputImage                          InputImageType;
00055   typedef typename InputImageType::PixelType   InputPixelType;
00056   typedef typename InputImageType::SizeType    InputSizeType;
00057   typedef TOutputImage                         OutputImageType;
00058   typedef typename OutputImageType::PixelType  OutputPixelType;
00059   typedef typename OutputImageType::SizeType   OutputSizeType;
00060 
00061   typedef FFTWInverseFFTImageFilter                                Self;
00062   typedef InverseFFTImageFilter< InputImageType, OutputImageType > Superclass;
00063   typedef SmartPointer< Self >                                     Pointer;
00064   typedef SmartPointer< const Self >                               ConstPointer;
00065 
00071   typedef typename fftw::Proxy< OutputPixelType > FFTWProxyType;
00072 
00073   typedef typename OutputImageType::RegionType OutputImageRegionType;
00074 
00076   itkNewMacro(Self);
00077 
00079   itkTypeMacro(FFTWInverseFFTImageFilter,
00080                InverseFFTImageFilter);
00081 
00083   itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
00084 
00092   virtual void SetPlanRigor( const int & value )
00093   {
00094     // Use that method to check the value.
00095     FFTWGlobalConfiguration::GetPlanRigorName( value );
00096     if( m_PlanRigor != value )
00097       {
00098       m_PlanRigor = value;
00099       this->Modified();
00100       }
00101   }
00102   itkGetConstReferenceMacro( PlanRigor, int );
00103   void SetPlanRigor( const std::string & name )
00104   {
00105     this->SetPlanRigor( FFTWGlobalConfiguration::GetPlanRigorValue( name ) );
00106   }
00108 
00109 protected:
00110   FFTWInverseFFTImageFilter();
00111   virtual ~FFTWInverseFFTImageFilter() {}
00112 
00113   virtual void BeforeThreadedGenerateData();
00114 
00115   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId );
00116 
00117   void PrintSelf(std::ostream & os, Indent indent) const;
00118 
00119 private:
00120   FFTWInverseFFTImageFilter(const Self&); //purposely not implemented
00121   void operator=(const Self&); //purposely not implemented
00122 
00123   int m_PlanRigor;
00124 
00125 };
00126 
00127 
00128 } // namespace itk
00129 
00130 #ifndef ITK_MANUAL_INSTANTIATION
00131 #include "itkFFTWInverseFFTImageFilter.hxx"
00132 #endif
00133 
00134 #endif //__itkFFTWInverseFFTImageFilter_h
00135