00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkPath.h,v $ 00005 Language: C++ 00006 Date: $Date: 2006/03/02 19:22:43 $ 00007 Version: $Revision: 1.9 $ 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 __itkPath_h 00018 #define __itkPath_h 00019 00020 #include "itkDataObject.h" 00021 #include "itkIndex.h" 00022 #include "itkOffset.h" 00023 #include "itkNumericTraits.h" 00024 00025 namespace itk 00026 { 00027 00028 00048 template <class TInput, class TOutput, unsigned int VDimension> 00049 class ITK_EXPORT Path : public DataObject 00050 { 00051 public: 00053 typedef Path Self; 00054 typedef DataObject Superclass; 00055 typedef SmartPointer<Self> Pointer; 00056 typedef SmartPointer<const Self> ConstPointer; 00057 00059 itkStaticConstMacro(PathDimension, unsigned int, VDimension); 00060 00062 itkTypeMacro(Path, FunctionBase); 00063 00065 typedef TInput InputType; 00066 00068 typedef TOutput OutputType; 00069 00070 00072 typedef Index< VDimension > IndexType; 00073 typedef Offset< VDimension > OffsetType; 00074 00075 00079 virtual inline InputType StartOfInput() const 00080 { 00081 return NumericTraits<InputType>::Zero; 00082 } 00083 00086 virtual inline InputType EndOfInput() const 00087 { 00088 return NumericTraits<InputType>::One; 00089 } 00090 00093 virtual OutputType Evaluate( const InputType & input ) const = 0; 00094 00096 virtual IndexType EvaluateToIndex( const InputType & input ) const = 0; 00097 00106 virtual OffsetType IncrementInput(InputType & input) const = 0; 00107 00108 00109 protected: 00110 Path(); 00111 ~Path(){} 00112 00113 void PrintSelf(std::ostream& os, Indent indent) const; 00114 00115 itkGetConstMacro(ZeroOffset,OffsetType); 00116 itkGetConstMacro(ZeroIndex,IndexType); 00117 00118 private: 00119 Path(const Self&); //purposely not implemented 00120 void operator=(const Self&); //purposely not implemented 00121 00122 // These "constants" are initialized in the constructor 00123 OffsetType m_ZeroOffset; // = 0 for all dimensions 00124 IndexType m_ZeroIndex; // = 0 for all dimensions 00125 00126 }; 00127 00128 } // namespace itk 00129 00130 #ifndef ITK_MANUAL_INSTANTIATION 00131 #include "itkPath.txx" 00132 #endif 00133 00134 #endif 00135