Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkItkNonUniformBSpline.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkItkNonUniformBSpline_h
14 #define mitkItkNonUniformBSpline_h
15 
16 /*===================================================================
17 
18 This file is based heavily on a corresponding ITK filter.
19 
20 ===================================================================*/
21 
22 /*********************************
23  This file was taken from ITK, CVS version 1.8 to circumvent a bug in ITK release 3.18
24  *********************************/
25 
26 #if defined(_MSC_VER)
27 #pragma warning ( disable : 4786 )
28 #endif
29 
30 #include <vector>
31 
32 #include "itkPoint.h"
33 #include "itkObject.h"
34 #include "itkObjectFactory.h"
35 #include "itkArray.h"
36 
37 namespace itk {
38 
52 template < unsigned int TDimension = 3 >
53 class NonUniformBSpline
54  : public Object
55 {
56 public:
60  typedef NonUniformBSpline Self;
61  typedef Object Superclass;
64  typedef double ScalarType;
65  typedef itk::Point< ScalarType, TDimension > PointType;
66  typedef std::vector < PointType > PointListType;
68  typedef std::vector < double > KnotListType;
69  typedef std::vector<double> CoordinateListType;
70  typedef itk::Point<double, TDimension > ControlPointType;
71  typedef std::vector< ControlPointType > ControlPointListType;
73  typedef std::vector<double> ChordLengthListType;
74 
76  itkFactorylessNewMacro(Self);
77  itkCloneMacro(Self);
78 
80  itkTypeMacro( NonUniformBSpline, Object );
81 
85  void SetPoints( PointListType & newPoints );
86 
90  const PointListType & GetPoints() const;
91 
96  void SetKnots( KnotListType & newKnots);
97 
101  const KnotListType & GetKnots() const;
102 
106  void ComputeChordLengths();
107 
112  PointType EvaluateSpline(const Array<double> & p) const;
113  PointType EvaluateSpline( double t ) const;
114 
118  void ComputeControlPoints();
119 
123  void SetControlPoints( ControlPointListType& ctrlpts );
124 
128  const ControlPointListType & GetControlPoints() const;
129 
136  double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const;
137 
141  itkSetMacro( SplineOrder, unsigned int );
142  itkGetConstReferenceMacro( SplineOrder, unsigned int );
143 
144 
145 protected:
146 
151 
155  ~NonUniformBSpline() override;
156 
160  void PrintSelf( std::ostream& os, Indent indent ) const override;
161 
166 
171 
176 
181 
186 
190  unsigned int m_SplineOrder;
191 
195  unsigned int m_SpatialDimension;
196 
197 };
198 
199 } // end namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 #include "mitkItkNonUniformBSpline.txx"
203 #endif
204 
205 
206 #endif
itk::NonUniformBSpline::ComputeControlPoints
void ComputeControlPoints()
itk::NonUniformBSpline::Self
NonUniformBSpline Self
Definition: mitkItkNonUniformBSpline.h:62
itk::NonUniformBSpline::m_ControlPoints
ControlPointListType m_ControlPoints
Definition: mitkItkNonUniformBSpline.h:177
itk::NonUniformBSpline::PointListType
std::vector< PointType > PointListType
Definition: mitkItkNonUniformBSpline.h:68
itk::NonUniformBSpline::ControlPointListType
std::vector< ControlPointType > ControlPointListType
Definition: mitkItkNonUniformBSpline.h:73
itk::NonUniformBSpline::GetPoints
const PointListType & GetPoints() const
itk::NonUniformBSpline::m_Knots
KnotListType m_Knots
Definition: mitkItkNonUniformBSpline.h:172
itk::NonUniformBSpline::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: mitkItkNonUniformBSpline.h:65
itk::NonUniformBSpline::~NonUniformBSpline
~NonUniformBSpline() override
itk::NonUniformBSpline::KnotListType
std::vector< double > KnotListType
Definition: mitkItkNonUniformBSpline.h:70
itk::NonUniformBSpline::PointListPointer
PointListType * PointListPointer
Definition: mitkItkNonUniformBSpline.h:69
itk::NonUniformBSpline::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::NonUniformBSpline::m_Points
PointListType m_Points
Definition: mitkItkNonUniformBSpline.h:167
itk::SmartPointer< Self >
itk::NonUniformBSpline::Superclass
Object Superclass
Definition: mitkItkNonUniformBSpline.h:63
itk::NonUniformBSpline::CoordinateListType
std::vector< double > CoordinateListType
Definition: mitkItkNonUniformBSpline.h:71
itk::NonUniformBSpline::ChordLengthListType
std::vector< double > ChordLengthListType
Definition: mitkItkNonUniformBSpline.h:75
itk::NonUniformBSpline
BSpline with nonuniform knot spacing.
Definition: mitkItkNonUniformBSpline.h:55
itk::NonUniformBSpline::GetControlPoints
const ControlPointListType & GetControlPoints() const
itk::NonUniformBSpline::m_SpatialDimension
unsigned int m_SpatialDimension
Definition: mitkItkNonUniformBSpline.h:197
itk::NonUniformBSpline::m_CumulativeChordLength
ChordLengthListType m_CumulativeChordLength
Definition: mitkItkNonUniformBSpline.h:187
itk::NonUniformBSpline::PointType
itk::Point< ScalarType, TDimension > PointType
Definition: mitkItkNonUniformBSpline.h:67
itk::NonUniformBSpline::GetKnots
const KnotListType & GetKnots() const
itk::NonUniformBSpline::NonUniformBSpline
NonUniformBSpline()
itk::NonUniformBSpline::SetPoints
void SetPoints(PointListType &newPoints)
itk::NonUniformBSpline::EvaluateSpline
PointType EvaluateSpline(const Array< double > &p) const
itk::NonUniformBSpline::ControlPointType
itk::Point< double, TDimension > ControlPointType
Definition: mitkItkNonUniformBSpline.h:72
itk::NonUniformBSpline::Pointer
SmartPointer< Self > Pointer
Definition: mitkItkNonUniformBSpline.h:64
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::NonUniformBSpline::m_SplineOrder
unsigned int m_SplineOrder
Definition: mitkItkNonUniformBSpline.h:192
itk::NonUniformBSpline::SetControlPoints
void SetControlPoints(ControlPointListType &ctrlpts)
itk::NonUniformBSpline::m_ChordLength
ChordLengthListType m_ChordLength
Definition: mitkItkNonUniformBSpline.h:182
itk::NonUniformBSpline::ControlPointListPointer
ControlPointListType * ControlPointListPointer
Definition: mitkItkNonUniformBSpline.h:74
itk::NonUniformBSpline::ScalarType
double ScalarType
Definition: mitkItkNonUniformBSpline.h:66
itk::NonUniformBSpline::SetKnots
void SetKnots(KnotListType &newKnots)
itk::NonUniformBSpline::NonUniformBSplineFunctionRecursive
double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const
itk::NonUniformBSpline::ComputeChordLengths
void ComputeChordLengths()