itkNonUniformBSpline.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkNonUniformBSpline_h
00019 #define __itkNonUniformBSpline_h
00020
00021 #if defined(_MSC_VER)
00022 #pragma warning ( disable : 4786 )
00023 #endif
00024
00025 #include <vector>
00026
00027 #include "itkPoint.h"
00028 #include "itkObject.h"
00029 #include "itkArray.h"
00030
00031 namespace itk {
00032
00046 template < unsigned int TDimension = 3 >
00047 class NonUniformBSpline
00048 : public Object
00049 {
00050 public:
00054 typedef NonUniformBSpline Self;
00055 typedef Object Superclass;
00056 typedef SmartPointer < Self > Pointer;
00057 typedef SmartPointer < const Self > ConstPointer;
00058 typedef double ScalarType;
00059 typedef itk::Point< ScalarType, TDimension > PointType;
00060 typedef std::vector < PointType > PointListType;
00061 typedef PointListType * PointListPointer;
00062 typedef std::vector < double > KnotListType;
00063 typedef std::vector<double> CoordinateListType;
00064 typedef itk::Point<double, TDimension > ControlPointType;
00065 typedef std::vector< ControlPointType > ControlPointListType;
00066 typedef ControlPointListType * ControlPointListPointer;
00067 typedef std::vector<double> ChordLengthListType;
00068
00070 itkNewMacro( Self );
00071
00073 itkTypeMacro( NonUniformBSpline, Object );
00074
00078 void SetPoints( PointListType & newPoints );
00079
00083 itkGetConstReferenceMacro( Points, PointListType );
00084
00089 void SetKnots( KnotListType & newKnots);
00090
00094 KnotListType& GetKnots();
00095
00099 void ComputeChordLengths();
00100
00105 PointType EvaluateSpline(const Array<double> & p) const;
00106 PointType EvaluateSpline( double t ) const;
00108
00112 void ComputeControlPoints();
00113
00117 void SetControlPoints( ControlPointListType& ctrlpts );
00118
00122 itkGetConstReferenceMacro( ControlPoints, ControlPointListType );
00123
00130 double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const;
00131
00135 itkSetMacro( SplineOrder, unsigned int );
00136 itkGetConstReferenceMacro( SplineOrder, unsigned int );
00138
00139
00140 protected:
00141
00145 NonUniformBSpline();
00146
00150 virtual ~NonUniformBSpline();
00151
00155 virtual void PrintSelf( std::ostream& os, Indent indent ) const;
00156
00160 PointListType m_Points;
00161
00165 KnotListType m_Knots;
00166
00170 ControlPointListType m_ControlPoints;
00171
00175 ChordLengthListType m_ChordLength;
00176
00180 ChordLengthListType m_CumulativeChordLength;
00181
00185 unsigned int m_SplineOrder;
00186
00190 unsigned int m_SpatialDimension;
00191
00192 };
00193
00194 }
00195
00196 #ifndef ITK_MANUAL_INSTANTIATION
00197 #include "itkNonUniformBSpline.txx"
00198 #endif
00199
00200
00201 #endif // __itkNonUniformBSpline_h
00202