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

itkNeighborhoodAccessorFunctor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNeighborhoodAccessorFunctor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/09/07 14:46:28 $
00007   Version:   $Revision: 1.1 $
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 __itkNeighborhoodAccessorFunctor_h
00018 #define __itkNeighborhoodAccessorFunctor_h
00019 
00020 #include "itkImageBoundaryCondition.h"
00021 #include "itkNeighborhood.h"
00022 #include "itkImageBase.h" 
00023 
00024 namespace itk
00025 {
00026  
00040 template< class TImage >
00041 class NeighborhoodAccessorFunctor
00042 {
00043 public:
00044   typedef TImage                                ImageType;
00045   typedef typename ImageType::PixelType         PixelType;
00046   typedef typename ImageType::InternalPixelType InternalPixelType;
00047   typedef unsigned int                          VectorLengthType;
00048   typedef typename ImageType::OffsetType        OffsetType;
00049 
00050   typedef Neighborhood< InternalPixelType *,
00051           ::itk::GetImageDimension< TImage >::ImageDimension > NeighborhoodType;
00052   
00053   typedef ImageBoundaryCondition< ImageType > const *
00054                           ImageBoundaryConditionConstPointerType;
00055   
00057   inline void SetBegin( const InternalPixelType *) {}
00058 
00065   inline PixelType Get( const InternalPixelType *pixelPointer ) const
00066     { 
00067     return (*pixelPointer);
00068     }
00069 
00071   inline void Set( InternalPixelType* &pixelPointer, const PixelType &p ) const
00072     {
00073     *pixelPointer = p;
00074     }
00075 
00076   inline PixelType BoundaryCondition( 
00077       const OffsetType& point_index,
00078       const OffsetType &boundary_offset, 
00079       const NeighborhoodType *data,
00080       const ImageBoundaryConditionConstPointerType boundaryCondition) const
00081     {
00082     return boundaryCondition->operator()(point_index, boundary_offset, data);
00083     }
00084   
00085   void SetVectorLength( VectorLengthType length ) {};
00086   VectorLengthType SetVectorLength() { return 0; };
00087   
00088 };
00089 
00090 } // end namespace itk
00091 #endif
00092 

Generated at Sun Sep 23 13:41:39 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000