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 __itkPolyLineParametricPath_h 00019 #define __itkPolyLineParametricPath_h 00020 00021 #include "itkParametricPath.h" 00022 #include "itkVectorContainer.h" 00023 #include "itkIndex.h" 00024 00025 namespace itk 00026 { 00055 template< unsigned int VDimension > 00056 class ITK_EXPORT PolyLineParametricPath:public 00057 ParametricPath< VDimension > 00058 { 00059 public: 00061 typedef PolyLineParametricPath Self; 00062 typedef ParametricPath< VDimension > Superclass; 00063 typedef SmartPointer< Self > Pointer; 00064 typedef SmartPointer< const Self > ConstPointer; 00065 00067 itkTypeMacro(PolyLineParametricPath, ParametricPath); 00068 00070 typedef typename Superclass::InputType InputType; 00071 00073 typedef typename Superclass::OutputType OutputType; 00074 00076 typedef ContinuousIndex< double, VDimension > ContinuousIndexType; 00077 typedef Index< VDimension > IndexType; 00078 typedef Offset< VDimension > OffsetType; 00079 typedef Point< double, VDimension > PointType; 00080 typedef Vector< double, VDimension > VectorType; 00081 typedef ContinuousIndexType VertexType; 00082 typedef VectorContainer< unsigned, VertexType > VertexListType; 00083 typedef typename VertexListType::Pointer VertexListPointer; 00084 00086 virtual OutputType Evaluate(const InputType & input) const; 00087 00090 //virtual VectorType EvaluateDerivative(const InputType & input) const; 00091 00096 inline void AddVertex(const ContinuousIndexType & vertex) 00097 { 00098 m_VertexList->InsertElement(m_VertexList->Size(), vertex); 00099 this->Modified(); 00100 } 00102 00106 virtual inline InputType EndOfInput() const 00107 { 00108 return m_VertexList->Size() - 1; 00109 } 00110 00112 itkNewMacro(Self); 00113 00115 virtual void Initialize(void) 00116 { 00117 m_VertexList->Initialize(); 00118 } 00119 00121 itkGetConstObjectMacro(VertexList, VertexListType); 00122 protected: 00123 PolyLineParametricPath(); 00124 ~PolyLineParametricPath(){} 00125 void PrintSelf(std::ostream & os, Indent indent) const; 00127 00128 private: 00129 PolyLineParametricPath(const Self &); //purposely not implemented 00130 void operator=(const Self &); //purposely not implemented 00131 00132 VertexListPointer m_VertexList; 00133 }; 00134 } // end namespace itk 00135 00136 // Define instantiation macro for this template. 00137 #define ITK_TEMPLATE_PolyLineParametricPath(_, EXPORT, TypeX, TypeY) \ 00138 namespace itk \ 00139 { \ 00140 _( 1 ( class EXPORT PolyLineParametricPath< ITK_TEMPLATE_1 TypeX > ) ) \ 00141 namespace Templates \ 00142 { \ 00143 typedef PolyLineParametricPath< ITK_TEMPLATE_1 TypeX > \ 00144 PolyLineParametricPath##TypeY; \ 00145 } \ 00146 } 00147 00148 #if ITK_TEMPLATE_EXPLICIT 00149 #include "Templates/itkPolyLineParametricPath+-.h" 00150 #endif 00151 00152 #if ITK_TEMPLATE_TXX 00153 #include "itkPolyLineParametricPath.hxx" 00154 #endif 00155 00156 #endif 00157