Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.cxx,v $
Language: C++
- Date: $Date: 2008/11/26 16:19:44 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/11/27 14:57:38 $
+ Version: $Revision: 1.12 $
=========================================================================*/
/* ---------------------------------------------------------------------
namespace bbvtk
{
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImagePlanes)
BBTK_BLACK_BOX_IMPLEMENTATION(ImagePlanes,bbtk::AtomicBlackBox);
void ImagePlanes::bbUserConstructor()
{
planeWidgetX = planeWidgetY = planeWidgetZ = 0;
+ imageX = imageY = imageZ = 0;
bbSetInputIn(0);
std::vector<double> vect;
vect.push_back(512);
void ImagePlanes::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
{
planeWidgetX = planeWidgetY = planeWidgetZ = 0;
+ imageX = imageY = imageZ = 0;
}
void ImagePlanes::Init()
- {
+ {
+
if (planeWidgetX != 0) return;
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
planeWidgetX->SetInput(bbGetInputIn());
planeWidgetX->SetPlaneOrientationToXAxes();
- planeWidgetX->SetSlicePosition((xMax+xMin)/2.*xSpacing);
+ planeWidgetX->SetSlicePosition((xMax+xMin)/2.*xSpacing);
+ bbSetOutput("ImageX", planeWidgetX->GetResliceOutput());
planeWidgetY->SetInput(bbGetInputIn());
planeWidgetY->SetPlaneOrientationToYAxes();
planeWidgetY->SetSlicePosition((yMax+yMin)/2.*ySpacing);
-
+ bbSetOutput("ImageY", planeWidgetY->GetResliceOutput());
+
planeWidgetZ->SetInput(bbGetInputIn());
planeWidgetZ->SetPlaneOrientationToZAxes();
planeWidgetZ->SetSlicePosition((zMax+zMin)/2.*zSpacing);
-
+ bbSetOutput("ImageZ", planeWidgetZ->GetResliceOutput());
+
// planeWidgetZ->SetWindowLevel(512,256);
planeWidgetZ->SetWindowLevel(bbGetInputWindowLevel()[0],bbGetInputWindowLevel()[1]);
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.h,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:23 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/11/27 14:57:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
// BBTK_DECLARE_INPUT(Contour,int);
BBTK_DECLARE_INPUT(In,vtkImageData *);
BBTK_DECLARE_INPUT(WindowLevel,winLevel);
+
BBTK_DECLARE_OUTPUT(PlaneX,vtkImagePlaneWidget*);
BBTK_DECLARE_OUTPUT(PlaneY,vtkImagePlaneWidget*);
BBTK_DECLARE_OUTPUT(PlaneZ,vtkImagePlaneWidget*);
+ BBTK_DECLARE_OUTPUT(ImageX,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(ImageY,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(ImageZ,vtkImageData*);
BBTK_PROCESS(Process);
void Process();
vtkImagePlaneWidget* planeWidgetX;
vtkImagePlaneWidget* planeWidgetY;
vtkImagePlaneWidget* planeWidgetZ;
+ vtkImageData* imageX;
+ vtkImageData* imageY;
+ vtkImageData* imageZ;
+
};
//=================================================================
BBTK_DESCRIPTION("Creates three 3D planes with the input image mapped onto with which the user can interact. The output vtkImagePlaneWidget objects are to be inserted into a 3D scene (e.g. a Viewer3D)");
BBTK_CATEGORY("3D object creator");
BBTK_INPUT(ImagePlanes,In,"Input Image",vtkImageData *,"");
- BBTK_INPUT(ImagePlanes,WindowLevel,"Widdow Level",winLevel,"");
+ BBTK_INPUT(ImagePlanes,WindowLevel,"Widdow Level",winLevel,"");
+
BBTK_OUTPUT(ImagePlanes,PlaneX,"The image plane in X direction",vtkImagePlaneWidget*,"");
BBTK_OUTPUT(ImagePlanes,PlaneY,"The image plane in Y direction",vtkImagePlaneWidget*,"");
BBTK_OUTPUT(ImagePlanes,PlaneZ,"The image plane in Z direction",vtkImagePlaneWidget*,"");
+ BBTK_OUTPUT(ImagePlanes,ImageX,"The image in X direction",vtkImageData*,"");
+ BBTK_OUTPUT(ImagePlanes,ImageY,"The image in Y direction",vtkImageData*,"");
+ BBTK_OUTPUT(ImagePlanes,ImageZ,"The image in Z direction",vtkImageData*,"");
BBTK_END_DESCRIBE_BLACK_BOX(ImagePlanes);
//=================================================================