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;
30 typedef typename TPoint::VectorType TVector;
31 typedef cpExtensions::Algorithms::BezierCurveFunction< TVector > TBezier;
35 itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath );
37 itkGetConstReferenceMacro( Spacing, TSpacing );
38 itkGetConstReferenceMacro( Origin, TPoint );
39 itkGetConstReferenceMacro( Direction, TDirection );
40 itkGetConstReferenceMacro( InverseDirection, TDirection );
42 itkSetMacro( Origin, TPoint );
45 void AddVertex( const TContinuousIndex& vertex );
46 unsigned long GetSize( ) const;
47 TContinuousIndex GetVertex( unsigned long i ) const;
48 TPoint GetPoint( unsigned long i ) const;
49 TPoint GetSmoothPoint( double u ) const;
51 virtual void SetSpacing( const TSpacing& spac );
52 virtual void SetSpacing( const double spac[ _VDim ] );
53 virtual void SetSpacing( const float spac[ _VDim ] );
54 virtual void SetOrigin( const double ori[ _VDim ] );
55 virtual void SetOrigin( const float ori[ _VDim ] );
56 virtual void SetDirection( const TDirection& dir );
58 template< class _TRefImage >
59 inline void SetReferenceImage( const _TRefImage* image )
61 this->SetSpacing( image->GetSpacing( ) );
62 this->SetOrigin( image->GetOrigin( ) );
63 this->SetDirection( image->GetDirection( ) );
67 PolyLineParametricPath( );
68 virtual ~PolyLineParametricPath( );
70 virtual void _ComputeIndexToPhysicalPointMatrices( );
73 // Purposely not implemented
74 PolyLineParametricPath( const Self& other );
75 Self& operator=( const Self& other );
78 typename TBezier::Pointer m_Bezier;
82 TDirection m_Direction;
83 TDirection m_InverseDirection;
84 TDirection m_IndexToPhysicalPoint;
85 TDirection m_PhysicalPointToIndex;
92 #ifndef ITK_MANUAL_INSTANTIATION
93 # include <cpExtensions/DataStructures/PolyLineParametricPath.hxx>
94 #endif // ITK_MANUAL_INSTANTIATION
96 #endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__