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

itkSimilarityIndexImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSimilarityIndexImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/03/30 15:36:25 $
00007   Version:   $Revision: 1.8 $
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 __itkSimilarityIndexImageFilter_h
00018 #define __itkSimilarityIndexImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNumericTraits.h"
00022 #include "itkArray.h"
00023 
00024 namespace itk {
00025 
00057 template<class TInputImage1, class TInputImage2>
00058 class ITK_EXPORT SimilarityIndexImageFilter : 
00059     public ImageToImageFilter<TInputImage1, TInputImage1>
00060 {
00061 public:
00063   typedef SimilarityIndexImageFilter Self;
00064   typedef ImageToImageFilter<TInputImage1,TInputImage1>  Superclass;
00065   typedef SmartPointer<Self>        Pointer;
00066   typedef SmartPointer<const Self>  ConstPointer;
00067 
00069   itkNewMacro(Self);  
00070 
00072   itkTypeMacro(SimilarityIndexImageFilter, ImageToImageFilter);
00073 
00075   typedef TInputImage1 InputImage1Type;
00076   typedef TInputImage2 InputImage2Type;
00077   typedef typename TInputImage1::Pointer InputImage1Pointer;
00078   typedef typename TInputImage2::Pointer InputImage2Pointer;
00079   typedef typename TInputImage1::ConstPointer InputImage1ConstPointer;
00080   typedef typename TInputImage2::ConstPointer InputImage2ConstPointer;
00081 
00082   typedef typename TInputImage1::RegionType RegionType ;
00083   typedef typename TInputImage1::SizeType SizeType ;
00084   typedef typename TInputImage1::IndexType IndexType ;
00085 
00086   typedef typename TInputImage1::PixelType InputImage1PixelType;
00087   typedef typename TInputImage2::PixelType InputImage2PixelType;
00088   
00090   itkStaticConstMacro(ImageDimension, unsigned int,
00091                       TInputImage1::ImageDimension );
00092 
00094   typedef typename NumericTraits<InputImage1PixelType>::RealType RealType;
00095 
00097   void SetInput1( const InputImage1Type * image )
00098   { this->SetInput( image ); }
00099 
00101   void SetInput2( const InputImage2Type * image );
00102 
00104   const InputImage1Type * GetInput1(void)
00105   { return this->GetInput(); }
00106 
00108   const InputImage2Type * GetInput2(void);
00109 
00111   itkGetMacro(SimilarityIndex,RealType);
00112 
00113 #ifdef ITK_USE_CONCEPT_CHECKING
00114 
00115   itkConceptMacro(Input1HasNumericTraitsCheck,
00116                   (Concept::HasNumericTraits<InputImage1PixelType>));
00117   itkConceptMacro(Input2HasNumericTraitsCheck,
00118                   (Concept::HasNumericTraits<InputImage2PixelType>));
00119 
00121 #endif
00122 
00123 protected:
00124   SimilarityIndexImageFilter();
00125   ~SimilarityIndexImageFilter(){};
00126   void PrintSelf(std::ostream& os, Indent indent) const;
00127 
00129   void AllocateOutputs();      
00130 
00132   void BeforeThreadedGenerateData ();
00133 
00135   void AfterThreadedGenerateData ();
00136 
00138   void  ThreadedGenerateData (const RegionType& 
00139                               outputRegionForThread,
00140                               int threadId) ;
00141 
00142   // Override since the filter needs all the data for the algorithm
00143   void GenerateInputRequestedRegion();
00144 
00145   // Override since the filter produces all of its output
00146   void EnlargeOutputRequestedRegion(DataObject *data);
00147 
00148 private:
00149   SimilarityIndexImageFilter(const Self&); //purposely not implemented
00150   void operator=(const Self&); //purposely not implemented
00151 
00152   RealType m_SimilarityIndex;
00153 
00154   Array<unsigned long> m_CountOfImage1;
00155   Array<unsigned long> m_CountOfImage2;
00156   Array<unsigned long> m_CountOfIntersection;
00157 
00158 } ; // end of class
00159 
00160 } // end namespace itk
00161   
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkSimilarityIndexImageFilter.txx"
00164 #endif
00165 
00166 #endif
00167 

Generated at Tue Jul 29 22:26:04 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000