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: 2002/08/22 13:33:00 $
00007   Version:   $Revision: 1.20 $
00008 
00009   Copyright (c) 2002 Insight 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     inline TOutput operator()( const TInput1 & A, 
00043                                const TInput2 & B,
00044                                const TInput3 & C)
00045       { return (TOutput) sqrt( (double)(A*A + B*B + C*C) ); }
00046     bool operator != (const Modulus3&) const
00047       {
00048       return false;
00049       }
00050   }; 
00051 }
00052 
00053 template <class TInputImage1, class TInputImage2, 
00054           class TInputImage3, class TOutputImage>
00055 class ITK_EXPORT TernaryMagnitudeImageFilter :
00056     public
00057     TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00058                       TInputImage3,TOutputImage, 
00059             Function::Modulus3< 
00060                       typename TInputImage1::PixelType, 
00061                       typename TInputImage2::PixelType,
00062                       typename TInputImage3::PixelType,
00063                       typename TOutputImage::PixelType>   >
00064 {
00065 public:
00067   typedef TernaryMagnitudeImageFilter  Self;
00068   typedef TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00069                       TInputImage3,TOutputImage, 
00070                       Function::Modulus3< 
00071                       typename TInputImage1::PixelType, 
00072                       typename TInputImage2::PixelType,
00073                       typename TInputImage3::PixelType,
00074                       typename TOutputImage::PixelType>   
00075                         >  Superclass;
00076   typedef SmartPointer<Self>   Pointer;
00077   typedef SmartPointer<const Self>  ConstPointer;
00078 
00080   itkNewMacro(Self);
00081   
00082 protected:
00083   TernaryMagnitudeImageFilter() {}
00084   virtual ~TernaryMagnitudeImageFilter() {}
00085 
00086 private:
00087   TernaryMagnitudeImageFilter(const Self&); //purposely not implemented
00088   void operator=(const Self&); //purposely not implemented
00089 
00090 
00091 };
00092 
00093 } // end namespace itk
00094 
00095 
00096 #endif

Generated at Fri May 21 01:15:23 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000