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

itkUnaryFunctorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkUnaryFunctorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/08/09 19:52:23 $
00007   Version:   $Revision: 1.18 $
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 __itkUnaryFunctorImageFilter_h
00018 #define __itkUnaryFunctorImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImageRegionIteratorWithIndex.h"
00022 
00023 namespace itk
00024 {
00025   
00035 template <class TInputImage, class TOutputImage, class TFunction >
00036 class ITK_EXPORT UnaryFunctorImageFilter : public ImageToImageFilter<TInputImage,TOutputImage> 
00037 {
00038 public:
00040   typedef UnaryFunctorImageFilter  Self;
00041   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00042   typedef SmartPointer<Self>   Pointer;
00043   typedef SmartPointer<const Self>  ConstPointer;
00044 
00046   itkNewMacro(Self);
00047   
00049   itkTypeMacro(UnaryFunctorImageFilter, ImageToImageFilter);
00050 
00052   typedef TFunction   FunctorType;
00053   typedef TInputImage InputImageType;
00054   typedef typename    InputImageType::ConstPointer    InputImagePointer;
00055   typedef typename    InputImageType::RegionType InputImageRegionType; 
00056   typedef typename    InputImageType::PixelType  InputImagePixelType; 
00057   typedef TOutputImage OutputImageType;
00058   typedef typename     OutputImageType::Pointer    OutputImagePointer;
00059   typedef typename     OutputImageType::RegionType OutputImageRegionType;
00060   typedef typename     OutputImageType::PixelType  OutputImagePixelType;
00061 
00066   FunctorType& GetFunctor() { return m_Functor; };
00067   const FunctorType& GetFunctor() const { return m_Functor; };
00068 
00075   void SetFunctor(const FunctorType& functor)
00076     {
00077       m_Functor = functor;
00078       this->Modified();
00079     }
00080   
00081 protected:
00082   UnaryFunctorImageFilter();
00083   virtual ~UnaryFunctorImageFilter() {};
00084 
00095   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00096                             int threadId );
00097 
00098 private:
00099   UnaryFunctorImageFilter(const Self&); //purposely not implemented
00100   void operator=(const Self&); //purposely not implemented
00101 
00102   FunctorType m_Functor;
00103 };
00104 
00105 } // end namespace itk
00106 
00107 #ifndef ITK_MANUAL_INSTANTIATION
00108 #include "itkUnaryFunctorImageFilter.txx"
00109 #endif
00110 
00111 #endif

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