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