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 __itkPointSetFunction_h 00019 #define __itkPointSetFunction_h 00020 00021 #include "itkFunctionBase.h" 00022 #include "itkPoint.h" 00023 00024 namespace itk 00025 { 00026 00027 00055 template < 00056 class TInputPointSet, 00057 class TOutput, 00058 class TCoordRep = float 00059 > 00060 class ITK_EXPORT PointSetFunction : 00061 public FunctionBase<typename TInputPointSet::PointType, TOutput> 00062 { 00063 public: 00065 itkStaticConstMacro(Dimension, unsigned int, 00066 TInputPointSet::PointDimension); 00067 00069 typedef PointSetFunction Self; 00070 typedef FunctionBase 00071 <typename TInputPointSet::PointType, TOutput> Superclass; 00072 typedef SmartPointer<Self> Pointer; 00073 typedef SmartPointer<const Self> ConstPointer; 00074 00076 itkTypeMacro( PointSetFunction, FunctionBase ); 00077 00079 typedef TInputPointSet InputPointSetType; 00080 00082 typedef typename InputPointSetType::PointType InputPointType; 00083 typedef typename InputPointSetType::PixelType InputPixelType; 00084 00086 typedef typename InputPointSetType::ConstPointer InputPointSetConstPointer; 00087 00089 typedef TOutput OutputType; 00090 00092 typedef TCoordRep CoordRepType; 00093 00098 virtual void SetInputPointSet( const InputPointSetType * ptr ); 00099 00101 const InputPointSetType * GetInputPointSet() const 00102 { return m_PointSet.GetPointer(); } 00103 00106 virtual TOutput Evaluate( const InputPointType& point ) const = 0; 00107 00108 protected: 00109 PointSetFunction(); 00110 virtual ~PointSetFunction(); 00111 void PrintSelf(std::ostream& os, Indent indent) const; 00112 00114 InputPointSetConstPointer m_PointSet; 00115 00116 private: 00117 PointSetFunction(const Self&); //purposely not implemented 00118 void operator=(const Self&); //purposely not implemented 00119 00120 }; 00121 00122 } // end namespace itk 00123 00124 // Define instantiation macro for this template. 00125 #define ITK_TEMPLATE_PointSetFunction(_, EXPORT, x, y) namespace itk { \ 00126 _(3(class EXPORT PointSetFunction< ITK_TEMPLATE_3 x >)) \ 00127 namespace Templates { typedef PointSetFunction< ITK_TEMPLATE_3 x > PointSetFunction##y; } \ 00128 } 00129 00130 00131 #ifndef ITK_MANUAL_INSTANTIATION 00132 # include "itkPointSetFunction.hxx" 00133 #endif 00134 00135 00136 #endif 00137