+}
+
+// -------------------------------------------------------------------------
+template< class F, class R >
+void fpa::VTK::Image3DObserver< F, R >::
+SetPixel(
+ typename TImage::IndexType idx,
+ unsigned char red,
+ unsigned char green,
+ unsigned char blue,
+ unsigned char alpha
+ )
+{
+ std::cout << idx << std::endl;
+ this->m_Stencil->SetScalarComponentFromDouble
+ ( idx[ 0 ], idx[ 1 ], idx[ 2 ], 0, red );
+ this->m_Stencil->SetScalarComponentFromDouble
+ ( idx[ 0 ], idx[ 1 ], idx[ 2 ], 1, green );
+ this->m_Stencil->SetScalarComponentFromDouble
+ ( idx[ 0 ], idx[ 1 ], idx[ 2 ], 2, blue );
+ this->m_Stencil->SetScalarComponentFromDouble
+ ( idx[ 0 ], idx[ 1 ], idx[ 2 ], 3, alpha );
+
+ int ijk[ 3 ];
+ ijk[ 0 ] = idx[ 0 ];
+ ijk[ 1 ] = idx[ 1 ];
+ ijk[ 2 ] = idx[ 2 ];
+ long id = this->m_Stencil->ComputePointId( ijk );
+ vtkUnsignedCharArray* pd_data =
+ dynamic_cast< vtkUnsignedCharArray* >(
+ this->m_PolyData->GetPointData( )->GetScalars( )
+ );
+ pd_data->SetTuple4( id, red, green, blue, alpha );
+ this->m_Stencil->Modified( );
+ this->m_PolyData->Modified( );
+ this->m_PolyDataMapper->Modified( );
+ this->m_PolyDataActor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class F, class R >
+void fpa::VTK::Image3DObserver< F, R >::
+Render( )
+{
+ if( this->m_RenderWindow != NULL )
+ this->m_RenderWindow->Render( );
+}
+
+// -------------------------------------------------------------------------
+template< class F, class R >
+void fpa::VTK::Image3DObserver< F, R >::
+Execute( const itk::Object* c, const itk::EventObject& e )
+{
+ typedef typename F::TStartEvent _TStartEvent;
+ typedef typename F::TStartLoopEvent _TStartLoopEvent;
+ typedef typename F::TEndEvent _TEndEvent;
+ typedef typename F::TEndLoopEvent _TEndLoopEvent;
+ typedef typename F::TAliveEvent _TAliveEvent;
+ typedef typename F::TFrontEvent _TFrontEvent;
+ typedef typename F::TFreezeEvent _TFreezeEvent;
+
+ typedef typename F::TStartBacktrackingEvent _TStartBacktrackingEvent;
+ typedef typename F::TEndBacktrackingEvent _TEndBacktrackingEvent;
+ typedef typename F::TBacktrackingEvent _TBacktrackingEvent;
+
+ static unsigned char Colors[][4] =