]> Creatis software - clitk.git/commitdiff
Corrected bug in landmarks with negative spacing
authorsrit <srit>
Mon, 7 Jun 2010 21:50:15 +0000 (21:50 +0000)
committersrit <srit>
Mon, 7 Jun 2010 21:50:15 +0000 (21:50 +0000)
vv/vvSlicer.cxx

index bbecaa40acd3e8e515ff856c3a891dc4394e566d..0e18d54d991c1465587b0ff9bc34c0dbbb442db0 100644 (file)
@@ -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];