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