X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FRasterContourFilter.h;fp=lib%2FcpExtensions%2FAlgorithms%2FRasterContourFilter.h;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=4797dec122d9e159d4502138fcb5bf173244fe7a;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/RasterContourFilter.h b/lib/cpExtensions/Algorithms/RasterContourFilter.h deleted file mode 100644 index 4797dec..0000000 --- a/lib/cpExtensions/Algorithms/RasterContourFilter.h +++ /dev/null @@ -1,105 +0,0 @@ -// ------------------------------------------------------------------------- -// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -// ------------------------------------------------------------------------- - -#ifndef __cpExtensions__Algorithms__RasterContourFilter__h__ -#define __cpExtensions__Algorithms__RasterContourFilter__h__ - -#include -#include -#include - -// ------------------------------------------------------------------------- -namespace cpExtensions -{ - namespace Algorithms - { - /** - */ - template< class _TImage > - class RasterContourFilter - : public itk::ImageSource< _TImage > - { - public: - // Basic types - typedef RasterContourFilter Self; - typedef itk::ImageSource< _TImage > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TImage TImage; - typedef typename _TImage::IndexType TIndex; - typedef typename _TImage::PixelType TPixel; - typedef typename _TImage::PointType TPoint; - typedef typename _TImage::RegionType TRegion; - typedef itk::ImageBase< 2 > TImageBase; - - public: - itkNewMacro( Self ); - itkTypeMacro( RasterContourFilter, itk::ImageSource ); - - itkGetConstObjectMacro( Template, TImageBase ); - itkGetConstMacro( InsideValue, TPixel ); - itkGetConstMacro( OutsideValue, TPixel ); - - itkSetConstObjectMacro( Template, TImageBase ); - itkSetMacro( InsideValue, TPixel ); - itkSetMacro( OutsideValue, TPixel ); - - public: - void AddPoint( double x, double y ); - void AddPoint( double p[ 2 ] ); - template< class _TPoint > - inline void AddPoint( const _TPoint& p ); - void ClearPoints( ); - - protected: - RasterContourFilter( ); - virtual ~RasterContourFilter( ); - - virtual void AllocateOutputs( ) cpExtensions_OVERRIDE; - virtual void BeforeThreadedGenerateData( ) cpExtensions_OVERRIDE; - virtual void AfterThreadedGenerateData( ) cpExtensions_OVERRIDE; - virtual void ThreadedGenerateData( - const TRegion& region, itk::ThreadIdType id - ) cpExtensions_OVERRIDE; - - private: - // Purposely not implemented - RasterContourFilter( const Self& ); - void operator=( const Self& ); - - protected: - std::deque< TPoint > m_Contour; - std::deque< TIndex > m_Polygon; - TRegion m_ROI; - typename TImageBase::ConstPointer m_Template; - TPixel m_InsideValue; - TPixel m_OutsideValue; - }; - - } // ecapseman - -} // ecapseman - -// ------------------------------------------------------------------------- -template< class _TImage > -template< class _TPoint > -void cpExtensions::Algorithms::RasterContourFilter< _TImage >:: -AddPoint( const _TPoint& p ) -{ - TPoint pnt; - pnt[ 0 ] = p[ 0 ]; - pnt[ 1 ] = p[ 2 ]; - this->m_Contour.push_back( pnt ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - -#endif // __cpExtensions__Algorithms__RasterContourFilter__h__ - -// eof - $RCSfile$