#include <bbvtkImagePlanes.h>
Public Member Functions | |
BBTK_BLACK_BOX_INTERFACE (ImagePlanes, bbtk::AtomicBlackBox) | |
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_PROCESS (Process) | |
void | Process () |
Protected Member Functions | |
virtual void | bbUserConstructor () |
virtual void | bbUserCopyConstructor () |
virtual void | bbUserDestructor () |
void | Init () |
Private Attributes | |
vtkImagePlaneWidget * | planeWidgetX |
vtkImagePlaneWidget * | planeWidgetY |
vtkImagePlaneWidget * | planeWidgetZ |
Definition at line 73 of file bbvtkImagePlanes.h.
bbvtk::ImagePlanes::BBTK_BLACK_BOX_INTERFACE | ( | ImagePlanes | , | |
bbtk::AtomicBlackBox | ||||
) |
bbvtk::ImagePlanes::BBTK_DECLARE_INPUT | ( | In | , | |
vtkImageData * | ||||
) |
bbvtk::ImagePlanes::BBTK_DECLARE_INPUT | ( | WindowLevel | , | |
winLevel | ||||
) |
bbvtk::ImagePlanes::BBTK_DECLARE_OUTPUT | ( | PlaneX | , | |
vtkImagePlaneWidget * | ||||
) |
bbvtk::ImagePlanes::BBTK_DECLARE_OUTPUT | ( | PlaneY | , | |
vtkImagePlaneWidget * | ||||
) |
bbvtk::ImagePlanes::BBTK_DECLARE_OUTPUT | ( | PlaneZ | , | |
vtkImagePlaneWidget * | ||||
) |
bbvtk::ImagePlanes::BBTK_PROCESS | ( | Process | ) |
void bbvtk::ImagePlanes::Process | ( | ) |
Definition at line 135 of file bbvtkImagePlanes.cxx.
References Init(), planeWidgetX, planeWidgetY, and planeWidgetZ.
00136 { 00137 if (bbGetInputIn()!=0) 00138 { 00139 Init(); 00140 00141 int xMin, xMax, yMin, yMax, zMin, zMax; 00142 bbGetInputIn()->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax); 00143 00144 planeWidgetX->SetInput(bbGetInputIn()); 00145 planeWidgetX->SetPlaneOrientationToXAxes(); 00146 planeWidgetX->SetSlicePosition((xMax+xMin)/2.); 00147 00148 planeWidgetY->SetInput(bbGetInputIn()); 00149 planeWidgetY->SetPlaneOrientationToYAxes(); 00150 planeWidgetY->SetSlicePosition((yMax+yMin)/2.); 00151 00152 planeWidgetZ->SetInput(bbGetInputIn()); 00153 planeWidgetZ->SetPlaneOrientationToZAxes(); 00154 planeWidgetZ->SetSlicePosition((zMax+zMin)/2.); 00155 00156 // planeWidgetZ->SetWindowLevel(512,256); 00157 00158 planeWidgetZ->SetWindowLevel(bbGetInputWindowLevel()[0],bbGetInputWindowLevel()[1]); 00159 } 00160 }
void bbvtk::ImagePlanes::bbUserConstructor | ( | ) | [protected, virtual] |
Definition at line 70 of file bbvtkImagePlanes.cxx.
00071 { 00072 planeWidgetX = planeWidgetY = planeWidgetZ = 0; 00073 bbSetInputIn(0); 00074 std::vector<double> vect; 00075 vect.push_back(512); 00076 vect.push_back(256); 00077 bbSetInputWindowLevel (vect); 00078 }
void bbvtk::ImagePlanes::bbUserCopyConstructor | ( | ) | [protected, virtual] |
Definition at line 80 of file bbvtkImagePlanes.cxx.
References planeWidgetX, planeWidgetY, and planeWidgetZ.
00081 { 00082 planeWidgetX = planeWidgetY = planeWidgetZ = 0; 00083 }
void bbvtk::ImagePlanes::bbUserDestructor | ( | ) | [protected, virtual] |
Definition at line 125 of file bbvtkImagePlanes.cxx.
References planeWidgetX, planeWidgetY, and planeWidgetZ.
00126 { 00127 00128 if (planeWidgetX) planeWidgetX->UnRegister(NULL); 00129 if (planeWidgetY) planeWidgetY->UnRegister(NULL); 00130 if (planeWidgetZ) planeWidgetZ->UnRegister(NULL); 00131 00132 }
void bbvtk::ImagePlanes::Init | ( | ) | [protected] |
Definition at line 85 of file bbvtkImagePlanes.cxx.
References planeWidgetX, planeWidgetY, and planeWidgetZ.
Referenced by Process().
00086 { 00087 if (planeWidgetX != 0) return; 00088 // The shared picker enables us to use 3 planes at one time 00089 // and gets the picking order right 00090 vtkCellPicker* picker = vtkCellPicker::New(); 00091 picker->SetTolerance(0.005); 00092 00093 // The 3 image plane widgets 00094 planeWidgetX = vtkImagePlaneWidget::New(); 00095 planeWidgetX->DisplayTextOn(); 00096 planeWidgetX->SetPicker(picker); 00097 planeWidgetX->SetKeyPressActivationValue('x'); 00098 vtkProperty* prop1 = planeWidgetX->GetPlaneProperty(); 00099 prop1->SetColor(1, 0, 0); 00100 00101 planeWidgetY = vtkImagePlaneWidget::New(); 00102 planeWidgetY->DisplayTextOn(); 00103 planeWidgetY->SetPicker(picker); 00104 planeWidgetY->SetKeyPressActivationValue('y'); 00105 vtkProperty* prop2 = planeWidgetY->GetPlaneProperty(); 00106 prop2->SetColor(1, 1, 0); 00107 planeWidgetY->SetLookupTable(planeWidgetX->GetLookupTable()); 00108 00109 planeWidgetZ = vtkImagePlaneWidget::New(); 00110 planeWidgetZ->DisplayTextOn(); 00111 planeWidgetZ->SetPicker(picker); 00112 planeWidgetZ->SetKeyPressActivationValue('z'); 00113 vtkProperty* prop3 = planeWidgetZ->GetPlaneProperty(); 00114 prop3->SetColor(0, 0, 1); 00115 planeWidgetZ->SetLookupTable(planeWidgetX->GetLookupTable()); 00116 00117 bbSetOutputPlaneX(planeWidgetX); 00118 bbSetOutputPlaneY(planeWidgetY); 00119 bbSetOutputPlaneZ(planeWidgetZ); 00120 00121 picker->UnRegister(NULL); 00122 }
vtkImagePlaneWidget* bbvtk::ImagePlanes::planeWidgetX [private] |
Definition at line 92 of file bbvtkImagePlanes.h.
Referenced by bbUserCopyConstructor(), bbUserDestructor(), Init(), and Process().
vtkImagePlaneWidget* bbvtk::ImagePlanes::planeWidgetY [private] |
Definition at line 93 of file bbvtkImagePlanes.h.
Referenced by bbUserCopyConstructor(), bbUserDestructor(), Init(), and Process().
vtkImagePlaneWidget* bbvtk::ImagePlanes::planeWidgetZ [private] |
Definition at line 94 of file bbvtkImagePlanes.h.
Referenced by bbUserCopyConstructor(), bbUserDestructor(), Init(), and Process().