1 #include "interfMainPanel.h"
4 #include "interfNewContourMenu.h"
5 #include "interfIOMenu.h"
6 #include "interfEditMenu.h"
7 #include "interfDeleteMenu.h"
8 #include "interfToolsMenu.h"
9 #include "interfToolsSpreadPanel.h"
10 #include "interfMenuBar.h"
11 #include "interfSegmentationMenu.h"
14 interfMainPanel* interfMainPanel::interfmainpanel=NULL;
15 wxFrame* interfMainPanel::_newframe=NULL;
17 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
18 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
21 PANEL = "New Contour";
26 PANEL5 = "Segmentation";
28 segmentPanelITK = NULL;
34 informationPanel = NULL;
36 thresholdPanel = NULL;
39 splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
41 splitterwindow->SetMinimumPaneSize( 10 );
44 wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
46 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
47 toolpanel->SetSizer(flexsizer, true);
48 toolpanel->SetAutoLayout( true );
50 wxButton* b = getButton(toolpanel);
51 b->SetClientData(&PANEL);
52 wxButton* b1 = getButton(toolpanel);
53 b1->SetClientData(&PANEL1);
54 wxButton* b2 = getButton(toolpanel);
55 b2->SetClientData(&PANEL2);
56 wxButton* b3 = getButton(toolpanel);
57 b3->SetClientData(&PANEL3);
58 wxButton* b4 = getButton(toolpanel);
59 b4->SetClientData(&PANEL4);
60 wxButton* b5 = getButton(toolpanel);
61 b5->SetClientData(&PANEL5);
63 wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
64 wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
65 wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
66 wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
67 wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
68 wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
70 menubar = new interfNewContourMenu(mentex, sizex, sizey, evtHandler, datadir);
71 menubar1 = new interfIOMenu(mentex1, sizex, sizey, evtHandler, datadir);
72 menubar2 = new interfEditMenu(mentex2, sizex, sizey, evtHandler, datadir);
73 menubar3 = new interfDeleteMenu(mentex3, sizex, sizey, evtHandler, datadir);
74 menubar4 = new interfToolsMenu(mentex4, sizex,sizey, evtHandler, datadir);
75 menubar5 = new interfSegmentationMenu(mentex5, sizex,sizey, evtHandler, datadir);
77 statictext = getText(mentex, PANEL);
78 statictext1 = getText(mentex1, PANEL1);
79 statictext2 = getText(mentex2, PANEL2);
80 statictext3 = getText(mentex3, PANEL3);
81 statictext4 = getText(mentex4, PANEL4);
82 statictext5 = getText(mentex5, PANEL5);
84 flexsizer->Add(b, wxFIXED_MINSIZE);
85 flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
87 flexsizer->Add(b1, wxFIXED_MINSIZE);
88 flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
90 flexsizer->Add(b2, wxFIXED_MINSIZE);
91 flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
93 flexsizer->Add(b3, wxFIXED_MINSIZE);
94 flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
96 flexsizer->Add(b4, wxFIXED_MINSIZE);
97 flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
99 flexsizer->Add(b5, wxFIXED_MINSIZE);
100 flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE);
105 infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
106 wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
107 infoPanel->SetSizer(infosizer, true);
108 infoPanel->SetAutoLayout( true );
110 splitterwindow->Initialize(toolpanel);
111 splitterwindow->SetSashGravity(1);
112 splitterwindow->SplitHorizontally(toolpanel, infoPanel);
114 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
115 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
116 Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
117 Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
118 Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
119 Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
124 interfMainPanel::~interfMainPanel(void)
128 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler){
130 _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
133 if(interfmainpanel == NULL){
134 interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
137 _newframe->Show(TRUE);
138 return interfmainpanel;
141 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler){
143 _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
145 if(interfmainpanel == NULL){
146 interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
149 _newframe->Show(TRUE);
150 return interfmainpanel;
152 bool interfMainPanel::Show(bool show){
153 return _newframe->Show(show);
155 interfMainPanel* interfMainPanel::getInstance()
158 return interfmainpanel;
161 void interfMainPanel :: resetInstance()
163 //delete interfmainpanel;
165 interfmainpanel = NULL;
168 wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler){
171 wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
173 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2) ;
174 panel->SetSizer(flexsizer, true);
175 panel->SetAutoLayout( true );
177 interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
178 toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
180 flexsizer->Add(menu, wxFIXED_MINSIZE);
181 flexsizer->Add(toolspread, wxFIXED_MINSIZE);
191 ** Adds a new checkbox to the scrolledwindow using the checkboxsizer
192 ** @Params id of contour
195 void interfMainPanel::addContourCheckBox(std::string id){
196 toolspread->addContourCheckBox(id);
200 ** Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
201 ** @Params id of contour
204 void interfMainPanel::removeContourCheckBox(std::string id){
205 toolspread->removeContourCheckBox(id);
208 void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ){
209 //((interfToolsMenu*)menubar4)->hideAxis();
210 wxButton* b = (wxButton*)event.GetEventObject();
213 std::string dstring = *((std::string*) b->GetClientData());
217 if(dstring.compare(PANEL)==0){
220 }else if(dstring.compare(PANEL1)==0 ){
223 }else if(dstring.compare(PANEL2)==0){
226 }else if(dstring.compare(PANEL3)==0){
229 }else if(dstring.compare(PANEL4)==0){
232 }else if(dstring.compare(PANEL5)==0){
237 if(wxStrcmp(b->GetLabel(),_T("+"))==0 ){
240 b->SetLabel(_T("-"));
244 b->SetLabel(_T("+"));
247 sizechange *= dmenu->GetSize().GetHeight();
248 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+sizechange);
254 wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom){
255 return new wxStaticText(parent, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
256 wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
259 wxButton* interfMainPanel::getButton(wxWindow* parent){
260 wxButton* b = new wxButton(parent, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
261 wxDefaultValidator, wxString(_T("-")));
265 wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text){
267 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
268 parent->SetSizer(flexsizer, true);
269 parent->SetAutoLayout( true );
271 flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
272 flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
275 return (wxPanel*)parent;
280 ** Shows the panel in the
282 void interfMainPanel::showPanel(wxWindow* panel)
284 wxContourMainFrame::getInstance()->showAxis(false);
285 wxSizer* sizer = infoPanel->GetSizer();
287 if(currentWindow != NULL){
288 currentWindow->Hide();
289 sizer->Remove(currentWindow);
292 currentWindow = panel;
293 currentWindow->Show(true);
295 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
296 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
299 infoPanel->Refresh();
305 ** Hide the panel in the lower box
307 void interfMainPanel::hidePanel( ){
308 wxContourMainFrame::getInstance()->showAxis(false);
309 wxSizer* sizer = infoPanel->GetSizer();
311 if(currentWindow != NULL){
312 currentWindow->Hide();
313 sizer->Remove(currentWindow);
315 wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
316 sizer->Add(emptyPanel);
317 currentWindow = emptyPanel;
318 currentWindow->Show(true);
320 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
321 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
324 infoPanel->Refresh();
330 ** Gets the Information panel
332 wxPanel* interfMainPanel::getInfoPanel(){
336 void interfMainPanel::onCreateContourSpline( ){
337 wxContourMainFrame::getInstance()->showAxis(false);
338 wxContourMainFrame::getInstance()->onCreateContourSpline();
340 void interfMainPanel::onCreateContourRectangle( ){
341 wxContourMainFrame::getInstance()->showAxis(false);
342 wxContourMainFrame::getInstance()->onCreateContourRectangle();
344 void interfMainPanel::onCreateContourCircle( ){
345 wxContourMainFrame::getInstance()->showAxis(false);
346 wxContourMainFrame::getInstance()->onCreateContourCircle();
348 void interfMainPanel::onCreateContourLine( ){
349 wxContourMainFrame::getInstance()->showAxis(false);
350 wxContourMainFrame::getInstance()->onCreateContourLine();
352 void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
353 wxContourMainFrame::getInstance()->showAxis(false);
354 wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
356 void interfMainPanel::onDeleteContour(){
357 wxContourMainFrame::getInstance()->showAxis(false);
358 wxContourMainFrame::getInstance()->onDeleteContour();
360 void interfMainPanel::onDeleteContoursActSlice(){
361 wxContourMainFrame::getInstance()->showAxis(false);
362 wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
364 void interfMainPanel::onDeleteAllContours(){
365 wxContourMainFrame::getInstance()->showAxis(false);
366 wxContourMainFrame::getInstance()->onDeleteAllContours();
369 void interfMainPanel::onCopy(){
370 wxContourMainFrame::getInstance()->onCopy();
372 void interfMainPanel::onPaste(){
373 wxContourMainFrame::getInstance()->onPaste();
375 void interfMainPanel::onUndo(){
376 wxContourMainFrame::getInstance()->onUndo();
378 void interfMainPanel::onRedo(){
379 wxContourMainFrame::getInstance()->onRedo();
381 void interfMainPanel::onLoad(){
382 wxContourMainFrame::getInstance()->onLoad();
384 void interfMainPanel::onSave(){
385 wxContourMainFrame::getInstance()-> onSave();
387 void interfMainPanel::RefreshInterface(){
388 wxContourMainFrame::getInstance()->RefreshInterface();
391 vtkImageData* interfMainPanel::getImageData(){
392 return wxContourMainFrame::getInstance()->getImageData();
395 void interfMainPanel::getImageRange(double range[2] )
397 vtkImageData * img = getImageData();
398 img->GetScalarRange(range);
401 void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
403 wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
406 void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation){
407 wxContourMainFrame::getInstance()->onSegmentationOneSliceITK(distance, sigma, alfa, beta, propagation, iterations, inflation);
410 int interfMainPanel::GetImageDataSizeZ(){
411 return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
414 void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
415 wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
418 void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
419 ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
421 void interfMainPanel::onSegmentationPressed(){
422 if(segmentPanel == NULL){
423 segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
424 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
425 segmentPanel->SetSizer(flexsizer, true);
426 segmentPanel->SetAutoLayout( true );
427 segmentPanel->SetEventHandler(this);
429 //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
430 segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
433 wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T(" Automatic Segmentation ")), wxDefaultPosition,
434 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
436 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
437 flexsizer->Add(segmentationPanel, wxEXPAND);
438 segmentPanel->Layout();
440 showPanel(segmentPanel);
441 wxContourMainFrame::getInstance()->showAxis(true);
445 void interfMainPanel::onSegmentationPressedITK(){
446 if(segmentPanelITK == NULL){
447 segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
450 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
451 segmentPanelITK->SetSizer(flexsizer, true);
452 segmentPanelITK->SetAutoLayout( true );
453 //segmentPanelITK->SetEventHandler(this->contourevent);
455 //wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK);
456 wxPanel* panel = new interfSegmentationPanelITK(segmentPanelITK);
459 wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
460 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
462 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
463 flexsizer->Add(panel, wxEXPAND);
464 segmentPanelITK->Layout();
466 showPanel(segmentPanelITK);
467 wxContourMainFrame::getInstance()->showAxis(true);
471 void interfMainPanel::onRigidPressed(){
472 wxContourMainFrame::getInstance()->onRigidPressed();
475 void interfMainPanel::onWidthOfContour(double width){
476 wxContourMainFrame::getInstance()->onWidthOfContour(width);
479 int interfMainPanel::getColorWindow(){
480 return wxContourMainFrame::getInstance()->getColorWindow();
482 int interfMainPanel::getWindowLevel(){
483 return wxContourMainFrame::getInstance()->getWindowLevel();
485 void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
486 wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
489 void interfMainPanel::onInterpolation(bool interpolate)
491 wxContourMainFrame::getInstance()->onInterpolation(interpolate);
495 void interfMainPanel::onConfigurationPressed(){
496 if(configPanel == NULL){
497 configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
498 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
499 configPanel->SetSizer(flexsizer, true);
500 configPanel->SetAutoLayout( true );
501 //configPanel->SetEventHandler(this->contourevent);
502 wxPanel* panel = new interfConfigurationPanel(configPanel);
503 wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T(" Interface Configuration ")), wxDefaultPosition,
504 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
505 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
506 flexsizer->Add(panel, wxEXPAND);
507 configPanel->Layout();
509 showPanel(configPanel);
512 void interfMainPanel::onSpreadPressed(){
513 if(spreadPanel==NULL){
515 spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
516 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
517 spreadPanel->SetSizer(flexsizer, true);
518 spreadPanel->SetAutoLayout( true );
519 //spreadPanel->SetEventHandler(this->contourevent);
521 //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
522 panelSpread = new interfSpreadPanel(spreadPanel);
525 wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T(" Automatic Spread ")), wxDefaultPosition,
526 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
528 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
529 flexsizer->Add(panelSpread, wxEXPAND);
530 spreadPanel->Layout();
532 showPanel(spreadPanel);
536 void interfMainPanel::resetAppend(){
537 wxContourMainFrame::getInstance()->resetAppend();
540 void interfMainPanel::onSpreadAdd(){
541 wxContourMainFrame::getInstance()->onSpreadAdd();
544 void interfMainPanel::appendStringSpread(std::string val){
545 panelSpread->appendStringSpread(val);
548 void interfMainPanel::onSpreadGo(int type){
549 wxContourMainFrame::getInstance()->onSpreadGo(type);
551 void interfMainPanel::setStringSpread(std::string stringtemp){
552 panelSpread->setStringSpread(stringtemp);
555 void interfMainPanel::onInformationPressed(){
559 infoWin = new wxFrame (this, -1,_T(" Statistics "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
560 infoWin->SetSize( wxSize(825,650) );
562 wxSize sizepanel(825,675);
563 informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
565 wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
566 sizerPanel -> Add( informationPanel , 1, wxEXPAND ,0);
568 infoWin->SetSizer( sizerPanel );
569 infoWin->SetAutoLayout( true );
574 if (infoWin->IsShown()==true)
576 infoWin->Show(false);
578 //contourevent->FillGridWithContoursInformation();
583 // mask view control panel
584 if(infoPanelMask == NULL){
585 infoPanelMask = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
586 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
587 infoPanelMask->SetSizer(flexsizer, true);
588 infoPanelMask->SetAutoLayout( true );
589 //configPanel->SetEventHandler(this->contourevent);
590 wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( infoPanelMask );
591 wxStaticText* stattext = new wxStaticText(infoPanelMask, -1, wxString(_T(" Mask segmentation ")), wxDefaultPosition,
592 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
594 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
596 flexsizer->Add(panel, wxEXPAND);
597 infoPanelMask->Layout();
600 showPanel(infoPanelMask);
601 wxContourMainFrame::getInstance()->changeInstant();
604 void interfMainPanel::getInstantVector(std::vector<int>& tempVector){
605 wxContourMainFrame::getInstance()->getInstantVector(tempVector);
608 std::vector<std::string> interfMainPanel::getOutlinesName(int slide){
609 return wxContourMainFrame::getInstance()->getOutlinesName(slide);
612 void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax){
613 wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);
616 void interfMainPanel::setStringInfoPanel(wxString tmpString){
617 if(informationPanel!=NULL){
618 ((interfInformationPanel*)informationPanel)->setStringInfoPanel(tmpString);
622 void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString){
623 ((interfInformationPanel*)informationPanel)->setRowLabelInfoPanel(z, tempString);
626 int interfMainPanel::getNumberColsInformationPanel(){
627 return ((interfInformationPanel*)informationPanel)->getNumberCols();
630 void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics){
631 ((interfInformationPanel*)informationPanel)->appendCols(_numberOfVariablesStatistics);
634 void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString){
635 ((interfInformationPanel*)informationPanel)->setCellValue(z, tmpIntA, tempString);
638 void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString){
639 ((interfInformationPanel*)informationPanel)->setColLabel(tmpIntB, tmpTitleString);
643 void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename,
644 int typeContourGroup, int selection, int minZ, int maxZ ,bool XYZValues, bool contourImage, bool statistics)
646 wxContourMainFrame::getInstance()->onSaveResults(directory, namefile, filename,
647 typeContourGroup, selection, minZ,maxZ, XYZValues, contourImage, statistics);
650 wxString interfMainPanel::getCellValue(int j,int i){
651 return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
654 void interfMainPanel::onSnakePressed()
657 wxContourMainFrame::getInstance()->showAxis(axisshown);
658 wxContourMainFrame::getInstance()->onSnakePressed();
661 void interfMainPanel::onMirrorPressed(){
662 if(mirrorPanel==NULL)
665 mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
666 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
667 mirrorPanel->SetSizer(flexsizer, true);
668 mirrorPanel->SetAutoLayout( true );
669 panelMirror = new interfMirrorPanel(mirrorPanel);
671 wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T(" Mirroring Tool ")), wxDefaultPosition,
672 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
674 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
675 flexsizer->Add(panelMirror, wxEXPAND);
676 mirrorPanel->Layout();
679 wxContourMainFrame::getInstance()->referenceLine();
687 wxContourMainFrame::getInstance()->refLineShow();
692 showPanel(mirrorPanel);
695 void interfMainPanel::onMirror()
697 wxContourMainFrame::getInstance()->onMirror();
700 void interfMainPanel::onMirrorAxisShow()
704 wxContourMainFrame::getInstance()->refLineShow();
709 void interfMainPanel::onMirrorAxisHide()
713 wxContourMainFrame::getInstance()->refLineHide();
718 void interfMainPanel::onMirrorChangeWidth(int width)
720 wxContourMainFrame::getInstance()->refLineChangeWidth(width);
724 void interfMainPanel::onThreshold()
726 wxContourMainFrame::getInstance()->onThreshold();
729 void interfMainPanel::onThresholdChange()
731 wxContourMainFrame::getInstance()->onThresholdChange();
734 void interfMainPanel::onThresholdInstantChange(double range[])
736 panelThreshold->onThresholdInstantChange(range);
739 void interfMainPanel::onThresholdInterpolation(bool interpolate)
741 wxContourMainFrame::getInstance()->onThresholdInterpolation(interpolate);
744 void interfMainPanel::onThresholdChangeOpacity (int opacity)
746 wxContourMainFrame::getInstance()->onThresholdChangeOpacity(opacity);
749 void interfMainPanel::onThresholdRemove()
751 wxContourMainFrame::getInstance()->onThresholdRemove();
754 void interfMainPanel::onThresholdPressed()
756 if(thresholdPanel==NULL)
759 thresholdPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
760 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
761 thresholdPanel->SetSizer(flexsizer, true);
762 thresholdPanel->SetAutoLayout( true );
763 panelThreshold = new interfThresholdPanel(thresholdPanel);
765 wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T(" Threshold Tool ")), wxDefaultPosition,
766 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
768 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
769 flexsizer->Add(panelThreshold, wxEXPAND);
770 thresholdPanel->Layout();
773 showPanel(thresholdPanel);
776 void interfMainPanel::ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ)
778 wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
781 void interfMainPanel::SetContourGroup(int contourGroup)
783 wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);