#include <wxEmptyPanel_3_Widget.h>
Public Member Functions | |
wxEmptyPanel_3_Widget (wxWindow *parent) | |
~wxEmptyPanel_3_Widget () | |
void | ConfigureVTK (marImageData *marimagedata) |
void | OnContourA (wxCommandEvent &event) |
void | OnContourB (wxCommandEvent &event) |
void | OnContourAB (wxCommandEvent &event) |
void | Refresh () |
void | OnRefreshView (wxCommandEvent &event) |
void | CreateNewPoint (double x, double y) |
Private Member Functions | |
wxPanel * | CreateControlPanel (wxWindow *parent) |
wxPanel * | CreateViewPanel (wxWindow *parent) |
DECLARE_EVENT_TABLE () | |
Private Attributes | |
wxWindow * | _parent |
vtkImageData * | _data |
wxVtk2DBaseView * | _imageviewer2D_1 |
vtkBaseData * | _vtkbasedata_1 |
manualRoiControler * | _manRoiControl |
manualContourModel * | _mContourModel |
manualViewRoi * | _mViewRoi |
manualContourControler * | _manContourControl_1 |
manualContourModel * | _mContourModel_1 |
manualViewContour * | _mViewContour_1 |
manualContourControler * | _manContourControl_2 |
manualContourModel * | _mContourModel_2 |
manualViewContour * | _mViewContour_2 |
Definition at line 20 of file wxEmptyPanel_3_Widget.h.
wxEmptyPanel_3_Widget::wxEmptyPanel_3_Widget | ( | wxWindow * | parent | ) |
Definition at line 38 of file wxEmptyPanel_3_Widget.cxx.
00039 : wxPanel( parent, -1) 00040 { 00041 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL ); 00042 wxSplitterWindow *pnlSplitter = new wxSplitterWindow( this , -1); 00043 wxPanel *viewPanel = CreateViewPanel(pnlSplitter); 00044 wxPanel *controlPanel = CreateControlPanel(pnlSplitter); 00045 00046 sizer -> Add( pnlSplitter ,1,wxGROW ,0); 00047 pnlSplitter -> SetMinimumPaneSize( 50 ); 00048 pnlSplitter -> SplitVertically( viewPanel, controlPanel ); 00049 this -> SetSizer(sizer); 00050 //EEDxx2.4 00051 // FitInside(); 00052 }
wxEmptyPanel_3_Widget::~wxEmptyPanel_3_Widget | ( | ) |
Definition at line 54 of file wxEmptyPanel_3_Widget.cxx.
References _imageviewer2D_1.
00054 { 00055 delete _imageviewer2D_1; 00056 }
void wxEmptyPanel_3_Widget::ConfigureVTK | ( | marImageData * | marimagedata | ) |
Definition at line 115 of file wxEmptyPanel_3_Widget.cxx.
References _data, _imageviewer2D_1, _manContourControl_1, _manContourControl_2, _manRoiControl, _mContourModel, _mContourModel_1, _mContourModel_2, _mViewContour_1, _mViewContour_2, _mViewRoi, _vtkbasedata_1, wxVtk2DBaseView::Configure(), manualContourBaseControler::CreateNewManualContour(), CreateNewPoint(), marImageData::GetImageData(), wxVtkBaseView::GetInteractorStyleBaseView(), Refresh(), manualViewRoi::RefreshContour(), manualViewContour::RefreshContour(), InteractorStyleMaracas::SetActive(), manualViewBaseContour::SetColorEditContour(), manualViewBaseContour::SetColorNormalContour(), vtkBaseData::SetMarImageData(), manualViewBaseContour::SetModel(), manualContourBaseControler::SetModelView(), manualViewBaseContour::SetRange(), manualViewBaseContour::SetSpacing(), wxVtk2DBaseView::SetVtkBaseData(), manualViewBaseContour::SetWxVtkBaseView(), and manualViewBaseContour::SetZ().
00116 { 00117 wxBusyCursor wait; 00118 double spc[3]; 00119 00120 vtkImageData *vtkimagedata = marimagedata->GetImageData(); // image t=0 00121 vtkimagedata->UpdateInformation(); 00122 vtkimagedata->SetUpdateExtent(vtkimagedata->GetWholeExtent()); 00123 vtkimagedata->Update(); 00124 _data = vtkimagedata; 00125 _data->GetSpacing(spc); 00126 _vtkbasedata_1 = new vtkBaseData(); 00127 _vtkbasedata_1->SetMarImageData(marimagedata); 00128 _imageviewer2D_1->SetVtkBaseData( _vtkbasedata_1 ); 00129 _imageviewer2D_1->Configure(); 00130 00131 // vtkImageViewer2 *_imageViewer=_imageviewer2D_1->_imageViewer2XYZ->GetVtkImageViewer2(); 00132 00133 // Contorno 1 00134 _manContourControl_1 = new manualContourControler(); 00135 _mContourModel_1 = new manualContourModel(); 00136 _mViewContour_1 = new manualViewContour(); 00137 _mViewContour_1->SetModel( _mContourModel_1 ); 00138 _mViewContour_1->SetWxVtkBaseView( _imageviewer2D_1 ); 00139 _mViewContour_1->SetRange( 2 ); 00140 _mViewContour_1->SetZ( 1000 ); 00141 00142 00143 //EED 3 oct 2006 00144 _mViewContour_1->SetSpacing(spc); 00145 00146 00147 //EED 3 oct 2006 00148 _mViewContour_1->SetColorNormalContour(0, 0, 1); 00149 _mViewContour_1->SetColorEditContour(0, 0.5, 0.5); 00150 00151 00152 _manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 ); 00153 _imageviewer2D_1->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _manContourControl_1 ); 00154 _manContourControl_1->CreateNewManualContour(); 00155 _manContourControl_1->SetActive(false); 00156 _mViewContour_1->RefreshContour(); 00157 00158 // Rectangulo 00159 _manRoiControl = new manualRoiControler(); 00160 _mContourModel = new manualContourModel(); 00161 _mViewRoi = new manualViewRoi(); 00162 _mViewRoi->SetModel( _mContourModel ); 00163 _mViewRoi->SetWxVtkBaseView( _imageviewer2D_1 ); 00164 _mViewRoi->SetRange( 2 ); 00165 _mViewRoi->SetZ( 1000 ); 00166 00167 //EED 3 oct 2006 00168 _mViewRoi->SetSpacing(spc); 00169 00170 _manRoiControl->SetModelView( _mContourModel , _mViewRoi ); 00171 _imageviewer2D_1->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _manRoiControl ); 00172 _manRoiControl->CreateNewManualContour(); 00173 _manRoiControl->SetActive(true); 00174 _mViewRoi->RefreshContour(); 00175 00176 // Contorno 2 00177 _manContourControl_2 = new manualContourControler(); 00178 _mContourModel_2 = new manualContourModel(); 00179 _mViewContour_2 = new manualViewContour(); 00180 _mViewContour_2->SetModel( _mContourModel_2 ); 00181 _mViewContour_2->SetWxVtkBaseView( _imageviewer2D_1 ); 00182 _mViewContour_2->SetRange( 2 ); 00183 _mViewContour_2->SetZ( 1000 ); 00184 00185 //EED 3 oct 2006 00186 _mViewContour_2->SetSpacing(spc); 00187 00188 //EED 3 oct 2006 00189 _mViewContour_2->SetColorNormalContour(1, 1, 1); 00190 _mViewContour_2->SetColorEditContour(0.5, 0.5, 0.5); 00191 00192 00193 _manContourControl_2->SetModelView( _mContourModel_2 , _mViewContour_2 ); 00194 _imageviewer2D_1->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _manContourControl_2 ); 00195 _manContourControl_2->CreateNewManualContour(); 00196 _manContourControl_2->SetActive(false); 00197 _mViewContour_2->RefreshContour(); 00198 00199 CreateNewPoint( 0,0); 00200 00201 Refresh(); 00202 }
wxPanel * wxEmptyPanel_3_Widget::CreateControlPanel | ( | wxWindow * | parent | ) | [private] |
Definition at line 75 of file wxEmptyPanel_3_Widget.cxx.
References _parent, OnContourA(), OnContourAB(), and OnContourB().
00076 { 00077 _parent=parent; 00078 wxPanel *panel = new wxPanel(parent,-1); 00079 00080 wxButton *btnContourA = new wxButton( panel, -1, _T("Active Contour A")); 00081 wxButton *btnContourB = new wxButton( panel, -1, _T("Active Contour B")); 00082 wxButton *btnContourAB = new wxButton( panel, -1, _T("Active Contour AB")); 00083 00084 00085 wxFlexGridSizer *sizer = new wxFlexGridSizer(1); 00086 sizer->Add(new wxStaticText(panel,-1,_T(" "))); 00087 sizer->Add(new wxStaticText(panel,-1,_T(" "))); 00088 sizer->Add(btnContourA); 00089 sizer->Add(btnContourB); 00090 sizer->Add(btnContourAB); 00091 00092 panel->SetSizer(sizer); 00093 panel->SetAutoLayout(true); 00094 panel->SetSize(400,400); 00095 panel->Layout(); 00096 Connect(btnContourA->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxEmptyPanel_3_Widget::OnContourA ); 00097 Connect(btnContourB->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxEmptyPanel_3_Widget::OnContourB ); 00098 Connect(btnContourAB->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxEmptyPanel_3_Widget::OnContourAB ); 00099 return panel; 00100 }
void wxEmptyPanel_3_Widget::CreateNewPoint | ( | double | x, | |
double | y | |||
) |
Definition at line 207 of file wxEmptyPanel_3_Widget.cxx.
References _imageviewer2D_1.
Referenced by ConfigureVTK().
00208 { 00209 /* 00210 00211 vtkSphereSource* aSphere =vtkSphereSource::New(); 00212 aSphere->SetRadius(0.2); 00213 aSphere->SetCenter(x,y,0.5); 00214 00215 point_mapped.push_back(vtkPolyDataMapper::New()); 00216 point_mapped.back()->ImmediateModeRenderingOn(); 00217 //point_mapped.back()->ScalarVisibilityOff( ); 00218 point_mapped.back()->SetInput(aSphere->GetOutput()); 00219 00220 point_actor.push_back(vtkActor::New()); 00221 point_actor.back()->SetMapper(point_mapped.back()); 00222 point_actor.back()->GetProperty()->BackfaceCullingOff(); 00223 point_actor.back()->GetProperty()->SetColor(0, 1, 0); 00224 00225 point_actor.back()->ApplyProperties(); 00226 00227 _wxvtkbaseview->GetRenderer()->AddActor(point_actor.back()); 00228 _wxvtkbaseview->GetRenWin()->Render(); 00229 */ 00230 00231 /* 00232 vtkActor *spheresActor = vtkActor::New( ); 00233 vtkSphereSource *spheres = vtkSphereSource::New( ); 00234 vtkPolyDataMapper *spheresMapper = vtkPolyDataMapper::New( ); 00235 spheresMapper -> SetInput( spheres->GetOutput( ) ); 00236 spheresActor -> SetMapper( spheresMapper ); 00237 _imageviewer2D_1 -> GetRenderer() -> AddActor( spheresActor ); 00238 spheres->SetCenter( x,y,0 ); 00239 spheres->SetRadius( 10 ); 00240 */ 00241 00242 vtkSphereSource *spheres = vtkSphereSource::New( ); 00243 spheres->SetCenter( x,y,0 ); 00244 spheres->SetRadius( 5 ); 00245 vtkPolyDataMapper *spheresMapper = vtkPolyDataMapper::New( ); 00246 spheresMapper ->ImmediateModeRenderingOn(); 00247 spheresMapper -> SetInput( spheres->GetOutput( ) ); 00248 vtkActor *spheresActor = vtkActor::New( ); 00249 spheresActor -> SetMapper( spheresMapper ); 00250 spheresActor ->GetProperty()->BackfaceCullingOff(); 00251 spheresActor ->GetProperty()->SetColor(0, 1, 0); 00252 spheresActor ->ApplyProperties(); 00253 _imageviewer2D_1 -> GetRenderer() -> AddActor( spheresActor ); 00254 00255 00256 }
wxPanel * wxEmptyPanel_3_Widget::CreateViewPanel | ( | wxWindow * | parent | ) | [private] |
Definition at line 58 of file wxEmptyPanel_3_Widget.cxx.
References _imageviewer2D_1, and wxVtkBaseView::GetWxVTKRenderWindowInteractor().
00059 { 00060 wxPanel *panel = new wxPanel(parent,-1); 00061 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); 00062 00063 _imageviewer2D_1 = new wxVtk2DBaseView(panel); 00064 wxVTKRenderWindowInteractor *iren = _imageviewer2D_1->GetWxVTKRenderWindowInteractor(); 00065 sizer->Add(iren , 1, wxEXPAND, 0); 00066 00067 00068 panel->SetSizer(sizer); 00069 panel->SetAutoLayout(true); 00070 panel->SetSize(400,400); 00071 panel->Layout(); 00072 return panel; 00073 }
wxEmptyPanel_3_Widget::DECLARE_EVENT_TABLE | ( | ) | [private] |
void wxEmptyPanel_3_Widget::OnContourA | ( | wxCommandEvent & | event | ) |
Definition at line 262 of file wxEmptyPanel_3_Widget.cxx.
References _manContourControl_1, _manContourControl_2, and _manRoiControl.
Referenced by CreateControlPanel().
00263 { 00264 _manRoiControl -> SetActive(false); 00265 _manContourControl_1 -> SetActive(true); 00266 _manContourControl_2 -> SetActive(false); 00267 }
void wxEmptyPanel_3_Widget::OnContourAB | ( | wxCommandEvent & | event | ) |
Definition at line 276 of file wxEmptyPanel_3_Widget.cxx.
References _manContourControl_1, _manContourControl_2, and _manRoiControl.
Referenced by CreateControlPanel().
00277 { 00278 _manRoiControl -> SetActive(false); 00279 _manContourControl_1 -> SetActive(true); 00280 _manContourControl_2 -> SetActive(true); 00281 }
void wxEmptyPanel_3_Widget::OnContourB | ( | wxCommandEvent & | event | ) |
Definition at line 269 of file wxEmptyPanel_3_Widget.cxx.
References _manContourControl_1, _manContourControl_2, and _manRoiControl.
Referenced by CreateControlPanel().
00270 { 00271 _manRoiControl -> SetActive(false); 00272 _manContourControl_1 -> SetActive(false); 00273 _manContourControl_2 -> SetActive(true); 00274 }
void wxEmptyPanel_3_Widget::OnRefreshView | ( | wxCommandEvent & | event | ) |
Definition at line 107 of file wxEmptyPanel_3_Widget.cxx.
References Refresh().
00108 { 00109 Refresh(); 00110 }
void wxEmptyPanel_3_Widget::Refresh | ( | ) |
Definition at line 102 of file wxEmptyPanel_3_Widget.cxx.
References _imageviewer2D_1, and wxVtk2DBaseView::Refresh().
Referenced by ConfigureVTK(), and OnRefreshView().
00103 { 00104 _imageviewer2D_1->Refresh(); 00105 }
vtkImageData* wxEmptyPanel_3_Widget::_data [private] |
Definition at line 34 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
Definition at line 35 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK(), CreateNewPoint(), CreateViewPanel(), Refresh(), and ~wxEmptyPanel_3_Widget().
Definition at line 44 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK(), OnContourA(), OnContourAB(), and OnContourB().
Definition at line 48 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK(), OnContourA(), OnContourAB(), and OnContourB().
Definition at line 40 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK(), OnContourA(), OnContourAB(), and OnContourB().
Definition at line 41 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
Definition at line 45 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
Definition at line 49 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
Definition at line 46 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
Definition at line 50 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
manualViewRoi* wxEmptyPanel_3_Widget::_mViewRoi [private] |
Definition at line 42 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().
wxWindow* wxEmptyPanel_3_Widget::_parent [private] |
Definition at line 33 of file wxEmptyPanel_3_Widget.h.
Referenced by CreateControlPanel().
vtkBaseData* wxEmptyPanel_3_Widget::_vtkbasedata_1 [private] |
Definition at line 36 of file wxEmptyPanel_3_Widget.h.
Referenced by ConfigureVTK().