ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkMagnitudeAndPhaseToComplexImageFilter.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 __itkMagnitudeAndPhaseToComplexImageFilter_h
19 #define __itkMagnitudeAndPhaseToComplexImageFilter_h
20 
22 
23 namespace itk
24 {
53 namespace Functor
54 {
55 template< class TInput1, class TInput2, class TOutput >
57 {
58 public:
62  {
63  return false;
64  }
65 
66  bool operator==(const MagnitudeAndPhaseToComplex & other) const
67  {
68  return !( *this != other );
69  }
70 
71  inline std::complex< TOutput > operator()(const TInput1 & A, const TInput2 & B) const
72  {
73  return std::complex< TOutput >( std::polar( static_cast< TOutput >( A ), static_cast< TOutput >( B ) ) );
74  }
75 };
76 }
77 
78 template< class TInputImage1,
79  class TInputImage2 = TInputImage1,
81  TInputImage1::ImageDimension > >
84  TInputImage1,
85  TInputImage2,
86  TOutputImage,
87  Functor::MagnitudeAndPhaseToComplex<
88  typename TInputImage1::PixelType,
89  typename TInputImage2::PixelType,
90  typename TOutputImage::PixelType::value_type > >
91 
92 {
93 public:
96 
98  TInputImage1,
99  TInputImage2,
100  TOutputImage,
102  typename TInputImage1::PixelType,
103  typename TInputImage2::PixelType,
104  typename TOutputImage::PixelType::value_type > > Superclass;
105 
106  typedef typename TInputImage1::PixelType InputPixel1Type;
107  typedef typename TInputImage2::PixelType InputPixel2Type;
108  typedef typename TOutputImage::PixelType OutputPixelType;
109 
112 
114  itkNewMacro(Self);
115 
118 
119 #ifdef ITK_USE_CONCEPT_CHECKING
120 
121  itkConceptMacro( Input1ConvertibleToDoubleCheck,
123  itkConceptMacro( Input2ConvertibleToDoubleCheck,
125  itkConceptMacro( DoubleConvertibleToOutputCheck,
127 
129 #endif
130 protected:
133 private:
134  MagnitudeAndPhaseToComplexImageFilter(const Self &); //purposely not
135  // implemented
136  void operator=(const Self &); //purposely not
137  // implemented
138 };
139 } // end namespace itk
141 
142 #endif
143