1 #ifndef __cpExtensions__DataStructures__PolyLineParametricPath__h__
2 #define __cpExtensions__DataStructures__PolyLineParametricPath__h__
4 #include <itkPolyLineParametricPath.h>
5 #include <itkImageBase.h>
6 #include <cpExtensions/Algorithms/BezierCurveFunction.h>
10 namespace DataStructures
14 template< unsigned int _VDim >
15 class PolyLineParametricPath
16 : public itk::PolyLineParametricPath< _VDim >
19 typedef PolyLineParametricPath Self;
20 typedef itk::PolyLineParametricPath< _VDim > Superclass;
21 typedef itk::SmartPointer< Self > Pointer;
22 typedef itk::SmartPointer< const Self > ConstPointer;
24 typedef itk::ImageBase< _VDim > TImageBase;
25 typedef typename TImageBase::SpacingType TSpacing;
26 typedef typename TImageBase::PointType TPoint;
27 typedef typename TImageBase::DirectionType TDirection;
28 typedef typename Superclass::ContinuousIndexType TContinuousIndex;
29 typedef typename TContinuousIndex::IndexType TIndex;
31 typedef typename TPoint::VectorType TVector;
32 typedef cpExtensions::Algorithms::BezierCurveFunction< TVector > TBezier;
36 itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath );
38 itkGetConstReferenceMacro( Spacing, TSpacing );
39 itkGetConstReferenceMacro( Origin, TPoint );
40 itkGetConstReferenceMacro( Direction, TDirection );
41 itkGetConstReferenceMacro( InverseDirection, TDirection );
43 itkSetMacro( Origin, TPoint );
46 void AddVertex( const TContinuousIndex& vertex );
47 unsigned long GetSize( ) const;
48 TContinuousIndex GetContinuousVertex( unsigned long i ) const;
49 TIndex GetVertex( unsigned long i ) const;
50 TPoint GetPoint( unsigned long i ) const;
51 TPoint GetSmoothPoint( double u ) const;
53 virtual void SetSpacing( const TSpacing& spac );
54 virtual void SetSpacing( const double spac[ _VDim ] );
55 virtual void SetSpacing( const float spac[ _VDim ] );
56 virtual void SetOrigin( const double ori[ _VDim ] );
57 virtual void SetOrigin( const float ori[ _VDim ] );
58 virtual void SetDirection( const TDirection& dir );
60 template< class _TRefImage >
61 inline void SetReferenceImage( const _TRefImage* image )
63 this->SetSpacing( image->GetSpacing( ) );
64 this->SetOrigin( image->GetOrigin( ) );
65 this->SetDirection( image->GetDirection( ) );
69 PolyLineParametricPath( );
70 virtual ~PolyLineParametricPath( );
72 virtual void _ComputeIndexToPhysicalPointMatrices( );
75 // Purposely not implemented
76 PolyLineParametricPath( const Self& other );
77 Self& operator=( const Self& other );
80 typename TBezier::Pointer m_Bezier;
84 TDirection m_Direction;
85 TDirection m_InverseDirection;
86 TDirection m_IndexToPhysicalPoint;
87 TDirection m_PhysicalPointToIndex;
94 #ifndef ITK_MANUAL_INSTANTIATION
95 # include <cpExtensions/DataStructures/PolyLineParametricPath.hxx>
96 #endif // ITK_MANUAL_INSTANTIATION
98 #endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__