X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FThresholdImageView%2FLayerImageBase.cxx;h=6f3762475dc2af6b361714d32f42af060db51341;hb=a22c876a590e28034ddf1980fe1b2f78372bf227;hp=f2ebd6f981d0099dcfbbb481bcefa969de89ec17;hpb=05c4abbebf824bbbbaaab135acf6c888662dff69;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..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 );