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

itkBinaryFunctorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBinaryFunctorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-07 17:31:02 $
00007   Version:   $Revision: 1.37 $
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 __itkBinaryFunctorImageFilter_h
00018 #define __itkBinaryFunctorImageFilter_h
00019 
00020 #include "itkInPlaceImageFilter.h"
00021 #include "itkImageRegionIteratorWithIndex.h"
00022 
00023 namespace itk
00024 {
00025   
00037 template <class TInputImage1, class TInputImage2, 
00038           class TOutputImage, class TFunction    >
00039 class ITK_EXPORT BinaryFunctorImageFilter :
00040     public InPlaceImageFilter<TInputImage1,TOutputImage> 
00041 {
00042 public:
00044   typedef BinaryFunctorImageFilter                       Self;
00045   typedef InPlaceImageFilter<TInputImage1,TOutputImage>  Superclass;
00046   typedef SmartPointer<Self>                             Pointer;
00047   typedef SmartPointer<const Self>                       ConstPointer;
00048 
00050   itkNewMacro(Self);
00051 
00053   itkTypeMacro(BinaryFunctorImageFilter, InPlaceImageFilter);
00054 
00056   typedef TFunction                              FunctorType;
00057   typedef TInputImage1                           Input1ImageType;
00058   typedef typename Input1ImageType::ConstPointer Input1ImagePointer;
00059   typedef typename Input1ImageType::RegionType   Input1ImageRegionType; 
00060   typedef typename Input1ImageType::PixelType    Input1ImagePixelType; 
00061 
00062   typedef TInputImage2                           Input2ImageType;
00063   typedef typename Input2ImageType::ConstPointer Input2ImagePointer;
00064   typedef typename Input2ImageType::RegionType   Input2ImageRegionType; 
00065   typedef typename Input2ImageType::PixelType    Input2ImagePixelType; 
00066 
00067   typedef TOutputImage                           OutputImageType;
00068   typedef typename OutputImageType::Pointer      OutputImagePointer;
00069   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00070   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00071 
00073   void SetInput1( const TInputImage1 * image1);
00074 
00076   void SetInput2( const TInputImage2 * image2);
00077 
00082   FunctorType& GetFunctor() { return m_Functor; }
00083 
00088   const FunctorType& GetFunctor() const
00089     {
00090     return m_Functor;
00091     }
00092 
00099   void SetFunctor(const FunctorType& functor)
00100     {
00101     if (m_Functor != functor)
00102       {
00103       m_Functor = functor;
00104       this->Modified();
00105       }
00106     }
00108 
00110   itkStaticConstMacro(
00111     InputImage1Dimension, unsigned int, TInputImage1::ImageDimension);
00112   itkStaticConstMacro(
00113     InputImage2Dimension, unsigned int, TInputImage2::ImageDimension);
00114   itkStaticConstMacro(
00115     OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00117 
00118 #ifdef ITK_USE_CONCEPT_CHECKING
00119 
00120   itkConceptMacro(SameDimensionCheck1,
00121     (Concept::SameDimension<itkGetStaticConstMacro(InputImage1Dimension),
00122                             itkGetStaticConstMacro(InputImage2Dimension)>));
00123   itkConceptMacro(SameDimensionCheck2,
00124     (Concept::SameDimension<itkGetStaticConstMacro(InputImage1Dimension),
00125                             itkGetStaticConstMacro(OutputImageDimension)>));
00126 
00128 #endif
00129 
00130 protected:
00131   BinaryFunctorImageFilter();
00132   virtual ~BinaryFunctorImageFilter() {}
00133 
00144   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00145                             int threadId );
00146 
00147 private:
00148   BinaryFunctorImageFilter(const Self&); //purposely not implemented
00149   void operator=(const Self&); //purposely not implemented
00150 
00151   FunctorType m_Functor;
00152 };
00153 
00154 } // end namespace itk
00155 
00156 #ifndef ITK_MANUAL_INSTANTIATION
00157 #include "itkBinaryFunctorImageFilter.txx"
00158 #endif
00159 
00160 #endif
00161 

Generated at Thu May 28 09:23:15 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000