]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/DataStructures/PolyLineParametricPath.h
e8046eac90e76207393d1dcd66ed2e837d6761d0
[cpPlugins.git] / lib / cpExtensions / DataStructures / PolyLineParametricPath.h
1 #ifndef __cpExtensions__DataStructures__PolyLineParametricPath__h__
2 #define __cpExtensions__DataStructures__PolyLineParametricPath__h__
3
4 #include <itkPolyLineParametricPath.h>
5 #include <itkImageBase.h>
6
7 namespace cpExtensions
8 {
9   namespace DataStructures
10   {
11     /**
12      */
13     template< unsigned int _VDim >
14     class PolyLineParametricPath
15       : public itk::PolyLineParametricPath< _VDim >
16     {
17     public:
18       typedef PolyLineParametricPath               Self;
19       typedef itk::PolyLineParametricPath< _VDim > Superclass;
20       typedef itk::SmartPointer< Self >            Pointer;
21       typedef itk::SmartPointer< const Self >      ConstPointer;
22
23       typedef itk::ImageBase< _VDim >                  TImageBase;
24       typedef typename TImageBase::SpacingType         TSpacing;
25       typedef typename TImageBase::PointType           TPoint;
26       typedef typename TImageBase::DirectionType       TDirection;
27       typedef typename Superclass::ContinuousIndexType TContinuousIndex;
28
29     public:
30       itkNewMacro( Self );
31       itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath );
32
33       itkGetConstReferenceMacro( Spacing, TSpacing );
34       itkGetConstReferenceMacro( Origin, TPoint );
35       itkGetConstReferenceMacro( Direction, TDirection );
36       itkGetConstReferenceMacro( InverseDirection, TDirection );
37
38       itkSetMacro( Origin, TPoint );
39
40     public:
41       unsigned long GetSize( ) const;
42       TContinuousIndex GetVertex( unsigned long i ) const;
43       TPoint GetPoint( unsigned long i ) const;
44
45       virtual void SetSpacing( const TSpacing& spac );
46       virtual void SetSpacing( const double spac[ _VDim ] );
47       virtual void SetSpacing( const float spac[ _VDim ] );
48       virtual void SetOrigin( const double ori[ _VDim ] );
49       virtual void SetOrigin( const float ori[ _VDim ] );
50       virtual void SetDirection( const TDirection& dir );
51
52       template< class _TRefImage >
53       inline void SetReferenceImage( const _TRefImage* image )
54         {
55           this->SetSpacing( image->GetSpacing( ) );
56           this->SetOrigin( image->GetOrigin( ) );
57           this->SetDirection( image->GetDirection( ) );
58         }
59
60     protected:
61       PolyLineParametricPath( );
62       virtual ~PolyLineParametricPath( );
63
64       virtual void _ComputeIndexToPhysicalPointMatrices( );
65
66     private:
67       // Purposely not implemented
68       PolyLineParametricPath( const Self& other );
69       Self& operator=( const Self& other );
70
71     protected:
72       TSpacing   m_Spacing;
73       TPoint     m_Origin;
74       TDirection m_Direction;
75       TDirection m_InverseDirection;
76       TDirection m_IndexToPhysicalPoint;
77       TDirection m_PhysicalPointToIndex;
78     };
79
80   } // ecapseman
81
82 } // ecapseman
83
84 #ifndef ITK_MANUAL_INSTANTIATION
85 #  include <cpExtensions/DataStructures/PolyLineParametricPath.hxx>
86 #endif // ITK_MANUAL_INSTANTIATION
87
88 #endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__
89
90 // eof - $RCSfile$