X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicerManagerCommand.cxx;h=73a0ab5efda3e79ba42b604908662a2149806b4b;hb=f8f487135ec75a4a88e1d325cad6375313b59a29;hp=1b7103301b7d9f0544c731c14ccca913a623657d;hpb=97b13fba69a83e91416caa9e689e012211649f12;p=clitk.git diff --git a/vv/vvSlicerManagerCommand.cxx b/vv/vvSlicerManagerCommand.cxx index 1b71033..73a0ab5 100644 --- a/vv/vvSlicerManagerCommand.cxx +++ b/vv/vvSlicerManagerCommand.cxx @@ -271,7 +271,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, //All type of mouse events if (event == vtkCommand::LeaveEvent) { this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX, - -VTK_DOUBLE_MAX,this->SM->GetSlicer(VisibleInWindow)->GetTSlice()); + -VTK_DOUBLE_MAX,this->SM->GetSlicer(VisibleInWindow)->GetMaxCurrentTSlice()); this->SM->GetSlicer(VisibleInWindow)->Render(); return; } @@ -362,8 +362,13 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, zWorld = z; break; } - this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition(xWorld,yWorld,zWorld, - this->SM->GetSlicer(VisibleInWindow)->GetTSlice()); + + double p[3]; p[0] = xWorld; p[1] = yWorld; p[2] = zWorld; + double pt[3]; + this->SM->GetSlicer(VisibleInWindow)->GetSlicingTransform()->TransformPoint(p, pt); + + this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition(pt[0],pt[1],pt[2], + this->SM->GetSlicer(VisibleInWindow)->GetMaxCurrentTSlice()); if (newLandmark) { this->SM->AddLandmark(xWorld,yWorld,zWorld, this->SM->GetSlicer(VisibleInWindow)->GetTSlice());