]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ThresholdImageView / LayerImageBase.cxx
index 1e402d3b35785d86341c215e7f797ca9285c2487..77a55799d4d1ff92dfc53ef8cbf3440c68fe413c 100644 (file)
@@ -243,6 +243,7 @@ void LayerImageBase::SetImage(vtkImageData* image)
        _imageChangeInformation->SetInput(_image);
 #else
        _imageChangeInformation->SetInputData(_image);
+       _imageChangeInformation->Update();
 #endif
 
 }
@@ -258,9 +259,9 @@ void LayerImageBase::SetSpcOriginalLayer(double spc[3])
 //------------------------------------------------------------------------------
 void LayerImageBase::SetNewSpacingLayer(double spc[3])
 {
-       _newSpcLayer[0]=spc[0];
-       _newSpcLayer[1]=spc[1];
-       _newSpcLayer[2]=spc[2];
+       _newSpcLayer[0] = spc[0];
+       _newSpcLayer[1] = spc[1];
+       _newSpcLayer[2] = spc[2];
        _imageChangeInformation->SetOutputSpacing( _newSpcLayer );  
 
 }
@@ -430,12 +431,10 @@ void LayerImageBase::onThreshold()
                double y=GetY();
                double z=GetZ();
 
-
                x = x*_spcBase[0];
                y = y*_spcBase[1];
                z = z*_spcBase[2];
 
-
                CleanXYZ(x,y,z);
 
                vtkCamera *camera = _baseView->GetRenderer()->GetActiveCamera();
@@ -528,11 +527,15 @@ void LayerImageBase::onThreshold()
                _imageReslicer->SetInterpolationModeToNearestNeighbor();
                _imageReslicer->Modified();
 
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               // ..
+#else
+               _imageReslicer->Update();
+#endif
                vtkImageData *img = _imageReslicer->GetOutput();
 //             img->Update();
 //             img->UpdateInformation();
-
 //             _thresholdTable->Update();
 
 //EED 2017-01-01 Migration VTK7
@@ -549,9 +552,9 @@ void LayerImageBase::onThreshold()
 #if VTK_MAJOR_VERSION <= 5
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
 #else
+               _thresholdMapper->Update();
                _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
 #endif
-
                
                _scalarbarActor->SetLookupTable( _thresholdTable );
 //             _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
@@ -559,10 +562,7 @@ void LayerImageBase::onThreshold()
                _scalarbarActor->SetNumberOfLabels(4);
                int fontsize = _scalarbarActor->GetLabelTextProperty()->GetFontSize();
                _scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
-
 //             _scalarbarActor->SetTextPad(4);  ??
-
-
                } // _image
 }
 
@@ -612,7 +612,7 @@ void LayerImageBase::onThresholdRemove()
                baseView->GetRenderer()->RemoveActor( _scalarbarActor );
 
                _actorPresent = false;
-       }
+       }  // if _actorPresent
 }
 
 //----------------------------------------------------------------------------
@@ -637,7 +637,5 @@ void LayerImageBase::GetImageScalarRange()
        _range[1]=max;
 }
 
-
-
 // EOF