]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
#3162 creaMaracasVisu Bug New Normal - Threshold layer
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ThresholdImageView / LayerImageBase.cxx
index 6f3762475dc2af6b361714d32f42af060db51341..06a085a5634fbf8c4bb87aabbc3a31be2fa09484 100644 (file)
@@ -97,6 +97,7 @@ LayerImageBase::LayerImageBase()
        _X                                              =       -1;
        _Y                                              =       -1;
        _Z                                              =       -1;
+       _opacity                                =       1;
        _thresholdTable                 =       NULL;
        _thresholdMapper                =       NULL;
        _scalarbarActor                 =       NULL;
@@ -409,12 +410,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();
@@ -450,7 +449,7 @@ void LayerImageBase::onThreshold()
                                        _scalarbarActor->SetDisplayPosition(0,0);
                                }
 
-                               _thresholdActor->SetOpacity( 0 );
+                               _thresholdActor->SetOpacity( 1 );
                                _thresholdActor->InterpolateOn(  );
                                
                                if (directionViewer==0)
@@ -509,7 +508,8 @@ void LayerImageBase::onThreshold()
                _thresholdMapper->SetInput( img );
                _thresholdMapper->SetLookupTable( _thresholdTable );
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
-               
+               _thresholdActor->SetOpacity(_opacity);
+
                _scalarbarActor->SetLookupTable( _thresholdTable );
 //             _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
                _scalarbarActor->SetTitle("Value");
@@ -557,6 +557,8 @@ void LayerImageBase::onThresholdChangeOpacity (int opacity)
        {
                _thresholdActor->SetOpacity(opacity/100.0);
        }
+// EED 2017-12-17
+       _opacity = (double)opacity/100.0;
 }
 
 //----------------------------------------------------------------------------