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

itkNeighborhoodOperatorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNeighborhoodOperatorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/05/13 17:15:34 $
00007   Version:   $Revision: 1.31 $
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 __itkNeighborhoodOperatorImageFilter_h
00018 #define __itkNeighborhoodOperatorImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNeighborhoodOperator.h"
00022 #include "itkImage.h"
00023 #include "itkImageBoundaryCondition.h"
00024 #include "itkZeroFluxNeumannBoundaryCondition.h"
00025 
00026 namespace itk
00027 {
00045 template <class TInputImage, class TOutputImage, class TOperatorValueType=ITK_TYPENAME TOutputImage::PixelType>
00046 class ITK_EXPORT NeighborhoodOperatorImageFilter :
00047     public ImageToImageFilter< TInputImage, TOutputImage > 
00048 {
00049 public:
00051   typedef NeighborhoodOperatorImageFilter Self;
00052   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00053   typedef       SmartPointer<Self> Pointer;
00054   typedef SmartPointer<const Self> ConstPointer;
00055 
00057   itkNewMacro(Self);
00058 
00060   itkTypeMacro(NeighborhoodOperatorImageFilter, ImageToImageFilter);
00061   
00064   typedef typename TOutputImage::PixelType         OutputPixelType;
00065   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00066   typedef typename  TInputImage::PixelType         InputPixelType;
00067   typedef typename  TInputImage::InternalPixelType InputInternalPixelType;
00068   typedef TOperatorValueType                       OperatorValueType;
00069 
00072   itkStaticConstMacro(ImageDimension, unsigned int,
00073                       TOutputImage::ImageDimension);
00074   
00076   typedef TInputImage  InputImageType;
00077   typedef TOutputImage OutputImageType;
00078   typedef typename InputImageType::Pointer InputImagePointer;
00079   
00081   typedef ImageBoundaryCondition<InputImageType> *
00082   ImageBoundaryConditionPointerType;
00083 
00085   typedef ZeroFluxNeumannBoundaryCondition<InputImageType> DefaultBoundaryCondition;
00086 
00088   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00089 
00091   typedef Neighborhood<OperatorValueType,
00092                itkGetStaticConstMacro(ImageDimension)> OutputNeighborhoodType;
00093   
00097   void SetOperator(const OutputNeighborhoodType &p)
00098   {
00099     m_Operator = p;
00100     this->Modified();
00101   }
00102 
00104   const OutputNeighborhoodType& GetOperator() const
00105     { return m_Operator; } 
00106 
00112   void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
00113   { m_BoundsCondition = i; }
00114 
00116   ImageBoundaryConditionPointerType GetBoundaryCondition()
00117     { return m_BoundsCondition; }
00118   
00126   virtual void GenerateInputRequestedRegion() throw (InvalidRequestedRegionError);
00127 
00128 protected:
00129   NeighborhoodOperatorImageFilter()
00130     { m_BoundsCondition = static_cast<ImageBoundaryConditionPointerType>(&m_DefaultBoundaryCondition); }
00131   virtual ~NeighborhoodOperatorImageFilter() {}
00132     
00144   void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00145                             int threadId );
00146 
00147   
00148   void PrintSelf(std::ostream& os, Indent indent) const
00149   {  Superclass::PrintSelf(os, indent); }
00150 private:
00151   NeighborhoodOperatorImageFilter(const Self&); //purposely not implemented
00152   void operator=(const Self&); //purposely not implemented
00153 
00155   OutputNeighborhoodType m_Operator;
00156 
00159   ImageBoundaryConditionPointerType m_BoundsCondition;
00160 
00162   DefaultBoundaryCondition m_DefaultBoundaryCondition;
00163 
00164 };
00165   
00166 } // end namespace itk
00167 
00168 #ifndef ITK_MANUAL_INSTANTIATION
00169 #include "itkNeighborhoodOperatorImageFilter.txx"
00170 #endif
00171 
00172 #endif

Generated at Wed May 24 23:46:33 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000