ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkFFTWComplexToComplexImageFilter_h 00019 #define __itkFFTWComplexToComplexImageFilter_h 00020 00021 #include "itkFFTComplexToComplexImageFilter.h" 00022 #include "itkFFTWCommon.h" 00023 00024 00025 namespace itk 00026 { 00055 template< class TImage > 00056 class ITK_EXPORT FFTWComplexToComplexImageFilter: 00057 public FFTComplexToComplexImageFilter< TImage > 00058 { 00059 public: 00060 typedef FFTWComplexToComplexImageFilter Self; 00061 typedef FFTComplexToComplexImageFilter< TImage > Superclass; 00062 typedef SmartPointer< Self > Pointer; 00063 typedef SmartPointer< const Self > ConstPointer; 00064 00066 typedef TImage ImageType; 00067 typedef typename ImageType::PixelType PixelType; 00068 typedef typename Superclass::InputImageType InputImageType; 00069 typedef typename Superclass::OutputImageType OutputImageType; 00070 typedef typename OutputImageType::RegionType OutputImageRegionType; 00071 00072 // 00073 // the proxy type is a wrapper for the fftw API 00074 // since the proxy is only defined over double and float, 00075 // trying to use any other pixel type is inoperative, as 00076 // is trying to use double if only the float FFTW version is 00077 // configured in, or float if only double is configured. 00078 // 00079 typedef typename fftw::Proxy< typename PixelType::value_type > FFTWProxyType; 00080 00082 itkNewMacro(Self); 00083 00085 itkTypeMacro(FFTWComplexToComplexImageFilter, 00086 FFTComplexToComplexImageFilter); 00087 00088 itkStaticConstMacro(ImageDimension, unsigned int, 00089 ImageType::ImageDimension); 00090 00092 typedef typename ImageType::SizeType ImageSizeType; 00093 00094 // 00095 // these should be defined in every FFT filter class 00096 virtual bool FullMatrix(); 00097 00106 virtual void SetPlanRigor( const int & value ) 00107 { 00108 // use that method to check the value 00109 FFTWGlobalConfiguration::GetPlanRigorName( value ); 00110 if( m_PlanRigor != value ) 00111 { 00112 m_PlanRigor = value; 00113 this->Modified(); 00114 } 00115 } 00116 itkGetConstReferenceMacro( PlanRigor, int ); 00117 void SetPlanRigor( const std::string & name ) 00118 { 00119 this->SetPlanRigor( FFTWGlobalConfiguration::GetPlanRigorValue( name ) ); 00120 } 00122 00123 protected: 00124 FFTWComplexToComplexImageFilter() 00125 { 00126 m_PlanRigor = FFTWGlobalConfiguration::GetPlanRigor(); 00127 } 00128 virtual ~FFTWComplexToComplexImageFilter() 00129 { 00130 } 00131 00132 virtual void UpdateOutputData(DataObject *output); 00133 00134 virtual void BeforeThreadedGenerateData(); 00135 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ); 00136 00137 void PrintSelf(std::ostream & os, Indent indent) const; 00138 00139 private: 00140 FFTWComplexToComplexImageFilter(const Self&); //purposely not implemented 00141 void operator=(const Self&); //purposely not implemented 00142 00143 bool m_CanUseDestructiveAlgorithm; 00144 00145 int m_PlanRigor; 00146 00147 }; 00148 00149 00150 } // namespace itk 00151 00152 #ifndef ITK_MANUAL_INSTANTIATION 00153 #include "itkFFTWComplexToComplexImageFilter.hxx" 00154 #endif 00155 00156 #endif //__itkFFTWComplexToComplexImageFilter_h 00157