]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfMainPanel.cxx
7d77c933622ace10e4195237b09823ef94fbae81
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.cxx
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #include "interfMainPanel.h"
27
28
29 interfMainPanel* interfMainPanel::interfmainpanel=NULL;
30 wxFrame* interfMainPanel::_newframe=NULL;
31
32 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
33 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
34 {
35
36         PANEL                                   = "New Contour";
37         PANEL1                                  = "I/O";
38         PANEL2                                  = "Edit";
39         PANEL3                                  = "Delete";
40         PANEL4                                  = "Contour Tools";
41         PANEL5                                  = "Segmentation";
42 //EED 07/07/2010
43         PANEL6                                  = "Image Tools";
44
45         segmentPanel                    = NULL;
46         segmentPanelITK                 = NULL;
47         configPanel                             = NULL;
48         spreadPanel                             = NULL;
49         infoWin                                 = NULL;
50         infoPanel                               = NULL;
51         infoPanelMask                   = NULL;
52         informationPanel                = NULL;
53         mirrorPanel                             = NULL;
54         thresholdPanel                  = NULL;
55         colorImageLayerPanel    = NULL;
56         currentWindow                   = NULL;
57         testPanel                               = NULL;
58         flipPanel                               = NULL;
59
60 //CMRU 17-08-09 ------------------------------------------------------------------
61         infoPanelCalibration = NULL;
62         panelAux = NULL;
63 //--------------------------------------------------------------------------------
64         splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
65
66         splitterwindow->SetMinimumPaneSize( 10 );
67         sizey = sizey/8;
68
69         wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
70
71         wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
72         toolpanel->SetSizer(flexsizer, true);
73         toolpanel->SetAutoLayout( true );
74
75         wxButton* b = getButton(toolpanel);
76         b->SetClientData(&PANEL);
77         wxButton* b1 = getButton(toolpanel);
78         b1->SetClientData(&PANEL1);
79         wxButton* b2 = getButton(toolpanel);
80         b2->SetClientData(&PANEL2);
81         wxButton* b3 = getButton(toolpanel);
82         b3->SetClientData(&PANEL3);
83         wxButton* b4 = getButton(toolpanel);
84         b4->SetClientData(&PANEL4);
85         wxButton* b5 = getButton(toolpanel);
86         b5->SetClientData(&PANEL5);
87 //EED 07/07/2010
88         wxButton* b6 = getButton(toolpanel);
89         b6->SetClientData(&PANEL6);
90
91
92         wxPanel* mentex  = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
93         wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
94         wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
95         wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
96         wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
97         wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
98 //EED 07/07/2010
99         wxPanel* mentex6 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
100
101         menubar  = new interfNewContourMenu  (mentex,  sizex, sizey, evtHandler, datadir);
102         menubar1 = new interfIOMenu          (mentex1, sizex, sizey, evtHandler, datadir);
103         menubar2 = new interfEditMenu        (mentex2, sizex, sizey, evtHandler, datadir);
104         menubar3 = new interfDeleteMenu      (mentex3, sizex, sizey, evtHandler, datadir);
105         menubar4 = new interfToolsMenu       (mentex4, sizex ,sizey, evtHandler, datadir);
106         menubar5 = new interfSegmentationMenu(mentex5, sizex, sizey, evtHandler, datadir);
107         menubar6 = new interfImageToolsMenu(mentex6, sizex, sizey, evtHandler, datadir);
108
109         statictext  = getText(mentex,  PANEL);
110         statictext1 = getText(mentex1, PANEL1);
111         statictext2 = getText(mentex2, PANEL2);
112         statictext3 = getText(mentex3, PANEL3);
113         statictext4 = getText(mentex4, PANEL4);
114         statictext5 = getText(mentex5, PANEL5);
115         statictext6 = getText(mentex6, PANEL6);
116
117         flexsizer->Add(b, wxFIXED_MINSIZE);
118         flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
119
120         flexsizer->Add(b1, wxFIXED_MINSIZE);
121         flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
122
123         flexsizer->Add(b2, wxFIXED_MINSIZE);
124         flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
125
126         flexsizer->Add(b3, wxFIXED_MINSIZE);
127         flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
128
129         flexsizer->Add(b4, wxFIXED_MINSIZE);
130         flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
131
132         flexsizer->Add(b5, wxFIXED_MINSIZE);
133         flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE);
134         flexsizer->Add(b6, wxFIXED_MINSIZE);
135         flexsizer->Add(setMenuTextSizer(mentex6, menubar6,statictext6), wxFIXED_MINSIZE);
136
137         toolpanel->Update();
138         toolpanel->Layout();
139
140         infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
141         wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
142         infoPanel->SetSizer(infosizer, true);
143         infoPanel->SetAutoLayout( true );
144
145         splitterwindow->Initialize(toolpanel);
146         splitterwindow->SetSashGravity(1);
147 //EED   splitterwindow->SetSashPosition(600);
148         splitterwindow->SetSashSize(5);
149         splitterwindow->SplitHorizontally(toolpanel, infoPanel,8*73);
150
151         Connect(b->GetId(),  wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
152         Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
153         Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
154         Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
155         Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
156         Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
157         Connect(b6->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
158
159         this->Layout();
160 }
161
162 interfMainPanel::~interfMainPanel(void)
163 {
164
165 }
166
167 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler)
168 {
169         _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);
170
171         if(interfmainpanel == NULL){
172                 interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
173         }
174         _newframe->Show(TRUE);
175         return interfmainpanel;
176 }
177
178 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler)
179 {
180
181         _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 );
182
183         if(interfmainpanel == NULL){
184                 interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
185         }
186         _newframe->Show(TRUE);
187         return interfmainpanel;
188 }
189
190 bool interfMainPanel::Show(bool show)
191 {
192         return _newframe->Show(show);
193 }
194
195 interfMainPanel* interfMainPanel::getInstance()
196 {
197         return interfmainpanel;
198 }
199
200 void interfMainPanel :: resetInstance()
201 {
202         //delete interfmainpanel;
203         delete _newframe;
204         interfmainpanel = NULL;
205 }
206
207 wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler)
208 {
209         wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
210
211         wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2)       ;
212         panel->SetSizer(flexsizer, true);
213         panel->SetAutoLayout( true );
214
215         interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
216         toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
217
218         flexsizer->Add(menu, wxFIXED_MINSIZE);
219         flexsizer->Add(toolspread, wxFIXED_MINSIZE);
220
221         panel->Layout();
222
223         return panel;
224 }
225
226 /**
227 **      Adds a new checkbox to the scrolledwindow using the checkboxsizer
228 **      @Params id of contour
229 **
230 **/
231 void interfMainPanel::addContourCheckBox(std::string id)
232 {
233         toolspread->addContourCheckBox(id);
234 }
235
236 /**
237 **      Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
238 **      @Params id of contour
239 **
240 **/
241 void interfMainPanel::removeContourCheckBox(std::string id)
242 {
243         toolspread->removeContourCheckBox(id);
244 }
245
246 void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event )
247 {
248         //((interfToolsMenu*)menubar4)->hideAxis();
249         wxButton* b = (wxButton*)event.GetEventObject();
250         wxPanel* dmenu;
251         wxStaticText* text;
252         std::string dstring = *((std::string*) b->GetClientData());
253         int sizechange=0;
254
255         if(dstring.compare(PANEL)==0){
256                 dmenu = menubar;
257                 text = statictext;
258         }else if(dstring.compare(PANEL1)==0 ){
259                 dmenu = menubar1;
260                 text = statictext1;
261         }else if(dstring.compare(PANEL2)==0){
262                 dmenu = menubar2;
263                 text = statictext2;
264         }else if(dstring.compare(PANEL3)==0){
265                 dmenu = menubar3;
266                 text = statictext3;
267         }else if(dstring.compare(PANEL4)==0){
268                 dmenu = menubar4;
269                 text = statictext4;
270         }else if(dstring.compare(PANEL5)==0){
271                 dmenu = menubar5;
272                 text = statictext5;
273         }else if(dstring.compare(PANEL6)==0){
274                 dmenu = menubar6;
275                 text = statictext6;
276         }
277
278         if(wxStrcmp(b->GetLabel(),_T("+"))==0 ){
279                 dmenu->Show(true);
280                 sizechange = 1;
281                 b->SetLabel(_T("-"));
282         }else{
283                 dmenu->Show(false);
284                 sizechange = -1;
285                 b->SetLabel(_T("+"));
286         }
287
288         sizechange *= (dmenu->GetSize().GetHeight()-10);
289         splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+sizechange);
290
291         this->Layout();
292         this->Refresh();
293 }
294
295 wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom)
296 {
297         return new wxStaticText(parent, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
298                                         wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
299 }
300
301 wxButton* interfMainPanel::getButton(wxWindow* parent)
302 {
303         wxButton* b = new wxButton(parent, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
304                                         wxDefaultValidator, wxString(_T("-")));
305         return b;
306 }
307
308 wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text)
309 {
310
311         wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
312         parent->SetSizer(flexsizer, true);
313         parent->SetAutoLayout( true );
314
315         flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
316         flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
317
318         parent->Layout();
319         return (wxPanel*)parent;
320 }
321
322 /**
323 **      Shows the panel in the
324 **/
325 void interfMainPanel::showPanel(wxWindow* panel)
326 {
327         wxContourMainFrame::getInstance()->showAxis(false);
328         wxSizer* sizer = infoPanel->GetSizer();
329
330         if(currentWindow != NULL){
331                 currentWindow->Hide();
332                 /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
333                 sizer->Remove(currentWindow);
334         }
335         sizer->Add(panel);
336         currentWindow = panel;
337         currentWindow->Show(true);
338
339         splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
340         splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
341
342         infoPanel->Layout();
343         infoPanel->Refresh();
344         this->Layout();
345         this->Refresh();
346 }
347
348 /**
349 **      Hide the panel in the lower box
350 **/
351 void interfMainPanel::hidePanel( )
352 {
353         wxContourMainFrame::getInstance()->showAxis(false);
354         wxSizer* sizer = infoPanel->GetSizer();
355
356         if(currentWindow != NULL){
357                 currentWindow->Hide();
358                 /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
359                 sizer->Remove(currentWindow);
360         }
361         wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
362         sizer->Add(emptyPanel);
363         currentWindow = emptyPanel;
364         currentWindow->Show(true);
365
366         splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
367         splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
368
369         infoPanel->Layout();
370         infoPanel->Refresh();
371         this->Layout();
372         this->Refresh();
373 }
374
375 /**
376 **      Gets the Information panel
377 **/
378 wxPanel* interfMainPanel::getInfoPanel()
379 {
380         return infoPanel;
381 }
382
383 void interfMainPanel::onCreateContourSpline( )
384 {
385         wxContourMainFrame::getInstance()->showAxis(false);
386         wxContourMainFrame::getInstance()->onCreateContourSpline();
387 }
388
389 void interfMainPanel::onCreateContourRectangle( )
390 {
391         wxContourMainFrame::getInstance()->showAxis(false);
392     wxContourMainFrame::getInstance()->onCreateContourRectangle();
393 }
394 void interfMainPanel::onCreateContourCircle( )
395 {
396         wxContourMainFrame::getInstance()->showAxis(false);
397     wxContourMainFrame::getInstance()->onCreateContourCircle();
398 }
399
400 void interfMainPanel::onCreateContourLine( )
401 {
402         wxContourMainFrame::getInstance()->showAxis(false);
403     wxContourMainFrame::getInstance()->onCreateContourLine();
404 }
405
406 // RaC 09-09 ---------------------
407 void interfMainPanel::onCreateContourPoints( )
408 {
409         wxContourMainFrame::getInstance()->showAxis(false);
410     wxContourMainFrame::getInstance()->onCreateContourPoints();
411 }
412 // RaC 09-09 ---------------------
413
414 // RaC 10-09 ---------------------
415 void interfMainPanel::onCreateContourPolygon( )
416 {
417         wxContourMainFrame::getInstance()->showAxis(false);
418     wxContourMainFrame::getInstance()->onCreateContourPolygon();
419 }
420 // RaC 10-09 ---------------------
421
422 void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull)
423 {
424         wxContourMainFrame::getInstance()->showAxis(false);
425         wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
426 }
427
428 void interfMainPanel::onDeleteContour()
429 {
430         wxContourMainFrame::getInstance()->showAxis(false);
431         wxContourMainFrame::getInstance()->onDeleteContour();
432 }
433
434 void interfMainPanel::onDeleteContoursActSlice()
435 {
436         wxContourMainFrame::getInstance()->showAxis(false);
437         wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
438 }
439
440 void interfMainPanel::onDeleteAllContours()
441 {
442         wxContourMainFrame::getInstance()->showAxis(false);
443         wxContourMainFrame::getInstance()->onDeleteAllContours();
444 }
445
446 void interfMainPanel::onCopy()
447 {
448         wxContourMainFrame::getInstance()->onCopy();
449 }
450
451 void interfMainPanel::onPaste()
452 {
453         wxContourMainFrame::getInstance()->onPaste();
454 }
455
456 void interfMainPanel::onUndo()
457 {
458         wxContourMainFrame::getInstance()->onUndo();
459 }
460
461 void interfMainPanel::onRedo()
462 {
463         wxContourMainFrame::getInstance()->onRedo();
464 }
465
466 void interfMainPanel::onLoad()
467 {
468         wxContourMainFrame::getInstance()->onLoad();
469 }
470
471 void interfMainPanel::onSave()
472 {
473         wxContourMainFrame::getInstance()->onSave();
474 }
475
476 void interfMainPanel::onImport()
477 {
478         wxContourMainFrame::getInstance()->onImport();
479 }
480
481 void interfMainPanel::onTest()
482 {
483         printf("EED interfMainPanel::onTest \n");
484         if(testPanel==NULL)
485         {
486                 testPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
487                         wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
488                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
489                 testPanel->SetSizer(flexsizer, true);
490                 testPanel->SetAutoLayout( true );
491                 panelTest = new interfTestPanel(testPanel);
492                 wxStaticText* stattext = new wxStaticText(testPanel,  -1,
493                         wxString(_T("   Test Panel   ")),
494                         wxDefaultPosition, wxDefaultSize,
495                         wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
496                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
497                 flexsizer->Add(panelTest, wxEXPAND);
498                 testPanel->Layout();
499         }
500         showPanel(testPanel);
501 }
502
503 void interfMainPanel::RefreshInterface()
504 {
505         wxContourMainFrame::getInstance()->RefreshInterface();
506 }
507
508 vtkImageData* interfMainPanel::getImageData()
509 {
510         return wxContourMainFrame::getInstance()->getImageData();
511 }
512
513 void interfMainPanel::getImageRange(double  range[2] )
514 {
515         vtkImageData * img = getImageData();
516         img->GetScalarRange(range);
517 }
518
519 void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
520 {
521         wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
522 }
523
524 void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation)
525 {
526         wxContourMainFrame::getInstance()->onSegmentationOneSliceITK(distance, sigma, alfa, beta, propagation, iterations, inflation);
527 }
528
529 int interfMainPanel::GetImageDataSizeZ()
530 {
531         return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
532 }
533
534 void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method)
535 {
536         wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
537 }
538
539 void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString)
540 {
541     ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
542 }
543 void interfMainPanel::onSegmentationPressed()
544 {
545         if(segmentPanel == NULL){
546                 segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
547                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
548                 segmentPanel->SetSizer(flexsizer, true);
549                 segmentPanel->SetAutoLayout(true);
550                 segmentPanel->SetEventHandler(this);
551
552                 //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
553                 segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
554
555
556                 wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T("   Automatic Segmentation   ")), wxDefaultPosition,
557                         wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
558
559                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
560                 flexsizer->Add(segmentationPanel, wxEXPAND);
561                 segmentPanel->Layout();
562         }
563         showPanel(segmentPanel);
564         wxContourMainFrame::getInstance()->showAxis(true);
565         axisshown = true;
566 }
567
568 void interfMainPanel::onSegmentationPressedITK()
569 {
570     if(segmentPanelITK == NULL){
571                 segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
572
573
574                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
575                 segmentPanelITK->SetSizer(flexsizer, true);
576                 segmentPanelITK->SetAutoLayout( true );
577                 //segmentPanelITK->SetEventHandler(this->contourevent);
578
579                 //wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK);
580                 wxPanel* panel = new interfSegmentationPanelITK(segmentPanelITK);
581
582                 wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T("   Automatic ITK Segmentation   ")), wxDefaultPosition,
583                         wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
584
585                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
586                 flexsizer->Add(panel, wxEXPAND);
587                 segmentPanelITK->Layout();
588         }
589         showPanel(segmentPanelITK);
590         wxContourMainFrame::getInstance()->showAxis(true);
591         axisshown = true;
592 }
593
594 void interfMainPanel::onRigidPressed()
595 {
596         wxContourMainFrame::getInstance()->onRigidPressed();
597 }
598
599 void interfMainPanel::onWidthOfContour(double width)
600 {
601         wxContourMainFrame::getInstance()->onWidthOfContour(width);
602 }
603
604 int interfMainPanel::getColorWindow()
605 {
606         return wxContourMainFrame::getInstance()->getColorWindow();
607 }
608 int interfMainPanel::getWindowLevel()
609 {
610         return wxContourMainFrame::getInstance()->getWindowLevel();
611 }
612 void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
613 {
614         wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
615 }
616
617 void interfMainPanel::onInterpolation(bool interpolate)
618 {
619         wxContourMainFrame::getInstance()->onInterpolation(interpolate);
620 }
621
622
623 void interfMainPanel::onConfigurationPressed()
624 {
625         if(configPanel == NULL){
626                 configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
627                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
628                 configPanel->SetSizer(flexsizer, true);
629                 configPanel->SetAutoLayout( true );
630                 //configPanel->SetEventHandler(this->contourevent);
631                 wxPanel* panel = new interfConfigurationPanel(configPanel);
632                 wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T("   Interface Configuration   ")), wxDefaultPosition,
633                         wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
634                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
635                 flexsizer->Add(panel, wxEXPAND);
636                 configPanel->Layout();
637         }
638         showPanel(configPanel);
639 }
640
641 void interfMainPanel::onSpreadPressed()
642 {
643     if(spreadPanel==NULL){
644
645                 spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
646                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
647                 spreadPanel->SetSizer(flexsizer, true);
648                 spreadPanel->SetAutoLayout( true );
649                 //spreadPanel->SetEventHandler(this->contourevent);
650
651                 //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
652                 panelSpread = new interfSpreadPanel(spreadPanel);
653
654
655                 wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T("   Automatic Spread   ")), wxDefaultPosition,
656                         wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
657
658                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
659                 flexsizer->Add(panelSpread, wxEXPAND);
660                 spreadPanel->Layout();
661         }
662         showPanel(spreadPanel);
663         //hideAxis();
664 }
665
666 void interfMainPanel::resetAppend()
667 {
668         wxContourMainFrame::getInstance()->resetAppend();
669 }
670
671 void interfMainPanel::onSpreadAdd()
672 {
673         wxContourMainFrame::getInstance()->onSpreadAdd();
674 }
675
676 void interfMainPanel::onSpreadAddAll()
677 {
678         wxContourMainFrame::getInstance()->onSpreadAddAll();
679 }
680
681
682 void interfMainPanel::appendStringSpread(std::string val)
683 {
684     panelSpread->appendStringSpread(val);
685 }
686
687 void interfMainPanel::onSpreadGo(int type)
688 {
689         wxContourMainFrame::getInstance()->onSpreadGo(type);
690 }
691
692 void interfMainPanel::setStringSpread(std::string stringtemp)
693 {
694         panelSpread->setStringSpread(stringtemp);
695 }
696
697 void interfMainPanel::onInformationPressed()
698 {
699
700         // Statistics frame
701         if(infoWin ==NULL){
702                 infoWin                 = new wxFrame (this, -1,_T("  Statistics  "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER  );
703                 infoWin->SetSize( wxSize(825,650) );
704
705                 wxSize sizepanel(825,675);
706                 informationPanel        = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
707
708                 wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
709                 sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
710
711                 infoWin->SetSizer( sizerPanel );
712                 infoWin->SetAutoLayout( true );
713                 infoWin->Layout();
714                 infoWin->Show();
715         }else {
716
717                 if (infoWin->IsShown()==true)
718                 {
719                         infoWin->Show(false);
720                 } else  {
721                         //contourevent->FillGridWithContoursInformation();
722                         infoWin->Show(true);
723                 }
724         }
725
726 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
727         if(panelAux == NULL)
728         {
729                 panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
730         }
731 //------------------------------------------------------------------------------------------------------------
732
733         // mask view control panel
734         if(infoPanelMask == NULL){
735                 infoPanelMask = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
736                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
737                 infoPanelMask->SetSizer(flexsizer, true);
738                 infoPanelMask->SetAutoLayout( true );
739                 //configPanel->SetEventHandler(this->contourevent);
740                 wxPanel *panel = wxContourMainFrame::getInstance()->getMaskImageViewPanel( infoPanelMask );
741                 wxStaticText* stattext = new wxStaticText(infoPanelMask, -1, wxString(_T("   Mask segmentation    ")), wxDefaultPosition,
742                                                                                                   wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
743
744                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
745
746                 flexsizer->Add(panel, wxEXPAND);
747                 infoPanelMask->Layout();
748
749         }
750
751 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
752         //Calibration panel
753         if(infoPanelCalibration == NULL)
754         {
755                 infoPanelCalibration = new wxPanel(panelAux, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER , wxString(_T("")));
756                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
757                 infoPanelCalibration->SetSizer(flexsizer, true);
758                 infoPanelCalibration->SetAutoLayout( true );
759
760                 wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
761                 wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T("              Calibration               ")), wxDefaultPosition,
762                                                                                                   wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
763
764                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
765
766                 flexsizer->Add(panel, wxEXPAND);
767                 infoPanelCalibration->Layout();
768         }
769
770         wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
771         panelAux->SetSizer(sizer, true);
772         panelAux->SetAutoLayout( true );
773         sizer->Add(infoPanelMask);
774         sizer->Add(infoPanelCalibration);
775
776         showPanel(panelAux);
777
778 //------------------------------------------------------------------
779
780         wxContourMainFrame::getInstance()->changeInstant();
781 }
782
783 void interfMainPanel::getInstantVector(std::vector<int>& tempVector)
784 {
785         wxContourMainFrame::getInstance()->getInstantVector(tempVector);
786 }
787
788 std::vector<std::string> interfMainPanel::getOutlinesName(int slide)
789 {
790         return wxContourMainFrame::getInstance()->getOutlinesName(slide);
791 }
792
793 void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax){
794         wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);
795 }
796
797 void interfMainPanel::setStringInfoPanel(wxString tmpString)
798 {
799         if(informationPanel!=NULL){
800                 ((interfInformationPanel*)informationPanel)->setStringInfoPanel(tmpString);
801         }
802 }
803
804 void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString)
805 {
806         ((interfInformationPanel*)informationPanel)->setRowLabelInfoPanel(z, tempString);
807 }
808
809 int interfMainPanel::getNumberColsInformationPanel()
810 {
811         return ((interfInformationPanel*)informationPanel)->getNumberCols();
812 }
813
814 void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics)
815 {
816         ((interfInformationPanel*)informationPanel)->appendCols(_numberOfVariablesStatistics);
817 }
818
819 void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString)
820 {
821         ((interfInformationPanel*)informationPanel)->setCellValue(z, tmpIntA, tempString);
822 }
823
824 void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString)
825 {
826         ((interfInformationPanel*)informationPanel)->setColLabel(tmpIntB, tmpTitleString);
827
828 }
829
830 void interfMainPanel::SetScalarRange(int grayRangeMin,int grayRangeMax)
831 {
832         wxContourMainFrame::getInstance()->SetScalarRange(grayRangeMin, grayRangeMax);
833 }
834
835 void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename,
836                                                                         int typeContourGroup, int selection, int minZ, int maxZ ,bool XYZValues, bool contourImage, bool statistics)
837 {
838         wxContourMainFrame::getInstance()->onSaveResults(directory, namefile, filename,
839                 typeContourGroup, selection, minZ,maxZ, XYZValues, contourImage, statistics);
840 }
841
842 wxString interfMainPanel::getCellValue(int j,int i){
843         return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
844 }
845
846 void interfMainPanel::onSnakePressed()
847 {
848         axisshown=false;
849         wxContourMainFrame::getInstance()->showAxis(axisshown);
850         wxContourMainFrame::getInstance()->onSnakePressed();
851 }
852
853 void interfMainPanel::onMirrorPressed(){
854     if(mirrorPanel==NULL)
855         {
856
857                 mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
858                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
859                 mirrorPanel->SetSizer(flexsizer, true);
860                 mirrorPanel->SetAutoLayout( true );
861                 panelMirror = new interfMirrorPanel(mirrorPanel);
862
863                 wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T("   Mirroring Tool   ")), wxDefaultPosition,
864                         wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
865
866                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
867                 flexsizer->Add(panelMirror, wxEXPAND);
868                 mirrorPanel->Layout();
869
870                 refLineShown=true;
871                 wxContourMainFrame::getInstance()->referenceLine();
872         }
873
874         else
875         {
876
877                 if (!refLineShown)
878                 {
879                         wxContourMainFrame::getInstance()->refLineShow();
880                         refLineShown=true;
881                 }
882         }
883
884         showPanel(mirrorPanel);
885 }
886
887 void interfMainPanel::onMirror()
888 {
889         wxContourMainFrame::getInstance()->onMirror();
890 }
891
892 void interfMainPanel::onMirrorAxisShow()
893 {
894         if (!refLineShown)
895         {
896                 wxContourMainFrame::getInstance()->refLineShow();
897                 refLineShown=true;
898         }
899 }
900
901 void interfMainPanel::onMirrorAxisHide()
902 {
903         if (refLineShown)
904         {
905                 wxContourMainFrame::getInstance()->refLineHide();
906                 refLineShown=false;
907         }
908 }
909
910 void interfMainPanel::onMirrorChangeWidth(int width)
911 {
912         wxContourMainFrame::getInstance()->refLineChangeWidth(width);
913 }
914
915 //EED 07/07/2010
916 void interfMainPanel::onColorLayerImagePressed()
917 {
918         // Color Image Layer  view control panel
919         if(colorImageLayerPanel == NULL){
920                 colorImageLayerPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
921                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
922                 colorImageLayerPanel->SetSizer(flexsizer, true);
923                 colorImageLayerPanel->SetAutoLayout( true );
924                 //configPanel->SetEventHandler(this->contourevent);
925                 wxPanel *panel = wxContourMainFrame::getInstance()->getColorLayerImageViewPanel( colorImageLayerPanel );
926                 wxStaticText* stattext = new wxStaticText(colorImageLayerPanel, -1, wxString(_T("   Color Image Layer     ")), wxDefaultPosition,
927                                                                                                   wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
928                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
929                 flexsizer->Add(panel, wxEXPAND);
930                 colorImageLayerPanel->Layout();
931         }
932         showPanel(colorImageLayerPanel);
933         wxContourMainFrame::getInstance()->changeInstant();
934 }
935
936 //EED01
937 void interfMainPanel::onThresholdPressed()
938 {
939         // Threshold view control panel
940         if(thresholdPanel == NULL){
941                 thresholdPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
942                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
943                 thresholdPanel->SetSizer(flexsizer, true);
944                 thresholdPanel->SetAutoLayout( true );
945                 //configPanel->SetEventHandler(this->contourevent);
946                 wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( thresholdPanel );
947                 wxStaticText* stattext = new wxStaticText(thresholdPanel, -1, wxString(_T("   Threshold segmentation    ")), wxDefaultPosition,
948                                                                                                   wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
949                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
950                 flexsizer->Add(panel, wxEXPAND);
951                 thresholdPanel->Layout();
952         }
953         showPanel(thresholdPanel);
954         wxContourMainFrame::getInstance()->changeInstant();
955 }
956
957
958 void interfMainPanel::ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ)
959 {
960         wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
961 }
962
963
964 void interfMainPanel::SetContourGroup(int contourGroup)
965 {
966         wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
967 }
968
969
970 void interfMainPanel::onFlipContours()
971 {
972         printf("EED interfMainPanel::onFlipContours() \n");
973         if(flipPanel==NULL)
974         {
975                 flipPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
976                         wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
977                 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
978                 flipPanel->SetSizer(flexsizer, true);
979                 flipPanel->SetAutoLayout( true );
980                 panelFlip = new interfFlipPanel(flipPanel);
981                 wxStaticText* stattext = new wxStaticText(flipPanel,  -1,
982                         wxString(_T("         Flip Contours   ")),
983                         wxDefaultPosition, wxDefaultSize,
984                         wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
985                 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
986                 flexsizer->Add(panelFlip, wxEXPAND);
987                 flipPanel->Layout();
988         }
989         showPanel(flipPanel);
990 }
991
992
993 void interfMainPanel::FlipContours(int typeContourFlip, int flipDirection)
994 {
995         printf("EED interfMainPanel::FlipContours( %d , %d ) \n",typeContourFlip,  flipDirection );
996         wxContourMainFrame::getInstance()->FlipContours( typeContourFlip , flipDirection );
997 }
998
999
1000
1001 //CMRU 17-08-09 ---------------------------------------------
1002 void interfMainPanel::onPrintLabel ()
1003 {
1004         wxString label;
1005         manualBaseModel* manualModel = wxContourMainFrame::getInstance()->getContour();
1006
1007         if(manualModel==NULL)
1008         {
1009         wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a Contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
1010                 dial->ShowModal();
1011                 return;
1012         }
1013
1014         wxTextEntryDialog* dialog = new wxTextEntryDialog(this,_T("Enter a tag name: ")) ;
1015
1016         if (dialog->ShowModal() == wxID_OK)
1017         {
1018                 label = dialog->GetValue();
1019
1020                 if(label.Len()!=0)
1021                 {
1022                         wxContourMainFrame::getInstance()->onPrintLabel(label,manualModel);
1023                         wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The tag name was updated"), wxT("Information"), wxOK | wxICON_INFORMATION);
1024                         dial->ShowModal();
1025                 }
1026                 else
1027                 {
1028                         wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a valid tag"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
1029                         dial->ShowModal();
1030                 }
1031         }
1032 }
1033
1034 void interfMainPanel::onCalibration(wxString size, int unit)
1035 {
1036         int type = 0;
1037         double contourSize = 0.0;
1038         double realSizeDouble = 0.0;
1039
1040         type = wxContourMainFrame::getInstance()->getType();
1041         contourSize = wxContourMainFrame::getInstance()->getContourSizeInPixels();
1042
1043         std::cout<<"Cata->Tama�o del contorno en pixeles:"<<contourSize<<endl;
1044
1045         if ( type == 6 )
1046         {
1047                 if (size.ToDouble(&realSizeDouble))
1048                 {
1049                         if(unit==1)
1050                         {
1051                                 realSizeDouble = realSizeDouble * 10;
1052                         }
1053                         if(unit==2)
1054                         {
1055                                 realSizeDouble = realSizeDouble * 25.4;
1056                         }
1057                         std::cout<< "Valor del usuario" << realSizeDouble<< endl ;
1058                         onePixelSize (realSizeDouble,contourSize);
1059                  }
1060                  else
1061                  {
1062                         wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please enter a numeric value"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
1063                         dial->ShowModal();
1064                  }
1065         }
1066         else
1067         {
1068                 wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Please select a line contour"), wxT("Warning"), wxOK | wxICON_EXCLAMATION);
1069                 dial->ShowModal();
1070         }
1071
1072         wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("The calibration was made"), wxT("Information"), wxOK | wxICON_INFORMATION);
1073         dial->ShowModal();
1074         std::cout<< "Cata-> Se ha realizado la calibracion" << endl ;
1075 }
1076
1077 double interfMainPanel::onePixelSize (double realSize,double sizePixel)
1078 {
1079         _pixelValue = realSize/sizePixel;
1080         std::cout<< "Valor del un pixel = " << _pixelValue<< endl ;
1081         wxContourMainFrame::getInstance()->onePixelSize (_pixelValue);
1082         return _pixelValue ;
1083 }
1084
1085 double interfMainPanel::GetPixelValue()
1086 {
1087         return _pixelValue;
1088 }
1089 //------------------------------------------------------------------------------------------------------------