]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
creaButtonContainer & creaPanelButtonContainer: Deep errors have been solved!! ready...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtkMPR3DView.cxx
index a094c266bcc871a8457c4f41b461ef5e0ef9c049..179f325554b6a69f48437ffc82c9d2d9ce06eaff 100644 (file)
 #include "vtkCutter.h"
 #include "vtkTransform.h"
 #include "vtkmyPWCallback_3DPointWidget.h"
+#include "vtkProperty.h"
+#include "vtkCellPicker.h"
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
 
 wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview )
 {
        _wxvtk3Dbaseview                        =       wxvtk3Dbaseview;
        _vtkmpr3Ddataviewer                     =       NULL;
-       _wxvtkmpr3DviewCntrlPanel       =       NULL;   
-       //_myCallback=NULL;
-       _pointWidget=NULL;
-       _planeWidget=NULL;
-       _vtkplane=NULL;
-       _probe=NULL;
-       _contourMapper=NULL;
+       _wxvtkmpr3DviewCntrlPanel       =       NULL;
+       //_myCallback                           =       NULL;
+       _pointWidget                            =       NULL;
+       _planeWidget                            =       NULL;
+       _vtkplane                                       =       NULL;
+       _probe                                          =       NULL;
+       _contourMapper                          =       NULL;
+
+       _planeWidgetX = 0;
+       _planeWidgetY = 0;
+       _planeWidgetZ = 0;
+       //EED Fev 3 2010
+       //Free Planes
 }
