Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkTernaryMagnitudeImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkTernaryMagnitudeImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-18 16:11:14 $
00007   Version:   $Revision: 1.27 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkTernaryMagnitudeImageFilter_h
00018 #define __itkTernaryMagnitudeImageFilter_h
00019 
00020 #include "itkTernaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00034 namespace Function {  
00035   
00036 template< class TInput1, class TInput2, class TInput3, class TOutput>
00037 class Modulus3
00038 {
00039 public:
00040   Modulus3() {}
00041   ~Modulus3() {}
00042   bool operator!=( const Modulus3 & ) const
00043     {
00044     return false;
00045     }
00046   bool operator==( const Modulus3 & other ) const
00047     {
00048     return !(*this != other);
00049     }
00050   inline TOutput operator()( const TInput1 & A, 
00051                              const TInput2 & B,
00052                              const TInput3 & C)
00053     { return (TOutput) vcl_sqrt((double)(A*A + B*B + C*C) ); }
00054 }; 
00055 }
00056 
00057 template <class TInputImage1, class TInputImage2, 
00058           class TInputImage3, class TOutputImage>
00059 class ITK_EXPORT TernaryMagnitudeImageFilter :
00060     public
00061 TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00062                           TInputImage3,TOutputImage, 
00063                           Function::Modulus3< 
00064   typename TInputImage1::PixelType, 
00065   typename TInputImage2::PixelType,
00066   typename TInputImage3::PixelType,
00067   typename TOutputImage::PixelType>   >
00068 {
00069 public:
00071   typedef TernaryMagnitudeImageFilter   Self;
00072   typedef TernaryFunctorImageFilter<
00073     TInputImage1,TInputImage2,
00074     TInputImage3,TOutputImage, 
00075     Function::Modulus3< 
00076       typename TInputImage1::PixelType, 
00077       typename TInputImage2::PixelType,
00078       typename TInputImage3::PixelType,
00079       typename TOutputImage::PixelType>   
00080     >                                   Superclass;
00081   typedef SmartPointer<Self>            Pointer;
00082   typedef SmartPointer<const Self>      ConstPointer;
00083 
00085   itkNewMacro(Self);
00086 
00088   itkTypeMacro(TernaryMagnitudeImageFilter, 
00089                TernaryFunctorImageFilter);
00090 
00091 protected:
00092   TernaryMagnitudeImageFilter() {}
00093   virtual ~TernaryMagnitudeImageFilter() {}
00094 
00095 private:
00096   TernaryMagnitudeImageFilter(const Self&); //purposely not implemented
00097   void operator=(const Self&); //purposely not implemented
00098 
00099 
00100 };
00101 
00102 } // end namespace itk
00103 
00104 
00105 #endif
00106 

Generated at Sat Feb 28 13:39:04 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000