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

itkDifferenceImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDifferenceImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-25 12:24:03 $
00007   Version:   $Revision: 1.15 $
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 __itkDifferenceImageFilter_h
00018 #define __itkDifferenceImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNumericTraits.h"
00022 #include "itkArray.h"
00023 
00024 namespace itk
00025 {
00026   
00038 template <class TInputImage, class TOutputImage>
00039 class ITK_EXPORT DifferenceImageFilter :
00040     public ImageToImageFilter<TInputImage, TOutputImage> 
00041 {
00042 public:
00044   typedef DifferenceImageFilter                           Self;
00045   typedef ImageToImageFilter<TInputImage,TOutputImage>    Superclass;
00046   typedef SmartPointer<Self>                              Pointer;
00047   typedef SmartPointer<const Self>                        ConstPointer;
00048 
00050   itkNewMacro(Self);
00051 
00053   itkTypeMacro(DifferenceImageFilter, ImageToImageFilter);
00054 
00056   typedef TInputImage                                         InputImageType;
00057   typedef TOutputImage                                        OutputImageType;
00058   typedef typename OutputImageType::PixelType                 OutputPixelType;
00059   typedef typename OutputImageType::RegionType                OutputImageRegionType;
00060   typedef typename NumericTraits<OutputPixelType>::RealType   RealType;
00061   typedef typename NumericTraits<RealType>::AccumulateType    AccumulateType;
00062 
00064   virtual void SetValidInput(const InputImageType* validImage);
00065 
00067   virtual void SetTestInput(const InputImageType* testImage);
00068 
00071   itkSetMacro(ToleranceRadius, int);
00072   itkGetConstMacro(ToleranceRadius, int);
00074 
00077   itkSetMacro(DifferenceThreshold, OutputPixelType);
00078   itkGetConstMacro(DifferenceThreshold, OutputPixelType);
00080 
00084   itkSetMacro(IgnoreBoundaryPixels, bool);
00085   itkGetConstMacro(IgnoreBoundaryPixels, bool);
00087 
00089   itkGetConstMacro(MeanDifference, RealType);
00090   itkGetConstMacro(TotalDifference, AccumulateType);
00091   itkGetConstMacro(NumberOfPixelsWithDifferences, unsigned long);
00093 
00094 protected:
00095   DifferenceImageFilter();
00096   virtual ~DifferenceImageFilter() {}
00097   
00098   void PrintSelf(std::ostream& os, Indent indent) const;
00099 
00111   void ThreadedGenerateData(const OutputImageRegionType& threadRegion,
00112                             int threadId);
00113 
00114   void BeforeThreadedGenerateData();
00115   void AfterThreadedGenerateData();
00116  
00117   OutputPixelType          m_DifferenceThreshold;
00118   RealType                 m_MeanDifference;
00119   AccumulateType           m_TotalDifference;
00120   unsigned long            m_NumberOfPixelsWithDifferences;
00121   int                      m_ToleranceRadius;
00122 
00123   Array<AccumulateType>    m_ThreadDifferenceSum;
00124   Array<unsigned long>     m_ThreadNumberOfPixels;
00125 
00126 private:
00127   DifferenceImageFilter(const Self&); //purposely not implemented
00128   void operator=(const Self&); //purposely not implemented
00129 
00130   bool m_IgnoreBoundaryPixels;
00131 };
00132 
00133 } // end namespace itk
00134 
00135 // Define instantiation macro for this template.
00136 #define ITK_TEMPLATE_DifferenceImageFilter(_, EXPORT, x, y) namespace itk { \
00137   _(2(class EXPORT DifferenceImageFilter< ITK_TEMPLATE_2 x >)) \
00138   namespace Templates { typedef DifferenceImageFilter< ITK_TEMPLATE_2 x > \
00139                                             DifferenceImageFilter##y; } \
00140   }
00141 
00142 #if ITK_TEMPLATE_EXPLICIT
00143 # include "Templates/itkDifferenceImageFilter+-.h"
00144 #endif
00145 
00146 #if ITK_TEMPLATE_TXX
00147 # include "itkDifferenceImageFilter.txx"
00148 #endif
00149 
00150 #endif
00151 

Generated at Tue Sep 15 02:47:34 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000