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

itkContourDirectedMeanDistanceImageFilter.h

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

Generated at Fri Apr 16 18:09:57 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000