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: 2009-04-25 12:28:09 $
00007   Version:   $Revision: 1.10 $
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   itkGetConstMacro(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 
00130   void AllocateOutputs();
00131 
00133   void BeforeThreadedGenerateData ();
00134 
00136   void AfterThreadedGenerateData ();
00137 
00139   void  ThreadedGenerateData (const RegionType& 
00140                               outputRegionForThread,
00141                               int threadId);
00142 
00143   // Override since the filter needs all the data for the algorithm
00144   void GenerateInputRequestedRegion();
00145 
00146   // Override since the filter produces all of its output
00147   void EnlargeOutputRequestedRegion(DataObject *data);
00148 
00149 private:
00150   SimilarityIndexImageFilter(const Self&); //purposely not implemented
00151   void operator=(const Self&); //purposely not implemented
00152 
00153   RealType m_SimilarityIndex;
00154 
00155   Array<unsigned long> m_CountOfImage1;
00156   Array<unsigned long> m_CountOfImage2;
00157   Array<unsigned long> m_CountOfIntersection;
00158 
00159 }; // end of class
00160 
00161 } // end namespace itk
00162   
00163 #ifndef ITK_MANUAL_INSTANTIATION
00164 #include "itkSimilarityIndexImageFilter.txx"
00165 #endif
00166 
00167 #endif
00168 

Generated at Tue Sep 15 04:58:30 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000