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