From 9262dd39f62ae6041ae76d525020a2d884bfdcfa Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Thu, 21 Apr 2011 14:46:55 +0200 Subject: [PATCH] Corrected displayed value at crosshair in overlay and fusion --- vv/vvSlicerManager.cxx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index 4536f39..c3f5c0c 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -846,23 +846,19 @@ void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer) } if (mSlicers[slicer]->GetOverlayActor() && mSlicers[slicer]->GetOverlayActor()->GetVisibility()) { displayOver = 1; - double Xover = (x - mSlicers[slicer]->GetOverlay()->GetOrigin()[0]) - /mSlicers[slicer]->GetOverlay()->GetSpacing()[0]; - double Yover = (y - mSlicers[slicer]->GetOverlay()->GetOrigin()[1]) - /mSlicers[slicer]->GetOverlay()->GetSpacing()[1]; - double Zover = (z - mSlicers[slicer]->GetOverlay()->GetOrigin()[2]) - /mSlicers[slicer]->GetOverlay()->GetSpacing()[2]; - valueOver = this->GetScalarComponentAsDouble(static_cast(mSlicers[slicer]->GetOverlayMapper()->GetInput()), Xover, Yover, Zover); + vtkImageData *overlay = dynamic_cast(mSlicers[slicer]->GetOverlayMapper()->GetInput()); + double Xover = (x - overlay->GetOrigin()[0]) / overlay->GetSpacing()[0]; + double Yover = (y - overlay->GetOrigin()[1]) / overlay->GetSpacing()[1]; + double Zover = (z - overlay->GetOrigin()[2]) / overlay->GetSpacing()[2]; + valueOver = this->GetScalarComponentAsDouble(overlay, Xover, Yover, Zover); } if (mSlicers[slicer]->GetFusionActor() && mSlicers[slicer]->GetFusionActor()->GetVisibility()) { displayFus = 1; - double Xfus = (x - mSlicers[slicer]->GetFusion()->GetOrigin()[0]) - /mSlicers[slicer]->GetFusion()->GetSpacing()[0]; - double Yfus = (y - mSlicers[slicer]->GetFusion()->GetOrigin()[1]) - /mSlicers[slicer]->GetFusion()->GetSpacing()[1]; - double Zfus = (z - mSlicers[slicer]->GetFusion()->GetOrigin()[2]) - /mSlicers[slicer]->GetFusion()->GetSpacing()[2]; - valueFus = this->GetScalarComponentAsDouble(static_cast(mSlicers[slicer]->GetFusionMapper()->GetInput()), Xfus, Yfus, Zfus); + vtkImageData *fusion = dynamic_cast(mSlicers[slicer]->GetFusionMapper()->GetInput()); + double Xover = (x - fusion->GetOrigin()[0]) / fusion->GetSpacing()[0]; + double Yover = (y - fusion->GetOrigin()[1]) / fusion->GetSpacing()[1]; + double Zover = (z - fusion->GetOrigin()[2]) / fusion->GetSpacing()[2]; + valueFus = this->GetScalarComponentAsDouble(fusion, Xover, Yover, Zover); } emit UpdatePosition(mSlicers[slicer]->GetCursorVisibility(), x,y,z,X,Y,Z,value); -- 2.47.1