]> Creatis software - bbtk.git/commitdiff
Initial planes positions are now the center of the volume (in real world, not in...
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 26 Nov 2008 16:19:44 +0000 (16:19 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 26 Nov 2008 16:19:44 +0000 (16:19 +0000)
packages/vtk/src/bbvtkImagePlanes.cxx

index 191fcfa426eca62c0f869e548e2d1f94a45431bb..64ae9ee734da64f191080ce7ffe7cbda6f59b37c 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkImagePlanes.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/11/25 11:17:23 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2008/11/26 16:19:44 $
+  Version:   $Revision: 1.11 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -141,17 +141,21 @@ namespace bbvtk
         int xMin, xMax, yMin, yMax, zMin, zMax;
         bbGetInputIn()->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
 
+         // Initial values : center of the volume (in real world, not in pixels!)
+         double xSpacing, ySpacing, zSpacing;
+        bbGetInputIn()->GetSpacing(xSpacing, ySpacing, zSpacing);
+        
         planeWidgetX->SetInput(bbGetInputIn());
         planeWidgetX->SetPlaneOrientationToXAxes();
-        planeWidgetX->SetSlicePosition((xMax+xMin)/2.); 
+        planeWidgetX->SetSlicePosition((xMax+xMin)/2.*xSpacing); 
 
         planeWidgetY->SetInput(bbGetInputIn());
         planeWidgetY->SetPlaneOrientationToYAxes();
-        planeWidgetY->SetSlicePosition((yMax+yMin)/2.); 
+        planeWidgetY->SetSlicePosition((yMax+yMin)/2.*ySpacing); 
 
         planeWidgetZ->SetInput(bbGetInputIn());
         planeWidgetZ->SetPlaneOrientationToZAxes();
-        planeWidgetZ->SetSlicePosition((zMax+zMin)/2.); 
+        planeWidgetZ->SetSlicePosition((zMax+zMin)/2.*zSpacing); 
 
        // planeWidgetZ->SetWindowLevel(512,256);