From: schaerer Date: Wed, 23 Jun 2010 11:13:14 +0000 (+0000) Subject: fix crash when origin is negative X-Git-Tag: v1.2.0~607 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=11359456787921edeba06494b3c1e26ca16e6797;p=clitk.git fix crash when origin is negative --- 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);