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

itkDirectedHausdorffDistanceImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDirectedHausdorffDistanceImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-14 19:20:33 $
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 __itkDirectedHausdorffDistanceImageFilter_h
00018 #define __itkDirectedHausdorffDistanceImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNumericTraits.h"
00022 #include "itkArray.h"
00023 #include "itkImage.h"
00024 
00025 namespace itk {
00026 
00061 template<class TInputImage1, class TInputImage2>
00062 class ITK_EXPORT DirectedHausdorffDistanceImageFilter : 
00063     public ImageToImageFilter<TInputImage1, TInputImage1>
00064 {
00065 public:
00067   typedef DirectedHausdorffDistanceImageFilter           Self;
00068   typedef ImageToImageFilter<TInputImage1,TInputImage1>  Superclass;
00069   typedef SmartPointer<Self>                             Pointer;
00070   typedef SmartPointer<const Self>                       ConstPointer;
00071 
00073   itkNewMacro(Self);  
00074 
00076   itkTypeMacro(DirectedHausdorffDistanceImageFilter, ImageToImageFilter);
00077 
00079   typedef TInputImage1                        InputImage1Type;
00080   typedef TInputImage2                        InputImage2Type;
00081   typedef typename TInputImage1::Pointer      InputImage1Pointer;
00082   typedef typename TInputImage2::Pointer      InputImage2Pointer;
00083   typedef typename TInputImage1::ConstPointer InputImage1ConstPointer;
00084   typedef typename TInputImage2::ConstPointer InputImage2ConstPointer;
00085 
00086   typedef typename TInputImage1::RegionType RegionType;
00087   typedef typename TInputImage1::SizeType   SizeType;
00088   typedef typename TInputImage1::IndexType  IndexType;
00089 
00090   typedef typename TInputImage1::PixelType InputImage1PixelType;
00091   typedef typename TInputImage2::PixelType InputImage2PixelType;
00092   
00094   itkStaticConstMacro(ImageDimension, unsigned int,
00095                       TInputImage1::ImageDimension);
00096 
00098   typedef typename NumericTraits<InputImage1PixelType>::RealType RealType;
00099 
00101   void SetInput1( const InputImage1Type * image )
00102     { this->SetInput( image ); }
00103 
00105   void SetInput2( const InputImage2Type * image );
00106 
00108   const InputImage1Type * GetInput1(void)
00109     { return this->GetInput(); }
00110 
00112   const InputImage2Type * GetInput2(void);
00113 
00115   itkGetMacro(DirectedHausdorffDistance,RealType);
00116   itkGetMacro(AverageHausdorffDistance,RealType);
00118 
00119 #ifdef ITK_USE_CONCEPT_CHECKING
00120 
00121   itkConceptMacro(InputHasNumericTraitsCheck,
00122     (Concept::HasNumericTraits<InputImage1PixelType>));
00123 
00125 #endif
00126 
00127 protected:
00128   DirectedHausdorffDistanceImageFilter();
00129   ~DirectedHausdorffDistanceImageFilter(){};
00130   void PrintSelf(std::ostream& os, Indent indent) const;
00131 
00134   void AllocateOutputs();
00135 
00137   void BeforeThreadedGenerateData ();
00138 
00140   void AfterThreadedGenerateData ();
00141 
00143   void  ThreadedGenerateData (const RegionType& 
00144                               outputRegionForThread,
00145                               int threadId);
00146 
00147   // Override since the filter needs all the data for the algorithm
00148   void GenerateInputRequestedRegion();
00149 
00150   // Override since the filter produces all of its output
00151   void EnlargeOutputRequestedRegion(DataObject *data);
00152 
00153 private:
00154   DirectedHausdorffDistanceImageFilter(const Self&); //purposely not implemented
00155   void operator=(const Self&); //purposely not implemented
00156 
00157   typedef Image<RealType,itkGetStaticConstMacro(ImageDimension)> DistanceMapType;
00158   
00159   typename DistanceMapType::Pointer   m_DistanceMap;
00160   Array<RealType>                     m_MaxDistance;
00161   Array<unsigned int>                 m_PixelCount;
00162   Array<RealType>                     m_Sum;
00163   RealType                            m_DirectedHausdorffDistance;
00164   RealType                            m_AverageHausdorffDistance;
00165 
00166 }; // end of class
00167 
00168 } // end namespace itk
00169   
00170 #ifndef ITK_MANUAL_INSTANTIATION
00171 #include "itkDirectedHausdorffDistanceImageFilter.txx"
00172 #endif
00173 
00174 #endif
00175 

Generated at Wed Nov 5 21:09:51 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000