ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkNonUniformBSpline.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkNonUniformBSpline_h
19 #define __itkNonUniformBSpline_h
20 
21 
22 #include <vector>
23 
24 #include "itkPoint.h"
25 #include "itkObject.h"
26 #include "itkObjectFactory.h"
27 #include "itkArray.h"
28 
29 namespace itk
30 {
45 template< unsigned int TDimension = 3 >
47  public Object
48 {
49 public:
54  typedef Object Superclass;
57  typedef double ScalarType;
59  typedef std::vector< PointType > PointListType;
61  typedef std::vector< double > KnotListType;
62  typedef std::vector< double > CoordinateListType;
64  typedef std::vector< ControlPointType > ControlPointListType;
66  typedef std::vector< double > ChordLengthListType;
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(NonUniformBSpline, Object);
73 
77  void SetPoints(PointListType & newPoints);
78 
82  const PointListType & GetPoints() const;
83 
88  void SetKnots(KnotListType & newKnots);
89 
93  const KnotListType & GetKnots() const;
94 
98  void ComputeChordLengths();
99 
104  PointType EvaluateSpline(const Array< double > & p) const;
105 
106  PointType EvaluateSpline(double t) const;
107 
111  void ComputeControlPoints();
112 
116  void SetControlPoints(ControlPointListType & ctrlpts);
117 
121  const ControlPointListType & GetControlPoints() const;
122 
129  double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const;
130 
134  itkSetMacro(SplineOrder, unsigned int);
135  itkGetConstReferenceMacro(SplineOrder, unsigned int);
136 protected:
138 
143 
147  virtual ~NonUniformBSpline();
148 
152  virtual void PrintSelf(std::ostream & os, Indent indent) const;
153 
158 
163 
168 
173 
178 
182  unsigned int m_SplineOrder;
183 
187  unsigned int m_SpatialDimension;
188 };
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkNonUniformBSpline.hxx"
193 #endif
194 
195 #endif // __itkNonUniformBSpline_h
196