From: Eduardo DAVILA Date: Thu, 28 Jul 2016 13:22:04 +0000 (+0200) Subject: #2651 creaMaracasVisu Feature New Norma - lColor Layer: Transparent Base, Refresh X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaMaracasVisu.git;a=commitdiff_plain;h=a22c876a590e28034ddf1980fe1b2f78372bf227 #2651 creaMaracasVisu Feature New Norma - lColor Layer: Transparent Base, Refresh --- 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 );