ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkSpatialFunctionImageEvaluatorFilter.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 __itkSpatialFunctionImageEvaluatorFilter_h
00019 #define __itkSpatialFunctionImageEvaluatorFilter_h
00020 
00021 #include "itkImageFunction.h"
00022 #include "itkImageRegionIterator.h"
00023 #include "itkImageToImageFilter.h"
00024 #include "itkSize.h"
00025 #include "itkSpatialFunction.h"
00026 
00027 namespace itk
00028 {
00042 template< class TSpatialFunction, class TInputImage, class TOutputImage >
00043 class ITK_EXPORT SpatialFunctionImageEvaluatorFilter:
00044   public ImageToImageFilter< TInputImage, TOutputImage >
00045 {
00046 public:
00048   typedef SpatialFunctionImageEvaluatorFilter             Self;
00049   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00050   typedef SmartPointer< Self >                            Pointer;
00051   typedef SmartPointer< const Self >                      ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(SpatialFunctionImageEvaluatorFilter, ImageToImageFilter);
00058 
00060   itkStaticConstMacro(NDimensions, unsigned int,
00061                       TInputImage::ImageDimension);
00062 
00064   typedef typename TInputImage::SizeType SizeType;
00065 
00067   typedef typename TOutputImage::IndexType IndexType;
00068 
00070   typedef typename TOutputImage::PixelType PixelType;
00071 
00073   typedef typename TOutputImage::RegionType OutputImageRegionType;
00074 
00076   typedef TSpatialFunction FunctionType;
00077 
00079   typedef typename FunctionType::OutputType FunctionValueType;
00080 
00082   typedef typename FunctionType::InputType PositionType;
00083 
00085   void SetFunction(FunctionType *PixelFunction)
00086   { m_PixelFunction = PixelFunction; }
00087 protected:
00088   SpatialFunctionImageEvaluatorFilter();
00089   virtual ~SpatialFunctionImageEvaluatorFilter() {}
00091 
00093   void GenerateData();
00094 
00095 private:
00096   SpatialFunctionImageEvaluatorFilter(const Self &); //purposely not implemented
00097   void operator=(const Self &);                      //purposely not implemented
00098 
00100   FunctionType *m_PixelFunction;
00101 };
00102 } // end namespace itk
00103 
00104 #ifndef ITK_MANUAL_INSTANTIATION
00105 #include "itkSpatialFunctionImageEvaluatorFilter.hxx"
00106 #endif
00107 
00108 #endif
00109