17 #ifndef __itkCartesianToPolarVectorImageFilter_h
18 #define __itkCartesianToPolarVectorImageFilter_h
20 #include "itkUnaryFunctorImageFilter.h"
22 #define _USE_MATH_DEFINES
32 template<
typename TInput,
typename TOutput,
bool symmetric >
44 return !(*
this != other);
51 if(x[0] || x[1] || x[2])
53 opoint[0] = sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] );
54 opoint[1] = atan2( x[1], x[0] );
55 opoint[2] = 0.5*
C2P_PI - atan( x[2] / sqrt( x[0] * x[0] + x[1] * x[1] ) );
57 if(symmetric && opoint[1]>
C2P_PI)
59 opoint[1] = opoint[1] -
C2P_PI;
79 template <
typename TInputImage,
typename TOutputImage,
bool symmetric>
82 UnaryFunctorImageFilter<TInputImage,TOutputImage,
83 Functor::CartesianToPolarFunction<
84 typename TInputImage::PixelType,
85 typename TOutputImage::PixelType, symmetric> >
90 typedef UnaryFunctorImageFilter<
91 TInputImage,TOutputImage,
107 itkFactorylessNewMacro(Self)
112 { this->Superclass::PrintSelf( os, indent ); }
114 #ifdef ITK_USE_CONCEPT_CHECKING
116 itkConceptMacro(InputHasNumericTraitsCheck,
117 (Concept::HasNumericTraits<InputValueType>));
127 void operator=(
const Self&);
135 #endif // __itkCartesianToPolarVectorImageFilter_h
virtual ~CartesianToPolarVectorImageFilter()
OutputImageType::PixelType OutputPixelType
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::CartesianToPolarFunction< typename TInputImage::PixelType, typename TOutputImage::PixelType, symmetric > > Superclass
TOutput operator()(const TInput &x)
TInputImage::PixelType InputPixelType
Superclass::OutputImageType OutputImageType
ValueType
Type of the value held by a Value object.
void PrintSelf(std::ostream &os, Indent indent) const
~CartesianToPolarFunction()
SmartPointer< Self > Pointer
CartesianToPolarFunction()
SmartPointer< const Self > ConstPointer
bool operator==(const CartesianToPolarFunction &other) const
bool operator!=(const CartesianToPolarFunction &) const
InputPixelType::ValueType InputValueType
CartesianToPolarVectorImageFilter()
CartesianToPolarVectorImageFilter Self