From a22c876a590e28034ddf1980fe1b2f78372bf227 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 28 Jul 2016 15:22:04 +0200 Subject: [PATCH] #2651 creaMaracasVisu Feature New Norma - lColor Layer: Transparent Base, Refresh --- .../widgets/ThresholdImageView/LayerImageBase.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index f2ebd6f..6f37624 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -94,9 +94,9 @@ private: LayerImageBase::LayerImageBase() { _actorPresent = false; - _X = 0; - _Y = 0; - _Z = 0; + _X = -1; + _Y = -1; + _Z = -1; _thresholdTable = NULL; _thresholdMapper = NULL; _scalarbarActor = NULL; @@ -212,9 +212,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 ); -- 2.47.1