1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__DataStructures__Image__Path__h__
6 #define __fpa__DataStructures__Image__Path__h__
8 #include <itkPolyLineParametricPath.h>
9 #include <itkImageBase.h>
13 namespace DataStructures
19 template< unsigned int _VDim >
21 : public itk::PolyLineParametricPath< _VDim >
25 typedef itk::PolyLineParametricPath< _VDim > Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
29 itkStaticConstMacro( Dimension, unsigned int, _VDim );
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;
40 itkTypeMacro( Path, itk::PolyLineParametricPath );
42 itkGetConstReferenceMacro( Spacing, TSpacing );
43 itkGetConstReferenceMacro( Origin, TPoint );
44 itkGetConstReferenceMacro( Direction, TDirection );
45 itkGetConstReferenceMacro( InverseDirection, TDirection );
47 itkSetMacro( Origin, TPoint );
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;
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 );
62 template< class _TRefImage >
63 inline void SetReferenceImage( const _TRefImage* image )
65 this->SetSpacing( image->GetSpacing( ) );
66 this->SetOrigin( image->GetOrigin( ) );
67 this->SetDirection( image->GetDirection( ) );
70 virtual void Graft( itk::DataObject* o );
76 virtual void _ComputeIndexToPhysicalPointMatrices( );
79 // Purposely not implemented
80 Path( const Self& other );
81 Self& operator=( const Self& other );
86 TDirection m_Direction;
87 TDirection m_InverseDirection;
88 TDirection m_IndexToPhysicalPoint;
89 TDirection m_PhysicalPointToIndex;
98 #ifndef ITK_MANUAL_INSTANTIATION
99 # include <fpa/DataStructures/Image/Path.hxx>
100 #endif // ITK_MANUAL_INSTANTIATION
102 #endif // __fpa__DataStructures__Image__Path__h__