-void wxVtkMPR3DView::RemoveActor(vtkActor* actor){     
 
-       _wxvtk3Dbaseview->GetRenderer()->RemoveActor(actor);    
 
+//-------------------------------------------------------------------
+wxVtkMPR3DView::~wxVtkMPR3DView()
+{
+       VisiblePointWidget( false );
+       VisiblePlaneWidget( false );
+
+       if(_pointWidget!=NULL){
+               _pointWidget->Delete();
+       }
+       if(_planeWidget!=NULL){
+               _planeWidget->Delete();
+       }
+
+       if(_vtkplane!=NULL){
+               _vtkplane->Delete();
+               _probe->Delete();
+               _contourMapper->Delete();
+               _contourPlaneActor->Delete();
+       }
+
+}
 
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::RemoveActor(vtkActor* actor)
+{
+       _wxvtk3Dbaseview->GetRenderer()->RemoveActor(actor);
 }
-void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc){
-       if(ext == NULL){
 
-               _wxvtk3Dbaseview->GetRenderer()->ResetCamera ();        
-               _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);      
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc)
+{
+       if(ext == NULL){
+               _wxvtk3Dbaseview->GetRenderer()->ResetCamera ();
+               _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);
        }else{
-               /*double x = (spc[0])*(origin[0]+(((double)ext[1]-(double)ext[0])/2.0));                
+               /*double x = (spc[0])*(origin[0]+(((double)ext[1]-(double)ext[0])/2.0));
                double y = (spc[1])*(origin[1]+(double)ext[3]);
                double z = (spc[2])*(origin[2]+(((double)ext[5]-(double)ext[4])/2.0));*/
                /*double x0=(spc[0])*((double)ext[0]+origin[0]);
@@ -53,43 +91,46 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc){
                double y1=(spc[1])*((double)ext[3]);
                double z0=(spc[2])*((double)ext[4]);
                double z1=(spc[2])*((double)ext[5]);
-               
+
                _wxvtk3Dbaseview->GetRenderer()->ResetCamera(x0,x1,y0,y1,z0,z1);
                //_wxvtk3Dbaseview->GetCamera()->SetPosition(x,y,z);
-               _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);      
+               _wxvtk3Dbaseview->GetCamera()->Dolly(1.5);
        }
 }
-void wxVtkMPR3DView::Configure(){
 
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::Configure()
+{
+       vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
 
        _wxvtk3Dbaseview->Configure();
        _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel();
-       
-//EED 27 Mai 2009 
-//     _wxvtk3Dbaseview->GetRenderer()->Clear();    
-       
-       // Actors are added to the renderer. 
+
+//EED 27 Mai 2009
+//     _wxvtk3Dbaseview->GetRenderer()->Clear();
+
+       // Actors are added to the renderer.
        vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
-       _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );                     
+       _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
 //     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0)  );    // _saggital
 //     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1)  );    // _axial
 //     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2)  );    // _coronal
 
 
-       // An initial camera view is created.  The Dolly() method moves 
-       // the camera towards the FocalPoint, thereby enlarging the image.      
+       // An initial camera view is created.  The Dolly() method moves
+       // the camera towards the FocalPoint, thereby enlarging the image.
        _wxvtk3Dbaseview->GetRenderer()->SetActiveCamera(_wxvtk3Dbaseview->GetCamera());
        this->ResetCamera();
-       
+
 
        // Set a background color for the renderer and set the size of the
        // render window (expressed in pixels).
        _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
-       _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
+//EED 23oct2010        _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
 
        // Note that when camera movement occurs (as it does in the Dolly()
        // method), the clipping planes often need adjusting. Clipping planes
-       // consist of two planes: near and far along the view direction. The 
+       // consist of two planes: near and far along the view direction. The
        // near plane clips out objects in front of the plane; the far plane
        // clips out objects behind the plane. This way only what is drawn
        // between the planes is actually rendered.
@@ -103,100 +144,181 @@ void wxVtkMPR3DView::Configure(){
        //}
        vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
        _myCallback->SetWxVtkMPR3DView(this);
-       if(_pointWidget!=NULL){
-               _pointWidget->Delete();
+
+
+       if(imageData){
+               if(_pointWidget==NULL){
+                       _pointWidget = vtkPointWidget::New();
+               }
+               _pointWidget->SetInput( imageData );
+               _myCallback->SetVtkPointWidget(_pointWidget);
+               _pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
+               _pointWidget->AllOff();
+               _pointWidget->PlaceWidget();
+
+               _pointWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
+
+               if(_planeWidget==NULL)
+               {
+                       _planeWidget = vtkPlaneWidget::New();
+               }
+               _planeWidget->SetInput( imageData );
+
+               _myCallback->SetVtkPlaneWidget(_planeWidget);
+
+               _planeWidget->NormalToXAxisOn();
+               _planeWidget->SetResolution(50);
+               _planeWidget->SetRepresentationToOutline();
+
+               int dim[3];
+
+               imageData->GetDimensions(dim);
+               int px=(dim[0]/2);
+               int py=(dim[1]/2);
+               int pz=(dim[2]/2);
+               int dd=20;
+               _planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
+
+               if(_vtkplane==NULL){
+                       _vtkplane = vtkPolyData::New();
+
+                       _probe = vtkProbeFilter::New();
+                       _probe->SetInput(_vtkplane);
+
+                       _contourMapper = vtkPolyDataMapper::New();
+
+                       _contourMapper->SetInput( _probe->GetPolyDataOutput() );
+
+                       _contourPlaneActor = vtkActor::New();
+                       _contourPlaneActor->SetMapper(_contourMapper);
+
+                       _contourPlaneActor->VisibilityOff();
+
+                       _planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
+                       _planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
+
+                       _planeWidget->Off();
+                       _wxvtk3Dbaseview->GetRenderer()->AddActor( _contourPlaneActor );
+
+               }
+
+               _planeWidget->GetPolyData(_vtkplane);
+               _probe->SetSource( imageData );
+               _contourMapper->SetScalarRange( imageData->GetScalarRange() );
+
+
+               ConfigureFreePlanes();
        }
-       _pointWidget = vtkPointWidget::New();
-       _myCallback->SetVtkPointWidget(_pointWidget);
-       _pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() ); 
-       _pointWidget->SetInput( GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
-       
-       _pointWidget->AllOff();
-       
-       _pointWidget->PlaceWidget();
-//     _pointWidget->SetPosition( x,y,z ); 
-       
+
+//     _pointWidget->SetPosition( x,y,z );
+
 //EED01 29Mars2009
-// MACOS probleme vtk-window out of wx-window  
+// MACOS probleme vtk-window out of wx-window
 //     _pointWidget->On();
-       
-       _pointWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
-
 
 // PlaneWidget
-       if(_planeWidget!=NULL){
-               _planeWidget->Delete();
+
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::ConfigureFreePlanes()
+{
+
+       // The shared picker enables us to use 3 planes at one time
+       // and gets the picking order right
+       vtkCellPicker* picker = vtkCellPicker::New();
+       picker->SetTolerance(0.005);
+
+       // The 3 image plane widgets
+       _planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
+       _planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
+       _planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
+
+       _planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
+       _planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
+
+       picker->UnRegister(NULL);
+
+}
+
+//-------------------------------------------------------------------
+vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
+{
+       vtkProperty* prop1 = 0;
+       vtkImagePlaneWidget* planeWidget = 0;
+       planeWidget = vtkImagePlaneWidget::New();
+       planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
+       planeWidget->EnabledOff();
+       vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+       int xMin = 0, xMax = 0, yMin = 0, yMax = 0, zMin = 0, zMax = 0;
+       double xSpacing = 0, ySpacing = 0, zSpacing = 0;
+       if(image){
+               planeWidget->SetInput( image );
+               image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
+               image->GetSpacing(xSpacing, ySpacing, zSpacing);
        }
-       _planeWidget = vtkPlaneWidget::New();
-       _myCallback->SetVtkPlaneWidget(_planeWidget);
-       _planeWidget->SetInput( GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
-       _planeWidget->NormalToXAxisOn();
-       _planeWidget->SetResolution(50);
-       _planeWidget->SetRepresentationToOutline();
-       int dim[3];
-       GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetDimensions(dim);
-       int px=(dim[0]/2);
-       int py=(dim[1]/2);
-       int pz=(dim[2]/2);
-       int dd=20;
-       _planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
-
-
-       if(_vtkplane==NULL){
-               _vtkplane = vtkPolyData::New();
-               
-               _probe = vtkProbeFilter::New();
-               _probe->SetInput(_vtkplane);
-
-               _contourMapper = vtkPolyDataMapper::New();
-               
-               _contourMapper->SetInput( _probe->GetPolyDataOutput() );
-
-               _contourPlaneActor = vtkActor::New();
-               _contourPlaneActor->SetMapper(_contourMapper);
-
-               _contourPlaneActor->VisibilityOff();
-
-               _planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
-               _planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
-
-               _planeWidget->Off();
-               _wxvtk3Dbaseview->GetRenderer()->AddActor( _contourPlaneActor );        
 
-       }else{
-               
+       if (activationkey=='x')
+       {
+               planeWidget->SetPlaneOrientationToXAxes();
+               planeWidget->SetSlicePosition((xMax+xMin)/2.*xSpacing);
        }
-       _planeWidget->GetPolyData(_vtkplane);
 
-       
-       vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData(); 
-       _probe->SetSource( imageData );
+       if (activationkey=='y')
+       {
+               planeWidget->SetPlaneOrientationToYAxes();
+               planeWidget->SetSlicePosition((yMax+yMin)/2.*ySpacing);
+       }
 
-       
-       _contourMapper->SetScalarRange( imageData->GetScalarRange() );
-    
-       
+       if (activationkey=='z')
+       {
+               planeWidget->SetPlaneOrientationToZAxes();
+               planeWidget->SetSlicePosition((zMax+zMin)/2.*zSpacing);
+       }
 
-                       
+       planeWidget->DisplayTextOn();
+       planeWidget->SetPicker(picker);
+       planeWidget->SetKeyPressActivationValue(activationkey);
+       prop1 = planeWidget->GetPlaneProperty();
+       prop1->SetColor(r, g, b);
+       return planeWidget;
 }
+
 //-------------------------------------------------------------------
-wxVtkMPR3DView::~wxVtkMPR3DView()
+void wxVtkMPR3DView::FreePlaneVisible(int plane, bool ok)
 {
-       if(_pointWidget!=NULL){
-               _pointWidget->Delete();
-       }
-       if(_planeWidget!=NULL){
-               _planeWidget->Delete();
+       if(_planeWidgetX){
+               if ((plane==1) && (ok==true)) _planeWidgetX->EnabledOn();
+               if ((plane==2) && (ok==true)) _planeWidgetY->EnabledOn();
+               if ((plane==3) && (ok==true)) _planeWidgetZ->EnabledOn();
+               if ((plane==1) && (ok==false)) _planeWidgetX->EnabledOff();
+               if ((plane==2) && (ok==false)) _planeWidgetY->EnabledOff();
+               if ((plane==3) && (ok==false)) _planeWidgetZ->EnabledOff();
        }
+}
 
-       if(_vtkplane!=NULL){
-               _vtkplane->Delete();            
-               _probe->Delete();
-               _contourMapper->Delete();                       
-               _contourPlaneActor->Delete();           
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::FreePlaneInteraction(bool ok)
+{
+       if(_planeWidgetX){
+               if (ok==true)
+               {
+                       _planeWidgetX->InteractionOn();
+                       _planeWidgetY->InteractionOn();
+                       _planeWidgetZ->InteractionOn();
+               } else {
+                       _planeWidgetX->InteractionOff();
+                       _planeWidgetY->InteractionOff();
+                       _planeWidgetZ->InteractionOff();
+               }
        }
+}
 
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::setColorTransferFunction(vtkColorTransferFunction* colortable)
+{
+       GetVtkMPR3DDataViewer ()->setColorTransferFunction(colortable);
 }
 
 //-------------------------------------------------------------------
@@ -209,11 +331,21 @@ void wxVtkMPR3DView::Refresh()   // virtual
        }
 
 }
+
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::RefreshView()   // virtual
 {
        double spc[3];
-       this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc);
+       vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+
+       if(image){
+               image->GetSpacing(spc);
+       }else{
+               spc[0] = 0;
+               spc[1] = 0;
+               spc[2] = 0;
+       }
+       //this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc);
 
        //double nx=1,ny=0,nz=0; // JPRx
        Refresh();
@@ -225,31 +357,33 @@ void wxVtkMPR3DView::RefreshView()   // virtual
        y=y*spc[1];
        z=z*spc[2];
 
-       _pointWidget->SetPosition( x,y,z ); 
+       if(_pointWidget){
+               _pointWidget->SetPosition( x,y,z );
 
 
-       double in[3]; 
-       double normal[3];
-       vtkTransform *transform = GetVtkMPR3DDataViewer ()->GetVtkMPRBaseData()->GetTransformOrientation();
-       in[0]=1;                in[1]=0;                        in[2]=0;
-       transform->TransformPoint(in,normal);
-       _planeWidget->SetNormal( normal[0],normal[1],normal[2] );
+               double in[3];
+               double normal[3];
+               vtkTransform *transform = GetVtkMPR3DDataViewer ()->GetVtkMPRBaseData()->GetTransformOrientation();
+               in[0]=1;                in[1]=0;                        in[2]=0;
+               transform->TransformPoint(in,normal);
+               _planeWidget->SetNormal( normal[0],normal[1],normal[2] );
 
 
-       _planeWidget->SetCenter( x,y,z );
-       _planeWidget->UpdatePlacement();
-       _planeWidget->GetPolyData(_vtkplane);
+               _planeWidget->SetCenter( x,y,z );
+               _planeWidget->UpdatePlacement();
+               _planeWidget->GetPolyData(_vtkplane);
+       }
 }
 //-------------------------------------------------------------------
-wxPanel* wxVtkMPR3DView::CreateControlPanel(wxWindow *parent)
+wxPanel* wxVtkMPR3DView::CreateControlPanel(wxWindow *parent, bool align)
 {
-       _wxvtkmpr3DviewCntrlPanel = new wxVtkMPR3DViewCntrlPanel(parent,this);
+       _wxvtkmpr3DviewCntrlPanel = new wxVtkMPR3DViewCntrlPanel(parent,this, align);
        return _wxvtkmpr3DviewCntrlPanel;
 }
 //-------------------------------------------------------------------
-vtkMPR3DDataViewer* wxVtkMPR3DView::GetVtkMPR3DDataViewer() 
+vtkMPR3DDataViewer* wxVtkMPR3DView::GetVtkMPR3DDataViewer()
 {
-       return _vtkmpr3Ddataviewer; 
+       return _vtkmpr3Ddataviewer;
 }
 //-------------------------------------------------------------------
 wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*)
@@ -263,11 +397,19 @@ wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*)
 
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
+       /*if(visible == false)
+               printf("CPR: wxVtkMPR3DView::VisibleImageActor-> visibleActor == false \n");
+       else
+       {
+               printf("CPR: wxVtkMPR3DView::VisibleImageActor-> visibleActor == true\n");
+               printf("CPR: wxVtkMPR3DView::VisibleImageActor-> idPosition == %d\n", idPosition);
+       }
+       */
        if (visible!=_vtkmpr3Ddataviewer->GetVisiblePosition(idPosition)){
                if (visible==false){
-                       _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );        
+                       _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );
                } else {
-                       _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );   
+                       _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition)  );
                }
                _vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible);
        }
