X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FThresholdImageView%2FLayerImageBase.cxx;h=06a085a5634fbf8c4bb87aabbc3a31be2fa09484;hb=8cb2e736dbd160649089afd44928db6d26febcca;hp=f2ebd6f981d0099dcfbbb481bcefa969de89ec17;hpb=cef231b63d21ad7ac9914306a0a012666c24f00a;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index f2ebd6f..06a085a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -94,9 +94,10 @@ private: LayerImageBase::LayerImageBase() { _actorPresent = false; - _X = 0; - _Y = 0; - _Z = 0; + _X = -1; + _Y = -1; + _Z = -1; + _opacity = 1; _thresholdTable = NULL; _thresholdMapper = NULL; _scalarbarActor = NULL; @@ -212,9 +213,12 @@ void LayerImageBase::SetImage(vtkImageData* image) SetDimensionBase(dimBase); imagebase->GetSpacing(spcBase); SetSpcBase(spcBase); - SetX( dimBase[0]*spcBase[0]/2 ); - SetY( dimBase[1]*spcBase[1]/2 ); - SetZ( dimBase[2]*spcBase[2]/2 ); + + if ((_X<0) || (_X>dimBase[0])) { SetX( dimBase[0]/2 ); } + if ((_Y<0) || (_Y>dimBase[1])) { SetY( dimBase[1]/2 ); } + if ((_Z<0) || (_Z>dimBase[2])) { SetZ( dimBase[2]/2 ); } + + } // if imagebase } // if wxvtkbaseview _image->GetScalarRange( _range ); @@ -406,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(); @@ -447,7 +449,7 @@ void LayerImageBase::onThreshold() _scalarbarActor->SetDisplayPosition(0,0); } - _thresholdActor->SetOpacity( 0 ); + _thresholdActor->SetOpacity( 1 ); _thresholdActor->InterpolateOn( ); if (directionViewer==0) @@ -506,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"); @@ -554,6 +557,8 @@ void LayerImageBase::onThresholdChangeOpacity (int opacity) { _thresholdActor->SetOpacity(opacity/100.0); } +// EED 2017-12-17 + _opacity = (double)opacity/100.0; } //----------------------------------------------------------------------------