]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
#3012 creaMaracasVisu Bug New Normal - Update Image in ViewerNV
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkClipping3DDataViewer.cxx
index 335af08b1429898e41ed6ae1a151dc76840cee95..a888215dc78262188dcaa7fade05be4dc4b72176 100644 (file)
@@ -201,46 +201,49 @@ void vtkClipping3DDataViewer::SetVisibleVolumeBox(bool visibleBox)
        _visibleVolumeBox = visibleBox;
 }
 
+
 //-------------------------------------------------------------------
-void vtkClipping3DDataViewer::Configure_Tissue()
+void vtkClipping3DDataViewer::SetImage()
 {
+       int i;
+       vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+       for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+       {
+               _mCubes[i]->SetInput( imagedata );
+       } // for
+       _volumeMapper->SetInput( imagedata );
+       _volumerendererdata->SetImageData( imagedata );
+}
 
-       double range[2];
+//-------------------------------------------------------------------
+void vtkClipping3DDataViewer::Configure_Tissue()
+{
        int i;
-       for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
+       double range[2];
+       vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+       imagedata->GetScalarRange( range );
+       for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+       {
                // Visualisation - original volume
-               vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
-               imagedata->GetScalarRange( range );
                _mCubes[i] = vtkMarchingCubes::New( );
                _mCubes[i]->SetInput( imagedata );
-
                _mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
 //             _mCubes[i]->SetValue( 0, 1500 );
-
            _tissueStripper[i] = vtkStripper::New();
            _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
-
-
-
                _tissuePlanes[i]  = vtkPlanes::New();
-
                int x1,x2,y1,y2,z1,z2;
                imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
                _tissuePlanes[i]->SetBounds  (x1,x2,y1,y2,z1,z2);
-
                _tissueClipper[i] = vtkClipPolyData::New();
                _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
                _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
                _tissueClipper[i]->InsideOutOn( );
-
                _tissueMapper[i] = vtkPolyDataMapper::New( );
                _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
                _tissueMapper[i]->ScalarVisibilityOff( );
 //             _tissueMapper[i]->Update();
-
-       }
-
-
+       } // for i  
 
        // vtkActor tissue
        for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
@@ -384,6 +387,7 @@ void vtkClipping3DDataViewer::Configure_Volume()
        _observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
 }
 
+//-----------------------------------------------------------------------------
 
 void vtkClipping3DDataViewer::Configure_VolumeBox()
 {
@@ -401,12 +405,15 @@ void vtkClipping3DDataViewer::Configure_VolumeBox()
        //_volumerendererdata->BoundingBoxChanged(event.IsChecked() );
 }
 
+//-----------------------------------------------------------------------------
+
 void vtkClipping3DDataViewer::SetRenderer(vtkRenderer* renderer)
 {
     _volumerendererdata->SetRenderer(renderer);
 
 }
 
+//-----------------------------------------------------------------------------
 void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interactor)
 {
 
@@ -414,6 +421,7 @@ void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interacto
 }
 
 
+//-----------------------------------------------------------------------------
 void vtkClipping3DDataViewer::BoxActorChanged(bool changed)
 {
     vector<double> *gv = this->GetGreyValuesTransferenceFVector();
@@ -425,6 +433,7 @@ void vtkClipping3DDataViewer::BoxActorChanged(bool changed)
 
 }
 
+//-----------------------------------------------------------------------------
 void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun)
 {
         _volumerendererdata->SetLookUpTable((vtkLookupTable*)(ctfun));
@@ -432,6 +441,7 @@ void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double>
 }
 
 
+//-----------------------------------------------------------------------------
 void vtkClipping3DDataViewer::updateVolume()
 {
 
@@ -481,7 +491,7 @@ void vtkClipping3DDataViewer::Configure()
 //EED 4 nov 2015 Estelle 
 //    _mapOutline->SetInput(_outlineData->GetOutput());
 
-       _outline                = vtkActor::New();
+       _outline        = vtkActor::New();
     _outline->SetMapper(_mapOutline);
     _outline->GetProperty()->SetColor(0,0,0);
 }