ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkImageKernelOperator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkImageKernelOperator_h
00019 #define __itkImageKernelOperator_h
00020 
00021 #include "itkNeighborhoodOperator.h"
00022 
00023 #include "itkImage.h"
00024 
00025 namespace itk
00026 {
00046 template< class TPixel, unsigned int VDimension = 2,
00047           class TAllocator = NeighborhoodAllocator< TPixel > >
00048 class ITK_EXPORT ImageKernelOperator :
00049   public NeighborhoodOperator< TPixel, VDimension, TAllocator >
00050 {
00051 public:
00052 
00054   typedef ImageKernelOperator                                    Self;
00055   typedef NeighborhoodOperator< TPixel, VDimension, TAllocator > Superclass;
00056 
00057   typedef Image< TPixel, VDimension >            ImageType;
00058   typedef typename Superclass::SizeType          SizeType;
00059   typedef typename Superclass::CoefficientVector CoefficientVector;
00060 
00062   ImageKernelOperator() {}
00063 
00065   ImageKernelOperator(const Self & orig):
00066     Neighborhood< TPixel, VDimension, TAllocator >(orig)
00067   {}
00068 
00070   Self & operator=(const Self & orig)
00071   {
00072     Superclass::operator=(orig);
00073     return *this;
00074   }
00076 
00080   void SetImageKernel(const ImageType *kernel);
00081 
00083   const ImageType * GetImageKernel() const;
00084 
00086   virtual void PrintSelf(std::ostream & os, Indent i) const
00087   {
00088     os << i << "ImageKernelOperator { this=" << this
00089        << "} "  << std::endl;
00090     Superclass::PrintSelf( os, i.GetNextIndent() );
00091   }
00093 
00094 protected:
00096   CoefficientVector GenerateCoefficients();
00097 
00099   void Fill(const CoefficientVector & coeff);
00100 
00101 private:
00102   typename ImageType::ConstPointer m_ImageKernel;
00103 
00105   const char * GetNameOfClass()
00106   { return "itkImageKernelOperator"; }
00107 
00108 };
00109 } // namespace itk
00110 
00111 #ifndef ITK_MANUAL_INSTANTIATION
00112 #include "itkImageKernelOperator.hxx"
00113 #endif
00114 
00115 #endif
00116