00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkTensorRelativeAnisotropyImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/05/07 17:39:57 $ 00007 Version: $Revision: 1.1 $ 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 inline RealValueType operator()( const TInput & x ) 00037 { 00038 return x.GetRelativeAnisotropy(); 00039 } 00040 }; 00041 00042 } // end namespace functor 00043 00044 00059 template <typename TInputImage, typename TOutputImage=TInputImage> 00060 class ITK_EXPORT TensorRelativeAnisotropyImageFilter : 00061 public 00062 UnaryFunctorImageFilter<TInputImage,TOutputImage, 00063 Functor::TensorRelativeAnisotropyFunction< 00064 typename TInputImage::PixelType> > 00065 { 00066 public: 00068 typedef TensorRelativeAnisotropyImageFilter Self; 00069 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 00070 Functor::TensorRelativeAnisotropyFunction< 00071 typename TInputImage::PixelType> > Superclass; 00072 00073 typedef SmartPointer<Self> Pointer; 00074 typedef SmartPointer<const Self> ConstPointer; 00075 00076 typedef typename Superclass::OutputImageType OutputImageType; 00077 typedef typename TOutputImage::PixelType OutputPixelType; 00078 typedef typename TInputImage::PixelType InputPixelType; 00079 typedef typename InputPixelType::ValueType InputValueType; 00080 00081 00083 itkNewMacro(Self); 00084 00086 void PrintSelf(std::ostream& os, Indent indent) const 00087 { this->Superclass::PrintSelf( os, indent ); } 00088 00089 00090 protected: 00091 TensorRelativeAnisotropyImageFilter() {}; 00092 virtual ~TensorRelativeAnisotropyImageFilter() {}; 00093 00094 private: 00095 TensorRelativeAnisotropyImageFilter(const Self&); //purposely not implemented 00096 void operator=(const Self&); //purposely not implemented 00097 00098 }; 00099 00100 00101 00102 } // end namespace itk 00103 00104 #endif