00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkTensorRelativeAnisotropyImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/10/27 19:51:42 $ 00007 Version: $Revision: 1.5 $ 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 __itkTensorRelativeAnisotropyImageFilter_h 00018 #define __itkTensorRelativeAnisotropyImageFilter_h 00019 00020 #include "itkUnaryFunctorImageFilter.h" 00021 00022 namespace itk 00023 { 00024 00025 // This functor class invokes the computation of relative anisotropy from 00026 // every pixel. 00027 namespace Functor { 00028 00029 template< typename TInput > 00030 class TensorRelativeAnisotropyFunction 00031 { 00032 public: 00033 typedef typename TInput::RealValueType RealValueType; 00034 TensorRelativeAnisotropyFunction() {} 00035 ~TensorRelativeAnisotropyFunction() {} 00036 bool operator!=( const TensorRelativeAnisotropyFunction & ) const 00037 { 00038 return false; 00039 } 00040 bool operator==( const TensorRelativeAnisotropyFunction & other ) const 00041 { 00042 return !(*this != other); 00043 } 00044 inline RealValueType operator()( const TInput & x ) 00045 { 00046 return x.GetRelativeAnisotropy(); 00047 } 00048 }; 00049 00050 } // end namespace functor 00051 00052 00067 template <typename TInputImage, typename TOutputImage=TInputImage> 00068 class ITK_EXPORT TensorRelativeAnisotropyImageFilter : 00069 public 00070 UnaryFunctorImageFilter<TInputImage,TOutputImage, 00071 Functor::TensorRelativeAnisotropyFunction< 00072 typename TInputImage::PixelType> > 00073 { 00074 public: 00076 typedef TensorRelativeAnisotropyImageFilter Self; 00077 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 00078 Functor::TensorRelativeAnisotropyFunction< 00079 typename TInputImage::PixelType> > Superclass; 00080 00081 typedef SmartPointer<Self> Pointer; 00082 typedef SmartPointer<const Self> ConstPointer; 00083 00084 typedef typename Superclass::OutputImageType OutputImageType; 00085 typedef typename TOutputImage::PixelType OutputPixelType; 00086 typedef typename TInputImage::PixelType InputPixelType; 00087 typedef typename InputPixelType::ValueType InputValueType; 00088 00090 itkTypeMacro( TensorRelativeAnisotropyImageFilter, UnaryFunctorImageFilter ); 00091 00093 itkNewMacro(Self); 00094 00096 void PrintSelf(std::ostream& os, Indent indent) const 00097 { this->Superclass::PrintSelf( os, indent ); } 00098 00099 #ifdef ITK_USE_CONCEPT_CHECKING 00100 00101 itkConceptMacro(InputHasNumericTraitsCheck, 00102 (Concept::HasNumericTraits<InputValueType>)); 00103 00105 #endif 00106 00107 protected: 00108 TensorRelativeAnisotropyImageFilter() {}; 00109 virtual ~TensorRelativeAnisotropyImageFilter() {}; 00110 00111 private: 00112 TensorRelativeAnisotropyImageFilter(const Self&); //purposely not implemented 00113 void operator=(const Self&); //purposely not implemented 00114 00115 }; 00116 00117 00118 00119 } // end namespace itk 00120 00121 #endif 00122