ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkAsinImageFilter.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 __itkAsinImageFilter_h
00019 #define __itkAsinImageFilter_h
00020 
00021 #include "itkUnaryFunctorImageFilter.h"
00022 #include "vnl/vnl_math.h"
00023 
00024 namespace itk
00025 {
00026 namespace Functor
00027 {
00033 template< class TInput, class TOutput >
00034 class Asin
00035 {
00036 public:
00037   Asin() {}
00038   ~Asin() {}
00039   bool operator!=(const Asin &) const
00040   {
00041     return false;
00042   }
00044 
00045   bool operator==(const Asin & other) const
00046   {
00047     return !( *this != other );
00048   }
00049 
00050   inline TOutput operator()(const TInput & A) const
00051   {
00052     return static_cast< TOutput >(
00053              vcl_asin(
00054                static_cast< double >( A )
00055                )
00056              );
00057   }
00058 };
00059 }
00082 template< class TInputImage, class TOutputImage >
00083 class ITK_EXPORT AsinImageFilter:
00084   public
00085   UnaryFunctorImageFilter< TInputImage, TOutputImage,
00086                            Functor::Asin<
00087                              typename TInputImage::PixelType,
00088                              typename TOutputImage::PixelType >   >
00089 {
00090 public:
00092   typedef AsinImageFilter Self;
00093   typedef UnaryFunctorImageFilter< TInputImage, TOutputImage,
00094                                    Functor::Asin<
00095                                      typename TInputImage::PixelType,
00096                                      typename TOutputImage::PixelType >
00097                                    >                                 Superclass;
00098 
00099   typedef SmartPointer< Self >       Pointer;
00100   typedef SmartPointer< const Self > ConstPointer;
00101 
00103   itkNewMacro(Self);
00104 
00106   itkTypeMacro(AsinImageFilter,
00107                UnaryFunctorImageFilter);
00108 
00109 #ifdef ITK_USE_CONCEPT_CHECKING
00110 
00111   itkConceptMacro( InputConvertibleToDoubleCheck,
00112                    ( Concept::Convertible< typename TInputImage::PixelType, double > ) );
00113   itkConceptMacro( DoubleConvertibleToOutputCheck,
00114                    ( Concept::Convertible< double, typename TOutputImage::PixelType > ) );
00115 
00117 #endif
00118 protected:
00119   AsinImageFilter() {}
00120   virtual ~AsinImageFilter() {}
00121 private:
00122   AsinImageFilter(const Self &); //purposely not implemented
00123   void operator=(const Self &);  //purposely not implemented
00124 };
00125 } // end namespace itk
00127 
00128 #endif
00129