1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: wxQuantificationWidget_base.cxx,v $
31 Date: $Date: 2012/11/15 14:15:17 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
37 This software is distributed WITHOUT ANY WARRANTY; without even
38 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39 PURPOSE. See the above copyright notice for more information.
41 =========================================================================*/
43 #include "wxQuantificationWidget_base.h"
44 #include "../marDictionary.h"
45 #include "../wxMaracasMPR.h"
49 //#include <wx/notebook.h>
55 long int startTimeCalcule;
60 //------------------------------------------------------------------------
61 //------------------------------------------------------------------------
62 //------------------------------------------------------------------------
63 wxPnlModifyContour::wxPnlModifyContour(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
66 marDictionary marDict;
69 _quantificationWidget_base=quantificationWidget_base;
71 // this->SetBackgroundColour(*wxLIGHT_GREY);
72 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(803), wxConvUTF8)); // "Contour modification"
75 // wxStaticText *blank = new wxStaticText(this,-1," ");
77 strcpy( tmp , marDict.GetString(820) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(825) );
78 _newContour = new wxButton(this, -1, wxString(tmp, wxConvUTF8) ,wxPoint(0,0),wxSize(80,80)); // " New\nContour"
79 _fixContour = new wxButton(this, -1, wxString(marDict.GetString(830), wxConvUTF8) ,wxPoint(0,0),wxSize(80,80)); // " Replace "
80 // _cancelContour = new wxButton(this, -1, marDict.GetString(835) ,wxPoint(0,0),wxSize(80,35)); // " End "
81 // _insert = new wxRadioButton(this, -1, wxString(marDict.GetString(840), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Insert Point "
82 // _erase = new wxRadioButton(this, -1, wxString(marDict.GetString(845), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Delete Point "
83 // _move = new wxRadioButton(this, -1, wxString(marDict.GetString(850), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Move Point "
84 _one = new wxStaticText(this,-1,wxString(marDict.GetString(805), wxConvUTF8) ); // "1"
85 _two = new wxStaticText(this,-1,wxString(marDict.GetString(810), wxConvUTF8) ); // "2"
86 _three = new wxStaticText(this,-1,wxString(marDict.GetString(815), wxConvUTF8) ); // "3"
88 strcpy( tmp , "\n\n" );
89 strcat( tmp , marDict.GetString(855) );
91 strcat( tmp , marDict.GetString(860) );
92 _msg = new wxStaticText(this,-1,wxString(tmp, wxConvUTF8) ); // "\n\nUse mouse left button \n to create the new contour"
94 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
95 title -> SetFont(font);
96 _one -> SetFont(font);
97 _two -> SetFont(font);
98 _three -> SetFont(font);
101 // title -> SetBackgroundColour(*wxLIGHT_GREY);
102 // _insert -> SetBackgroundColour(*wxLIGHT_GREY);
103 // _erase -> SetBackgroundColour(*wxLIGHT_GREY);
104 // _move -> SetBackgroundColour(*wxLIGHT_GREY);
105 // _msg -> SetBackgroundColour(*wxLIGHT_GREY);
107 _fixContour -> Disable();
108 // _cancelContour -> Disable();
109 // _insert -> Disable();
110 // _erase -> Disable();
111 // _move -> Disable();
115 // _msg -> Show(false);
117 Connect(_newContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnNewContour );
118 Connect(_fixContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnFixContour );
119 // Connect(_cancelContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnCancelContour );
120 // Connect(_insert->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnInsertPoint );
121 // Connect(_erase->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnErasePoint );
122 // Connect(_move->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnMovePoint );
125 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
126 wxFlexGridSizer *sizerAh= new wxFlexGridSizer(6);
127 wxFlexGridSizer *sizerAv= new wxFlexGridSizer(1);
128 wxFlexGridSizer *sizerBv= new wxFlexGridSizer(1);
130 // sizerAv->Add(_insert , 1, wxALL|wxEXPAND, 6);
131 // sizerAv->Add(_erase , 1, wxALL|wxEXPAND, 6);
132 // sizerAv->Add(_move , 1, wxALL|wxEXPAND, 6);
134 sizerBv->Add(_fixContour , 1, wxALL|wxEXPAND, 6);
135 // sizerBv->Add(_cancelContour , 1, wxALL|wxEXPAND, 6);
137 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
138 sizerAh->Add(_one , 1, wxALIGN_CENTER_HORIZONTAL, 3);
139 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
140 sizerAh->Add(_two , 1, wxALIGN_CENTER_HORIZONTAL, 3);
141 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
142 sizerAh->Add(_three , 1, wxALIGN_CENTER_HORIZONTAL, 3);
144 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
145 sizerAh->Add(_newContour , 1, wxALL|wxEXPAND, 3);
146 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
147 sizerAh->Add(_msg , 1, wxALL|wxEXPAND, 3);
148 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
149 sizerAh->Add(sizerBv , 1, wxALL|wxEXPAND, 3);
151 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
152 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
153 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
154 // sizerAh->Add(_msg , 1, wxALIGN_CENTER_HORIZONTAL, 3);
155 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
156 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
158 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
159 sizer->Add(sizerAh , 1, wxALL|wxEXPAND, 10);
161 this->SetSizer(sizer);
162 this->SetSize(wxSize(400,400));
165 //------------------------------------------------------------------------
166 void wxPnlModifyContour::OnFixContour(wxCommandEvent& event){
167 _fixContour -> Enable(false);
168 _two -> Enable(false);
169 _three -> Enable(false);
170 _msg -> Enable(false);
171 _quantificationWidget_base->SetManualContour_ReplaceContour();
172 _quantificationWidget_base->SetManualContour_2DWorld(false);
174 //------------------------------------------------------------------------
175 void wxPnlModifyContour::OnNewContour(wxCommandEvent& event){
177 // _insert -> Enable(true);
178 // _erase -> Enable(true);
179 // _move -> Enable(true);
180 _fixContour -> Enable(true);
181 // _cancelContour -> Enable(true);
182 _two -> Enable(true);
183 _three -> Enable(true);
184 _msg -> Enable(true);
185 // _msg -> Show(true);
187 // _insert -> SetValue(true);
188 // _erase -> SetValue(false);
189 // _move -> SetValue(false);
191 _quantificationWidget_base->SetManualContour_AddPoint_2DWorld();
192 _quantificationWidget_base->SetManualContour_2DWorld(false);
193 _quantificationWidget_base->SetManualContour_2DWorld(true);
199 //------------------------------------------------------------------------
200 //------------------------------------------------------------------------
201 //------------------------------------------------------------------------
202 wxPnlSearchStenosisAutomatic::wxPnlSearchStenosisAutomatic(wxWindow *parent, wxQuantificationWidget_base *quantificationWidget_base)
204 marDictionary marDict;
207 _quantificationWidget_base=quantificationWidget_base;
209 wxPanel* _panelAutomatic=this;
210 wxFlexGridSizer *sizerPanelAutomatic1 = new wxFlexGridSizer(7);
213 // _st1_blank = new wxStaticText(_panelAutomatic,-1," ");
215 strcpy( tmp , marDict.GetString(275) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(280) );
216 _st1_text1 = new wxStaticText(_panelAutomatic,-1,wxString(tmp, wxConvUTF8) ); //"Select\n slice"
217 _st1_next1 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
218 _st1_next2 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
219 _st1_next3 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
220 _st1_cero = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(273), wxConvUTF8) );//"0"
221 _st1_one = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(283), wxConvUTF8) );//"1"
222 _st1_two = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(293), wxConvUTF8) );//"2"
223 _st1_three = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(303), wxConvUTF8) );//"3"
224 strcpy( tmp , marDict.GetString(285) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(290) );
225 _bt1_HealthySlice = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Validate\nHealthy Slice"
226 strcpy( tmp , marDict.GetString(295) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(300) );
227 _bt1_EndRegion = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Validate\nEnd region"
228 strcpy( tmp , marDict.GetString(305) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(310) );
229 _bt1_Start = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Find \nStenosis"
230 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(270), wxConvUTF8)); //"Automatic stenosis search"
233 _panelSpecial = new wxPanel(_panelAutomatic,-1,wxDefaultPosition,wxSize(400,200));
234 _st_BeginRegion = new wxStaticText(_panelSpecial,-1,_T("Begin Region : "));
235 _st_EndRegion = new wxStaticText(_panelSpecial,-1,_T(" End Region : "));
236 _sl_BeginRegion = new wxSlider(_panelSpecial, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
237 _sl_EndRegion = new wxSlider(_panelSpecial, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
238 _rb_surface = new wxRadioButton(_panelSpecial, -1, _T("Stenosis by Surface "), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
239 _rb_diameter = new wxRadioButton(_panelSpecial, -1, _T("Stenosis by Diameter "), wxDefaultPosition, wxDefaultSize );
240 _bt_MaxSurface = new wxButton(_panelSpecial,-1,_T("Find Max Surface"));
241 wxButton *bt_AxisMPR = new wxButton(_panelSpecial,-1,_T("Axis MPR"));
243 _bt_plus = new wxButton(_panelAutomatic,-1,_T("+"),wxPoint(0,0),wxSize(15,15));
244 _bt_plus->Show(true);
247 Connect(_bt1_HealthySlice->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtHealthySlice );
248 Connect(_bt1_EndRegion->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtEndRegion );
249 Connect(_bt1_Start->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtStart );
251 Connect(_sl_BeginRegion->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBeginSlider );
252 Connect(_sl_EndRegion->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnEndSlider );
253 Connect(_bt_plus->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtPlus );
254 Connect(_bt_MaxSurface->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtMaxSurf );
255 Connect(bt_AxisMPR->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtAxisMPR );
257 Connect(_rb_surface->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnRbArea );
258 Connect(_rb_diameter->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnRbDiameter );
261 wxFlexGridSizer *sizerPanelSpecial = new wxFlexGridSizer(1);
262 wxFlexGridSizer *sizerPanelSpecial1 = new wxFlexGridSizer(2);
263 wxFlexGridSizer *sizerPanelSpecial2 = new wxFlexGridSizer(2);
264 wxFlexGridSizer *sizerPanelSpecial3 = new wxFlexGridSizer(3);
266 wxFlexGridSizer *sizerPanelAutomatic = new wxFlexGridSizer(1);
269 // _panelAutomatic->SetBackgroundColour(*wxLIGHT_GREY);
272 // _st1_blank ->SetBackgroundColour(*wxLIGHT_GREY);
273 // _st1_text1 ->SetBackgroundColour(*wxLIGHT_GREY);
274 // _st1_next1 ->SetBackgroundColour(*wxLIGHT_GREY);
275 // _st1_next2 ->SetBackgroundColour(*wxLIGHT_GREY);
276 // _st1_next3 ->SetBackgroundColour(*wxLIGHT_GREY);
277 // _st1_next3 ->SetBackgroundColour(*wxLIGHT_GREY);
278 // _st1_cero ->SetBackgroundColour(*wxLIGHT_GREY);
279 // _st1_one ->SetBackgroundColour(*wxLIGHT_GREY);
280 // _st1_two ->SetBackgroundColour(*wxLIGHT_GREY);
281 // _st1_three ->SetBackgroundColour(*wxLIGHT_GREY);
283 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
284 title ->SetFont(font);
286 // title ->SetBackgroundColour(*wxLIGHT_GREY);
287 _st1_cero ->SetFont(font);
288 _st1_one ->SetFont(font);
289 _st1_two ->SetFont(font);
290 _st1_three ->SetFont(font);
291 _st1_next1 ->SetFont(font);
292 _st1_next2 ->SetFont(font);
293 _st1_next3 ->SetFont(font);
294 // _st1_one ->Disable();
295 _st1_two ->Disable();
296 _st1_three ->Disable();
297 // bt1_HealthySlice->Disable();
298 _bt1_EndRegion->Disable();
299 _bt1_Start->Disable();
302 // _panelSpecial ->SetBackgroundColour(*wxLIGHT_GREY);
303 // _st_BeginRegion ->SetBackgroundColour(*wxLIGHT_GREY);
304 // _st_EndRegion ->SetBackgroundColour(*wxLIGHT_GREY);
305 // _sl_BeginRegion ->SetBackgroundColour(*wxLIGHT_GREY);
306 // _sl_EndRegion ->SetBackgroundColour(*wxLIGHT_GREY);
307 // _rb_diameter ->SetBackgroundColour(*wxLIGHT_GREY);
308 // _rb_surface ->SetBackgroundColour(*wxLIGHT_GREY);
310 _sl_BeginRegion ->SetSize(330,30);
311 _sl_EndRegion ->SetSize(330,30);
312 _st_BeginRegion ->Disable();
313 _st_EndRegion ->Disable();
314 _sl_BeginRegion ->Disable();
315 _sl_EndRegion ->Disable();
316 _rb_diameter ->Disable();
317 _rb_surface ->Disable();
318 _bt_MaxSurface ->Disable();
320 _rb_surface->SetValue(true);
321 _quantificationWidget_base->SetAnalysisTypeStenosis(2);
324 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
325 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
326 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
327 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
328 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
329 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
330 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
333 sizerPanelAutomatic1->Add(_st1_cero , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
334 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
335 sizerPanelAutomatic1->Add(_st1_one , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
336 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
337 sizerPanelAutomatic1->Add(_st1_two , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
338 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
339 sizerPanelAutomatic1->Add(_st1_three , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
341 sizerPanelAutomatic1->Add(_st1_text1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
342 sizerPanelAutomatic1->Add(_st1_next1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
343 sizerPanelAutomatic1->Add(_bt1_HealthySlice , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
344 sizerPanelAutomatic1->Add(_st1_next2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
345 sizerPanelAutomatic1->Add(_bt1_EndRegion , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
346 sizerPanelAutomatic1->Add(_st1_next3 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
347 sizerPanelAutomatic1->Add(_bt1_Start , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
350 sizerPanelSpecial1->Add(_rb_surface ,1 ,wxALL ,0);
351 sizerPanelSpecial1->Add(_rb_diameter ,1 ,wxALL ,0);
352 sizerPanelSpecial2->Add(_st_BeginRegion ,1 ,wxALL ,0);
353 sizerPanelSpecial2->Add(_sl_BeginRegion ,1 ,wxALL|wxGROW ,0);
354 sizerPanelSpecial2->Add(_st_EndRegion ,1 ,wxALL ,0);
355 sizerPanelSpecial2->Add(_sl_EndRegion ,1 ,wxALL|wxGROW ,0);
356 sizerPanelSpecial3->Add(_bt_MaxSurface ,1 ,wxALL ,0);
357 sizerPanelSpecial3->Add( bt_AxisMPR ,1 ,wxALL ,0);
360 sizerPanelSpecial2->AddGrowableCol(1);
363 sizerPanelSpecial->Add(sizerPanelSpecial1 ,1 ,wxALL|wxALIGN_RIGHT , 0 );
364 sizerPanelSpecial->Add(sizerPanelSpecial2 ,1 ,wxALL|wxGROW , 0 );
365 sizerPanelSpecial->Add(sizerPanelSpecial3 ,1 ,wxALL , 0 );
366 _panelSpecial->SetSizer(sizerPanelSpecial);
367 _panelSpecial->SetAutoLayout(true);
368 _panelSpecial->SetSize( sizerPanelSpecial->GetMinSize() );
370 sizerPanelAutomatic->Add(title ,15, wxALL , 10);
371 sizerPanelAutomatic->Add(sizerPanelAutomatic1 ,15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL , 10);
372 sizerPanelAutomatic->Add(_bt_plus ,15, wxALL , 0);
373 sizerPanelAutomatic->Add(_panelSpecial ,15, wxALL|wxGROW , 0);
374 _panelAutomatic->SetSizer(sizerPanelAutomatic);
375 _panelAutomatic->SetAutoLayout(true);
377 _panelSpecial->Show(true);
379 _panelAutomatic->SetSize(400,270);
380 _panelAutomatic->SetSize( sizerPanelAutomatic->GetMinSize() );
384 //------------------------------------------------------------------------
385 void wxPnlSearchStenosisAutomatic::SetRange(int min, int max)
387 _sl_BeginRegion->SetRange(min,max);
388 _sl_EndRegion->SetRange(min,max);
392 //------------------------------------------------------------------------
393 void wxPnlSearchStenosisAutomatic::OnBtHealthySlice(wxCommandEvent& event){
395 _st1_two -> Enable();
396 _bt1_EndRegion -> Enable();
397 _st_BeginRegion -> Enable();
398 _sl_BeginRegion -> Enable();
399 int slice=_quantificationWidget_base->GetActualSlice();
400 _quantificationWidget_base->SetHealthySlice(slice);
402 int startSlice,endSlice;
403 _quantificationWidget_base->GetSliceLimites(0,startSlice,endSlice);
404 if ((_panelSpecial->IsShown()==false) || (startSlice==-1)){
405 _quantificationWidget_base->Set3DStartRegionSliceActor( 0, slice );
406 _quantificationWidget_base->Show3DStartRegionSliceActor(0);
407 _sl_BeginRegion ->SetValue(slice);
408 _quantificationWidget_base->RefreshAxis();
411 //------------------------------------------------------------------------
412 void wxPnlSearchStenosisAutomatic::OnBtEndRegion(wxCommandEvent& event){
413 _st1_three -> Enable();
414 _bt1_Start -> Enable();
415 _st_EndRegion -> Enable();
416 _sl_EndRegion -> Enable();
417 _rb_diameter -> Enable();
418 _rb_surface -> Enable();
419 _bt_MaxSurface -> Enable();
420 int slice=_quantificationWidget_base->GetActualSlice();
421 _quantificationWidget_base->Set3DEndRegionSliceActor( 0, slice );
422 _quantificationWidget_base->Show3DEndRegionSliceActor(0);
423 _sl_EndRegion->SetValue(slice);
424 _quantificationWidget_base->RefreshAxis();
427 //------------------------------------------------------------------------
428 void wxPnlSearchStenosisAutomatic::OnBtStart(wxCommandEvent& event)
430 _quantificationWidget_base->DetectHealthySickSlice( true, false );
434 //------------------------------------------------------------------------
436 void wxPnlSearchStenosisAutomatic::OnBtAxisMPR(wxCommandEvent& event){
438 wxFrame *frame = new wxFrame(this,-1,_T("MPR Axe"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP);
439 int wz1 = _sl_BeginRegion->GetValue();
440 int wz2 = _sl_EndRegion->GetValue();
448 kVolume *vol = _quantificationWidget_base->GetVolumeAxisExtended(wz1,wz2);
451 wxMaracasMPR *wxmaracasMPR = new wxMaracasMPR( frame , new marImageData( vol->castVtk() ) , 1);
452 // wxMaracasMPR *wxmaracasMPR = new wxMaracasMPR( frame , vol->castVtk() , getVoxelSize???? );
455 vtkPlane2DView *planeView = wxmaracasMPR->GetVtkPlane2DView();
456 planeView->SetImgSize(100);
457 wxmaracasMPR->ConfigureVTK();
458 frame->SetSize(600,600);
462 //------------------------------------------------------------------------
463 void wxPnlSearchStenosisAutomatic::OnBtPlus(wxCommandEvent& event){
464 if (_panelSpecial->IsShown()==true){
465 _bt_plus->SetLabel(_T("+"));
466 _panelSpecial->Show(false);
468 _bt_plus->SetLabel(_T("-"));
470 int startSlice,endSlice;
471 _quantificationWidget_base->GetSliceLimites(0,startSlice,endSlice);
472 int maxSlices = _quantificationWidget_base->GetMaxActualSlice();
473 _sl_BeginRegion->SetRange(0,maxSlices);
474 _sl_BeginRegion->SetValue(startSlice);
475 _sl_EndRegion->SetRange(0,maxSlices);
476 _sl_EndRegion->SetValue(endSlice);
477 _quantificationWidget_base->RefreshAxis();
479 _panelSpecial->Show(true);
482 //------------------------------------------------------------------------
483 void wxPnlSearchStenosisAutomatic::OnBeginSlider(wxScrollEvent& event){
484 _quantificationWidget_base->Set3DStartRegionSliceActor( 0, _sl_BeginRegion->GetValue() );
485 _quantificationWidget_base->Show3DStartRegionSliceActor( 0 );
486 _quantificationWidget_base->RefreshAxis();
488 //------------------------------------------------------------------------
489 void wxPnlSearchStenosisAutomatic::OnEndSlider(wxScrollEvent& event){
490 _quantificationWidget_base->Set3DEndRegionSliceActor( 0, _sl_EndRegion->GetValue() );
491 _quantificationWidget_base->Show3DEndRegionSliceActor( 0 );
492 _quantificationWidget_base->RefreshAxis();
494 //------------------------------------------------------------------------
495 void wxPnlSearchStenosisAutomatic::OnBtMaxSurf(wxCommandEvent& event){
496 _quantificationWidget_base->DetectHealthySickSlice( false, true );
498 //------------------------------------------------------------------------
499 void wxPnlSearchStenosisAutomatic::OnRbArea(wxCommandEvent& event){
500 _quantificationWidget_base->SetAnalysisTypeStenosis( 2 );
502 //------------------------------------------------------------------------
503 void wxPnlSearchStenosisAutomatic::OnRbDiameter(wxCommandEvent& event){
504 _quantificationWidget_base->SetAnalysisTypeStenosis( 1 );
506 //------------------------------------------------------------------------
514 //------------------------------------------------------------------------
515 //------------------------------------------------------------------------
516 //------------------------------------------------------------------------
517 wxPnlSearchStenosisManual::wxPnlSearchStenosisManual(wxWindow *parent, wxQuantificationWidget_base *quantificationWidget_base)
519 marDictionary marDict;
522 _quantificationWidget_base=quantificationWidget_base;
523 wxPanel* _panelManual=this;
524 wxFlexGridSizer *sizerPanelManual = new wxFlexGridSizer(1);
525 wxFlexGridSizer *sizerPanelManual1 = new wxFlexGridSizer(1);
526 wxFlexGridSizer *sizerPanelManual2 = new wxFlexGridSizer(5);
529 // _st2_blank = new wxStaticText(_panelManual,-1," ");
531 strcpy( tmp , marDict.GetString(330) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(335) );
532 _st2_text1 = new wxStaticText(_panelManual,-1,wxString(tmp, wxConvUTF8));//"Select\n slice"
533 strcpy( tmp , marDict.GetString(340) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(345) );
534 _st2_text2 = new wxStaticText(_panelManual,-1,wxString(tmp, wxConvUTF8));//" Select \n other slice"
535 _st2_next1 = new wxStaticText(_panelManual,-1,_T(" ")); //->
536 _st2_next2 = new wxStaticText(_panelManual,-1,_T(" ")); //->
537 _st2_cero = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(328), wxConvUTF8) ); //"0"
538 _st2_one = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(338), wxConvUTF8) ); //"1"
539 _st2_two = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(348), wxConvUTF8) ); //"2"
540 strcpy( tmp , marDict.GetString(350) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(355) );
541 _bt2_HealthySlice = new wxButton(_panelManual,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(85,85)); //" Validate\nHealthy Slice"
542 wxStaticText *title = new wxStaticText(this,-1,wxString( marDict.GetString(325) , wxConvUTF8 ));//"Manual stenosis search"
544 Connect(_bt2_HealthySlice->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisManual::OnBtHealthySlice );
546 // _panelManual->SetBackgroundColour(*wxLIGHT_GREY);
547 // _st2_blank ->SetBackgroundColour(*wxLIGHT_GREY);
548 // _st2_text1 ->SetBackgroundColour(*wxLIGHT_GREY);
549 // _st2_text2 ->SetBackgroundColour(*wxLIGHT_GREY);
550 // _st2_cero ->SetBackgroundColour(*wxLIGHT_GREY);
551 // _st2_one ->SetBackgroundColour(*wxLIGHT_GREY);
552 // _st2_two ->SetBackgroundColour(*wxLIGHT_GREY);
553 // _st2_next1 ->SetBackgroundColour(*wxLIGHT_GREY);
554 // _st2_next2 ->SetBackgroundColour(*wxLIGHT_GREY);
556 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
557 title ->SetFont(font);
559 // title ->SetBackgroundColour(*wxLIGHT_GREY);
560 _st2_cero ->SetFont(font);
561 _st2_one ->SetFont(font);
562 _st2_two ->SetFont(font);
563 _st2_next1 ->SetFont(font);
564 _st2_next2 ->SetFont(font);
567 _st2_text2->Disable();
569 sizerPanelManual1->Add( title, 15, wxALL, 10 );
572 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
573 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
574 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
575 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
576 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
578 sizerPanelManual2->Add(_st2_cero , 15, wxALIGN_CENTER_HORIZONTAL, 10);
579 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
580 sizerPanelManual2->Add(_st2_one , 15, wxALIGN_CENTER_HORIZONTAL, 10);
581 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
582 sizerPanelManual2->Add(_st2_two , 15, wxALIGN_CENTER_HORIZONTAL, 10);
584 sizerPanelManual2->Add(_st2_text1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
585 sizerPanelManual2->Add(_st2_next1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
586 sizerPanelManual2->Add(_bt2_HealthySlice, 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
587 sizerPanelManual2->Add(_st2_next2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
588 sizerPanelManual2->Add(_st2_text2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
590 sizerPanelManual->Add(sizerPanelManual1);
591 sizerPanelManual->Add(sizerPanelManual2);
594 _panelManual->SetSizer(sizerPanelManual);
595 _panelManual->SetAutoLayout(true);
596 _panelManual->SetSize(400,300);
598 //------------------------------------------------------------------------
599 void wxPnlSearchStenosisManual::OnBtHealthySlice(wxCommandEvent& event){
602 _st2_text2 ->Enable();
603 _quantificationWidget_base->SetHealthySlice();
605 //------------------------------------------------------------------------
608 //------------------------------------------------------------------------
609 //------------------------------------------------------------------------
610 //------------------------------------------------------------------------
611 wxPnlSearchStenosis::wxPnlSearchStenosis(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
612 : wxPanel(parent,-1){
613 marDictionary marDict;
614 _quantificationWidget_base=quantificationWidget_base;
616 // this->SetBackgroundColour(*wxLIGHT_GREY);
618 wxFlexGridSizer *axis1 = new wxFlexGridSizer(2);
619 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
620 wxRadioButton *rb_automatique = new wxRadioButton(this,-1,wxString(marDict.GetString(315), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); //"Automatic"
621 wxRadioButton *rb_manual = new wxRadioButton(this,-1,wxString(marDict.GetString(320), wxConvUTF8), wxDefaultPosition, wxDefaultSize ); //"Manual"
623 Connect(rb_automatique->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosis::OnRbAutomatic );
624 Connect(rb_manual->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosis::OnRbManual );
626 rb_automatique->SetValue(true);
628 // rb_automatique->SetBackgroundColour(*wxLIGHT_GREY);
629 // rb_manual->SetBackgroundColour(*wxLIGHT_GREY);
631 wxPanel *panelWork = new wxPanel(this,-1);
632 _panelAutomatic = new wxPnlSearchStenosisAutomatic(panelWork,_quantificationWidget_base);
633 _panelManual = new wxPnlSearchStenosisManual(panelWork,_quantificationWidget_base);
634 panelWork->SetSize(_panelAutomatic->GetSize());
636 _panelAutomatic->Show(true);
637 _panelManual->Show(false);
639 axis1->Add(rb_automatique);
640 axis1->Add(rb_manual);
642 sizer->Add(panelWork,1, wxALL|wxEXPAND, 0);
643 sizer->Add(axis1 ,1, wxALL|wxALIGN_RIGHT , 0);
644 this->SetSizer(sizer);
645 this->SetAutoLayout(true);
646 this->SetSize(wxSize(400,600));
647 this->SetSize( sizer->GetMinSize() );
649 //------------------------------------------------------------------------
650 void wxPnlSearchStenosis::OnRbAutomatic(wxCommandEvent& event){
651 _panelAutomatic->Show(true);
652 _panelManual->Show(false);
653 _quantificationWidget_base->Show3DStartRegionSliceActor( 0 );
654 _quantificationWidget_base->Show3DEndRegionSliceActor( 0 );
656 //------------------------------------------------------------------------
657 void wxPnlSearchStenosis::OnRbManual(wxCommandEvent& event){
658 _panelAutomatic->Show(false);
659 _panelManual->Show(true);
660 _quantificationWidget_base->Hide3DStartRegionSliceActor( 0 );
661 _quantificationWidget_base->Hide3DEndRegionSliceActor( 0 );
663 //------------------------------------------------------------------------
664 wxPnlSearchStenosisAutomatic* wxPnlSearchStenosis::GetPanelAutomatic(){
665 return _panelAutomatic;
671 //------------------------------------------------------------------------
672 //------------------------------------------------------------------------
673 //------------------------------------------------------------------------
674 wxPanelSizeHealthyRegion::wxPanelSizeHealthyRegion(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
675 : wxPanel(parent,-1){
676 marDictionary marDict;
678 // this->SetBackgroundColour(*wxLIGHT_GREY);
679 _quantificationWidget_base = quantificationWidget_base;
680 int maxSliderSize = 30;
681 int sizeHealthyRegion = 0;
682 sizeHealthyRegion = _quantificationWidget_base->GetSizeHealthyRegion();
684 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
685 wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
686 wxFlexGridSizer *sizer2 = new wxFlexGridSizer(2);
689 // wxStaticText *st_Blank = new wxStaticText( this, -1," ",wxPoint(0,0));
691 wxStaticText *st_Title = new wxStaticText( this, -1,wxString(marDict.GetString(370), wxConvUTF8),wxPoint(0,0));//"Size of the Healty Region:"
692 wxStaticText *st_Size = new wxStaticText( this, -1, wxString(marDict.GetString(373), wxConvUTF8) ); //"n : "
693 _sl_Size = new wxSlider( this, -1, sizeHealthyRegion, 0, maxSliderSize, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
694 wxButton *buttonRefresh = new wxButton( this, -1, wxString(marDict.GetString(375), wxConvUTF8));//"Refresh healthy region"
695 wxStaticText *title = new wxStaticText( this, -1,wxString(marDict.GetString(365), wxConvUTF8));//"Healthy region size "
698 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
699 title ->SetFont(font);
701 // title ->SetBackgroundColour(*wxLIGHT_GREY);
703 Connect(buttonRefresh->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPanelSizeHealthyRegion::OnButtonRefresh );
704 sizer1->Add( title, 15, wxALL, 10 );
706 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
707 sizer2->Add( st_Title );
709 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
710 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
712 sizer2->Add( st_Size );
713 sizer2->Add( _sl_Size ,1,wxALL|wxGROW);
715 sizer2->AddGrowableCol(1);
717 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
718 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
720 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
721 sizer2->Add( buttonRefresh );
723 sizer->Add( sizer1 );
724 sizer->Add( sizer2 );
726 this->SetSizer(sizer);
727 this->SetAutoLayout(true);
728 this->SetSize(200,400);
730 //------------------------------------------------------------------------
731 void wxPanelSizeHealthyRegion::OnButtonRefresh(wxScrollEvent& event){
732 _quantificationWidget_base->SetSizeHealthyRegion( _sl_Size->GetValue() );
733 int healthySlice=_quantificationWidget_base->GetHealthySlice();
734 if (healthySlice!=-1) {
735 _quantificationWidget_base->SetHealthySlice( healthySlice );
741 //------------------------------------------------------------------------
742 //------------------------------------------------------------------------
743 //------------------------------------------------------------------------
744 wxPanelControlsHealthySickSlice2::wxPanelControlsHealthySickSlice2(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
745 : wxPanel(parent,-1){
746 marDictionary marDict;
748 // this->SetBackgroundColour(*wxLIGHT_GREY);
751 //_quantificationWidget = quantificationWidget;
753 wxNotebook *wxnotbook = new wxNotebook(this, -1);
755 // wxnotbook->SetBackgroundColour(*wxLIGHT_GREY);
757 wxpnlsearchstenosis = new wxPnlSearchStenosis( wxnotbook , quantificationWidget_base);
758 wxPanelSizeHealthyRegion *page2 = new wxPanelSizeHealthyRegion (wxnotbook , quantificationWidget_base);
759 wxPnlModifyContour *page3 = new wxPnlModifyContour( wxnotbook , quantificationWidget_base);
760 wxnotbook->AddPage(wxpnlsearchstenosis, wxString(marDict.GetString(265), wxConvUTF8) ); //"Stenosis search "
761 wxnotbook->AddPage(page2, wxString(marDict.GetString(360), wxConvUTF8) ); //"Healty region size "
762 wxnotbook->AddPage(page3, wxString(marDict.GetString(800), wxConvUTF8) ); //"Contour modification"
763 wxnotbook->SetSize(400,315);
765 // page1->GetSize(&w,&h);
766 // wxnotbook->SetSize( w+20 , h+25 );
768 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
769 sizer->Add(wxnotbook, 1, wxALL|wxEXPAND, 0);
770 this->SetSizer(sizer);
771 this->SetAutoLayout(true);
773 this->SetSize(400,315);
774 // this->SetSize( wxnotbook->GetSize() );
778 //------------------------------------------------------------------------
779 wxPnlSearchStenosis *wxPanelControlsHealthySickSlice2::GetPnlSearStenosis()
781 return wxpnlsearchstenosis;
784 //------------------------------------------------------------------------
785 //------------------------------------------------------------------------
786 //------------------------------------------------------------------------
787 wxPnlContourControl::wxPnlContourControl(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
790 marDictionary marDict;
792 _quantificationWidget_base=quantificationWidget_base;
794 // this->SetBackgroundColour(*wxLIGHT_GREY);
796 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(940), wxConvUTF8)); // "Contour modification"
797 // wxStaticText *blank = new wxStaticText(this,-1," ");
800 // title -> SetBackgroundColour(*wxLIGHT_GREY);
803 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
804 title -> SetFont(font);
806 _sl_Discontinuity = new wxSlider(this, -1, 10, 0, 20, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
807 _sl_LumenPercentage = new wxSlider(this, -1, 86, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
808 _sl_CalcPercentage = new wxSlider(this, -1, 90, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
811 // _sl_Discontinuity->SetBackgroundColour(*wxLIGHT_GREY);
812 // _sl_LumenPercentage->SetBackgroundColour(*wxLIGHT_GREY);
813 // _sl_CalcPercentage->SetBackgroundColour(*wxLIGHT_GREY);
815 _sl_Discontinuity->SetSize(300,16);
816 _sl_LumenPercentage->SetSize(300,16);
817 _sl_CalcPercentage->SetSize(300,16);
819 _st_Discontinuity = new wxStaticText(this, -1, wxString(marDict.GetString(925), wxConvUTF8) ); //"Threshold "
820 _st_LumenPercentage = new wxStaticText(this, -1, wxString(marDict.GetString(930), wxConvUTF8) ); //"Lumen % "
821 _st_CalcPercentage = new wxStaticText(this, -1, wxString(marDict.GetString(935), wxConvUTF8) ); //"Calcification % "
824 btnCalibration = new wxButton( this, -1, _T("Calibrate"),wxPoint(0,0),wxSize(92,20));
825 btnFile = new wxButton( this, -1, _T("Generate File"),wxPoint(0,0),wxSize(92,20));
828 // _st_Discontinuity->SetBackgroundColour(*wxLIGHT_GREY);
829 // _st_LumenPercentage->SetBackgroundColour(*wxLIGHT_GREY);
830 // _st_CalcPercentage->SetBackgroundColour(*wxLIGHT_GREY);
833 Connect(_sl_Discontinuity->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderDiscontinuityScroll );
834 Connect(_sl_LumenPercentage->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderLumenPercentageScroll );
835 Connect(_sl_CalcPercentage->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderCalcPercentageScroll );
836 Connect(btnCalibration->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlContourControl::OnCalibration );
837 Connect(btnFile->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlContourControl::OnFile );
839 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
841 wxFlexGridSizer *axe1 = new wxFlexGridSizer(2);
842 wxFlexGridSizer *axe2 = new wxFlexGridSizer(2);
843 wxFlexGridSizer *axe3 = new wxFlexGridSizer(2);
846 axe1->Add(_st_Discontinuity , 1, wxALL|wxEXPAND, 0);
847 axe1->Add(_sl_Discontinuity , 1, wxALL|wxEXPAND, 0);
849 axe2->Add(_st_LumenPercentage , 1, wxALL|wxEXPAND, 0);
850 axe2->Add(_sl_LumenPercentage , 1, wxALL|wxEXPAND, 0);
852 axe3->Add(_st_CalcPercentage , 1, wxALL|wxEXPAND, 0);
853 axe3->Add(_sl_CalcPercentage , 1, wxALL|wxEXPAND, 0);
855 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
856 sizer->Add(axe1, 2, wxALL|wxEXPAND, 10);
857 sizer->Add(axe2, 2, wxALL|wxEXPAND, 10); //wxALIGN_CENTER_HORIZONTAL
858 sizer->Add(axe3, 2, wxALL|wxEXPAND, 10);
859 sizer->Add(btnCalibration, 2, wxALL|wxEXPAND, 10);
860 sizer->Add(btnFile, 2, wxALL|wxEXPAND, 10);
862 this->SetSizer(sizer);
863 this->SetSize(wxSize(400,400));
866 // ----------------------------------------------------------------------------
867 void wxPnlContourControl::OnSliderDiscontinuityScroll(wxScrollEvent& event)
870 _quantificationWidget_base->OnSliderDiscontinuityScroll(event.GetPosition());
873 // ----------------------------------------------------------------------------
874 void wxPnlContourControl::OnSliderLumenPercentageScroll(wxScrollEvent& event)
877 _quantificationWidget_base->OnSliderLumenPercentageScroll(event.GetPosition());
880 // ----------------------------------------------------------------------------
881 void wxPnlContourControl::OnSliderCalcPercentageScroll(wxScrollEvent& event)
883 _quantificationWidget_base->OnSliderCalcPercentageScroll(event.GetPosition());
886 // ----------------------------------------------------------------------------
887 void wxPnlContourControl::OnCalibration(wxScrollEvent& event)
889 _quantificationWidget_base->OnCalibration();
892 // ----------------------------------------------------------------------------
893 void wxPnlContourControl::OnFile(wxScrollEvent& event)
895 _quantificationWidget_base->OnFile();
898 //------------------------------------------------------------------------
899 //------------------------------------------------------------------------
900 //------------------------------------------------------------------------
901 wxPnlManualContour::wxPnlManualContour(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
904 marDictionary marDict;
905 _quantificationWidget_base=quantificationWidget_base;
908 // this->SetBackgroundColour(*wxLIGHT_GREY);
910 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(803), wxConvUTF8)); // "Contour modification"
911 // wxStaticText *blank = new wxStaticText(this,-1," ");
914 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
915 title -> SetFont(font);
918 // title -> SetBackgroundColour(*wxLIGHT_GREY);
921 //MAZV - texts not included in marDictionary since this is not the final version
922 btnContourWall = new wxButton( this, -1, _T("External wall \ncontour"),wxPoint(0,0),wxSize(92,40));
923 btnContourLumen = new wxButton( this, -1, _T("Lumen contours"),wxPoint(0,0),wxSize(92,40));
924 btnContourCalc = new wxButton( this, -1, _T("Calcification \ncontours"),wxPoint(0,0),wxSize(92,40));
925 btnContourHypo = new wxButton( this, -1, _T("Hipodense \ncontours"),wxPoint(0,0),wxSize(92,40));
928 // btnContourAB = new wxButton( this, -1, "Active Contour AB",wxPoint(0,0),wxSize(92,20));
929 fixContourWall = new wxButton(this, -1, _T("Replace \nExternal wall") ,wxPoint(0,0),wxSize(92,40));
930 fixContourLumen = new wxButton(this, -1, _T("Replace \nLumen") ,wxPoint(0,0),wxSize(92,40));
931 fixContourCalc = new wxButton(this, -1, _T("Replace \nCalcifications") ,wxPoint(0,0),wxSize(92,40));
932 fixContourHypo = new wxButton(this, -1, _T("Replace \nHipodense") ,wxPoint(0,0),wxSize(92,40));
934 cbShowAllManual = new wxCheckBox(this,-1,_T("Show All"));
935 cbShowWall = new wxCheckBox(this,-1,_T("Show Wall"));
936 cbShowLumen = new wxCheckBox(this,-1,_T("Show Lumen"));
937 cbShowCalc = new wxCheckBox(this,-1,_T("Show Calcifications"));
938 cbShowHypo = new wxCheckBox(this,-1,_T("Show Hypodense"));
940 cbShowAllManual->SetValue(true);
941 cbShowWall->SetValue(true);
942 cbShowLumen->SetValue(true);
943 cbShowCalc->SetValue(true);
944 cbShowHypo->SetValue(true);
947 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
949 wxFlexGridSizer *conts = new wxFlexGridSizer(4);
950 wxFlexGridSizer *replace = new wxFlexGridSizer(4);
951 wxFlexGridSizer *options = new wxFlexGridSizer(5);
954 conts->Add(btnContourWall , 1, wxALL|wxEXPAND, 0);
955 conts->Add(btnContourLumen , 1, wxALL|wxEXPAND, 0);
956 conts->Add(btnContourCalc , 1, wxALL|wxEXPAND, 0);
957 conts->Add(btnContourHypo , 1, wxALL|wxEXPAND, 0);
958 //conts->Add(btnContourAB , 1, wxALL|wxEXPAND, 0);
960 replace->Add(fixContourWall , 1, wxALL|wxEXPAND, 0);
961 replace->Add(fixContourLumen , 1, wxALL|wxEXPAND, 0);
962 replace->Add(fixContourCalc , 1, wxALL|wxEXPAND, 0);
963 replace->Add(fixContourHypo , 1, wxALL|wxEXPAND, 0);
964 //replace->Add(fixContourAB , 1, wxALL|wxEXPAND, 0);
966 options->Add(cbShowAllManual , 1, wxALL|wxEXPAND, 0);
967 options->Add(cbShowWall , 1, wxALL|wxEXPAND, 0);
968 options->Add(cbShowLumen , 1, wxALL|wxEXPAND, 0);
969 options->Add(cbShowCalc , 1, wxALL|wxEXPAND, 0);
970 options->Add(cbShowHypo , 1, wxALL|wxEXPAND, 0);
972 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
973 sizer->Add(conts , 2, wxALL|wxEXPAND, 10);
974 sizer->Add(replace , 2, wxALL|wxEXPAND, 10); //wxALIGN_CENTER_HORIZONTAL
975 sizer->Add(options , 2, wxALL|wxEXPAND, 10);
977 this->SetSizer(sizer);
978 this->SetSize(wxSize(400,400));
980 Connect(btnContourWall->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourWall );
981 Connect(btnContourLumen->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourLumen );
982 Connect(btnContourCalc->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourCalc );
983 Connect(btnContourHypo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourHypo );
985 Connect(fixContourWall->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourWall );
986 Connect(fixContourLumen->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourLumen );
987 Connect(fixContourCalc->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourCalc );
988 Connect(fixContourHypo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourHypo );
990 Connect(cbShowAllManual->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowAll );
991 Connect(cbShowWall->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowWall );
992 Connect(cbShowLumen->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowLumen );
993 Connect(cbShowCalc->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowCalc );
994 Connect(cbShowHypo->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowHypo );
999 //------------------------------------------------------------------------
1000 void wxPnlManualContour::OnContourWall(wxCommandEvent& event)
1002 _quantificationWidget_base->OnContourWall();
1004 //------------------------------------------------------------------------
1005 void wxPnlManualContour::OnContourLumen(wxCommandEvent& event)
1007 _quantificationWidget_base->OnContourLumen();
1009 //------------------------------------------------------------------------
1010 void wxPnlManualContour::OnContourHypo(wxCommandEvent& event)
1012 _quantificationWidget_base->OnContourHypo();
1014 //------------------------------------------------------------------------
1015 void wxPnlManualContour::OnContourCalc(wxCommandEvent& event)
1017 _quantificationWidget_base->OnContourCalc();
1020 //------------------------------------------------------------------------
1021 void wxPnlManualContour::OnReplaceContourWall(wxCommandEvent& event)
1023 _quantificationWidget_base->OnReplaceContourWall();
1025 //------------------------------------------------------------------------
1026 void wxPnlManualContour::OnReplaceContourLumen(wxCommandEvent& event)
1028 _quantificationWidget_base->OnReplaceContourLumen();
1030 //------------------------------------------------------------------------
1031 void wxPnlManualContour::OnReplaceContourHypo(wxCommandEvent& event)
1033 _quantificationWidget_base->OnReplaceContourHypo();
1036 //------------------------------------------------------------------------
1037 void wxPnlManualContour::OnReplaceContourCalc(wxCommandEvent& event)
1039 _quantificationWidget_base->OnReplaceContourCalc();
1042 //------------------------------------------------------------------------
1043 void wxPnlManualContour::OnShowAll(wxCommandEvent& event)
1045 cbShowCalc->SetValue(cbShowAllManual->GetValue());
1046 cbShowHypo->SetValue(cbShowAllManual->GetValue());
1047 cbShowLumen->SetValue(cbShowAllManual->GetValue());
1048 cbShowWall->SetValue(cbShowAllManual->GetValue());
1049 _quantificationWidget_base->OnShowAll(cbShowAllManual->GetValue());
1053 //------------------------------------------------------------------------
1054 void wxPnlManualContour::OnShowWall(wxCommandEvent& event)
1056 _quantificationWidget_base->OnShowWall(cbShowWall->GetValue());
1058 //------------------------------------------------------------------------
1059 void wxPnlManualContour::OnShowLumen(wxCommandEvent& event)
1061 _quantificationWidget_base->OnShowLumen(cbShowLumen->GetValue());
1064 //------------------------------------------------------------------------
1065 void wxPnlManualContour::OnShowCalc(wxCommandEvent& event)
1067 _quantificationWidget_base->OnShowCalc(cbShowCalc->GetValue());
1070 //------------------------------------------------------------------------
1071 void wxPnlManualContour::OnShowHypo(wxCommandEvent& event)
1073 _quantificationWidget_base->OnShowHypo(cbShowHypo->GetValue());
1077 //------------------------------------------------------------------------
1078 //------------------------------------------------------------------------
1079 //------------------------------------------------------------------------
1080 wxPanelControlsHealthySickSliceCT::wxPanelControlsHealthySickSliceCT(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
1081 : wxPanel(parent,-1)
1083 marDictionary marDict;
1085 // this->SetBackgroundColour(*wxLIGHT_GREY);
1088 //_quantificationWidget = quantificationWidget;
1090 wxNotebook *wxnotbook = new wxNotebook(this, -1);
1092 // wxnotbook->SetBackgroundColour(*wxLIGHT_GREY);
1094 wxPnlSearchStenosis *page1 = new wxPnlSearchStenosis( wxnotbook , quantificationWidget_base);
1095 wxPanelSizeHealthyRegion *page2 = new wxPanelSizeHealthyRegion (wxnotbook , quantificationWidget_base);
1096 wxPnlManualContour *page3 = new wxPnlManualContour( wxnotbook , quantificationWidget_base);
1097 wxPnlContourControl *page4 = new wxPnlContourControl( wxnotbook , quantificationWidget_base);
1098 wxnotbook->AddPage(page1, wxString(marDict.GetString(265), wxConvUTF8) ); //"Stenosis search "
1099 wxnotbook->AddPage(page2, wxString(marDict.GetString(360), wxConvUTF8) ); //"Healty region size "
1100 wxnotbook->AddPage(page3, wxString(marDict.GetString(800), wxConvUTF8) ); //"Contour modification"
1101 wxnotbook->AddPage(page4, wxString(marDict.GetString(940), wxConvUTF8) ); //"Contour Control"
1102 wxnotbook->SetSize(400,315);
1104 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
1105 sizer->Add(wxnotbook, 1, wxTOP|wxLEFT|wxRIGHT, 5);
1106 this->SetSizer(sizer);
1107 this->SetAutoLayout(true);
1109 this->SetSize(400,400);
1115 //------------------------------------------------------------------------
1116 //------------------------------------------------------------------------
1117 //------------------------------------------------------------------------
1135 //------------------------------------------------------------------------
1136 //------------------------------------------------------------------------
1137 //------------------------------------------------------------------------
1141 //--------------------------------------------------------------------------------
1143 //--------------------------------------------------------------------------------
1146 wxQuantificationWidget_base::wxQuantificationWidget_base(wxWindow* parent, wxWindowID id,
1147 const wxPoint& pos, const wxSize& size, long style,
1148 const wxString& name)
1149 : wxPanel( parent, id, pos, size, style, name )
1154 //--------------------------------------------------------------------------------
1156 // ----------------------------------------------------------------------------
1157 wxQuantificationWidget_base::~wxQuantificationWidget_base() // virtual
1162 // ----------------------------------------------------------------------------
1163 void wxQuantificationWidget_base::SetManualContour_ReplaceContour() // virtual
1167 // ----------------------------------------------------------------------------
1168 void wxQuantificationWidget_base::SetManualContour_2DWorld(bool ok) // virtual
1173 // ----------------------------------------------------------------------------
1174 void wxQuantificationWidget_base::SetManualContour_AddPoint_2DWorld() // virtual
1178 // ----------------------------------------------------------------------------
1179 void wxQuantificationWidget_base::SetAnalysisTypeStenosis(int analysisTypeStenosis) // virtual
1184 // ----------------------------------------------------------------------------
1185 int wxQuantificationWidget_base::GetActualSlice() // virtual
1190 // ----------------------------------------------------------------------------
1191 void wxQuantificationWidget_base::SetHealthySlice(int healthySlice) // virtual
1195 // ----------------------------------------------------------------------------
1196 void wxQuantificationWidget_base::GetSliceLimites(int type, int &sliceStart,int &sliceEnd)// virtual
1200 // ----------------------------------------------------------------------------
1201 void wxQuantificationWidget_base::Set3DStartRegionSliceActor( int type, int k )// virtual
1205 // ----------------------------------------------------------------------------
1206 void wxQuantificationWidget_base::RefreshAxis( )// virtual
1210 //------------------------------------------------------------------------
1211 void wxQuantificationWidget_base::OnContourWall()// virtual
1215 //------------------------------------------------------------------------
1216 void wxQuantificationWidget_base::OnContourLumen()// virtual
1220 //------------------------------------------------------------------------
1221 void wxQuantificationWidget_base::OnContourHypo()// virtual
1225 //------------------------------------------------------------------------
1226 void wxQuantificationWidget_base::OnContourCalc()// virtual
1230 //------------------------------------------------------------------------
1231 void wxQuantificationWidget_base::OnReplaceContourWall()// virtual
1234 //------------------------------------------------------------------------
1235 void wxQuantificationWidget_base::OnReplaceContourLumen()// virtual
1238 //------------------------------------------------------------------------
1239 void wxQuantificationWidget_base::OnReplaceContourHypo()// virtual
1243 //------------------------------------------------------------------------
1244 void wxQuantificationWidget_base::OnReplaceContourCalc()// virtual
1248 //------------------------------------------------------------------------
1249 void wxQuantificationWidget_base::OnSliderDiscontinuityScroll(int percentage) // virtual
1253 //------------------------------------------------------------------------
1254 void wxQuantificationWidget_base::OnSliderLumenPercentageScroll(int percentage) // virtual
1258 //------------------------------------------------------------------------
1259 void wxQuantificationWidget_base::OnSliderCalcPercentageScroll(int percentage) // virtual
1263 //------------------------------------------------------------------------
1264 void wxQuantificationWidget_base::OnCalibration() //virtual
1268 //------------------------------------------------------------------------
1269 void wxQuantificationWidget_base::OnFile() //virtual
1274 // ----------------------------------------------------------------------------
1275 kVolume *wxQuantificationWidget_base::GetVolumeAxisExtended(int wz1,int wz2)// virtual
1280 // ----------------------------------------------------------------------------
1281 int wxQuantificationWidget_base::GetMaxActualSlice()// virtual
1286 // ----------------------------------------------------------------------------
1287 void wxQuantificationWidget_base::Set3DRegionSliceActor( int type, int k1,int k2 )// virtual
1291 // ----------------------------------------------------------------------------
1292 void wxQuantificationWidget_base::DetectHealthySickSlice( bool minSurf , bool maxSurf )// virtual
1296 // ----------------------------------------------------------------------------
1297 void wxQuantificationWidget_base::Show3DStartRegionSliceActor(int type ) // virtual
1302 // ----------------------------------------------------------------------------
1303 void wxQuantificationWidget_base::Set3DEndRegionSliceActor( int type, int k ) // virtual
1307 // ----------------------------------------------------------------------------
1308 void wxQuantificationWidget_base::Show3DEndRegionSliceActor(int type ) // virtual
1313 // ----------------------------------------------------------------------------
1314 void wxQuantificationWidget_base::Hide3DStartRegionSliceActor(int type ) // virtual
1318 // ----------------------------------------------------------------------------
1319 void wxQuantificationWidget_base::Hide3DEndRegionSliceActor(int type ) // virtual
1323 // ----------------------------------------------------------------------------
1324 int wxQuantificationWidget_base::GetSizeHealthyRegion() // virtual
1329 // ----------------------------------------------------------------------------
1330 void wxQuantificationWidget_base::SetSizeHealthyRegion(int size) // virtual
1333 // ----------------------------------------------------------------------------
1334 int wxQuantificationWidget_base::GetHealthySlice() // virtual
1339 //------------------------------------------------------------------------
1340 void wxQuantificationWidget_base::OnShowAll(bool value) // virtual
1345 //------------------------------------------------------------------------
1346 void wxQuantificationWidget_base::OnShowWall(bool value) // virtual
1349 //------------------------------------------------------------------------
1350 void wxQuantificationWidget_base::OnShowLumen(bool value) // virtual
1354 //------------------------------------------------------------------------
1355 void wxQuantificationWidget_base::OnShowCalc(bool value) // virtual
1359 //------------------------------------------------------------------------
1360 void wxQuantificationWidget_base::OnShowHypo(bool value) // virtual