From: srit Date: Mon, 7 Jun 2010 21:50:15 +0000 (+0000) Subject: Corrected bug in landmarks with negative spacing X-Git-Tag: v1.2.0~619 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b7ea297944fd0df19cbaa19889cdb25673d93095;p=clitk.git Corrected bug in landmarks with negative spacing --- diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index bbecaa4..0e18d54 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -736,8 +736,8 @@ void vvSlicer::UpdateDisplayExtent() bounds[1] = ImageActor->GetBounds()[1]; bounds[2] = ImageActor->GetBounds()[2]; bounds[3] = ImageActor->GetBounds()[3]; - bounds[4] = ImageActor->GetBounds()[4]-(0.9/this->GetInput()->GetSpacing()[2]); - bounds[5] = ImageActor->GetBounds()[5]+(0.9/this->GetInput()->GetSpacing()[2]); + bounds[4] = ImageActor->GetBounds()[4]-fabs(0.5/this->GetInput()->GetSpacing()[2]); + bounds[5] = ImageActor->GetBounds()[5]+fabs(0.5/this->GetInput()->GetSpacing()[2]); mClipBox->SetBounds(bounds); UpdateLandmarks(); } @@ -786,8 +786,8 @@ void vvSlicer::UpdateDisplayExtent() double bounds [6]; bounds[0] = ImageActor->GetBounds()[0]; bounds[1] = ImageActor->GetBounds()[1]; - bounds[2] = ImageActor->GetBounds()[2]-(0.5/this->GetInput()->GetSpacing()[1]); - bounds[3] = ImageActor->GetBounds()[3]+(0.5/this->GetInput()->GetSpacing()[1]); + bounds[2] = ImageActor->GetBounds()[2]-fabs(0.5/this->GetInput()->GetSpacing()[1]); + bounds[3] = ImageActor->GetBounds()[3]+fabs(0.5/this->GetInput()->GetSpacing()[1]); bounds[4] = ImageActor->GetBounds()[4]; bounds[5] = ImageActor->GetBounds()[5]; mClipBox->SetBounds(bounds); @@ -836,8 +836,8 @@ void vvSlicer::UpdateDisplayExtent() if (mLandActor) { if (mClipBox) { double bounds [6]; - bounds[0] = ImageActor->GetBounds()[0]-(0.5/this->GetInput()->GetSpacing()[0]); - bounds[1] = ImageActor->GetBounds()[1]+(0.5/this->GetInput()->GetSpacing()[0]); + bounds[0] = ImageActor->GetBounds()[0]-fabs(0.5/this->GetInput()->GetSpacing()[0]); + bounds[1] = ImageActor->GetBounds()[1]+fabs(0.5/this->GetInput()->GetSpacing()[0]); bounds[2] = ImageActor->GetBounds()[2]; bounds[3] = ImageActor->GetBounds()[3]; bounds[4] = ImageActor->GetBounds()[4];