Principal Frame of the application MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis. More...
#include <wxMaracasFrame.h>
Public Member Functions | |
wxMaracasFrame (wxFrame *parent, wxWindowID id=-1, marInterface *mar=NULL, marSimpleDicom *simpleDicom=NULL, char *dictionaryFileName=NULL, const wxString &title=wxT("MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE) | |
void | OnDeleteAxis (wxCommandEvent &event) |
void | OnNewAxis (wxCommandEvent &event) |
void | RecreateToolbar () |
void | OnAboutCreatis (wxCommandEvent &event) |
void | OnQuit (wxCloseEvent &event) |
void | OnParameters (wxCommandEvent &event) |
void | OnStartExperiment (wxCommandEvent &event) |
void | OnQuant (wxCommandEvent &event) |
void | OnRegenerateAll (wxCommandEvent &event) |
void | OnRegenerateSplineAxe (wxCommandEvent &event) |
void | OnCleanContours (wxCommandEvent &event) |
void | OnRegenerateSignal (wxCommandEvent &event) |
wxMaracas3DBrowser * | Getwxmaracas3dbrowser () |
wxMaracasQuantification * | Getwxmaracasquantification () |
Private Member Functions | |
DECLARE_EVENT_TABLE () | |
void | DeletePanels () |
Private Attributes | |
wxPanel * | _actual_panel |
wxGauge * | _progressGauge |
marInterface * | _mar |
marSimpleDicom * | _marSimpleDicom |
wxMaracas3DBrowser * | _wxmaracas3dbrowser |
wxMaracasQuantification * | _wxmaracasquantification |
Principal Frame of the application MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis.
Definition at line 36 of file wxMaracasFrame.h.
wxMaracasFrame::wxMaracasFrame | ( | wxFrame * | parent, | |
wxWindowID | id = -1 , |
|||
marInterface * | mar = NULL , |
|||
marSimpleDicom * | simpleDicom = NULL , |
|||
char * | dictionaryFileName = NULL , |
|||
const wxString & | title = wxT("MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis") , |
|||
const wxPoint & | pos = wxDefaultPosition , |
|||
const wxSize & | size = wxDefaultSize , |
|||
long | style = wxDEFAULT_FRAME_STYLE | |||
) |
Definition at line 74 of file wxMaracasFrame.cxx.
References marDictionary::LoadDictionary_English().
00078 : wxFrame( parent, id, title, pos, size, style) 00079 { 00080 _mar = mar; 00081 _marSimpleDicom = simpleDicom; 00082 _wxmaracasquantification = NULL; 00083 _wxmaracas3dbrowser = NULL; 00084 00085 marDictionary marDict; 00086 // marDict.LoadDictionary_French(); 00087 marDict.LoadDictionary_English(); 00088 // marDict.LoadDictionary_Japanese(); 00089 00090 00091 /* 00092 if (!marDict.LoadDictionaryFile(dictionaryFileName)){ 00093 wxMessageBox( "Error: File(s) marDict.txt not found...", 00094 "DxMM : MARACAS", wxOK | wxCENTRE | wxICON_ERROR , this); 00095 } 00096 */ 00097 00098 //good luck ! 00099 vtkObject *a = vtkObject::New(); 00100 a->GlobalWarningDisplayOff(); 00101 a->Delete(); 00102 00103 // At the begining, there were nothing, just a window... 00104 _actual_panel = NULL; 00105 00106 // And the programmer said: let there be a status bar 00107 this->CreateStatusBar( ); 00108 00109 this->GetStatusBar()->SetFieldsCount( 2 ); 00110 wxRect rect; 00111 this->GetStatusBar()->GetFieldRect(1, rect); 00112 //wxPoint pos; 00113 //wxSize size; 00114 //_progressGauge = new wxGauge( this->GetStatusBar(), -1, 100); 00115 // _progressGauge = new wxGauge( this->GetStatusBar(), -1, 50, 00116 // rect.GetPosition(), rect.GetSize()); 00117 this->GetStatusBar()->Show(); 00118 this->PositionStatusBar(); 00119 00120 // And an icon (to be unique) 00121 //TODO change the icon to the real one! 00122 this->SetIcon( wxICON( maracas_icon ) ); 00123 00124 // And a toolbar (for dummy users) 00125 this->RecreateToolbar( ); 00126 00127 }
wxMaracasFrame::DECLARE_EVENT_TABLE | ( | ) | [private] |
void wxMaracasFrame::DeletePanels | ( | ) | [private] |
Definition at line 407 of file wxMaracasFrame.cxx.
References _wxmaracas3dbrowser, and _wxmaracasquantification.
Referenced by OnQuant(), OnQuit(), and OnStartExperiment().
00407 { 00408 if (_wxmaracasquantification!=NULL){ 00409 delete _wxmaracasquantification; 00410 _wxmaracasquantification=NULL; 00411 } 00412 if (_wxmaracas3dbrowser!=NULL){ 00413 delete _wxmaracas3dbrowser; 00414 _wxmaracas3dbrowser=NULL; 00415 } 00416 }
wxMaracas3DBrowser* wxMaracasFrame::Getwxmaracas3dbrowser | ( | ) | [inline] |
Definition at line 68 of file wxMaracasFrame.h.
00068 { return _wxmaracas3dbrowser; }
wxMaracasQuantification* wxMaracasFrame::Getwxmaracasquantification | ( | ) | [inline] |
Definition at line 69 of file wxMaracasFrame.h.
00069 { return _wxmaracasquantification; }
void wxMaracasFrame::OnAboutCreatis | ( | wxCommandEvent & | event | ) |
Definition at line 226 of file wxMaracasFrame.cxx.
Referenced by RecreateToolbar().
00226 { 00227 wxMaracasHelpDialog *dlg = new wxMaracasHelpDialog(this, -1, "Creatis", wxPoint(200,200), wxDefaultSize, wxDEFAULT_DIALOG_STYLE); 00228 dlg->ShowModal(); 00229 dlg->Close(); 00230 }
void wxMaracasFrame::OnCleanContours | ( | wxCommandEvent & | event | ) |
Definition at line 466 of file wxMaracasFrame.cxx.
References _wxmaracasquantification, and wxMaracasQuantification::CleanContours().
00466 { 00467 if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->CleanContours(); } 00468 }
void wxMaracasFrame::OnDeleteAxis | ( | wxCommandEvent & | event | ) |
void wxMaracasFrame::OnNewAxis | ( | wxCommandEvent & | event | ) |
void wxMaracasFrame::OnParameters | ( | wxCommandEvent & | event | ) |
Definition at line 276 of file wxMaracasFrame.cxx.
References _mar.
00277 { 00278 /* EED Photo Maracas 00279 //-- 00280 wxWindowDC *wxwindc =new wxWindowDC(this); 00281 wxCoord w, h; 00282 wxwindc->GetSize(&w, &h); 00283 wxBitmap *wxbitmap =new wxBitmap(w, h); 00284 wxMemoryDC *wxmemorydc = new wxMemoryDC(); 00285 00286 wxmemorydc->SelectObject(*wxbitmap); 00287 wxmemorydc->Blit(0,0,w,h,wxwindc,0,0); 00288 00289 wxbitmap->SaveFile("c:/tmp/MaracasPlamavic.bmp", wxBITMAP_TYPE_BMP ); 00290 delete wxwindc; 00291 delete wxbitmap; 00292 delete wxmemorydc; 00293 //-- 00294 */ 00295 wxMaracasParametersDialog *d = new wxMaracasParametersDialog( this, _mar ); 00296 d->ShowModal( ); 00297 d->Close(true); 00298 /* 00299 if (d->IfInitContour()==true){ 00300 } else { 00301 } 00302 if (d->GetInitContour()==true){ 00303 } 00304 wxmaracasquantification; 00305 if (wxmaracas3dbrowser!=NULL){ 00306 } 00307 */ 00308 }
void wxMaracasFrame::OnQuant | ( | wxCommandEvent & | event | ) |
Definition at line 418 of file wxMaracasFrame.cxx.
References _actual_panel, _mar, _wxmaracas3dbrowser, _wxmaracasquantification, DeletePanels(), wxMaracas3DBrowser::GetIsovalue(), wxMaracas3DBrowser::GetOpacity(), ID_TOOLBAR_3D_BROWSER, ID_TOOLBAR_PLANS, wxMaracasQuantification::LoadData(), and wxMaracasQuantification::SetSlider_Isovalue_Opacity().
00418 { 00419 int isovalue = 50; 00420 int opacity = 50; 00421 00422 if (_wxmaracas3dbrowser!=NULL){ 00423 isovalue = _wxmaracas3dbrowser->GetIsovalue(); 00424 opacity = _wxmaracas3dbrowser->GetOpacity(); 00425 } 00426 00427 DeletePanels(); 00428 _wxmaracasquantification = new wxMaracasQuantification( this, _mar, -1 ); 00429 _actual_panel = _wxmaracasquantification; 00430 00431 wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); 00432 this->OnSize(myevent); 00433 this->Show(true); 00434 00435 // Load panel data 00436 _wxmaracasquantification->LoadData( ); 00437 _wxmaracasquantification->SetSlider_Isovalue_Opacity(isovalue,opacity); 00438 this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, false); 00439 this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, true); 00440 }
void wxMaracasFrame::OnQuit | ( | wxCloseEvent & | event | ) |
Definition at line 233 of file wxMaracasFrame.cxx.
References _mar, DeletePanels(), and marDictionary::FreeDictionary().
00233 { 00234 00235 DeletePanels(); 00236 if (_mar!=NULL) { delete _mar; } 00237 _mar=NULL; 00238 marDictionary marDict; 00239 marDict.FreeDictionary(); 00240 00241 00242 // this->Show(FALSE); 00243 this->Destroy(); 00244 delete this; 00245 }
void wxMaracasFrame::OnRegenerateAll | ( | wxCommandEvent & | event | ) |
Definition at line 456 of file wxMaracasFrame.cxx.
References _wxmaracas3dbrowser, _wxmaracasquantification, wxMaracasQuantification::RegenerateAll(), and wxMaracas3DBrowser::RegenerateAll().
00456 { 00457 if (_wxmaracas3dbrowser!=NULL) { _wxmaracas3dbrowser->RegenerateAll(true); } 00458 if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateAll(true);} 00459 }
void wxMaracasFrame::OnRegenerateSignal | ( | wxCommandEvent & | event | ) |
Definition at line 470 of file wxMaracasFrame.cxx.
References _wxmaracasquantification, and wxMaracasQuantification::RegenerateSignal().
00470 { 00471 if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateSignal(); } 00472 }
void wxMaracasFrame::OnRegenerateSplineAxe | ( | wxCommandEvent & | event | ) |
Definition at line 461 of file wxMaracasFrame.cxx.
References _wxmaracas3dbrowser, _wxmaracasquantification, wxMaracasQuantification::RegenerateAll(), and wxMaracas3DBrowser::RegenerateAll().
00461 { 00462 if (_wxmaracas3dbrowser!=NULL) { _wxmaracas3dbrowser->RegenerateAll(false); } 00463 if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateAll(false); } 00464 }
void wxMaracasFrame::OnStartExperiment | ( | wxCommandEvent & | event | ) |
Definition at line 350 of file wxMaracasFrame.cxx.
References _actual_panel, marInterface::_dicom, marInterface::_experiment, _mar, _marSimpleDicom, _progressGauge, _wxmaracas3dbrowser, DeletePanels(), marFilesBase::getVolume(), ID_TOOLBAR_3D_BROWSER, ID_TOOLBAR_PLANS, ID_TOOLBAR_QUANT, marInterface::initExperiment(), marSimpleDicom::loadActualSerie(), wxMaracas3DBrowser::LoadData(), marExperiment::setVOI(), and marFilesBase::SetVolume().
Referenced by wxMaracasApp::Run().
00351 { 00352 00353 wxBusyCursor wait; 00354 00355 int voi[ 6 ]; 00356 // PS -> #ifndef DXMM 00357 // PS -> ((wxMaracasImageBrowser*)_actual_panel )->GetROI( voi ); 00358 // PS -> #else 00359 00360 _marSimpleDicom->loadActualSerie( this->_progressGauge ); 00361 _mar->_dicom->SetVolume( _marSimpleDicom->getVolume() ); 00362 00363 00364 voi[0] = 0; 00365 voi[1] = (_mar->_dicom->getVolume( )->getXdim( ))-1; 00366 voi[2] = 0; 00367 voi[3] = (_mar->_dicom->getVolume( )->getYdim( ))-1; 00368 voi[4] = 0; 00369 voi[5] = (_mar->_dicom->getVolume( )->getZdim( ))-1; 00370 // PS -> #endif 00371 00372 _mar->_experiment->setVOI( voi ); 00373 _mar->initExperiment( ); 00374 00375 // Create panel 00376 DeletePanels(); 00377 _wxmaracas3dbrowser = new wxMaracas3DBrowser( this, _mar, -1 ,ID_TOOLBAR_PLANS); 00378 00379 // Resize 00380 _actual_panel = _wxmaracas3dbrowser; 00381 00382 wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); 00383 this->OnSize(myevent); 00384 //this->Show(true); 00385 00386 // Load panel data 00387 _wxmaracas3dbrowser->LoadData( ); 00388 00389 // PS -> #ifndef DXMM 00390 // PS -> this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER, true); 00391 // PS -> this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, false); 00392 // PS -> #else 00393 this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, false); 00394 this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, false); 00395 this->GetToolBar()->EnableTool(ID_TOOLBAR_QUANT, false); 00396 // PS -> #endif 00397 }
void wxMaracasFrame::RecreateToolbar | ( | ) |
wxBitmap vs. wxBITMAP -> add _xpm at the end of the file
Definition at line 129 of file wxMaracasFrame.cxx.
References ID_TOOLBAR, ID_TOOLBAR_3D_BROWSER, ID_TOOLBAR_PARAMETERS, ID_TOOLBAR_PLANS, ID_TOOLBAR_QUANT, OnAboutCreatis(), and TOOLBAR_STYLE.
00130 { 00131 wxToolBar* toolBar = this->GetToolBar( ); 00132 delete toolBar; 00133 this->SetToolBar( NULL ); 00134 00135 toolBar = this->CreateToolBar( TOOLBAR_STYLE, ID_TOOLBAR ); 00136 00137 // Set up toolbar 00138 wxBitmap toolBarBitmaps[ 22+1 ]; 00139 00143 toolBarBitmaps[ 0 ] = wxBITMAP( toolbar_connect ); 00144 toolBarBitmaps[ 4 ] = wxBITMAP( toolbar_params ); 00145 toolBarBitmaps[ 7 ] = wxBITMAP( toolbar_imagebrowser ); 00146 toolBarBitmaps[ 9 ] = wxBITMAP( toolbar_triD ); 00147 00148 toolBarBitmaps[ 10 ] = wxBITMAP( toolbar_plans ); 00149 toolBarBitmaps[ 11 ] = wxBITMAP( toolbar_quant ); 00150 toolBarBitmaps[ 12 ] = wxBITMAP( toolbar_rotate ); 00151 toolBarBitmaps[ 13 ] = wxBITMAP( toolbar_bright ); 00152 toolBarBitmaps[ 14 ] = wxBITMAP( toolbar_pan ); 00153 toolBarBitmaps[ 15 ] = wxBITMAP( toolbar_zoom ); 00154 toolBarBitmaps[ 16 ] = wxBITMAP( toolbar_clear ); 00155 toolBarBitmaps[ 17 ] = wxBITMAP( toolbar_intensity ); 00156 toolBarBitmaps[ 20 ] = wxBITMAP( toolbar_help ); 00157 toolBarBitmaps[ 22 ] = wxBITMAP( creatis_logo ); 00158 00159 /* 00160 toolBarBitmaps[ 1 ] = wxBitmap( toolbar_loadexp ); 00161 toolBarBitmaps[ 2 ] = wxBitmap( toolbar_save ); 00162 toolBarBitmaps[ 3 ] = wxBitmap( toolbar_excel ); 00163 toolBarBitmaps[ 5 ] = wxBitmap( toolbar_wizard ); 00164 toolBarBitmaps[ 6 ] = wxBitmap( toolbar_back ); 00165 toolBarBitmaps[ 8 ] = wxBitmap( toolbar_subtract ); 00166 00167 toolBarBitmaps[ 18 ] = wxBitmap( toolbar_linear ); 00168 toolBarBitmaps[ 19 ] = wxBitmap( toolbar_area ); 00169 */ 00170 // Set size & margins 00171 toolBar->SetMargins( 4, 4 ); 00172 // PS -> #ifdef DXMM 00173 toolBar->SetToolBitmapSize( wxSize( toolBarBitmaps[ 4 ].GetWidth( ), toolBarBitmaps[ 4 ].GetHeight( ) ) ); 00174 // PS -> #else 00175 // PS -> toolBar->SetToolBitmapSize( wxSize( toolBarBitmaps[ 0 ].GetWidth( ), toolBarBitmaps[ 0 ].GetHeight( ) ) ); 00176 // PS -> #endif 00177 00178 // Adding tools 00179 // PS -> #ifndef DXMM 00180 // PS -> toolBar->AddTool( ID_TOOLBAR_DATA_BROWSER, toolBarBitmaps[ 0 ], "Patient data", "Load patient data: studies & series" ); 00181 // PS -> toolBar->AddSeparator( ); 00182 // PS -> toolBar->AddTool( ID_TOOLBAR_IMAGE_BROWSER, toolBarBitmaps[ 7 ], "Load image data", "Load DICOM images from disk" ); 00183 // PS -> toolBar->AddSeparator( ); 00184 // PS -> #endif 00185 toolBar->AddTool( ID_TOOLBAR_3D_BROWSER, toolBarBitmaps[ 9 ], _T("Start 3D"), _T("Load 3D representation") ); 00186 toolBar->AddSeparator( ); 00187 toolBar->AddTool( ID_TOOLBAR_PLANS, toolBarBitmaps[ 10 ], _T("Plan"), _T("Planes") ); 00188 toolBar->AddSeparator( ); 00189 // toolBar->AddTool( ID_TOOLBAR_QUANT, toolBarBitmaps[ 11 ], "Quant", "Quant" ); 00190 // toolBar->AddSeparator( ); 00191 //The following has been commented out temporarlily 00192 /* 00193 toolBar->AddTool( ID_TOOLBAR_ROTATE, toolBarBitmaps[ 12 ], "Rotate", "Rotate" ); 00194 toolBar->AddSeparator( ); 00195 toolBar->AddTool( ID_TOOLBAR_BRIGHT, toolBarBitmaps[ 13 ], "Bright", "Bright" ); 00196 toolBar->AddSeparator( ); 00197 toolBar->AddTool( ID_TOOLBAR_PAN, toolBarBitmaps[ 14 ], "Pan", "Pan" ); 00198 toolBar->AddSeparator( ); 00199 toolBar->AddTool( ID_TOOLBAR_ZOOM, toolBarBitmaps[ 15 ], "Zoom", "Zoom" ); 00200 toolBar->AddSeparator( ); 00201 toolBar->AddTool( ID_TOOLBAR_CLEAR, toolBarBitmaps[ 16 ], "Clear", "Clear" ); 00202 toolBar->AddSeparator( ); 00203 toolBar->AddTool( ID_TOOLBAR_INTENSITY, toolBarBitmaps[ 17 ], "Intensity", "Intensity" ); 00204 toolBar->AddSeparator( );*/ 00205 toolBar->AddTool( ID_TOOLBAR_PARAMETERS, toolBarBitmaps[ 4 ], _T("Parameters"), _T("Load parameters for modifying") ); 00206 //toolBar->AddTool( ID_TOOLBAR_HELP, toolBarBitmaps[ 20 ], "Help", "Help" ); 00207 toolBar->AddSeparator( ); 00208 00209 wxBitmapButton *btnCreatisLogo = new wxBitmapButton(toolBar,-1,toolBarBitmaps[ 22 ] ); 00210 btnCreatisLogo->SetSize(81+10,20+10); 00211 btnCreatisLogo->SetBackgroundColour(wxColour(0,0,153)); 00212 Connect(btnCreatisLogo->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame::OnAboutCreatis ); 00213 00214 toolBar->AddControl(btnCreatisLogo); 00215 00216 00217 00218 toolBar->Realize( ); 00219 toolBar->SetRows( 1 ); 00220 toolBar->EnableTool(ID_TOOLBAR_3D_BROWSER, true); 00221 toolBar->EnableTool(ID_TOOLBAR_PLANS, false); 00222 toolBar->EnableTool(ID_TOOLBAR_QUANT, false); 00223 }
wxPanel* wxMaracasFrame::_actual_panel [private] |
Definition at line 72 of file wxMaracasFrame.h.
Referenced by OnQuant(), and OnStartExperiment().
marInterface* wxMaracasFrame::_mar [private] |
Definition at line 74 of file wxMaracasFrame.h.
Referenced by OnParameters(), OnQuant(), OnQuit(), and OnStartExperiment().
marSimpleDicom* wxMaracasFrame::_marSimpleDicom [private] |
Definition at line 75 of file wxMaracasFrame.h.
Referenced by OnStartExperiment().
wxGauge* wxMaracasFrame::_progressGauge [private] |
Definition at line 73 of file wxMaracasFrame.h.
Referenced by OnStartExperiment().
Definition at line 77 of file wxMaracasFrame.h.
Referenced by DeletePanels(), OnQuant(), OnRegenerateAll(), OnRegenerateSplineAxe(), and OnStartExperiment().
Definition at line 78 of file wxMaracasFrame.h.
Referenced by DeletePanels(), OnCleanContours(), OnQuant(), OnRegenerateAll(), OnRegenerateSignal(), and OnRegenerateSplineAxe().