X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpExtensions%2FDataStructures%2FPolyLineParametricPath.h;h=7f122000948b60793d6f995152980e75939efd55;hb=2fed0327528e671e32cc7151cb65ebd769c053e6;hp=b2e1c77808c68c1ce9d384fbd9d667dfd92780fb;hpb=3393941bf8f26babc7b592db434b40c1b747a687;p=cpPlugins.git diff --git a/lib/cpExtensions/DataStructures/PolyLineParametricPath.h b/lib/cpExtensions/DataStructures/PolyLineParametricPath.h index b2e1c77..7f12200 100644 --- a/lib/cpExtensions/DataStructures/PolyLineParametricPath.h +++ b/lib/cpExtensions/DataStructures/PolyLineParametricPath.h @@ -3,6 +3,7 @@ #include #include +#include namespace cpExtensions { @@ -20,29 +21,55 @@ namespace cpExtensions typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; - typedef itk::ImageBase< _VDim > TImageBase; + typedef itk::ImageBase< _VDim > TImageBase; + typedef typename TImageBase::SpacingType TSpacing; + typedef typename TImageBase::PointType TPoint; + typedef typename TImageBase::DirectionType TDirection; + typedef typename Superclass::ContinuousIndexType TContinuousIndex; + typedef typename TContinuousIndex::IndexType TIndex; + + typedef typename TPoint::VectorType TVector; + typedef cpExtensions::Algorithms::BezierCurveFunction< TVector > TBezier; public: itkNewMacro( Self ); itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath ); + itkGetConstReferenceMacro( Spacing, TSpacing ); + itkGetConstReferenceMacro( Origin, TPoint ); + itkGetConstReferenceMacro( Direction, TDirection ); + itkGetConstReferenceMacro( InverseDirection, TDirection ); + + itkSetMacro( Origin, TPoint ); + public: - TImageBase* GetReferenceImage( ) - { return( this->m_ReferenceImage ); } - const TImageBase* GetReferenceImage( ) const - { return( this->m_ReferenceImage ); } - void SetReferenceImage( const TImageBase* image ) + void AddVertex( const TContinuousIndex& vertex ); + unsigned long GetSize( ) const; + TContinuousIndex GetContinuousVertex( unsigned long i ) const; + TIndex GetVertex( unsigned long i ) const; + TPoint GetPoint( unsigned long i ) const; + TPoint GetSmoothPoint( double u ) const; + + virtual void SetSpacing( const TSpacing& spac ); + virtual void SetSpacing( const double spac[ _VDim ] ); + virtual void SetSpacing( const float spac[ _VDim ] ); + virtual void SetOrigin( const double ori[ _VDim ] ); + virtual void SetOrigin( const float ori[ _VDim ] ); + virtual void SetDirection( const TDirection& dir ); + + template< class _TRefImage > + inline void SetReferenceImage( const _TRefImage* image ) { - this->m_ReferenceImage = TImageBase::New( ); - this->m_ReferenceImage->SetDirection( image->GetDirection( ) ); - this->m_ReferenceImage->SetOrigin( image->GetOrigin( ) ); - this->m_ReferenceImage->SetSpacing( image->GetSpacing( ) ); - this->Modified( ); + this->SetSpacing( image->GetSpacing( ) ); + this->SetOrigin( image->GetOrigin( ) ); + this->SetDirection( image->GetDirection( ) ); } protected: - PolyLineParametricPath( ) { } - virtual ~PolyLineParametricPath( ) { } + PolyLineParametricPath( ); + virtual ~PolyLineParametricPath( ); + + virtual void _ComputeIndexToPhysicalPointMatrices( ); private: // Purposely not implemented @@ -50,14 +77,24 @@ namespace cpExtensions Self& operator=( const Self& other ); protected: - typename TImageBase::Pointer m_ReferenceImage; + typename TBezier::Pointer m_Bezier; + + TSpacing m_Spacing; + TPoint m_Origin; + TDirection m_Direction; + TDirection m_InverseDirection; + TDirection m_IndexToPhysicalPoint; + TDirection m_PhysicalPointToIndex; }; } // ecapseman } // ecapseman -#endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__ +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION +#endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__ // eof - $RCSfile$