ITK  4.13.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 {
55 namespace Functor
56 {
57 template< typename TInput1, typename TInput2, typename TOutput >
59 {
60 public:
64  {
65  return false;
66  }
67 
68  bool operator==(const MagnitudeAndPhaseToComplex & other) const
69  {
70  return !( *this != other );
71  }
72 
73  inline std::complex< TOutput > operator()(const TInput1 & A, const TInput2 & B) const
74  {
75  return std::complex< TOutput >( std::polar( static_cast< TOutput >( A ), static_cast< TOutput >( B ) ) );
76  }
77 };
78 }
79 
80 template< typename TInputImage1,
81  typename TInputImage2 = TInputImage1,
83  TInputImage1::ImageDimension > >
86  TInputImage1,
87  TInputImage2,
88  TOutputImage,
89  Functor::MagnitudeAndPhaseToComplex<
90  typename TInputImage1::PixelType,
91  typename TInputImage2::PixelType,
92  typename TOutputImage::PixelType::value_type > >
93 
94 {
95 public:
98 
100  TInputImage1,
101  TInputImage2,
102  TOutputImage,
104  typename TInputImage1::PixelType,
105  typename TInputImage2::PixelType,
106  typename TOutputImage::PixelType::value_type > > Superclass;
107 
108  typedef typename TInputImage1::PixelType InputPixel1Type;
109  typedef typename TInputImage2::PixelType InputPixel2Type;
110  typedef typename TOutputImage::PixelType OutputPixelType;
111 
114 
116  itkNewMacro(Self);
117 
120 
121 #ifdef ITK_USE_CONCEPT_CHECKING
122  // Begin concept checking
123  itkConceptMacro( Input1ConvertibleToDoubleCheck,
125  itkConceptMacro( Input2ConvertibleToDoubleCheck,
127  itkConceptMacro( DoubleConvertibleToOutputCheck,
129  // End concept checking
130 #endif
131 
132 protected:
134  virtual ~MagnitudeAndPhaseToComplexImageFilter() ITK_OVERRIDE {}
135 
136 private:
137  ITK_DISALLOW_COPY_AND_ASSIGN(MagnitudeAndPhaseToComplexImageFilter);
138 };
139 } // end namespace itk
140 
141 #endif
std::complex< TOutput > operator()(const TInput1 &A, const TInput2 &B) const
Base class for all process objects that output image data.
bool operator!=(const MagnitudeAndPhaseToComplex &) const
BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::MagnitudeAndPhaseToComplex< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType::value_type > > Superclass
Implements pixel-wise conversion of magnitude and phase data into complex voxels. ...
bool operator==(const MagnitudeAndPhaseToComplex &other) const
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75
Implements pixel-wise generic operation of two images, or of an image and a constant.