From 11359456787921edeba06494b3c1e26ca16e6797 Mon Sep 17 00:00:00 2001 From: schaerer Date: Wed, 23 Jun 2010 11:13:14 +0000 Subject: [PATCH] fix crash when origin is negative --- vv/vvSegmentationDialog.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vv/vvSegmentationDialog.cxx b/vv/vvSegmentationDialog.cxx index e1f0ffd..4fb788e 100644 --- a/vv/vvSegmentationDialog.cxx +++ b/vv/vvSegmentationDialog.cxx @@ -413,9 +413,9 @@ void vvSegmentationDialog::InsertSeed() point4D[3] = mManager->GetLandmarks()->GetCoordinates( mManager->GetLandmarks()->GetNumberOfPoints()-1)[3]; - point4D[0] = point4D[0]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[0]; - point4D[1] = point4D[1]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[1]; - point4D[2] = point4D[2]/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[2]; + point4D[0] = (point4D[0]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[0])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[0]; + point4D[1] = (point4D[1]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[1])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[1]; + point4D[2] = (point4D[2]-mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetOrigin()[2])/mManager->GetSlicer(0)->GetImage()->GetVTKImages()[0]->GetSpacing()[2]; vtkImageSeedConnectivity* seed = vtkImageSeedConnectivity::New(); seed->SetInputConnectValue(1); -- 2.47.1