]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/RasterContourFilter.h
Cast image filter added. ROI filter modified.
[cpPlugins.git] / lib / cpExtensions / Algorithms / RasterContourFilter.h
index 8d22bba09dddaeddb552445eeb0bf68d4facd35e..4797dec122d9e159d4502138fcb5bf173244fe7a 100644 (file)
@@ -7,11 +7,7 @@
 
 #include <cpExtensions/Config.h>
 #include <itkImageSource.h>
-#include <vtkSmartPointer.h>
-
-// -------------------------------------------------------------------------
-class vtkPoints;
-class vtkPolygon;
+#include <deque>
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
@@ -53,7 +49,8 @@ namespace cpExtensions
     public:
       void AddPoint( double x, double y );
       void AddPoint( double p[ 2 ] );
-      void AddPoints( vtkPoints* points );
+      template< class _TPoint >
+        inline void AddPoint( const _TPoint& p );
       void ClearPoints( );
 
     protected:
@@ -73,7 +70,9 @@ namespace cpExtensions
       void operator=( const Self& );
 
     protected:
-      vtkSmartPointer< vtkPolygon >     m_Polygon;
+      std::deque< TPoint > m_Contour;
+      std::deque< TIndex > m_Polygon;
+      TRegion m_ROI;
       typename TImageBase::ConstPointer m_Template;
       TPixel m_InsideValue;
       TPixel m_OutsideValue;
@@ -83,6 +82,20 @@ namespace cpExtensions
 
 } // 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 <cpExtensions/Algorithms/RasterContourFilter.hxx>
 #endif // ITK_MANUAL_INSTANTIATION