From: Leonardo Florez-Valencia Date: Wed, 3 Feb 2016 22:58:10 +0000 (-0500) Subject: ... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=05fa5b3e9567a9115f39ebd5b4607ae70ee13015;p=FrontAlgorithms.git ... --- diff --git a/lib/fpa/VTK/Image3DObserver.hxx b/lib/fpa/VTK/Image3DObserver.hxx index c89bb4b..b993928 100644 --- a/lib/fpa/VTK/Image3DObserver.hxx +++ b/lib/fpa/VTK/Image3DObserver.hxx @@ -9,6 +9,9 @@ #include #include +#include + + // ------------------------------------------------------------------------- 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 ); diff --git a/lib/fpaPlugins/BaseImageFilter.h b/lib/fpaPlugins/BaseImageFilter.h index 05fdee6..991a2c0 100644 --- a/lib/fpaPlugins/BaseImageFilter.h +++ b/lib/fpaPlugins/BaseImageFilter.h @@ -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 );