@@ -277,25 +419,43 @@ void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::VisiblePointWidget( bool visible )
 {
-       if (visible==true)
-       {
-               _pointWidget->On();
-       } else {
-               _pointWidget->Off();
+       if(_pointWidget){
+               if (visible==true)
+               {
+                       _pointWidget->On();
+               } else {
+                       _pointWidget->Off();
+               }
        }
 }
 
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::VisiblePlaneWidget( bool visible )
 {
-       if (visible==true)
-       {
-               _planeWidget->On();
-               _contourPlaneActor->VisibilityOn();
+       if(_planeWidget){
+               if (visible==true)
+               {
+                       _planeWidget->On();
+                       _contourPlaneActor->VisibilityOn();
 
-       } else {
-               _planeWidget->Off();
-               _contourPlaneActor->VisibilityOff();
+               } else {
+                       _planeWidget->Off();
+                       _contourPlaneActor->VisibilityOff();
+               }
+       }
+}
+
+//CPR: Method added 30 Nov 2009
+void wxVtkMPR3DView::showOutlineActor(bool value)
+{
+       vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
+       if(value == true)
+       {
+               _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
+       }
+       else
+       {
+               _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
        }
 }
 
@@ -308,7 +468,7 @@ void wxVtkMPR3DView::SetVtkMPR3DDataViewer(vtkMPR3DDataViewer *vtkmpr3Ddataviewe
 //-------------------------------------------------------------------
 void wxVtkMPR3DView::InitOrientationPointWidget()
 {
-       this->_planeWidget->SetNormal(1,0,0);           
+       this->_planeWidget->SetNormal(1,0,0);
 }
 
 
@@ -360,7 +520,7 @@ void wxVtkMPR3DView::TestLoic1()
        stPoints -> Update();
 
        vtkImageChangeInformation  *change = vtkImageChangeInformation ::New();
-       change    -> SetInput( stPoints );  
+       change    -> SetInput( stPoints );
        change    -> Update();    //important
 
        double _range[2];
@@ -373,7 +533,7 @@ void wxVtkMPR3DView::TestLoic1()
    _bwlookup->SetValueRange( 0 , 1 );
    _bwlookup->SetAlphaRange( 1 , 1 );
    _bwlookup->Build( );
+
    vtkLookupTable * _collookup = vtkLookupTable::New( );
    _collookup->SetNumberOfColors( 256 );
    _collookup->SetTableRange( 0 , 255 );
@@ -416,7 +576,7 @@ void wxVtkMPR3DView::TestLoic1()
       renderer->SetActiveCamera(camera);
       renderer->ResetCamera();
       renderer->SetBackground(1,1,1);
-  
+
   renWin->SetSize(300,300);
 
   // interact with data
@@ -443,7 +603,7 @@ void wxVtkMPR3DView::TestLoic2()
         vtkPlane *slicePlane = vtkPlane::New();
                                this->_planeWidget->GetPlane( slicePlane );
 
-                
+
         vtkCutter* sliceCutter = vtkCutter::New();
                vtkImageData *vtkimagedata =  this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
                 sliceCutter->SetInput( vtkimagedata );
@@ -472,7 +632,7 @@ void wxVtkMPR3DView::TestLoic2()
                 contourMapper->SetScalarRange( range );
   //              contourMapper->SetLookupTable( lut );
 
-                
+
         vtkActor *contourActor = vtkActor::New();
                 contourActor->SetMapper( contourMapper );
 
@@ -495,7 +655,7 @@ void wxVtkMPR3DView::TestLoic2()
       renderer->SetActiveCamera(camera);
       renderer->ResetCamera();
       renderer->SetBackground(1,1,1);
-  
+
   renWin->SetSize(300,300);
 
   // interact with data
@@ -503,4 +663,5 @@ void wxVtkMPR3DView::TestLoic2()
   iren->Start();
 
 
-}
\ No newline at end of file
+}
+