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: 2006/01/15 04:28:36 $
00007   Version:   $Revision: 1.23 $
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 __itkUnaryFunctorImageFilter_h
00018 #define __itkUnaryFunctorImageFilter_h
00019 
00020 #include "itkInPlaceImageFilter.h"
00021 #include "itkImageRegionIteratorWithIndex.h"
00022 
00023 namespace itk
00024 {
00025   
00040 template <class TInputImage, class TOutputImage, class TFunction >
00041 class ITK_EXPORT UnaryFunctorImageFilter : public InPlaceImageFilter<TInputImage,TOutputImage> 
00042 {
00043 public:
00045   typedef UnaryFunctorImageFilter  Self;
00046   typedef InPlaceImageFilter<TInputImage,TOutputImage>  Superclass;
00047   typedef SmartPointer<Self>   Pointer;
00048   typedef SmartPointer<const Self>  ConstPointer;
00049 
00051   itkNewMacro(Self);
00052 
00054   itkTypeMacro(UnaryFunctorImageFilter, InPlaceImageFilter);
00055 
00057   typedef TFunction   FunctorType;
00058   typedef TInputImage InputImageType;
00059   typedef typename    InputImageType::ConstPointer    InputImagePointer;
00060   typedef typename    InputImageType::RegionType InputImageRegionType; 
00061   typedef typename    InputImageType::PixelType  InputImagePixelType; 
00062   typedef TOutputImage OutputImageType;
00063   typedef typename     OutputImageType::Pointer    OutputImagePointer;
00064   typedef typename     OutputImageType::RegionType OutputImageRegionType;
00065   typedef typename     OutputImageType::PixelType  OutputImagePixelType;
00066 
00071   FunctorType& GetFunctor() { return m_Functor; };
00072   const FunctorType& GetFunctor() const { return m_Functor; };
00074 
00081   void SetFunctor(const FunctorType& functor)
00082   {
00083     if (m_Functor != functor)
00084       {
00085       m_Functor = functor;
00086       this->Modified();
00087       }
00088   }
00090 
00091 protected:
00092   UnaryFunctorImageFilter();
00093   virtual ~UnaryFunctorImageFilter() {};
00094 
00103   virtual void GenerateOutputInformation();
00104 
00115   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00116                             int threadId );
00117 
00118 private:
00119   UnaryFunctorImageFilter(const Self&); //purposely not implemented
00120   void operator=(const Self&); //purposely not implemented
00121 
00122   FunctorType m_Functor;
00123 };
00124 
00125 } // end namespace itk
00126 
00127 #ifndef ITK_MANUAL_INSTANTIATION
00128 #include "itkUnaryFunctorImageFilter.txx"
00129 #endif
00130 
00131 #endif
00132 

Generated at Mon Mar 12 03:15:45 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000