1 /*=========================================================================
4 Module: $RCSfile: wxMaracasParametersDialog.cxx,v $
6 Date: $Date: 2008/10/31 16:32:10 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
18 #include "wxMaracasParametersDialog.h"
19 #include "marDictionary.h"
21 // ----------------------------------------------------------------------------
22 BEGIN_EVENT_TABLE( wxMaracasParametersDialog, wxDialog )
23 EVT_BUTTON( wxID_OK, wxMaracasParametersDialog::OnOk )
24 EVT_BUTTON( wxID_CANCEL, wxMaracasParametersDialog::OnCancel )
25 EVT_BUTTON( ID_BTN_DEFAULT, wxMaracasParametersDialog::OnDefault )
26 EVT_BUTTON( ID_BTN_RESET, wxMaracasParametersDialog::OnReset )
27 EVT_BUTTON( ID_BTN_APPLY, wxMaracasParametersDialog::OnApply )
28 // PS -> EVT_BUTTON( ID_BTN_BROWSE_WORK_DIR, wxMaracasParametersDialog::OnBrowseWorkDir )
29 // PS -> EVT_BUTTON( ID_BTN_BROWSE_DICOM_DIR, wxMaracasParametersDialog::OnBrowseDICOMDir )
30 // PS -> EVT_BUTTON( ID_BTN_3D_BACK_COLOR, wxMaracasParametersDialog::OnChoose3DColor )
31 // PS -> EVT_BUTTON( ID_BTN_AXIS_COLOR, wxMaracasParametersDialog::OnChooseAxisColor )
34 // ----------------------------------------------------------------------------
35 wxMaracasParametersDialog::wxMaracasParametersDialog( wxWindow* parent, marInterface* mar )
36 : wxParametersDialog( parent, -1, _T(""))
45 // ----------------------------------------------------------------------------
46 void wxMaracasParametersDialog::Reset( )
48 // PS -> // wxColour col, col2;
52 // PS -> // edtWorkDir->SetValue( _mar->_parameters->getStringParam( marParameters::e_installation_directory ) );
53 // PS -> edtDICOMDir->SetValue( _mar->_parameters->getStringParam( marParameters::e_dicom_images_directory ) );
54 // PS -> chkMIP->SetValue( _mar->_parameters->getBoolParam( marParameters::e_calculate_mip_default ) );
55 // PS -> chkSlices->SetValue( _mar->_parameters->getBoolParam( marParameters::e_choose_all_slices_default ) );
56 // PS -> chkDebugWindow->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_window_visible ) );
57 // PS -> chkConsole->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_console_visible ) );
59 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_r ),
60 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_g ),
61 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_b )
63 // PS -> // btn3DBackColor->SetBackgroundColour( col );
66 edtThresholdIsoContours->SetValue( wxString::Format( _T("%.2f"),
67 _mar->_parameters->getDoubleParam( marParameters::e_threshold_isocontour ) ) );
68 // PS -> // edtThresholdSnake->SetValue( wxString::Format( "%.4f",
69 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_threshold_snake_isocontour ) ) );
70 // PS -> // edtIterationsSnake->SetValue( wxString::Format( "%d",
71 // PS -> // _mar->_parameters->getIntParam( marParameters::e_number_of_iterations_snake_isocontour ) ) );
72 // PS -> // edtExternCoefSnake->SetValue( wxString::Format( "%.4f",
73 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_extern_coeficient ) ) );
74 // PS -> // edtIterationsDeriche->SetValue( wxString::Format( "%d",
75 // PS -> // _mar->_parameters->getIntParam( marParameters::e_number_of_iterations_snake_deriche ) ) );
76 // PS -> // edtBallonCoefDeriche->SetValue( wxString::Format( "%.4f",
77 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_ballon_coeficient ) ) );
78 // PS -> // edtGradientCoefDeriche->SetValue( wxString::Format( "%.4f",
79 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_gradient_coeficient ) ) );
80 // PS -> // edtSigmaDeriche->SetValue( wxString::Format( "%.4f",
81 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_sigma ) ) );
82 // PS -> // edtScale->SetValue( wxString::Format( "%.4f",
83 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_scale ) ) );
84 // PS -> // edtSample->SetValue( wxString::Format( "%.4f",
85 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_sampling ) ) );
86 //EED chkIsoContoursVis->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_isocontour ) );
87 //EED chkDiametersVis->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_diameters ) );
88 //EED chkInvertSliceOrder->SetValue( _mar->_parameters->getBoolParam( marParameters::e_invest_slice_order ) );
89 // PS -> // chkFillContours->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_fill_area ) );
90 // PS -> // radIsoContours->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::ISOCONTOURS );
91 // PS -> // radSnake->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::SNAKE );
92 // PS -> // radDeriche->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::DERICHE );
96 // PS -> // edtDistanceCdg->SetValue( wxString::Format( "%.4f",
97 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_gravity_distance ) ) );
98 edtFlexionCoef->SetValue( wxString::Format( _T("%g"),
99 _mar->_parameters->getDoubleParam( marParameters::e_flexion_coeficient ) ) );
100 edtTensionCoef->SetValue( wxString::Format( _T("%g"),
101 _mar->_parameters->getDoubleParam( marParameters::e_tension_coeficient ) ) );
102 int sizemask = _mar->_parameters->getIntParam( marParameters::e_mask_size );
103 sizemask=(sizemask-1)/2;
104 edtMaskSize->SetValue( wxString::Format( _T("%d"), sizemask ) );
105 edtDiscreetStep->SetValue( wxString::Format( _T("%#.2f"),
106 _mar->_parameters->getDoubleParam( marParameters::e_axis_discret_step ) ) );
107 // PS -> // edtVoxelX->SetValue( wxString::Format( "%.4f",
108 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_x_dimension ) ) );
109 // PS -> // edtVoxelY->SetValue( wxString::Format( "%.4f",
110 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_y_dimension ) ) );
111 // PS -> // edtVoxelZ->SetValue( wxString::Format( "%.4f",
112 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_z_dimension ) ) );
113 // PS -> edtDistanceInt->SetValue( wxString::Format( "%.4f",
114 // PS -> _mar->_parameters->getDoubleParam( marParameters::e_distance_to_maximum_intensity ) ) );
115 // PS -> edtCellMaxIntCoef->SetValue( wxString::Format( "%d",
116 // PS -> _mar->_parameters->getIntParam( marParameters::e_coef_cell_max_int ) ) );
117 // PS -> edtCellCoef->SetValue( wxString::Format( "%.4f",
118 // PS -> _mar->_parameters->getDoubleParam( marParameters::e_cell_coeficient ) ) );
119 // PS -> edtStepCoef->SetValue( wxString::Format( "%d",
120 // PS -> _mar->_parameters->getIntParam( marParameters::e_step_coeficient ) ) );
121 // PS -> edtMassPower->SetValue( wxString::Format( "%d",
122 // PS -> _mar->_parameters->getIntParam( marParameters::e_mass_power ) ) );
123 // PS -> edtROIDimension->SetValue( wxString::Format( "%d",
124 // PS -> _mar->_parameters->getIntParam( marParameters::e_roi_dimension ) ) );
125 // PS -> edtStep->SetValue( wxString::Format( "%d",
126 // PS -> _mar->_parameters->getIntParam( marParameters::e_step ) ) );
127 // PS -> // chkShowCell->SetValue( _mar->_parameters->getBoolParam( marParameters::e_show_cell ) );
128 // PS -> // chkShowIntCell->SetValue( _mar->_parameters->getBoolParam( marParameters::e_show_int_cell ) );
129 // PS -> // radMinimum->SetValue( _mar->_parameters->getIntParam( marParameters::e_voxel_type ) == marParameters::VOX_TYPE_MINIMUM );
130 // PS -> // radNormal->SetValue( _mar->_parameters->getIntParam( marParameters::e_voxel_type ) == marParameters::VOX_TYPE_NORMAL );
131 // PS -> // col2.Set(
132 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_r ),
133 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_g ),
134 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_b )
136 // PS -> // btnAxisColor->SetBackgroundColour( col2 );
139 // Quantification parameters
140 qt = _mar->_parameters->getIntParam( marParameters::e_quantification_type );
141 st = _mar->_parameters->getIntParam( marParameters::e_stenosis_type );
144 chkArea->SetValue( ( qt & marParameters::TYPE_AREA ) == marParameters::TYPE_AREA );
145 chkPerimeter->SetValue( ( qt & marParameters::TYPE_PERIMETER ) == marParameters::TYPE_PERIMETER );
146 chkDiameterFromArea->SetValue( ( qt & marParameters::TYPE_DIAMETER_FROM_AREA ) == marParameters::TYPE_DIAMETER_FROM_AREA );
147 chkDiameterFromPerimeter->SetValue( ( qt & marParameters::TYPE_DIAMETER_FROM_PERIMETER ) == marParameters::TYPE_DIAMETER_FROM_PERIMETER );
148 chkMinimumDiameter->SetValue( ( qt & marParameters::TYPE_MINIMUM_DIAMETER ) == marParameters::TYPE_MINIMUM_DIAMETER );
149 chkMaximumDiameter->SetValue( ( qt & marParameters::TYPE_MAXIMUM_DIAMETER ) == marParameters::TYPE_MAXIMUM_DIAMETER );
150 chkAverageDiameter->SetValue( ( qt & marParameters::TYPE_AVERAGE_DIAMETER ) == marParameters::TYPE_AVERAGE_DIAMETER );
151 radArea->SetValue( st == marParameters::TYPE_AREA );
152 radPerimeter->SetValue( st == marParameters::TYPE_PERIMETER );
153 radDiameterFromArea->SetValue( st == marParameters::TYPE_DIAMETER_FROM_AREA );
154 radDiameterFromPerimeter->SetValue( st == marParameters::TYPE_DIAMETER_FROM_PERIMETER );
155 radMinimumDiameter->SetValue( st == marParameters::TYPE_MINIMUM_DIAMETER );
156 radMaximumDiameter->SetValue( st == marParameters::TYPE_MAXIMUM_DIAMETER );
157 radAverageDiameter->SetValue( st == marParameters::TYPE_AVERAGE_DIAMETER );
160 // ----------------------------------------------------------------------------
161 bool wxMaracasParametersDialog::Apply( )
163 marDictionary marDict;
166 bool alertRegenerateAll = false;
167 bool alertRegenerateSignal = false;
168 bool alertClearContours = false;
169 bool alertRegenerateSplineAxe = false;
171 wxMessageDialog *wxdiag;
174 if ( _bak_edtMaskSize_String.CompareTo( edtMaskSize->GetValue().GetData() )!=0 ) {
175 alertRegenerateSignal=true;
176 strcpy(tmp , marDict.GetString(605) ); strcat(tmp,"\n");
177 wxtext=wxString(tmp, wxConvUTF8); //"The mask size was modified. \n"
179 if ( _bak_edtThresholdIsoContours_String.CompareTo( edtThresholdIsoContours->GetValue().GetData() )!=0 ) {
180 alertClearContours=true;
181 strcpy(tmp , marDict.GetString(610) ); strcat(tmp,"\n");
182 wxtext=wxString(tmp, wxConvUTF8); //"The threshold was modified. \n"
184 if ( _bak_edtFlexionCoef_String.CompareTo( edtFlexionCoef->GetValue().GetData() )!=0 ) {
185 alertRegenerateAll=true;
186 strcpy(tmp , marDict.GetString(615) ); strcat(tmp,"\n");
187 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The flexion coeficient was modified.\n"
189 if ( _bak_edtTensionCoef_String.CompareTo( edtTensionCoef->GetValue().GetData() )!=0 ) {
190 alertRegenerateAll=true;
191 strcpy(tmp , marDict.GetString(620) ); strcat(tmp,"\n");
192 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The tension coeficient was modified.\n"
194 if ( _bak_edtDiscreetStep_String.CompareTo( edtDiscreetStep->GetValue().GetData() )!=0 ) {
195 alertRegenerateSplineAxe=true;
196 strcpy(tmp , marDict.GetString(625) ); strcat(tmp,"\n");
197 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The discret step of the axis was modified.\n"
200 if ((alertRegenerateAll==true) ||(alertRegenerateSplineAxe==true) ) {
201 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(630) ); strcat(tmp,"\n");
202 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"\n The axe will be regenereted and the contours will be eresed. \n"
204 if ((alertRegenerateAll==true) ||(alertRegenerateSplineAxe==true) ) {
205 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(635) ); strcat(tmp,"\n");
206 wxtext=wxtext+wxString(tmp, wxConvUTF8); //"\n All contours will be erase. \n"
210 if ( (alertRegenerateAll==true) ||
211 (alertClearContours==true) ||
212 (alertRegenerateSignal==true) ||
213 (alertRegenerateSplineAxe==true) ) {
214 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(640) );
215 wxdiag= new wxMessageDialog(this, wxtext + wxString(tmp, wxConvUTF8), wxString(marDict.GetString(645), wxConvUTF8), wxOK | wxCANCEL);//"\n Do you want to continue?" "Alert"
216 if ( wxdiag->ShowModal() != wxID_OK ) {
223 // PS -> // wxColour col;
228 // General parameters
230 // PS -> // _mar->_parameters->setStringParam( marParameters::e_installation_directory, edtWorkDir->GetValue( ) );
231 // PS -> _mar->_parameters->setStringParam( marParameters::e_dicom_images_directory, edtDICOMDir->GetValue( ) );
233 // PS -> _mar->_parameters->setBoolParam( marParameters::e_calculate_mip_default, chkMIP->GetValue( ) );
234 // PS -> _mar->_parameters->setBoolParam( marParameters::e_choose_all_slices_default, chkSlices->GetValue( ) );
235 // PS -> _mar->_parameters->setBoolParam( marParameters::e_debug_window_visible, chkDebugWindow->GetValue( ) );
236 // PS -> _mar->_parameters->setBoolParam( marParameters::e_debug_console_visible, chkConsole->GetValue( ) );
238 // PS -> // col = btn3DBackColor->GetBackgroundColour( );
239 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_r, col.Red( ) );
240 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_g, col.Green( ) );
241 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_b, col.Blue( ) );
243 // PS -> // Axis parameters
244 // PS -> // if (!edtDistanceCdg->GetValue( ).ToDouble( &td ))
245 // PS -> // return false;
246 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_gravity_distance, td );
248 if (!edtFlexionCoef->GetValue( ).ToDouble( &td ))
250 _mar->_parameters->setDoubleParam( marParameters::e_flexion_coeficient, td );
252 if (!edtTensionCoef->GetValue( ).ToDouble( &td ))
254 _mar->_parameters->setDoubleParam( marParameters::e_tension_coeficient, td );
256 if (!edtDiscreetStep->GetValue( ).ToDouble( &td ))
258 _mar->_parameters->setDoubleParam( marParameters::e_axis_discret_step, td );
260 // PS -> // if (!edtVoxelX->GetValue( ).ToDouble( &td ))
261 // PS -> // return false;
262 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, td );
264 // PS -> // if (!edtVoxelY->GetValue( ).ToDouble( &td ))
265 // PS -> // return false;
266 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, td );
268 // PS -> // if (!edtVoxelZ->GetValue( ).ToDouble( &td ))
269 // PS -> // return false;
270 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, td );
272 // PS -> if (!edtDistanceInt->GetValue( ).ToDouble( &td ))
273 // PS -> return false;
274 // PS -> _mar->_parameters->setDoubleParam( marParameters::e_distance_to_maximum_intensity, td );
276 // PS -> if (!edtCellCoef->GetValue( ).ToDouble( &td ))
277 // PS -> return false;
278 // PS -> _mar->_parameters->setDoubleParam( marParameters::e_cell_coeficient, td );
280 if (!edtMaskSize->GetValue( ).ToLong( &tl ))
282 _mar->_parameters->setIntParam( marParameters::e_mask_size, ( int )tl * 2 +1);
284 // PS -> if (!edtCellMaxIntCoef->GetValue( ).ToLong( &tl ))
285 // PS -> return false;
286 // PS -> _mar->_parameters->setIntParam( marParameters::e_coef_cell_max_int, ( int )tl );
288 // PS -> if (!edtStepCoef->GetValue( ).ToLong( &tl ))
289 // PS -> return false;
290 // PS -> _mar->_parameters->setIntParam( marParameters::e_step_coeficient, ( int )tl );
292 // PS -> if (!edtMassPower->GetValue( ).ToLong( &tl ))
293 // PS -> return false;
294 // PS -> _mar->_parameters->setIntParam( marParameters::e_mass_power, ( int )tl );
296 // PS -> if (!edtROIDimension->GetValue( ).ToLong( &tl ))
297 // PS -> return false;
298 // PS -> _mar->_parameters->setIntParam( marParameters::e_roi_dimension, ( int )tl );
300 // PS -> if (!edtStep->GetValue( ).ToLong( &tl ))
301 // PS -> return false;
302 // PS -> _mar->_parameters->setIntParam( marParameters::e_step, ( int )tl );
304 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_show_cell, chkShowCell->GetValue( ) );
305 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_show_int_cell, chkShowIntCell->GetValue( ) );
307 // PS -> // _mar->_parameters->setIntParam( marParameters::e_voxel_type, radNormal->GetValue( ) ? marParameters::VOX_TYPE_NORMAL: marParameters::VOX_TYPE_MINIMUM );
309 // PS -> // wxColour col2 = btnAxisColor->GetBackgroundColour( );
310 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_r, col2.Red( ) );
311 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_g, col2.Green( ) );
312 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_b, col2.Blue( ) );
314 // Contour parameters
315 if (!edtThresholdIsoContours->GetValue( ).ToDouble( &td ))
317 _mar->_parameters->setDoubleParam( marParameters::e_threshold_isocontour, td );
319 // PS -> // if (!edtThresholdSnake->GetValue( ).ToDouble( &td ))
320 // PS -> // return false;
321 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_threshold_snake_isocontour, td );
323 // PS -> // if (!edtExternCoefSnake->GetValue( ).ToDouble( &td ))
324 // PS -> // return false;
325 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_extern_coeficient, td );
327 // PS -> // if (!edtBallonCoefDeriche->GetValue( ).ToDouble( &td ))
328 // PS -> // return false;
329 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_ballon_coeficient, td );
331 // PS -> // if (!edtGradientCoefDeriche->GetValue( ).ToDouble( &td ))
332 // PS -> // return false;
333 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_gradient_coeficient, td );
335 // PS -> // if (!edtSigmaDeriche->GetValue( ).ToDouble( &td ))
336 // PS -> // return false;
337 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_sigma, td );
339 // PS -> // if (!edtScale->GetValue( ).ToDouble( &td ))
340 // PS -> // return false;
341 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_scale, td );
343 // PS -> // if (!edtSample->GetValue( ).ToDouble( &td ))
344 // PS -> // return false;
345 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_sampling, td );
347 // PS -> // if (!edtIterationsSnake->GetValue( ).ToLong( &tl ))
348 // PS -> // return false;
349 // PS -> // _mar->_parameters->setIntParam( marParameters::e_number_of_iterations_snake_isocontour, ( int )tl );
351 // PS -> // if (!edtIterationsDeriche->GetValue( ).ToLong( &tl ))
352 // PS -> // return false;
353 // PS -> // _mar->_parameters->setIntParam( marParameters::e_number_of_iterations_snake_deriche, ( int )tl );
355 //EED _mar->_parameters->setBoolParam( marParameters::e_debug_isocontour, chkIsoContoursVis->GetValue( ) );
356 //EED _mar->_parameters->setBoolParam( marParameters::e_debug_diameters, chkDiametersVis->GetValue( ) );
357 //EED _mar->_parameters->setBoolParam( marParameters::e_invest_slice_order, chkInvertSliceOrder->GetValue( ) );
358 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_debug_fill_area, chkFillContours->GetValue( ) );
360 // PS -> // ti = radIsoContours->GetValue( ) ? marParameters::ISOCONTOURS: ti;
361 // PS -> // ti = radSnake->GetValue( ) ? marParameters::SNAKE: ti;
362 // PS -> // ti = radDeriche->GetValue( ) ? marParameters::DERICHE: ti;
363 ti = marParameters::ISOCONTOURS;
364 _mar->_parameters->setIntParam( marParameters::e_algorithm_type, ti );
367 // Quantification parameters
369 ti |= chkArea->GetValue( ) ? marParameters::TYPE_AREA: 0;
370 ti |= chkPerimeter->GetValue( ) ? marParameters::TYPE_PERIMETER: 0;
371 ti |= chkDiameterFromArea->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_AREA: 0;
372 ti |= chkDiameterFromPerimeter->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_PERIMETER: 0;
373 ti |= chkMinimumDiameter->GetValue( ) ? marParameters::TYPE_MINIMUM_DIAMETER: 0;
374 ti |= chkMaximumDiameter->GetValue( ) ? marParameters::TYPE_MAXIMUM_DIAMETER: 0;
375 ti |= chkAverageDiameter->GetValue( ) ? marParameters::TYPE_AVERAGE_DIAMETER: 0;
376 _mar->_parameters->setIntParam( marParameters::e_quantification_type, ti );
378 ti = radArea->GetValue( ) ? marParameters::TYPE_AREA: ti;
379 ti = radPerimeter->GetValue( ) ? marParameters::TYPE_PERIMETER: ti;
380 ti = radDiameterFromArea->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_AREA: ti;
381 ti = radDiameterFromPerimeter->GetValue( )? marParameters::TYPE_DIAMETER_FROM_PERIMETER: ti;
382 ti = radMinimumDiameter->GetValue( ) ? marParameters::TYPE_MINIMUM_DIAMETER: ti;
383 ti = radMaximumDiameter->GetValue( ) ? marParameters::TYPE_MAXIMUM_DIAMETER: ti;
384 ti = radAverageDiameter->GetValue( ) ? marParameters::TYPE_AVERAGE_DIAMETER: ti;
385 _mar->_parameters->setIntParam( marParameters::e_stenosis_type, ti );
390 if (alertRegenerateAll==true){
391 wxCommandEvent ev19999(wxEVT_COMMAND_MENU_SELECTED,19999);
392 _parent->ProcessEvent( ev19999 );
396 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(true); }
397 if ( wxwin3DBrowser!=NULL ) { wxwin3DBrowser->Clean3D(); }
398 // Model Regeneration
399 _mar->_experiment->RegenerateAxis();
401 if ( wxwinquan!=NULL ) {
402 wxwinquan->AddAxisActors();
403 wxwinquan->RefreshAxis();
405 if ( wxwin3DBrowser!=NULL ) {
406 wxwin3DBrowser->AddAxisActors();
407 wxwin3DBrowser->RefreshAxis();
412 if (alertRegenerateSplineAxe==true){
413 wxCommandEvent ev19998(wxEVT_COMMAND_MENU_SELECTED,19998);
414 _parent->ProcessEvent( ev19998 );
417 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(true); }
418 if ( wxwin3DBrowser!=NULL ) { wxwin3DBrowser->Clean3D(); }
419 // Model Regeneration
420 _mar->_experiment->RecalculateAxis();
422 if ( wxwinquan!=NULL ) {
423 wxwinquan->AddAxisActors();
424 wxwinquan->RefreshAxis();
426 if ( wxwin3DBrowser!=NULL ) {
427 wxwin3DBrowser->AddAxisActors();
428 wxwin3DBrowser->RefreshAxis();
434 if (alertClearContours==true) {
435 wxCommandEvent ev19997(wxEVT_COMMAND_MENU_SELECTED,19997);
436 _parent->ProcessEvent( ev19997 );
439 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(false); }
440 // Model Regeneration
441 _mar->_experiment->ClearContours();
443 if ( wxwinquan!=NULL ) { wxwinquan->RefreshAxis(); }
447 if (alertRegenerateSignal==true) {
448 wxCommandEvent ev19996(wxEVT_COMMAND_MENU_SELECTED,19996);
449 _parent->ProcessEvent( ev19996 );
452 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(false); }
453 // Model Regeneration
454 _mar->_experiment->RegenerateSignal();
456 if ( wxwinquan!=NULL ) { wxwinquan->RefreshAxis(); }
464 if (!_mar->saveParameters( ))
471 // ----------------------------------------------------------------------------
472 void wxMaracasParametersDialog::SetBakEdit(){
473 _bak_edtThresholdIsoContours_String = edtThresholdIsoContours->GetValue();
474 _bak_edtFlexionCoef_String = edtFlexionCoef->GetValue();
475 _bak_edtTensionCoef_String = edtTensionCoef->GetValue();
476 _bak_edtMaskSize_String = edtMaskSize->GetValue();
477 _bak_edtDiscreetStep_String = edtDiscreetStep->GetValue();
479 // ----------------------------------------------------------------------------
480 void wxMaracasParametersDialog::OnOk( wxCommandEvent& WXUNUSED( event ) )
485 wxMessageDialog(this,_T("Error : Bad Parameters"),_T("Error"),wxOK|wxICON_ERROR).ShowModal();
488 // ----------------------------------------------------------------------------
489 void wxMaracasParametersDialog::OnCancel( wxCommandEvent& WXUNUSED( event ) )
491 EndModal( wxID_CANCEL );
493 // ----------------------------------------------------------------------------
494 void wxMaracasParametersDialog::OnReset( wxCommandEvent& WXUNUSED( event ) )
499 // ----------------------------------------------------------------------------
500 void wxMaracasParametersDialog::OnDefault( wxCommandEvent& WXUNUSED( event ) )
502 _mar->_parameters->reset();
506 // ----------------------------------------------------------------------------
507 void wxMaracasParametersDialog::OnApply( wxCommandEvent& WXUNUSED( event ) )
511 wxMessageDialog(this,_T("Error : Bad Parameters"),_T("Error"),wxOK|wxICON_ERROR).ShowModal();
515 // ----------------------------------------------------------------------------
516 // PS -> void wxMaracasParametersDialog::OnBrowseWorkDir( wxCommandEvent& WXUNUSED( event ) )
518 // PS -> // wxString dirHome = edtWorkDir->GetValue( );
519 // PS -> // wxDirDialog dialog( this, "Choose a work directory...", ( !dirHome.IsEmpty( ) )? dirHome: wxGetHomeDir( ) );
521 // PS -> // if( dialog.ShowModal( ) == wxID_OK ) {
522 // PS -> // edtWorkDir->SetValue( dialog.GetPath( ) );
523 // PS -> //! \todo if dir has change ... should update marGdcm
527 // ----------------------------------------------------------------------------
528 // PS -> void wxMaracasParametersDialog::OnBrowseDICOMDir( wxCommandEvent& WXUNUSED( event ) )
530 // PS -> wxString dirHome = edtDICOMDir->GetValue( );
531 // PS -> wxDirDialog dialog( this, "Choose a DICOM directory...", ( !dirHome.IsEmpty( ) )? dirHome: wxGetHomeDir( ) );
533 // PS -> if( dialog.ShowModal( ) == wxID_OK )
534 // PS -> edtDICOMDir->SetValue( dialog.GetPath( ) );
536 // ----------------------------------------------------------------------------
537 // PS -> void wxMaracasParametersDialog::OnChoose3DColor( wxCommandEvent& WXUNUSED( event ) )
539 // PS -> // wxColourData data;
540 // PS -> // data.SetChooseFull( true );
541 // PS -> // for( int i = 0; i < 16; i++ )
543 // PS -> // wxColour colour( i * 16, i * 16, i * 16 );
544 // PS -> // data.SetCustomColour( i, colour );
547 // PS -> // wxColourDialog dialog ( this, &data );
548 // PS -> // dialog.SetTitle( "Choose a 3D background color" );
549 // PS -> // if( dialog.ShowModal( ) == wxID_OK )
551 // PS -> // wxColourData retData = dialog.GetColourData( );
552 // PS -> // wxColour col = retData.GetColour( );
553 // PS -> // btn3DBackColor->SetBackgroundColour( col );
557 // ----------------------------------------------------------------------------
558 // PS -> void wxMaracasParametersDialog::OnChooseAxisColor( wxCommandEvent& WXUNUSED( event ) )
560 // PS -> // wxColourData data;
561 // PS -> // data.SetChooseFull( true );
562 // PS -> // for( int i = 0; i < 16; i++ )
564 // PS -> // wxColour colour( i * 16, i * 16, i * 16 );
565 // PS -> // data.SetCustomColour( i, colour );
568 // PS -> // wxColourDialog dialog ( this, &data );
569 // PS -> // dialog.SetTitle( "Choose an axis color" );
570 // PS -> // if( dialog.ShowModal( ) == wxID_OK )
572 // PS -> // wxColourData retData = dialog.GetColourData( );
573 // PS -> // wxColour col = retData.GetColour( );
574 // PS -> // btnAxisColor->SetBackgroundColour( col );
578 // EOF - wxGeneralParametersDialog.cxx