From: Vivien Delmon Date: Mon, 4 Mar 2013 14:52:20 +0000 (+0100) Subject: Merge branch 'master' of tux.creatis.insa-lyon.fr:clitk X-Git-Tag: v1.4.0~242^2~3 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=674ad0ff12d7c7e888c928849745952249aa7910;hp=877d71d469d324280796c8c07fa0b926865425b1;p=clitk.git Merge branch 'master' of tux.creatis.insa-lyon.fr:clitk --- diff --git a/vv/qt_ui/vvMainWindow.ui b/vv/qt_ui/vvMainWindow.ui index 67a467d..b80a782 100644 --- a/vv/qt_ui/vvMainWindow.ui +++ b/vv/qt_ui/vvMainWindow.ui @@ -441,7 +441,7 @@ - 1 + 0 diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 30a8f10..ed53d2c 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -155,6 +155,7 @@ vvSlicer::vvSlicer() mConcatenatedTransform = vtkSmartPointer::New(); mConcatenatedFusionTransform = vtkSmartPointer::New(); mConcatenatedOverlayTransform = vtkSmartPointer::New(); + mFirstSetSliceOrientation = true; } //------------------------------------------------------------------------------ @@ -853,15 +854,17 @@ void vvSlicer::SetSliceOrientation(int orientation) // DDV(cursorPos, 3); // SetCurrentPosition(cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]); - if (this->Renderer && this->GetInput()) { + if (mFirstSetSliceOrientation) { + int *range = this->GetSliceRange(); + if (range) + this->Slice = static_cast((range[0] + range[1]) * 0.5); + mFirstSetSliceOrientation = false; + } + else if (this->Renderer && this->GetInput()) { double s = mCursor[orientation]; double sCursor = (s - this->GetInput()->GetOrigin()[orientation])/this->GetInput()->GetSpacing()[orientation]; this->Slice = static_cast(sCursor); } - -// int *range = this->GetSliceRange(); -// if (range) -// this->Slice = static_cast((range[0] + range[1]) * 0.5); this->UpdateOrientation(); this->UpdateDisplayExtent(); diff --git a/vv/vvSlicer.h b/vv/vvSlicer.h index 570c43d..0bffd1f 100644 --- a/vv/vvSlicer.h +++ b/vv/vvSlicer.h @@ -297,5 +297,6 @@ private: bool mOverlayVisibility; bool mFusionVisibility; bool mVFVisibility; + bool mFirstSetSliceOrientation; }; #endif