]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/PolyLineParametricPath.h
83a6c05010e647d601ac1ceec698a816a8b1c71b
[FrontAlgorithms.git] / lib / fpa / Image / PolyLineParametricPath.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__PolyLineParametricPath__h__
7 #define __fpa__Image__PolyLineParametricPath__h__
8
9 #include <itkPolyLineParametricPath.h>
10 #include <itkImageBase.h>
11
12 namespace fpa
13 {
14   namespace Image
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       virtual void Graft( itk::DataObject* o );
68
69     protected:
70       PolyLineParametricPath( );
71       virtual ~PolyLineParametricPath( );
72
73       virtual void _ComputeIndexToPhysicalPointMatrices( );
74
75     private:
76       // Purposely not implemented
77       PolyLineParametricPath( const Self& other );
78       Self& operator=( const Self& other );
79
80     protected:
81       TSpacing   m_Spacing;
82       TPoint     m_Origin;
83       TDirection m_Direction;
84       TDirection m_InverseDirection;
85       TDirection m_IndexToPhysicalPoint;
86       TDirection m_PhysicalPointToIndex;
87     };
88
89   } // ecapseman
90
91 } // ecapseman
92
93 #ifndef ITK_MANUAL_INSTANTIATION
94 #  include <fpa/Image/PolyLineParametricPath.hxx>
95 #endif // ITK_MANUAL_INSTANTIATION
96
97 #endif // __fpa__Image__PolyLineParametricPath__h__
98
99 // eof - $RCSfile$