From 6e385f9a227796b6a5fde57f8cf3b7965aca266a Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 4 Mar 2013 07:41:53 +0100 Subject: [PATCH] Rolled back to middle slice on first load --- vv/vvSlicer.cxx | 13 ++++++++----- vv/vvSlicer.h | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) 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 -- 2.47.1