3 /*=========================================================================
6 Module: $RCSfile: wxQuantificationWidget_base.cxx,v $
8 Date: $Date: 2009/05/14 13:54:57 $
9 Version: $Revision: 1.1 $
11 Copyright: (c) 2002, 2003
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notice for more information.
18 =========================================================================*/
20 #include "wxQuantificationWidget_base.h"
21 #include "../marDictionary.h"
22 #include "../wxMaracasMPR.h"
26 //#include <wx/notebook.h>
32 long int startTimeCalcule;
37 //------------------------------------------------------------------------
38 //------------------------------------------------------------------------
39 //------------------------------------------------------------------------
40 wxPnlModifyContour::wxPnlModifyContour(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
43 marDictionary marDict;
46 _quantificationWidget_base=quantificationWidget_base;
48 // this->SetBackgroundColour(*wxLIGHT_GREY);
49 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(803), wxConvUTF8)); // "Contour modification"
52 // wxStaticText *blank = new wxStaticText(this,-1," ");
54 strcpy( tmp , marDict.GetString(820) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(825) );
55 _newContour = new wxButton(this, -1, wxString(tmp, wxConvUTF8) ,wxPoint(0,0),wxSize(80,80)); // " New\nContour"
56 _fixContour = new wxButton(this, -1, wxString(marDict.GetString(830), wxConvUTF8) ,wxPoint(0,0),wxSize(80,80)); // " Replace "
57 // _cancelContour = new wxButton(this, -1, marDict.GetString(835) ,wxPoint(0,0),wxSize(80,35)); // " End "
58 // _insert = new wxRadioButton(this, -1, wxString(marDict.GetString(840), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Insert Point "
59 // _erase = new wxRadioButton(this, -1, wxString(marDict.GetString(845), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Delete Point "
60 // _move = new wxRadioButton(this, -1, wxString(marDict.GetString(850), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); // " Move Point "
61 _one = new wxStaticText(this,-1,wxString(marDict.GetString(805), wxConvUTF8) ); // "1"
62 _two = new wxStaticText(this,-1,wxString(marDict.GetString(810), wxConvUTF8) ); // "2"
63 _three = new wxStaticText(this,-1,wxString(marDict.GetString(815), wxConvUTF8) ); // "3"
65 strcpy( tmp , "\n\n" );
66 strcat( tmp , marDict.GetString(855) );
68 strcat( tmp , marDict.GetString(860) );
69 _msg = new wxStaticText(this,-1,wxString(tmp, wxConvUTF8) ); // "\n\nUse mouse left button \n to create the new contour"
71 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
72 title -> SetFont(font);
73 _one -> SetFont(font);
74 _two -> SetFont(font);
75 _three -> SetFont(font);
78 // title -> SetBackgroundColour(*wxLIGHT_GREY);
79 // _insert -> SetBackgroundColour(*wxLIGHT_GREY);
80 // _erase -> SetBackgroundColour(*wxLIGHT_GREY);
81 // _move -> SetBackgroundColour(*wxLIGHT_GREY);
82 // _msg -> SetBackgroundColour(*wxLIGHT_GREY);
84 _fixContour -> Disable();
85 // _cancelContour -> Disable();
86 // _insert -> Disable();
87 // _erase -> Disable();
88 // _move -> Disable();
92 // _msg -> Show(false);
94 Connect(_newContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnNewContour );
95 Connect(_fixContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnFixContour );
96 // Connect(_cancelContour->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlModifyContour::OnCancelContour );
97 // Connect(_insert->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnInsertPoint );
98 // Connect(_erase->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnErasePoint );
99 // Connect(_move->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlModifyContour::OnMovePoint );
102 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
103 wxFlexGridSizer *sizerAh= new wxFlexGridSizer(6);
104 wxFlexGridSizer *sizerAv= new wxFlexGridSizer(1);
105 wxFlexGridSizer *sizerBv= new wxFlexGridSizer(1);
107 // sizerAv->Add(_insert , 1, wxALL|wxEXPAND, 6);
108 // sizerAv->Add(_erase , 1, wxALL|wxEXPAND, 6);
109 // sizerAv->Add(_move , 1, wxALL|wxEXPAND, 6);
111 sizerBv->Add(_fixContour , 1, wxALL|wxEXPAND, 6);
112 // sizerBv->Add(_cancelContour , 1, wxALL|wxEXPAND, 6);
114 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
115 sizerAh->Add(_one , 1, wxALIGN_CENTER_HORIZONTAL, 3);
116 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
117 sizerAh->Add(_two , 1, wxALIGN_CENTER_HORIZONTAL, 3);
118 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
119 sizerAh->Add(_three , 1, wxALIGN_CENTER_HORIZONTAL, 3);
121 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
122 sizerAh->Add(_newContour , 1, wxALL|wxEXPAND, 3);
123 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
124 sizerAh->Add(_msg , 1, wxALL|wxEXPAND, 3);
125 sizerAh->Add(new wxStaticText(this,-1,_T(" ")) , 1, wxALL|wxEXPAND, 3);
126 sizerAh->Add(sizerBv , 1, wxALL|wxEXPAND, 3);
128 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
129 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
130 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
131 // sizerAh->Add(_msg , 1, wxALIGN_CENTER_HORIZONTAL, 3);
132 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
133 // sizerAh->Add(blank , 1, wxALL|wxEXPAND, 3);
135 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
136 sizer->Add(sizerAh , 1, wxALL|wxEXPAND, 10);
138 this->SetSizer(sizer);
139 this->SetSize(wxSize(400,400));
142 //------------------------------------------------------------------------
143 void wxPnlModifyContour::OnFixContour(wxCommandEvent& event){
144 _fixContour -> Enable(false);
145 _two -> Enable(false);
146 _three -> Enable(false);
147 _msg -> Enable(false);
148 _quantificationWidget_base->SetManualContour_ReplaceContour();
149 _quantificationWidget_base->SetManualContour_2DWorld(false);
151 //------------------------------------------------------------------------
152 void wxPnlModifyContour::OnNewContour(wxCommandEvent& event){
154 // _insert -> Enable(true);
155 // _erase -> Enable(true);
156 // _move -> Enable(true);
157 _fixContour -> Enable(true);
158 // _cancelContour -> Enable(true);
159 _two -> Enable(true);
160 _three -> Enable(true);
161 _msg -> Enable(true);
162 // _msg -> Show(true);
164 // _insert -> SetValue(true);
165 // _erase -> SetValue(false);
166 // _move -> SetValue(false);
168 _quantificationWidget_base->SetManualContour_AddPoint_2DWorld();
169 _quantificationWidget_base->SetManualContour_2DWorld(false);
170 _quantificationWidget_base->SetManualContour_2DWorld(true);
176 //------------------------------------------------------------------------
177 //------------------------------------------------------------------------
178 //------------------------------------------------------------------------
179 wxPnlSearchStenosisAutomatic::wxPnlSearchStenosisAutomatic(wxWindow *parent, wxQuantificationWidget_base *quantificationWidget_base)
181 marDictionary marDict;
184 _quantificationWidget_base=quantificationWidget_base;
186 wxPanel* _panelAutomatic=this;
187 wxFlexGridSizer *sizerPanelAutomatic1 = new wxFlexGridSizer(7);
190 // _st1_blank = new wxStaticText(_panelAutomatic,-1," ");
192 strcpy( tmp , marDict.GetString(275) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(280) );
193 _st1_text1 = new wxStaticText(_panelAutomatic,-1,wxString(tmp, wxConvUTF8) ); //"Select\n slice"
194 _st1_next1 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
195 _st1_next2 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
196 _st1_next3 = new wxStaticText(_panelAutomatic,-1,_T(" ")); //->
197 _st1_cero = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(273), wxConvUTF8) );//"0"
198 _st1_one = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(283), wxConvUTF8) );//"1"
199 _st1_two = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(293), wxConvUTF8) );//"2"
200 _st1_three = new wxStaticText(_panelAutomatic,-1,wxString(marDict.GetString(303), wxConvUTF8) );//"3"
201 strcpy( tmp , marDict.GetString(285) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(290) );
202 _bt1_HealthySlice = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Validate\nHealthy Slice"
203 strcpy( tmp , marDict.GetString(295) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(300) );
204 _bt1_EndRegion = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Validate\nEnd region"
205 strcpy( tmp , marDict.GetString(305) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(310) );
206 _bt1_Start = new wxButton(_panelAutomatic,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(80,85));//" Find \nStenosis"
207 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(270), wxConvUTF8)); //"Automatic stenosis search"
210 _panelSpecial = new wxPanel(_panelAutomatic,-1,wxDefaultPosition,wxSize(400,200));
211 _st_BeginRegion = new wxStaticText(_panelSpecial,-1,_T("Begin Region : "));
212 _st_EndRegion = new wxStaticText(_panelSpecial,-1,_T(" End Region : "));
213 _sl_BeginRegion = new wxSlider(_panelSpecial, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
214 _sl_EndRegion = new wxSlider(_panelSpecial, -1, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
215 _rb_surface = new wxRadioButton(_panelSpecial, -1, _T("Stenosis by Surface "), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
216 _rb_diameter = new wxRadioButton(_panelSpecial, -1, _T("Stenosis by Diameter "), wxDefaultPosition, wxDefaultSize );
217 _bt_MaxSurface = new wxButton(_panelSpecial,-1,_T("Find Max Surface"));
218 wxButton *bt_AxisMPR = new wxButton(_panelSpecial,-1,_T("Axis MPR"));
220 _bt_plus = new wxButton(_panelAutomatic,-1,_T("+"),wxPoint(0,0),wxSize(15,15));
221 _bt_plus->Show(true);
224 Connect(_bt1_HealthySlice->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtHealthySlice );
225 Connect(_bt1_EndRegion->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtEndRegion );
226 Connect(_bt1_Start->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtStart );
228 Connect(_sl_BeginRegion->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBeginSlider );
229 Connect(_sl_EndRegion->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnEndSlider );
230 Connect(_bt_plus->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtPlus );
231 Connect(_bt_MaxSurface->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtMaxSurf );
232 Connect(bt_AxisMPR->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnBtAxisMPR );
234 Connect(_rb_surface->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnRbArea );
235 Connect(_rb_diameter->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosisAutomatic::OnRbDiameter );
238 wxFlexGridSizer *sizerPanelSpecial = new wxFlexGridSizer(1);
239 wxFlexGridSizer *sizerPanelSpecial1 = new wxFlexGridSizer(2);
240 wxFlexGridSizer *sizerPanelSpecial2 = new wxFlexGridSizer(2);
241 wxFlexGridSizer *sizerPanelSpecial3 = new wxFlexGridSizer(3);
243 wxFlexGridSizer *sizerPanelAutomatic = new wxFlexGridSizer(1);
246 // _panelAutomatic->SetBackgroundColour(*wxLIGHT_GREY);
249 // _st1_blank ->SetBackgroundColour(*wxLIGHT_GREY);
250 // _st1_text1 ->SetBackgroundColour(*wxLIGHT_GREY);
251 // _st1_next1 ->SetBackgroundColour(*wxLIGHT_GREY);
252 // _st1_next2 ->SetBackgroundColour(*wxLIGHT_GREY);
253 // _st1_next3 ->SetBackgroundColour(*wxLIGHT_GREY);
254 // _st1_next3 ->SetBackgroundColour(*wxLIGHT_GREY);
255 // _st1_cero ->SetBackgroundColour(*wxLIGHT_GREY);
256 // _st1_one ->SetBackgroundColour(*wxLIGHT_GREY);
257 // _st1_two ->SetBackgroundColour(*wxLIGHT_GREY);
258 // _st1_three ->SetBackgroundColour(*wxLIGHT_GREY);
260 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
261 title ->SetFont(font);
263 // title ->SetBackgroundColour(*wxLIGHT_GREY);
264 _st1_cero ->SetFont(font);
265 _st1_one ->SetFont(font);
266 _st1_two ->SetFont(font);
267 _st1_three ->SetFont(font);
268 _st1_next1 ->SetFont(font);
269 _st1_next2 ->SetFont(font);
270 _st1_next3 ->SetFont(font);
271 // _st1_one ->Disable();
272 _st1_two ->Disable();
273 _st1_three ->Disable();
274 // bt1_HealthySlice->Disable();
275 _bt1_EndRegion->Disable();
276 _bt1_Start->Disable();
279 // _panelSpecial ->SetBackgroundColour(*wxLIGHT_GREY);
280 // _st_BeginRegion ->SetBackgroundColour(*wxLIGHT_GREY);
281 // _st_EndRegion ->SetBackgroundColour(*wxLIGHT_GREY);
282 // _sl_BeginRegion ->SetBackgroundColour(*wxLIGHT_GREY);
283 // _sl_EndRegion ->SetBackgroundColour(*wxLIGHT_GREY);
284 // _rb_diameter ->SetBackgroundColour(*wxLIGHT_GREY);
285 // _rb_surface ->SetBackgroundColour(*wxLIGHT_GREY);
287 _sl_BeginRegion ->SetSize(330,30);
288 _sl_EndRegion ->SetSize(330,30);
289 _st_BeginRegion ->Disable();
290 _st_EndRegion ->Disable();
291 _sl_BeginRegion ->Disable();
292 _sl_EndRegion ->Disable();
293 _rb_diameter ->Disable();
294 _rb_surface ->Disable();
295 _bt_MaxSurface ->Disable();
297 _rb_surface->SetValue(true);
298 _quantificationWidget_base->SetAnalysisTypeStenosis(2);
301 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
302 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
303 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
304 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
305 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
306 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
307 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
310 sizerPanelAutomatic1->Add(_st1_cero , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
311 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
312 sizerPanelAutomatic1->Add(_st1_one , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
313 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
314 sizerPanelAutomatic1->Add(_st1_two , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
315 sizerPanelAutomatic1->Add(new wxStaticText(_panelAutomatic,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
316 sizerPanelAutomatic1->Add(_st1_three , 15, wxALIGN_CENTER_HORIZONTAL, wx_border);
318 sizerPanelAutomatic1->Add(_st1_text1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
319 sizerPanelAutomatic1->Add(_st1_next1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
320 sizerPanelAutomatic1->Add(_bt1_HealthySlice , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
321 sizerPanelAutomatic1->Add(_st1_next2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
322 sizerPanelAutomatic1->Add(_bt1_EndRegion , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
323 sizerPanelAutomatic1->Add(_st1_next3 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
324 sizerPanelAutomatic1->Add(_bt1_Start , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, wx_border);
327 sizerPanelSpecial1->Add(_rb_surface ,1 ,wxALL ,0);
328 sizerPanelSpecial1->Add(_rb_diameter ,1 ,wxALL ,0);
329 sizerPanelSpecial2->Add(_st_BeginRegion ,1 ,wxALL ,0);
330 sizerPanelSpecial2->Add(_sl_BeginRegion ,1 ,wxALL|wxGROW ,0);
331 sizerPanelSpecial2->Add(_st_EndRegion ,1 ,wxALL ,0);
332 sizerPanelSpecial2->Add(_sl_EndRegion ,1 ,wxALL|wxGROW ,0);
333 sizerPanelSpecial3->Add(_bt_MaxSurface ,1 ,wxALL ,0);
334 sizerPanelSpecial3->Add( bt_AxisMPR ,1 ,wxALL ,0);
337 sizerPanelSpecial2->AddGrowableCol(1);
340 sizerPanelSpecial->Add(sizerPanelSpecial1 ,1 ,wxALL|wxALIGN_RIGHT , 0 );
341 sizerPanelSpecial->Add(sizerPanelSpecial2 ,1 ,wxALL|wxGROW , 0 );
342 sizerPanelSpecial->Add(sizerPanelSpecial3 ,1 ,wxALL , 0 );
343 _panelSpecial->SetSizer(sizerPanelSpecial);
344 _panelSpecial->SetAutoLayout(true);
345 _panelSpecial->SetSize( sizerPanelSpecial->GetMinSize() );
347 sizerPanelAutomatic->Add(title ,15, wxALL , 10);
348 sizerPanelAutomatic->Add(sizerPanelAutomatic1 ,15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL , 10);
349 sizerPanelAutomatic->Add(_bt_plus ,15, wxALL , 0);
350 sizerPanelAutomatic->Add(_panelSpecial ,15, wxALL|wxGROW , 0);
351 _panelAutomatic->SetSizer(sizerPanelAutomatic);
352 _panelAutomatic->SetAutoLayout(true);
354 _panelSpecial->Show(true);
356 _panelAutomatic->SetSize(400,270);
357 _panelAutomatic->SetSize( sizerPanelAutomatic->GetMinSize() );
361 //------------------------------------------------------------------------
362 void wxPnlSearchStenosisAutomatic::SetRange(int min, int max)
364 _sl_BeginRegion->SetRange(min,max);
365 _sl_EndRegion->SetRange(min,max);
369 //------------------------------------------------------------------------
370 void wxPnlSearchStenosisAutomatic::OnBtHealthySlice(wxCommandEvent& event){
372 _st1_two -> Enable();
373 _bt1_EndRegion -> Enable();
374 _st_BeginRegion -> Enable();
375 _sl_BeginRegion -> Enable();
376 int slice=_quantificationWidget_base->GetActualSlice();
377 _quantificationWidget_base->SetHealthySlice(slice);
379 int startSlice,endSlice;
380 _quantificationWidget_base->GetSliceLimites(0,startSlice,endSlice);
381 if ((_panelSpecial->IsShown()==false) || (startSlice==-1)){
382 _quantificationWidget_base->Set3DStartRegionSliceActor( 0, slice );
383 _quantificationWidget_base->Show3DStartRegionSliceActor(0);
384 _sl_BeginRegion ->SetValue(slice);
385 _quantificationWidget_base->RefreshAxis();
388 //------------------------------------------------------------------------
389 void wxPnlSearchStenosisAutomatic::OnBtEndRegion(wxCommandEvent& event){
390 _st1_three -> Enable();
391 _bt1_Start -> Enable();
392 _st_EndRegion -> Enable();
393 _sl_EndRegion -> Enable();
394 _rb_diameter -> Enable();
395 _rb_surface -> Enable();
396 _bt_MaxSurface -> Enable();
397 int slice=_quantificationWidget_base->GetActualSlice();
398 _quantificationWidget_base->Set3DEndRegionSliceActor( 0, slice );
399 _quantificationWidget_base->Show3DEndRegionSliceActor(0);
400 _sl_EndRegion->SetValue(slice);
401 _quantificationWidget_base->RefreshAxis();
404 //------------------------------------------------------------------------
405 void wxPnlSearchStenosisAutomatic::OnBtStart(wxCommandEvent& event)
407 _quantificationWidget_base->DetectHealthySickSlice( true, false );
411 //------------------------------------------------------------------------
413 void wxPnlSearchStenosisAutomatic::OnBtAxisMPR(wxCommandEvent& event){
415 wxFrame *frame = new wxFrame(this,-1,_T("MPR Axe"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP);
416 int wz1 = _sl_BeginRegion->GetValue();
417 int wz2 = _sl_EndRegion->GetValue();
425 kVolume *vol = _quantificationWidget_base->GetVolumeAxisExtended(wz1,wz2);
428 wxMaracasMPR *wxmaracasMPR = new wxMaracasMPR( frame , new marImageData( vol->castVtk() ) , 1);
429 // wxMaracasMPR *wxmaracasMPR = new wxMaracasMPR( frame , vol->castVtk() , getVoxelSize???? );
432 vtkPlane2DView *planeView = wxmaracasMPR->GetVtkPlane2DView();
433 planeView->SetImgSize(100);
434 wxmaracasMPR->ConfigureVTK();
435 frame->SetSize(600,600);
439 //------------------------------------------------------------------------
440 void wxPnlSearchStenosisAutomatic::OnBtPlus(wxCommandEvent& event){
441 if (_panelSpecial->IsShown()==true){
442 _bt_plus->SetLabel(_T("+"));
443 _panelSpecial->Show(false);
445 _bt_plus->SetLabel(_T("-"));
447 int startSlice,endSlice;
448 _quantificationWidget_base->GetSliceLimites(0,startSlice,endSlice);
449 int maxSlices = _quantificationWidget_base->GetMaxActualSlice();
450 _sl_BeginRegion->SetRange(0,maxSlices);
451 _sl_BeginRegion->SetValue(startSlice);
452 _sl_EndRegion->SetRange(0,maxSlices);
453 _sl_EndRegion->SetValue(endSlice);
454 _quantificationWidget_base->RefreshAxis();
456 _panelSpecial->Show(true);
459 //------------------------------------------------------------------------
460 void wxPnlSearchStenosisAutomatic::OnBeginSlider(wxScrollEvent& event){
461 _quantificationWidget_base->Set3DStartRegionSliceActor( 0, _sl_BeginRegion->GetValue() );
462 _quantificationWidget_base->Show3DStartRegionSliceActor( 0 );
463 _quantificationWidget_base->RefreshAxis();
465 //------------------------------------------------------------------------
466 void wxPnlSearchStenosisAutomatic::OnEndSlider(wxScrollEvent& event){
467 _quantificationWidget_base->Set3DEndRegionSliceActor( 0, _sl_EndRegion->GetValue() );
468 _quantificationWidget_base->Show3DEndRegionSliceActor( 0 );
469 _quantificationWidget_base->RefreshAxis();
471 //------------------------------------------------------------------------
472 void wxPnlSearchStenosisAutomatic::OnBtMaxSurf(wxCommandEvent& event){
473 _quantificationWidget_base->DetectHealthySickSlice( false, true );
475 //------------------------------------------------------------------------
476 void wxPnlSearchStenosisAutomatic::OnRbArea(wxCommandEvent& event){
477 _quantificationWidget_base->SetAnalysisTypeStenosis( 2 );
479 //------------------------------------------------------------------------
480 void wxPnlSearchStenosisAutomatic::OnRbDiameter(wxCommandEvent& event){
481 _quantificationWidget_base->SetAnalysisTypeStenosis( 1 );
483 //------------------------------------------------------------------------
491 //------------------------------------------------------------------------
492 //------------------------------------------------------------------------
493 //------------------------------------------------------------------------
494 wxPnlSearchStenosisManual::wxPnlSearchStenosisManual(wxWindow *parent, wxQuantificationWidget_base *quantificationWidget_base)
496 marDictionary marDict;
499 _quantificationWidget_base=quantificationWidget_base;
500 wxPanel* _panelManual=this;
501 wxFlexGridSizer *sizerPanelManual = new wxFlexGridSizer(1);
502 wxFlexGridSizer *sizerPanelManual1 = new wxFlexGridSizer(1);
503 wxFlexGridSizer *sizerPanelManual2 = new wxFlexGridSizer(5);
506 // _st2_blank = new wxStaticText(_panelManual,-1," ");
508 strcpy( tmp , marDict.GetString(330) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(335) );
509 _st2_text1 = new wxStaticText(_panelManual,-1,wxString(tmp, wxConvUTF8));//"Select\n slice"
510 strcpy( tmp , marDict.GetString(340) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(345) );
511 _st2_text2 = new wxStaticText(_panelManual,-1,wxString(tmp, wxConvUTF8));//" Select \n other slice"
512 _st2_next1 = new wxStaticText(_panelManual,-1,_T(" ")); //->
513 _st2_next2 = new wxStaticText(_panelManual,-1,_T(" ")); //->
514 _st2_cero = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(328), wxConvUTF8) ); //"0"
515 _st2_one = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(338), wxConvUTF8) ); //"1"
516 _st2_two = new wxStaticText(_panelManual,-1, wxString(marDict.GetString(348), wxConvUTF8) ); //"2"
517 strcpy( tmp , marDict.GetString(350) ); strcat( tmp , "\n" ); strcat( tmp , marDict.GetString(355) );
518 _bt2_HealthySlice = new wxButton(_panelManual,-1,wxString(tmp, wxConvUTF8),wxPoint(0,0),wxSize(85,85)); //" Validate\nHealthy Slice"
519 wxStaticText *title = new wxStaticText(this,-1,wxString( marDict.GetString(325) , wxConvUTF8 ));//"Manual stenosis search"
521 Connect(_bt2_HealthySlice->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlSearchStenosisManual::OnBtHealthySlice );
523 // _panelManual->SetBackgroundColour(*wxLIGHT_GREY);
524 // _st2_blank ->SetBackgroundColour(*wxLIGHT_GREY);
525 // _st2_text1 ->SetBackgroundColour(*wxLIGHT_GREY);
526 // _st2_text2 ->SetBackgroundColour(*wxLIGHT_GREY);
527 // _st2_cero ->SetBackgroundColour(*wxLIGHT_GREY);
528 // _st2_one ->SetBackgroundColour(*wxLIGHT_GREY);
529 // _st2_two ->SetBackgroundColour(*wxLIGHT_GREY);
530 // _st2_next1 ->SetBackgroundColour(*wxLIGHT_GREY);
531 // _st2_next2 ->SetBackgroundColour(*wxLIGHT_GREY);
533 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
534 title ->SetFont(font);
536 // title ->SetBackgroundColour(*wxLIGHT_GREY);
537 _st2_cero ->SetFont(font);
538 _st2_one ->SetFont(font);
539 _st2_two ->SetFont(font);
540 _st2_next1 ->SetFont(font);
541 _st2_next2 ->SetFont(font);
544 _st2_text2->Disable();
546 sizerPanelManual1->Add( title, 15, wxALL, 10 );
549 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
550 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
551 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
552 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
553 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
555 sizerPanelManual2->Add(_st2_cero , 15, wxALIGN_CENTER_HORIZONTAL, 10);
556 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
557 sizerPanelManual2->Add(_st2_one , 15, wxALIGN_CENTER_HORIZONTAL, 10);
558 sizerPanelManual2->Add( new wxStaticText(_panelManual,-1,_T(" ")) , 15, wxALIGN_CENTER_HORIZONTAL, 10);
559 sizerPanelManual2->Add(_st2_two , 15, wxALIGN_CENTER_HORIZONTAL, 10);
561 sizerPanelManual2->Add(_st2_text1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
562 sizerPanelManual2->Add(_st2_next1 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
563 sizerPanelManual2->Add(_bt2_HealthySlice, 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
564 sizerPanelManual2->Add(_st2_next2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
565 sizerPanelManual2->Add(_st2_text2 , 15, wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10);
567 sizerPanelManual->Add(sizerPanelManual1);
568 sizerPanelManual->Add(sizerPanelManual2);
571 _panelManual->SetSizer(sizerPanelManual);
572 _panelManual->SetAutoLayout(true);
573 _panelManual->SetSize(400,300);
575 //------------------------------------------------------------------------
576 void wxPnlSearchStenosisManual::OnBtHealthySlice(wxCommandEvent& event){
579 _st2_text2 ->Enable();
580 _quantificationWidget_base->SetHealthySlice();
582 //------------------------------------------------------------------------
585 //------------------------------------------------------------------------
586 //------------------------------------------------------------------------
587 //------------------------------------------------------------------------
588 wxPnlSearchStenosis::wxPnlSearchStenosis(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
589 : wxPanel(parent,-1){
590 marDictionary marDict;
591 _quantificationWidget_base=quantificationWidget_base;
593 // this->SetBackgroundColour(*wxLIGHT_GREY);
595 wxFlexGridSizer *axis1 = new wxFlexGridSizer(2);
596 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
597 wxRadioButton *rb_automatique = new wxRadioButton(this,-1,wxString(marDict.GetString(315), wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); //"Automatic"
598 wxRadioButton *rb_manual = new wxRadioButton(this,-1,wxString(marDict.GetString(320), wxConvUTF8), wxDefaultPosition, wxDefaultSize ); //"Manual"
600 Connect(rb_automatique->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosis::OnRbAutomatic );
601 Connect(rb_manual->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction) &wxPnlSearchStenosis::OnRbManual );
603 rb_automatique->SetValue(true);
605 // rb_automatique->SetBackgroundColour(*wxLIGHT_GREY);
606 // rb_manual->SetBackgroundColour(*wxLIGHT_GREY);
608 wxPanel *panelWork = new wxPanel(this,-1);
609 _panelAutomatic = new wxPnlSearchStenosisAutomatic(panelWork,_quantificationWidget_base);
610 _panelManual = new wxPnlSearchStenosisManual(panelWork,_quantificationWidget_base);
611 panelWork->SetSize(_panelAutomatic->GetSize());
613 _panelAutomatic->Show(true);
614 _panelManual->Show(false);
616 axis1->Add(rb_automatique);
617 axis1->Add(rb_manual);
619 sizer->Add(panelWork,1, wxALL|wxEXPAND, 0);
620 sizer->Add(axis1 ,1, wxALL|wxALIGN_RIGHT , 0);
621 this->SetSizer(sizer);
622 this->SetAutoLayout(true);
623 this->SetSize(wxSize(400,600));
624 this->SetSize( sizer->GetMinSize() );
626 //------------------------------------------------------------------------
627 void wxPnlSearchStenosis::OnRbAutomatic(wxCommandEvent& event){
628 _panelAutomatic->Show(true);
629 _panelManual->Show(false);
630 _quantificationWidget_base->Show3DStartRegionSliceActor( 0 );
631 _quantificationWidget_base->Show3DEndRegionSliceActor( 0 );
633 //------------------------------------------------------------------------
634 void wxPnlSearchStenosis::OnRbManual(wxCommandEvent& event){
635 _panelAutomatic->Show(false);
636 _panelManual->Show(true);
637 _quantificationWidget_base->Hide3DStartRegionSliceActor( 0 );
638 _quantificationWidget_base->Hide3DEndRegionSliceActor( 0 );
640 //------------------------------------------------------------------------
641 wxPnlSearchStenosisAutomatic* wxPnlSearchStenosis::GetPanelAutomatic(){
642 return _panelAutomatic;
648 //------------------------------------------------------------------------
649 //------------------------------------------------------------------------
650 //------------------------------------------------------------------------
651 wxPanelSizeHealthyRegion::wxPanelSizeHealthyRegion(wxWindow* parent, wxQuantificationWidget_base *quantificationWidget_base)
652 : wxPanel(parent,-1){
653 marDictionary marDict;
655 // this->SetBackgroundColour(*wxLIGHT_GREY);
656 _quantificationWidget_base = quantificationWidget_base;
657 int maxSliderSize = 30;
658 int sizeHealthyRegion = 0;
659 sizeHealthyRegion = _quantificationWidget_base->GetSizeHealthyRegion();
661 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
662 wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
663 wxFlexGridSizer *sizer2 = new wxFlexGridSizer(2);
666 // wxStaticText *st_Blank = new wxStaticText( this, -1," ",wxPoint(0,0));
668 wxStaticText *st_Title = new wxStaticText( this, -1,wxString(marDict.GetString(370), wxConvUTF8),wxPoint(0,0));//"Size of the Healty Region:"
669 wxStaticText *st_Size = new wxStaticText( this, -1, wxString(marDict.GetString(373), wxConvUTF8) ); //"n : "
670 _sl_Size = new wxSlider( this, -1, sizeHealthyRegion, 0, maxSliderSize, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
671 wxButton *buttonRefresh = new wxButton( this, -1, wxString(marDict.GetString(375), wxConvUTF8));//"Refresh healthy region"
672 wxStaticText *title = new wxStaticText( this, -1,wxString(marDict.GetString(365), wxConvUTF8));//"Healthy region size "
675 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
676 title ->SetFont(font);
678 // title ->SetBackgroundColour(*wxLIGHT_GREY);
680 Connect(buttonRefresh->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPanelSizeHealthyRegion::OnButtonRefresh );
681 sizer1->Add( title, 15, wxALL, 10 );
683 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
684 sizer2->Add( st_Title );
686 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
687 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
689 sizer2->Add( st_Size );
690 sizer2->Add( _sl_Size ,1,wxALL|wxGROW);
692 sizer2->AddGrowableCol(1);
694 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
695 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
697 sizer2->Add( new wxStaticText( this, -1,_T(" "),wxPoint(0,0)) );
698 sizer2->Add( buttonRefresh );
700 sizer->Add( sizer1 );
701 sizer->Add( sizer2 );
703 this->SetSizer(sizer);
704 this->SetAutoLayout(true);
705 this->SetSize(200,400);
707 //------------------------------------------------------------------------
708 void wxPanelSizeHealthyRegion::OnButtonRefresh(wxScrollEvent& event){
709 _quantificationWidget_base->SetSizeHealthyRegion( _sl_Size->GetValue() );
710 int healthySlice=_quantificationWidget_base->GetHealthySlice();
711 if (healthySlice!=-1) {
712 _quantificationWidget_base->SetHealthySlice( healthySlice );
718 //------------------------------------------------------------------------
719 //------------------------------------------------------------------------
720 //------------------------------------------------------------------------
721 wxPanelControlsHealthySickSlice2::wxPanelControlsHealthySickSlice2(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
722 : wxPanel(parent,-1){
723 marDictionary marDict;
725 // this->SetBackgroundColour(*wxLIGHT_GREY);
728 //_quantificationWidget = quantificationWidget;
730 wxNotebook *wxnotbook = new wxNotebook(this, -1);
732 // wxnotbook->SetBackgroundColour(*wxLIGHT_GREY);
734 wxpnlsearchstenosis = new wxPnlSearchStenosis( wxnotbook , quantificationWidget_base);
735 wxPanelSizeHealthyRegion *page2 = new wxPanelSizeHealthyRegion (wxnotbook , quantificationWidget_base);
736 wxPnlModifyContour *page3 = new wxPnlModifyContour( wxnotbook , quantificationWidget_base);
737 wxnotbook->AddPage(wxpnlsearchstenosis, wxString(marDict.GetString(265), wxConvUTF8) ); //"Stenosis search "
738 wxnotbook->AddPage(page2, wxString(marDict.GetString(360), wxConvUTF8) ); //"Healty region size "
739 wxnotbook->AddPage(page3, wxString(marDict.GetString(800), wxConvUTF8) ); //"Contour modification"
740 wxnotbook->SetSize(400,315);
742 // page1->GetSize(&w,&h);
743 // wxnotbook->SetSize( w+20 , h+25 );
745 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
746 sizer->Add(wxnotbook, 1, wxALL|wxEXPAND, 0);
747 this->SetSizer(sizer);
748 this->SetAutoLayout(true);
750 this->SetSize(400,315);
751 // this->SetSize( wxnotbook->GetSize() );
755 //------------------------------------------------------------------------
756 wxPnlSearchStenosis *wxPanelControlsHealthySickSlice2::GetPnlSearStenosis()
758 return wxpnlsearchstenosis;
761 //------------------------------------------------------------------------
762 //------------------------------------------------------------------------
763 //------------------------------------------------------------------------
764 wxPnlContourControl::wxPnlContourControl(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
767 marDictionary marDict;
769 _quantificationWidget_base=quantificationWidget_base;
771 // this->SetBackgroundColour(*wxLIGHT_GREY);
773 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(940), wxConvUTF8)); // "Contour modification"
774 // wxStaticText *blank = new wxStaticText(this,-1," ");
777 // title -> SetBackgroundColour(*wxLIGHT_GREY);
780 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
781 title -> SetFont(font);
783 _sl_Discontinuity = new wxSlider(this, -1, 10, 0, 20, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
784 _sl_LumenPercentage = new wxSlider(this, -1, 86, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
785 _sl_CalcPercentage = new wxSlider(this, -1, 90, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
788 // _sl_Discontinuity->SetBackgroundColour(*wxLIGHT_GREY);
789 // _sl_LumenPercentage->SetBackgroundColour(*wxLIGHT_GREY);
790 // _sl_CalcPercentage->SetBackgroundColour(*wxLIGHT_GREY);
792 _sl_Discontinuity->SetSize(300,16);
793 _sl_LumenPercentage->SetSize(300,16);
794 _sl_CalcPercentage->SetSize(300,16);
796 _st_Discontinuity = new wxStaticText(this, -1, wxString(marDict.GetString(925), wxConvUTF8) ); //"Threshold "
797 _st_LumenPercentage = new wxStaticText(this, -1, wxString(marDict.GetString(930), wxConvUTF8) ); //"Lumen % "
798 _st_CalcPercentage = new wxStaticText(this, -1, wxString(marDict.GetString(935), wxConvUTF8) ); //"Calcification % "
801 btnCalibration = new wxButton( this, -1, _T("Calibrate"),wxPoint(0,0),wxSize(92,20));
802 btnFile = new wxButton( this, -1, _T("Generate File"),wxPoint(0,0),wxSize(92,20));
805 // _st_Discontinuity->SetBackgroundColour(*wxLIGHT_GREY);
806 // _st_LumenPercentage->SetBackgroundColour(*wxLIGHT_GREY);
807 // _st_CalcPercentage->SetBackgroundColour(*wxLIGHT_GREY);
810 Connect(_sl_Discontinuity->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderDiscontinuityScroll );
811 Connect(_sl_LumenPercentage->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderLumenPercentageScroll );
812 Connect(_sl_CalcPercentage->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxPnlContourControl::OnSliderCalcPercentageScroll );
813 Connect(btnCalibration->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlContourControl::OnCalibration );
814 Connect(btnFile->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlContourControl::OnFile );
816 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
818 wxFlexGridSizer *axe1 = new wxFlexGridSizer(2);
819 wxFlexGridSizer *axe2 = new wxFlexGridSizer(2);
820 wxFlexGridSizer *axe3 = new wxFlexGridSizer(2);
823 axe1->Add(_st_Discontinuity , 1, wxALL|wxEXPAND, 0);
824 axe1->Add(_sl_Discontinuity , 1, wxALL|wxEXPAND, 0);
826 axe2->Add(_st_LumenPercentage , 1, wxALL|wxEXPAND, 0);
827 axe2->Add(_sl_LumenPercentage , 1, wxALL|wxEXPAND, 0);
829 axe3->Add(_st_CalcPercentage , 1, wxALL|wxEXPAND, 0);
830 axe3->Add(_sl_CalcPercentage , 1, wxALL|wxEXPAND, 0);
832 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
833 sizer->Add(axe1, 2, wxALL|wxEXPAND, 10);
834 sizer->Add(axe2, 2, wxALL|wxEXPAND, 10); //wxALIGN_CENTER_HORIZONTAL
835 sizer->Add(axe3, 2, wxALL|wxEXPAND, 10);
836 sizer->Add(btnCalibration, 2, wxALL|wxEXPAND, 10);
837 sizer->Add(btnFile, 2, wxALL|wxEXPAND, 10);
839 this->SetSizer(sizer);
840 this->SetSize(wxSize(400,400));
843 // ----------------------------------------------------------------------------
844 void wxPnlContourControl::OnSliderDiscontinuityScroll(wxScrollEvent& event)
847 _quantificationWidget_base->OnSliderDiscontinuityScroll(event.GetPosition());
850 // ----------------------------------------------------------------------------
851 void wxPnlContourControl::OnSliderLumenPercentageScroll(wxScrollEvent& event)
854 _quantificationWidget_base->OnSliderLumenPercentageScroll(event.GetPosition());
857 // ----------------------------------------------------------------------------
858 void wxPnlContourControl::OnSliderCalcPercentageScroll(wxScrollEvent& event)
860 _quantificationWidget_base->OnSliderCalcPercentageScroll(event.GetPosition());
863 // ----------------------------------------------------------------------------
864 void wxPnlContourControl::OnCalibration(wxScrollEvent& event)
866 _quantificationWidget_base->OnCalibration();
869 // ----------------------------------------------------------------------------
870 void wxPnlContourControl::OnFile(wxScrollEvent& event)
872 _quantificationWidget_base->OnFile();
875 //------------------------------------------------------------------------
876 //------------------------------------------------------------------------
877 //------------------------------------------------------------------------
878 wxPnlManualContour::wxPnlManualContour(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
881 marDictionary marDict;
882 _quantificationWidget_base=quantificationWidget_base;
885 // this->SetBackgroundColour(*wxLIGHT_GREY);
887 wxStaticText *title = new wxStaticText(this,-1,wxString(marDict.GetString(803), wxConvUTF8)); // "Contour modification"
888 // wxStaticText *blank = new wxStaticText(this,-1," ");
891 wxFont font(12,wxDEFAULT ,wxNORMAL,wxBOLD);
892 title -> SetFont(font);
895 // title -> SetBackgroundColour(*wxLIGHT_GREY);
898 //MAZV - texts not included in marDictionary since this is not the final version
899 btnContourWall = new wxButton( this, -1, _T("External wall \ncontour"),wxPoint(0,0),wxSize(92,40));
900 btnContourLumen = new wxButton( this, -1, _T("Lumen contours"),wxPoint(0,0),wxSize(92,40));
901 btnContourCalc = new wxButton( this, -1, _T("Calcification \ncontours"),wxPoint(0,0),wxSize(92,40));
902 btnContourHypo = new wxButton( this, -1, _T("Hipodense \ncontours"),wxPoint(0,0),wxSize(92,40));
905 // btnContourAB = new wxButton( this, -1, "Active Contour AB",wxPoint(0,0),wxSize(92,20));
906 fixContourWall = new wxButton(this, -1, _T("Replace \nExternal wall") ,wxPoint(0,0),wxSize(92,40));
907 fixContourLumen = new wxButton(this, -1, _T("Replace \nLumen") ,wxPoint(0,0),wxSize(92,40));
908 fixContourCalc = new wxButton(this, -1, _T("Replace \nCalcifications") ,wxPoint(0,0),wxSize(92,40));
909 fixContourHypo = new wxButton(this, -1, _T("Replace \nHipodense") ,wxPoint(0,0),wxSize(92,40));
911 cbShowAllManual = new wxCheckBox(this,-1,_T("Show All"));
912 cbShowWall = new wxCheckBox(this,-1,_T("Show Wall"));
913 cbShowLumen = new wxCheckBox(this,-1,_T("Show Lumen"));
914 cbShowCalc = new wxCheckBox(this,-1,_T("Show Calcifications"));
915 cbShowHypo = new wxCheckBox(this,-1,_T("Show Hypodense"));
917 cbShowAllManual->SetValue(true);
918 cbShowWall->SetValue(true);
919 cbShowLumen->SetValue(true);
920 cbShowCalc->SetValue(true);
921 cbShowHypo->SetValue(true);
924 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
926 wxFlexGridSizer *conts = new wxFlexGridSizer(4);
927 wxFlexGridSizer *replace = new wxFlexGridSizer(4);
928 wxFlexGridSizer *options = new wxFlexGridSizer(5);
931 conts->Add(btnContourWall , 1, wxALL|wxEXPAND, 0);
932 conts->Add(btnContourLumen , 1, wxALL|wxEXPAND, 0);
933 conts->Add(btnContourCalc , 1, wxALL|wxEXPAND, 0);
934 conts->Add(btnContourHypo , 1, wxALL|wxEXPAND, 0);
935 //conts->Add(btnContourAB , 1, wxALL|wxEXPAND, 0);
937 replace->Add(fixContourWall , 1, wxALL|wxEXPAND, 0);
938 replace->Add(fixContourLumen , 1, wxALL|wxEXPAND, 0);
939 replace->Add(fixContourCalc , 1, wxALL|wxEXPAND, 0);
940 replace->Add(fixContourHypo , 1, wxALL|wxEXPAND, 0);
941 //replace->Add(fixContourAB , 1, wxALL|wxEXPAND, 0);
943 options->Add(cbShowAllManual , 1, wxALL|wxEXPAND, 0);
944 options->Add(cbShowWall , 1, wxALL|wxEXPAND, 0);
945 options->Add(cbShowLumen , 1, wxALL|wxEXPAND, 0);
946 options->Add(cbShowCalc , 1, wxALL|wxEXPAND, 0);
947 options->Add(cbShowHypo , 1, wxALL|wxEXPAND, 0);
949 sizer->Add(title , 1, wxALL|wxEXPAND, 10);
950 sizer->Add(conts , 2, wxALL|wxEXPAND, 10);
951 sizer->Add(replace , 2, wxALL|wxEXPAND, 10); //wxALIGN_CENTER_HORIZONTAL
952 sizer->Add(options , 2, wxALL|wxEXPAND, 10);
954 this->SetSizer(sizer);
955 this->SetSize(wxSize(400,400));
957 Connect(btnContourWall->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourWall );
958 Connect(btnContourLumen->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourLumen );
959 Connect(btnContourCalc->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourCalc );
960 Connect(btnContourHypo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnContourHypo );
962 Connect(fixContourWall->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourWall );
963 Connect(fixContourLumen->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourLumen );
964 Connect(fixContourCalc->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourCalc );
965 Connect(fixContourHypo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnReplaceContourHypo );
967 Connect(cbShowAllManual->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowAll );
968 Connect(cbShowWall->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowWall );
969 Connect(cbShowLumen->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowLumen );
970 Connect(cbShowCalc->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowCalc );
971 Connect(cbShowHypo->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &wxPnlManualContour::OnShowHypo );
976 //------------------------------------------------------------------------
977 void wxPnlManualContour::OnContourWall(wxCommandEvent& event)
979 _quantificationWidget_base->OnContourWall();
981 //------------------------------------------------------------------------
982 void wxPnlManualContour::OnContourLumen(wxCommandEvent& event)
984 _quantificationWidget_base->OnContourLumen();
986 //------------------------------------------------------------------------
987 void wxPnlManualContour::OnContourHypo(wxCommandEvent& event)
989 _quantificationWidget_base->OnContourHypo();
991 //------------------------------------------------------------------------
992 void wxPnlManualContour::OnContourCalc(wxCommandEvent& event)
994 _quantificationWidget_base->OnContourCalc();
997 //------------------------------------------------------------------------
998 void wxPnlManualContour::OnReplaceContourWall(wxCommandEvent& event)
1000 _quantificationWidget_base->OnReplaceContourWall();
1002 //------------------------------------------------------------------------
1003 void wxPnlManualContour::OnReplaceContourLumen(wxCommandEvent& event)
1005 _quantificationWidget_base->OnReplaceContourLumen();
1007 //------------------------------------------------------------------------
1008 void wxPnlManualContour::OnReplaceContourHypo(wxCommandEvent& event)
1010 _quantificationWidget_base->OnReplaceContourHypo();
1013 //------------------------------------------------------------------------
1014 void wxPnlManualContour::OnReplaceContourCalc(wxCommandEvent& event)
1016 _quantificationWidget_base->OnReplaceContourCalc();
1019 //------------------------------------------------------------------------
1020 void wxPnlManualContour::OnShowAll(wxCommandEvent& event)
1022 cbShowCalc->SetValue(cbShowAllManual->GetValue());
1023 cbShowHypo->SetValue(cbShowAllManual->GetValue());
1024 cbShowLumen->SetValue(cbShowAllManual->GetValue());
1025 cbShowWall->SetValue(cbShowAllManual->GetValue());
1026 _quantificationWidget_base->OnShowAll(cbShowAllManual->GetValue());
1030 //------------------------------------------------------------------------
1031 void wxPnlManualContour::OnShowWall(wxCommandEvent& event)
1033 _quantificationWidget_base->OnShowWall(cbShowWall->GetValue());
1035 //------------------------------------------------------------------------
1036 void wxPnlManualContour::OnShowLumen(wxCommandEvent& event)
1038 _quantificationWidget_base->OnShowLumen(cbShowLumen->GetValue());
1041 //------------------------------------------------------------------------
1042 void wxPnlManualContour::OnShowCalc(wxCommandEvent& event)
1044 _quantificationWidget_base->OnShowCalc(cbShowCalc->GetValue());
1047 //------------------------------------------------------------------------
1048 void wxPnlManualContour::OnShowHypo(wxCommandEvent& event)
1050 _quantificationWidget_base->OnShowHypo(cbShowHypo->GetValue());
1054 //------------------------------------------------------------------------
1055 //------------------------------------------------------------------------
1056 //------------------------------------------------------------------------
1057 wxPanelControlsHealthySickSliceCT::wxPanelControlsHealthySickSliceCT(wxWindow* parent,wxQuantificationWidget_base *quantificationWidget_base)
1058 : wxPanel(parent,-1)
1060 marDictionary marDict;
1062 // this->SetBackgroundColour(*wxLIGHT_GREY);
1065 //_quantificationWidget = quantificationWidget;
1067 wxNotebook *wxnotbook = new wxNotebook(this, -1);
1069 // wxnotbook->SetBackgroundColour(*wxLIGHT_GREY);
1071 wxPnlSearchStenosis *page1 = new wxPnlSearchStenosis( wxnotbook , quantificationWidget_base);
1072 wxPanelSizeHealthyRegion *page2 = new wxPanelSizeHealthyRegion (wxnotbook , quantificationWidget_base);
1073 wxPnlManualContour *page3 = new wxPnlManualContour( wxnotbook , quantificationWidget_base);
1074 wxPnlContourControl *page4 = new wxPnlContourControl( wxnotbook , quantificationWidget_base);
1075 wxnotbook->AddPage(page1, wxString(marDict.GetString(265), wxConvUTF8) ); //"Stenosis search "
1076 wxnotbook->AddPage(page2, wxString(marDict.GetString(360), wxConvUTF8) ); //"Healty region size "
1077 wxnotbook->AddPage(page3, wxString(marDict.GetString(800), wxConvUTF8) ); //"Contour modification"
1078 wxnotbook->AddPage(page4, wxString(marDict.GetString(940), wxConvUTF8) ); //"Contour Control"
1079 wxnotbook->SetSize(400,315);
1081 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
1082 sizer->Add(wxnotbook, 1, wxTOP|wxLEFT|wxRIGHT, 5);
1083 this->SetSizer(sizer);
1084 this->SetAutoLayout(true);
1086 this->SetSize(400,400);
1092 //------------------------------------------------------------------------
1093 //------------------------------------------------------------------------
1094 //------------------------------------------------------------------------
1112 //------------------------------------------------------------------------
1113 //------------------------------------------------------------------------
1114 //------------------------------------------------------------------------
1118 //--------------------------------------------------------------------------------
1120 //--------------------------------------------------------------------------------
1123 wxQuantificationWidget_base::wxQuantificationWidget_base(wxWindow* parent, wxWindowID id,
1124 const wxPoint& pos, const wxSize& size, long style,
1125 const wxString& name)
1126 : wxPanel( parent, id, pos, size, style, name )
1131 //--------------------------------------------------------------------------------
1133 // ----------------------------------------------------------------------------
1134 wxQuantificationWidget_base::~wxQuantificationWidget_base() // virtual
1139 // ----------------------------------------------------------------------------
1140 void wxQuantificationWidget_base::SetManualContour_ReplaceContour() // virtual
1144 // ----------------------------------------------------------------------------
1145 void wxQuantificationWidget_base::SetManualContour_2DWorld(bool ok) // virtual
1150 // ----------------------------------------------------------------------------
1151 void wxQuantificationWidget_base::SetManualContour_AddPoint_2DWorld() // virtual
1155 // ----------------------------------------------------------------------------
1156 void wxQuantificationWidget_base::SetAnalysisTypeStenosis(int analysisTypeStenosis) // virtual
1161 // ----------------------------------------------------------------------------
1162 int wxQuantificationWidget_base::GetActualSlice() // virtual
1167 // ----------------------------------------------------------------------------
1168 void wxQuantificationWidget_base::SetHealthySlice(int healthySlice) // virtual
1172 // ----------------------------------------------------------------------------
1173 void wxQuantificationWidget_base::GetSliceLimites(int type, int &sliceStart,int &sliceEnd)// virtual
1177 // ----------------------------------------------------------------------------
1178 void wxQuantificationWidget_base::Set3DStartRegionSliceActor( int type, int k )// virtual
1182 // ----------------------------------------------------------------------------
1183 void wxQuantificationWidget_base::RefreshAxis( )// virtual
1187 //------------------------------------------------------------------------
1188 void wxQuantificationWidget_base::OnContourWall()// virtual
1192 //------------------------------------------------------------------------
1193 void wxQuantificationWidget_base::OnContourLumen()// virtual
1197 //------------------------------------------------------------------------
1198 void wxQuantificationWidget_base::OnContourHypo()// virtual
1202 //------------------------------------------------------------------------
1203 void wxQuantificationWidget_base::OnContourCalc()// virtual
1207 //------------------------------------------------------------------------
1208 void wxQuantificationWidget_base::OnReplaceContourWall()// virtual
1211 //------------------------------------------------------------------------
1212 void wxQuantificationWidget_base::OnReplaceContourLumen()// virtual
1215 //------------------------------------------------------------------------
1216 void wxQuantificationWidget_base::OnReplaceContourHypo()// virtual
1220 //------------------------------------------------------------------------
1221 void wxQuantificationWidget_base::OnReplaceContourCalc()// virtual
1225 //------------------------------------------------------------------------
1226 void wxQuantificationWidget_base::OnSliderDiscontinuityScroll(int percentage) // virtual
1230 //------------------------------------------------------------------------
1231 void wxQuantificationWidget_base::OnSliderLumenPercentageScroll(int percentage) // virtual
1235 //------------------------------------------------------------------------
1236 void wxQuantificationWidget_base::OnSliderCalcPercentageScroll(int percentage) // virtual
1240 //------------------------------------------------------------------------
1241 void wxQuantificationWidget_base::OnCalibration() //virtual
1245 //------------------------------------------------------------------------
1246 void wxQuantificationWidget_base::OnFile() //virtual
1251 // ----------------------------------------------------------------------------
1252 kVolume *wxQuantificationWidget_base::GetVolumeAxisExtended(int wz1,int wz2)// virtual
1257 // ----------------------------------------------------------------------------
1258 int wxQuantificationWidget_base::GetMaxActualSlice()// virtual
1263 // ----------------------------------------------------------------------------
1264 void wxQuantificationWidget_base::Set3DRegionSliceActor( int type, int k1,int k2 )// virtual
1268 // ----------------------------------------------------------------------------
1269 void wxQuantificationWidget_base::DetectHealthySickSlice( bool minSurf , bool maxSurf )// virtual
1273 // ----------------------------------------------------------------------------
1274 void wxQuantificationWidget_base::Show3DStartRegionSliceActor(int type ) // virtual
1279 // ----------------------------------------------------------------------------
1280 void wxQuantificationWidget_base::Set3DEndRegionSliceActor( int type, int k ) // virtual
1284 // ----------------------------------------------------------------------------
1285 void wxQuantificationWidget_base::Show3DEndRegionSliceActor(int type ) // virtual
1290 // ----------------------------------------------------------------------------
1291 void wxQuantificationWidget_base::Hide3DStartRegionSliceActor(int type ) // virtual
1295 // ----------------------------------------------------------------------------
1296 void wxQuantificationWidget_base::Hide3DEndRegionSliceActor(int type ) // virtual
1300 // ----------------------------------------------------------------------------
1301 int wxQuantificationWidget_base::GetSizeHealthyRegion() // virtual
1306 // ----------------------------------------------------------------------------
1307 void wxQuantificationWidget_base::SetSizeHealthyRegion(int size) // virtual
1310 // ----------------------------------------------------------------------------
1311 int wxQuantificationWidget_base::GetHealthySlice() // virtual
1316 //------------------------------------------------------------------------
1317 void wxQuantificationWidget_base::OnShowAll(bool value) // virtual
1322 //------------------------------------------------------------------------
1323 void wxQuantificationWidget_base::OnShowWall(bool value) // virtual
1326 //------------------------------------------------------------------------
1327 void wxQuantificationWidget_base::OnShowLumen(bool value) // virtual
1331 //------------------------------------------------------------------------
1332 void wxQuantificationWidget_base::OnShowCalc(bool value) // virtual
1336 //------------------------------------------------------------------------
1337 void wxQuantificationWidget_base::OnShowHypo(bool value) // virtual