]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 3 Feb 2016 22:58:10 +0000 (17:58 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 3 Feb 2016 22:58:10 +0000 (17:58 -0500)
lib/fpa/VTK/Image3DObserver.hxx
lib/fpaPlugins/BaseImageFilter.h

index c89bb4bd016b691289f9188970c567db87542118..b993928a90fd5db4dcb0fbbd0c8af73a3b10dabd 100644 (file)
@@ -9,6 +9,9 @@
 #include <vtkRenderer.h>
 #include <vtkRendererCollection.h>
 
+#include <vtkPolyDataWriter.h>
+
+
 // -------------------------------------------------------------------------
 template< class F, class R >
 void fpa::VTK::Image3DObserver< F, R >::
@@ -28,7 +31,6 @@ SetPixel(
   unsigned char alpha
   )
 {
-  std::cout << idx << std::endl;
   this->m_Stencil->SetScalarComponentFromDouble
     ( idx[ 0 ], idx[ 1 ], idx[ 2 ], 0, red );
   this->m_Stencil->SetScalarComponentFromDouble
@@ -47,7 +49,11 @@ SetPixel(
     dynamic_cast< vtkUnsignedCharArray* >(
       this->m_PolyData->GetPointData( )->GetScalars( )
       );
-  pd_data->SetTuple4( id, red, green, blue, alpha );
+  if( pd_data != NULL )
+  {
+    pd_data->SetTuple4( id, red, green, blue, alpha );
+
+  } // fi
   this->m_Stencil->Modified( );
   this->m_PolyData->Modified( );
   this->m_PolyDataMapper->Modified( );
@@ -164,7 +170,18 @@ Execute( const itk::Object* c, const itk::EventObject& e )
     } // rof
     this->m_PolyData->SetPoints( pd_points );
     this->m_PolyData->SetVerts( pd_verts );
-    this->m_PolyData->GetPointData( )->SetScalars( pd_data );
+    // this->m_PolyData->GetPointData( )->SetScalars( pd_data );
+
+
+    vtkSmartPointer< vtkPolyDataWriter > w =
+      vtkSmartPointer< vtkPolyDataWriter >::New( );
+    w->SetInputData( this->m_PolyData );
+    w->SetFileName( "fpa.vtk" );
+    w->Update( );
+
+    std::exit( 1 );
+
+
 
     this->m_PolyDataMapper->SetInputData( this->m_PolyData );
     this->m_PolyDataActor->SetMapper( this->m_PolyDataMapper );
index 05fdee6097554c21f03d4bb8c9af629f97f67524..991a2c0cbf8e70d20c4a3e35922cb5a254de96e2 100644 (file)
@@ -86,7 +86,6 @@ _ConfigureDebugger( F* filter )
         auto iren = this->m_MPRViewer->GetInteractor( 2 );
         if( iren != NULL )
         {
-          std::cout << "OK 3D" << std::endl;
           typename _3D::Pointer debugger = _3D::New( );
           debugger->SetRenderWindow( iren->GetRenderWindow( ) );
           debugger->SetRenderPercentage( 0.001 );