ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkSpatialFunction_h 00019 #define __itkSpatialFunction_h 00020 00021 #include "itkFunctionBase.h" 00022 #include "itkPoint.h" 00023 00024 namespace itk 00025 { 00044 template< typename TOutput, 00045 unsigned int VImageDimension = 3, 00046 typename TInput = Point< double, VImageDimension > > 00047 class ITK_EXPORT SpatialFunction:public FunctionBase< TInput, TOutput > 00048 { 00049 public: 00051 typedef SpatialFunction Self; 00052 typedef FunctionBase< TInput, TOutput > Superclass; 00053 typedef SmartPointer< Self > Pointer; 00054 typedef SmartPointer< const Self > ConstPointer; 00055 00057 itkTypeMacro(SpatialFunction, FunctionBase); 00058 00060 typedef typename Superclass::InputType InputType; 00061 00063 typedef typename Superclass::OutputType OutputType; 00064 00066 itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension); 00067 00070 virtual OutputType Evaluate(const InputType & input) const = 0; 00071 00072 protected: 00073 SpatialFunction(); 00074 virtual ~SpatialFunction(); 00075 void PrintSelf(std::ostream & os, Indent indent) const; 00076 00077 private: 00078 SpatialFunction(const Self &); //purposely not implemented 00079 void operator=(const Self &); //purposely not implemented 00080 }; 00081 } // end namespace itk 00082 00083 // Define instantiation macro for this template. 00084 #define ITK_TEMPLATE_SpatialFunction(_, EXPORT, TypeX, TypeY) \ 00085 namespace itk \ 00086 { \ 00087 _( 3 ( class EXPORT SpatialFunction< ITK_TEMPLATE_3 TypeX > ) ) \ 00088 namespace Templates \ 00089 { \ 00090 typedef SpatialFunction< ITK_TEMPLATE_3 TypeX > \ 00091 SpatialFunction##TypeY; \ 00092 } \ 00093 } 00094 00095 #if ITK_TEMPLATE_EXPLICIT 00096 #include "Templates/itkSpatialFunction+-.h" 00097 #endif 00098 00099 #if ITK_TEMPLATE_TXX 00100 #include "itkSpatialFunction.hxx" 00101 #endif 00102 00103 #endif 00104