creaContours_lib
interfToolsPanels.cxx
Go to the documentation of this file.
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 "interfToolsPanels.h"
27 #include "interfMainPanel.h"
28 
30 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
31 {
32 // wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString(_T("")));
33  _withOfContourLine = new wxSlider(this, -1, 1 , 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
34 
35  double range[2];
37  //this->_theViewPanel->getSceneManager()->GetImageDataRange(range);
38 
39  //wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
40  //vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
41  //int colorwindow = (int)imageviewer->GetWindowLevel()->GetLevel();
42  //int windowlevel = (int)imageviewer->GetWindowLevel()->GetWindow();
43 
44  int colorwindow = interfMainPanel::getInstance()->getColorWindow();
45  int windowlevel = interfMainPanel::getInstance()->getWindowLevel();
46 
47  int min = (int)floor (range[0]);
48  int max = (int)ceil (range[1]);
49 
50 
51  _brithtnessWindowLevel = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
52  _brithtnessColorLevel = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
53 
54  _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
55  _interpolationCheckBox->SetValue(true);
56 
57  Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
58  Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
59 
60  Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
61  Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
62  Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
63  Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
64  Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation);
65 
66  wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
67  sizer -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW );
68  sizer -> Add( _withOfContourLine , 1, wxGROW );
69  sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
70  sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
71  sizer -> Add( new wxStaticText(this,-1, _T("Brightness of the image")) , 1, wxGROW );
72  sizer -> Add( new wxStaticText(this,-1, _T("--Window level--")) , 1, wxGROW );
73  sizer -> Add( _brithtnessWindowLevel , 1, wxGROW );
74  sizer -> Add( new wxStaticText(this,-1, _T("--Color level--")) , 1, wxGROW );
75  sizer -> Add( _brithtnessColorLevel, 1, wxGROW );
76  sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
77  sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW );
78  sizer -> Add( _interpolationCheckBox , 1, wxGROW );
79 
80  this->SetSizer( sizer );
81  //JCP 13-10-08
82  //panel->SetSize( sizepanel );
83  //13-10-08
84  this->SetAutoLayout( true );
85  this->Layout();
86 
87 }
88 
89 
91 {
92 }
93 
94 void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){
95 
96  double width = (double)_withOfContourLine->GetValue() / 2.0;
98 }
99 
101  int colorwindow = _brithtnessColorLevel->GetValue();
102  int windowlevel = _brithtnessWindowLevel->GetValue();
103 
104  interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
105 
106 }
107 
108 void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
109 {
110 
112 
113 
114 }
115 
121 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
122 {
123 
124  //wxPanel *panel = new wxPanel(parent,-1);
125 
126  //_contourPropagation = new ContourPropagation();
127 
128  //wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString("",wxConvUTF8));
129 
130  wxButton *spreadResetBtn = new wxButton(this,-1,_T("Reset"),wxDefaultPosition, wxDefaultSize );
131  wxButton *spreadAddBtn = new wxButton(this,-1,_T("Add key contour "),wxDefaultPosition, wxDefaultSize);
132  wxButton *spreadAddAllBtn = new wxButton(this,-1,_T("Add All to key contour"),wxDefaultPosition, wxDefaultSize);
133 
134  wxString lstOptions[3];
135  lstOptions[0]=_T("A");
136  lstOptions[1]=_T("B");
137  lstOptions[2]=_T("C");
138  _spreadMethodRadiobox = new wxRadioBox(this, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 3, wxRA_SPECIFY_COLS);
139  _spreadMethodRadiobox->SetSelection(2);
140 
141  wxButton *spreadGoBtn = new wxButton(this,-1,_T("Go"),wxDefaultPosition, wxDefaultSize);
142  _staticTextSpread = new wxStaticText(this,-1,_T(" "));
143 
144  _wxtextctrlSpread = new wxTextCtrl(this,-1, _T(""),wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
145  _wxtextctrlSpread->SetEditable(false);
146 
147  Connect( spreadResetBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadReset );
148  Connect( spreadAddBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAdd );
149  Connect( spreadAddAllBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAddAll );
150  Connect( spreadGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadGo );
151 
152  wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
153  sizer -> Add( spreadResetBtn , 1, wxGROW );
154  sizer -> Add( spreadAddBtn , 1, wxGROW );
155  sizer -> Add( spreadAddAllBtn , 1, wxGROW );
156  sizer -> Add( _spreadMethodRadiobox , 1, wxGROW );
157  sizer -> Add( spreadGoBtn , 1, wxGROW );
158  sizer -> Add( _staticTextSpread , 1, wxGROW );
159  sizer -> Add( _wxtextctrlSpread , 1, wxGROW );
160 
161 
162  this->SetSizer( sizer );
163  //this->SetSize( wxDefaultSize );
164  this->SetAutoLayout( true );
165  this->Layout();
166  //return panel;
167 }
168 
170 }
171 
172 void interfSpreadPanel::onSpreadReset(wxCommandEvent& event){
173  setStringSpread(" ");
174  _wxtextctrlSpread->SetValue(wxString("",wxConvUTF8));
176 }
177 
178 void interfSpreadPanel::onSpreadAdd(wxCommandEvent& event){
180 }
181 
182 void interfSpreadPanel::onSpreadAddAll(wxCommandEvent& event){
184 }
185 
186 void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){
187  setStringSpread(" ");
188  int typeMethodFindCtrlPoints=_spreadMethodRadiobox->GetSelection();
189 printf("EED interfSpreadPanel::onSpreadGo %d\n",typeMethodFindCtrlPoints);
190  interfMainPanel::getInstance()->onSpreadGo(typeMethodFindCtrlPoints);
191 
192 }
193 
195  /* // if */
196  wxString newstring;
197  //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice );
198  newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8));
199  newstring.append(wxString(" ",wxConvUTF8));
200  newstring.append(wxString(val.c_str(),wxConvUTF8));
201  _wxtextctrlSpread->SetValue(newstring);
202 }
203 
204 void interfSpreadPanel::setStringSpread(std::string stringtemp){
205 
206  wxString newstring(stringtemp.c_str(),wxConvUTF8);
207  //_wxtextctrlSpread->SetEditable(true);
208  _staticTextSpread->SetLabel(newstring);
209  //_wxtextctrlSpread->SetEditable(false);
210 }
211 
216 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
217 {
218  //wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
219  wxString lstOptions[4];
220  lstOptions[0]=_T("Current Slice");
221  lstOptions[1]=_T("Range Slices");
222 // lstOptions[2]=_T("All Slices");
223  _informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS);
224 
225 
226  wxString lstOptContOperation[5];
227  lstOptContOperation[0]=_T("AND");
228  lstOptContOperation[1]=_T("OR");
229  lstOptContOperation[2]=_T("XOR");
230  lstOptContOperation[3]=_T("ALL");
231  _radiolstboxContourGroup = new wxRadioBox(this, -1, _T("Contour group"), wxDefaultPosition, wxSize(270,45), 4 , lstOptContOperation, 4, wxRA_SPECIFY_COLS);
232  _radiolstboxContourGroup->SetSelection(1);
233  Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
234 
235 
236  _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
237  _XYZValues->SetValue(true);
238 
239  _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
240  _contourImage->SetValue(true);
241 
242  _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
243  _statistics->SetValue(true);
244 
245  wxButton *informationContourLabelsBtn = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
246  informationContourLabelsBtn->SetEventHandler( this );
247  Connect( informationContourLabelsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
248 
249  wxButton *statisticsContourBtn = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
250  statisticsContourBtn->SetEventHandler( this );
251  Connect( statisticsContourBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
252 
253  wxButton *showResultImagesBtn = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
254  showResultImagesBtn->SetEventHandler( this );
255  Connect( showResultImagesBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
256 
257 
258  wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
259  saveResultsBtn->SetEventHandler( this );
260  Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
261 
262 
264  //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
265  _mbarrangeSliceInformation = new mBarRange(this,65,65);
266  _mbarrangeSliceInformation->SetMin(0);
267  _mbarrangeSliceInformation->SetStart(0);
268  _mbarrangeSliceInformation-> SetOrientation( true );
269  _mbarrangeSliceInformation-> setActiveStateTo(true);
270  _mbarrangeSliceInformation-> setVisibleLabels( true );
271  _mbarrangeSliceInformation-> setDeviceEndMargin(10);
272  _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
273  _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
274  _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
275  _mbarrangeSliceInformation-> SetStart( 0 );
276  _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
277 
278 
279 
280  double range[2];
282 
283  int min = (int)floor (range[0]);
284  int max = (int)ceil (range[1]);
285 
286  _mbarrangeRangeInformation = new mBarRange(this,65,65);
287  _mbarrangeRangeInformation->SetMin(0);
288  _mbarrangeRangeInformation->SetStart(0);
289  _mbarrangeRangeInformation->SetOrientation( true );
290  _mbarrangeRangeInformation->setActiveStateTo(true);
291  _mbarrangeRangeInformation->setVisibleLabels( true );
292  _mbarrangeRangeInformation->setDeviceEndMargin(10);
293  _mbarrangeRangeInformation->setRepresentedValues( min , max );
294  _mbarrangeRangeInformation->setDeviceBlitStart(10,10);
295  _mbarrangeRangeInformation->setIfWithActualDrawed( false );
296  _mbarrangeRangeInformation->SetStart( min );
297  _mbarrangeRangeInformation->SetEnd( max );
298 
299 // _mbarrangeSliceInformation->PushEventHandler(this);
300 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
301 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
302  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
303  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
304 // Connect(_mbarrangeRangeInformation->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
305  Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
306 
307 
308  _staticTextInformation = new wxStaticText(this,-1,_T(" "));
309 
310  _grid = new wxGrid( this,
311  wxID_ANY,
312  wxPoint( 0, 0 ),
313  wxSize( 200, 500 ) );
314 
315  int i,gridCol=10,gridRow=sizeZ+2;
316  _grid->CreateGrid( 0, 0 );
317  _grid->AppendRows(gridRow);
318  _grid->AppendCols(gridCol);
319 
320  for (i=0;i<gridRow;i++)
321  {
322  _grid->SetRowLabelValue(i, _T(" ") );
323  }
324 // _grid->SetColLabelSize(0);
325 
326 
328 
329  wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2);
330  sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: ")) , 1, wxGROW );
331  sizerSave->Add( _XYZValues, 1, wxALL, 2 );
332  sizerSave->Add( _statistics, 1, wxALL, 2 );
333  sizerSave->Add( _contourImage, 1, wxALL, 2 );
334 
335  wxFlexGridSizer * sizerA = new wxFlexGridSizer(10);
336  sizerA->Add( _informationRadiobox, 1, wxALL, 2 );
337  sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 );
338  sizerA->Add( sizerSave, 1, wxALL, 2 );
339 
340 
341  wxFlexGridSizer * sizerB = new wxFlexGridSizer(10);
342  sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 );
343  sizerB->Add( statisticsContourBtn, 1, wxALL, 2 );
344  sizerB->Add( showResultImagesBtn, 1, wxALL, 2 );
345  sizerB->Add( saveResultsBtn, 1, wxALL, 2 );
346 
347  wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8);
348  sizer->Add( sizerA , 1, wxALL , 0 );
349  sizer->Add( new wxStaticText(this ,-1,_T("Slice Range")) , 1, wxALL , 0 );
350  sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW , 2 );
351  sizer->Add( new wxStaticText(this ,-1,_T("Gray Range")) , 1, wxALL , 0 );
352  sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW , 2 );
353  sizer->Add( sizerB , 1, wxEXPAND , 0 );
354  sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 );
355  sizer->Add( _grid , 1, wxEXPAND , 0 );
356 
357  this->SetSizer( sizer );
358  this->SetSize( wxSize(1500,1500) );
359  //this->SetBackgroundColour( wxColour(100,100,100) );
360  this->SetAutoLayout( true );
361  this->Layout();
362  //return panel;
363 }
364 
366 {
367 }
368 
369 
371 {
372  int grayRangeMin = _mbarrangeRangeInformation->GetStart();
373  int grayRangeMax = _mbarrangeRangeInformation->GetEnd();
374  interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);
376 }
377 
378 
380  wxBusyCursor wait;
382 }
383 
384 
386 {
387 // onExtractInformation( event );
388  int selection = _informationRadiobox->GetSelection();
389  int minZ = _mbarrangeSliceInformation->GetStart();
390  int maxZ = _mbarrangeSliceInformation->GetEnd();
391  int typeContourGroup = _radiolstboxContourGroup->GetSelection();
392  interfMainPanel::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
393 }
394 
395 
397  wxBusyCursor wait;
398  _grid->ClearGrid();
399 
400  int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
401  int selection = _informationRadiobox->GetSelection();
402  int minZ = _mbarrangeSliceInformation->GetStart();
403  int maxZ = _mbarrangeSliceInformation->GetEnd();
404  int grayRangeMin = _mbarrangeRangeInformation->GetStart();
405  int grayRangeMax = _mbarrangeRangeInformation->GetEnd();
406 
407  interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ, grayRangeMin, grayRangeMax);
408 }
409 
410 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
411 {
412  wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE );
413  if (dialog.ShowModal() == wxID_OK)
414  {
415  onExtractInformation( event );
416  int selection = _informationRadiobox->GetSelection();
417  int minZ = _mbarrangeSliceInformation->GetStart();
418  int maxZ = _mbarrangeSliceInformation->GetEnd();
419  std::string directory = (const char *)(dialog.GetDirectory().mb_str());
420  std::string namefile = (const char *)(dialog.GetFilename().mb_str());
421  std::string filename = (const char *)(dialog.GetPath().mb_str() );
422  int typeContourGroup = _radiolstboxContourGroup->GetSelection();
423  interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
424  typeContourGroup,
425  selection,minZ,maxZ,
426  _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
427  }
428 }
429 
431 
432  wxString tempString;
433  _grid->ClearGrid();
434  _grid->SetColLabelValue(0, _T("A") );
435  _grid->SetColLabelValue(1, _T("B") );
436  _grid->SetColLabelValue(2, _T("C") );
437  _grid->SetColLabelValue(3, _T("D") );
438  _grid->SetColLabelValue(4, _T("E") );
439  _grid->SetColLabelValue(5, _T("F") );
440  //_instantPanel->getInstant( tempVector );
441 
442  int z,sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();//->getSceneManager()->GetImageDataSizeZ();
443  int ii,sizeLstContourThings;
444  for ( z=0 ; z<sizeZ ; z++)
445  {
446 
447  std::vector<std::string> lstContourThings = interfMainPanel::getInstance()->getOutlinesName(z);
448 
449  //this->_modelManager->getOutlinesAtInstant( &instant );
450 
451  sizeLstContourThings = lstContourThings.size();
452  tempString.Printf(_T("%d - %d"),z, sizeLstContourThings);
453  _grid->SetRowLabelValue(z, tempString );
454 
455  for (ii=0 ; ii<sizeLstContourThings ; ii++)
456  {
457  //ContourThing **contourthing = lstContourThings[ii];
458  //tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ;
459  tempString = wxString(lstContourThings[ii].c_str(),wxConvUTF8) ;
460  _grid->SetCellValue( z, ii, tempString );
461  } // for ii
462  }// for z
463 
464  // Last line
465  _grid->SetRowLabelValue(sizeZ, _T(" ") );
466  for (ii=0 ; ii<sizeLstContourThings ; ii++)
467  {
468  _grid->SetCellValue( sizeZ, ii, _T(" ") );
469  } // for ii
470 
471 }
472 
474  _staticTextInformation->SetLabel(tmpString);
475 }
476 
477 void interfInformationPanel::setRowLabelInfoPanel(int z,wxString tempString){
478  _grid->SetRowLabelValue(z, tempString );
479 }
480 
482  return _grid->GetNumberCols();
483 }
484 
486  _grid->AppendCols(numcols);
487 }
488 
489 void interfInformationPanel::setCellValue(int z,int tmpIntA,wxString tempString){
490  _grid->SetCellValue( z, tmpIntA , tempString );
491 }
492 
493 void interfInformationPanel::setColLabel(int tmpIntB,wxString tmpTitleString){
494  _grid->SetColLabelValue(tmpIntB, tmpTitleString);
495 }
496 
498  return _grid->GetCellValue( j , i );
499 }
500 
501 void interfInformationPanel::onContourGroup(wxCommandEvent& event)
502 {
503  printf("EED interfInformationPanel::onContourGroup \n");
504  int contourGroup=_radiolstboxContourGroup->GetSelection();
505  if (contourGroup==3)
506  {
507  contourGroup=0;
508  }
510 }
511 
512 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
514 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
515 {
516  double range[2];
518 
519  //Radio buttons
520  wxString options[3];
521  options[0]=_T("mm");
522  options[1]=_T("cm");
523  options[2]=_T("inch");
524 
525  _unitsRadiobox = new wxRadioBox(this, -1, _T("Unit of measurement"), wxPoint(2, 25), wxSize(145,45), 3 , options, 3, wxRA_SPECIFY_COLS);
526  _unitsRadiobox->SetSelection(0);
527 
528  //The label
529  new wxStaticText(this, wxID_ANY, wxT("Real Size: "), wxPoint(2, 5));
530 
531  //Text Control
532  _size = new wxTextCtrl(this, wxID_ANY, wxT(""), wxPoint(78,3), wxSize(70, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
533 
534  //The button
535  new wxButton(this, 1, wxT("Calibrate"), wxPoint(78, 70), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
536 
537  //Conexion del boton con su respectivo manejador
538  Connect(1, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfCalibrationPanel::onCalibrate);
539 
540 }
541 
543 {
544 }
545 
546 void interfCalibrationPanel::onCalibrate(wxCommandEvent& event)
547 {
548  wxString size =_size->GetValue();
549  int unit = _unitsRadiobox->GetSelection();
551 }
552 //------------------------------------------------------------------------------------------------------------
553