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 $
=========================================================================*/
/* ---------------------------------------------------------------------
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);