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: wxMaracasParametersDialog.cxx,v $
31 Date: $Date: 2012/11/15 14:14:56 $
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 "wxMaracasParametersDialog.h"
44 #include "marDictionary.h"
46 // ----------------------------------------------------------------------------
47 BEGIN_EVENT_TABLE( wxMaracasParametersDialog, wxDialog )
48 EVT_BUTTON( wxID_OK, wxMaracasParametersDialog::OnOk )
49 EVT_BUTTON( wxID_CANCEL, wxMaracasParametersDialog::OnCancel )
50 EVT_BUTTON( ID_BTN_DEFAULT, wxMaracasParametersDialog::OnDefault )
51 EVT_BUTTON( ID_BTN_RESET, wxMaracasParametersDialog::OnReset )
52 EVT_BUTTON( ID_BTN_APPLY, wxMaracasParametersDialog::OnApply )
53 // PS -> EVT_BUTTON( ID_BTN_BROWSE_WORK_DIR, wxMaracasParametersDialog::OnBrowseWorkDir )
54 // PS -> EVT_BUTTON( ID_BTN_BROWSE_DICOM_DIR, wxMaracasParametersDialog::OnBrowseDICOMDir )
55 // PS -> EVT_BUTTON( ID_BTN_3D_BACK_COLOR, wxMaracasParametersDialog::OnChoose3DColor )
56 // PS -> EVT_BUTTON( ID_BTN_AXIS_COLOR, wxMaracasParametersDialog::OnChooseAxisColor )
59 // ----------------------------------------------------------------------------
60 wxMaracasParametersDialog::wxMaracasParametersDialog( wxWindow* parent, marInterface* mar )
61 : wxParametersDialog( parent, -1, _T(""))
70 // ----------------------------------------------------------------------------
71 void wxMaracasParametersDialog::Reset( )
73 // PS -> // wxColour col, col2;
77 // PS -> // edtWorkDir->SetValue( _mar->_parameters->getStringParam( marParameters::e_installation_directory ) );
78 // PS -> edtDICOMDir->SetValue( _mar->_parameters->getStringParam( marParameters::e_dicom_images_directory ) );
79 // PS -> chkMIP->SetValue( _mar->_parameters->getBoolParam( marParameters::e_calculate_mip_default ) );
80 // PS -> chkSlices->SetValue( _mar->_parameters->getBoolParam( marParameters::e_choose_all_slices_default ) );
81 // PS -> chkDebugWindow->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_window_visible ) );
82 // PS -> chkConsole->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_console_visible ) );
84 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_r ),
85 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_g ),
86 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_back_color_3D_b )
88 // PS -> // btn3DBackColor->SetBackgroundColour( col );
91 edtThresholdIsoContours->SetValue( wxString::Format( _T("%.2f"),
92 _mar->_parameters->getDoubleParam( marParameters::e_threshold_isocontour ) ) );
93 // PS -> // edtThresholdSnake->SetValue( wxString::Format( "%.4f",
94 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_threshold_snake_isocontour ) ) );
95 // PS -> // edtIterationsSnake->SetValue( wxString::Format( "%d",
96 // PS -> // _mar->_parameters->getIntParam( marParameters::e_number_of_iterations_snake_isocontour ) ) );
97 // PS -> // edtExternCoefSnake->SetValue( wxString::Format( "%.4f",
98 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_extern_coeficient ) ) );
99 // PS -> // edtIterationsDeriche->SetValue( wxString::Format( "%d",
100 // PS -> // _mar->_parameters->getIntParam( marParameters::e_number_of_iterations_snake_deriche ) ) );
101 // PS -> // edtBallonCoefDeriche->SetValue( wxString::Format( "%.4f",
102 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_ballon_coeficient ) ) );
103 // PS -> // edtGradientCoefDeriche->SetValue( wxString::Format( "%.4f",
104 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_gradient_coeficient ) ) );
105 // PS -> // edtSigmaDeriche->SetValue( wxString::Format( "%.4f",
106 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_sigma ) ) );
107 // PS -> // edtScale->SetValue( wxString::Format( "%.4f",
108 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_scale ) ) );
109 // PS -> // edtSample->SetValue( wxString::Format( "%.4f",
110 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_sampling ) ) );
111 //EED chkIsoContoursVis->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_isocontour ) );
112 //EED chkDiametersVis->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_diameters ) );
113 //EED chkInvertSliceOrder->SetValue( _mar->_parameters->getBoolParam( marParameters::e_invest_slice_order ) );
114 // PS -> // chkFillContours->SetValue( _mar->_parameters->getBoolParam( marParameters::e_debug_fill_area ) );
115 // PS -> // radIsoContours->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::ISOCONTOURS );
116 // PS -> // radSnake->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::SNAKE );
117 // PS -> // radDeriche->SetValue( _mar->_parameters->getIntParam( marParameters::e_algorithm_type ) == marParameters::DERICHE );
121 // PS -> // edtDistanceCdg->SetValue( wxString::Format( "%.4f",
122 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_gravity_distance ) ) );
123 edtFlexionCoef->SetValue( wxString::Format( _T("%g"),
124 _mar->_parameters->getDoubleParam( marParameters::e_flexion_coeficient ) ) );
125 edtTensionCoef->SetValue( wxString::Format( _T("%g"),
126 _mar->_parameters->getDoubleParam( marParameters::e_tension_coeficient ) ) );
127 int sizemask = _mar->_parameters->getIntParam( marParameters::e_mask_size );
128 sizemask=(sizemask-1)/2;
129 edtMaskSize->SetValue( wxString::Format( _T("%d"), sizemask ) );
130 edtDiscreetStep->SetValue( wxString::Format( _T("%#.2f"),
131 _mar->_parameters->getDoubleParam( marParameters::e_axis_discret_step ) ) );
132 // PS -> // edtVoxelX->SetValue( wxString::Format( "%.4f",
133 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_x_dimension ) ) );
134 // PS -> // edtVoxelY->SetValue( wxString::Format( "%.4f",
135 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_y_dimension ) ) );
136 // PS -> // edtVoxelZ->SetValue( wxString::Format( "%.4f",
137 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_voxel_z_dimension ) ) );
138 // PS -> edtDistanceInt->SetValue( wxString::Format( "%.4f",
139 // PS -> _mar->_parameters->getDoubleParam( marParameters::e_distance_to_maximum_intensity ) ) );
140 // PS -> edtCellMaxIntCoef->SetValue( wxString::Format( "%d",
141 // PS -> _mar->_parameters->getIntParam( marParameters::e_coef_cell_max_int ) ) );
142 // PS -> edtCellCoef->SetValue( wxString::Format( "%.4f",
143 // PS -> _mar->_parameters->getDoubleParam( marParameters::e_cell_coeficient ) ) );
144 // PS -> edtStepCoef->SetValue( wxString::Format( "%d",
145 // PS -> _mar->_parameters->getIntParam( marParameters::e_step_coeficient ) ) );
146 // PS -> edtMassPower->SetValue( wxString::Format( "%d",
147 // PS -> _mar->_parameters->getIntParam( marParameters::e_mass_power ) ) );
148 // PS -> edtROIDimension->SetValue( wxString::Format( "%d",
149 // PS -> _mar->_parameters->getIntParam( marParameters::e_roi_dimension ) ) );
150 // PS -> edtStep->SetValue( wxString::Format( "%d",
151 // PS -> _mar->_parameters->getIntParam( marParameters::e_step ) ) );
152 // PS -> // chkShowCell->SetValue( _mar->_parameters->getBoolParam( marParameters::e_show_cell ) );
153 // PS -> // chkShowIntCell->SetValue( _mar->_parameters->getBoolParam( marParameters::e_show_int_cell ) );
154 // PS -> // radMinimum->SetValue( _mar->_parameters->getIntParam( marParameters::e_voxel_type ) == marParameters::VOX_TYPE_MINIMUM );
155 // PS -> // radNormal->SetValue( _mar->_parameters->getIntParam( marParameters::e_voxel_type ) == marParameters::VOX_TYPE_NORMAL );
156 // PS -> // col2.Set(
157 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_r ),
158 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_g ),
159 // PS -> // _mar->_parameters->getDoubleParam( marParameters::e_axis_color_b )
161 // PS -> // btnAxisColor->SetBackgroundColour( col2 );
164 // Quantification parameters
165 qt = _mar->_parameters->getIntParam( marParameters::e_quantification_type );
166 st = _mar->_parameters->getIntParam( marParameters::e_stenosis_type );
169 chkArea->SetValue( ( qt & marParameters::TYPE_AREA ) == marParameters::TYPE_AREA );
170 chkPerimeter->SetValue( ( qt & marParameters::TYPE_PERIMETER ) == marParameters::TYPE_PERIMETER );
171 chkDiameterFromArea->SetValue( ( qt & marParameters::TYPE_DIAMETER_FROM_AREA ) == marParameters::TYPE_DIAMETER_FROM_AREA );
172 chkDiameterFromPerimeter->SetValue( ( qt & marParameters::TYPE_DIAMETER_FROM_PERIMETER ) == marParameters::TYPE_DIAMETER_FROM_PERIMETER );
173 chkMinimumDiameter->SetValue( ( qt & marParameters::TYPE_MINIMUM_DIAMETER ) == marParameters::TYPE_MINIMUM_DIAMETER );
174 chkMaximumDiameter->SetValue( ( qt & marParameters::TYPE_MAXIMUM_DIAMETER ) == marParameters::TYPE_MAXIMUM_DIAMETER );
175 chkAverageDiameter->SetValue( ( qt & marParameters::TYPE_AVERAGE_DIAMETER ) == marParameters::TYPE_AVERAGE_DIAMETER );
176 radArea->SetValue( st == marParameters::TYPE_AREA );
177 radPerimeter->SetValue( st == marParameters::TYPE_PERIMETER );
178 radDiameterFromArea->SetValue( st == marParameters::TYPE_DIAMETER_FROM_AREA );
179 radDiameterFromPerimeter->SetValue( st == marParameters::TYPE_DIAMETER_FROM_PERIMETER );
180 radMinimumDiameter->SetValue( st == marParameters::TYPE_MINIMUM_DIAMETER );
181 radMaximumDiameter->SetValue( st == marParameters::TYPE_MAXIMUM_DIAMETER );
182 radAverageDiameter->SetValue( st == marParameters::TYPE_AVERAGE_DIAMETER );
185 // ----------------------------------------------------------------------------
186 bool wxMaracasParametersDialog::Apply( )
188 marDictionary marDict;
191 bool alertRegenerateAll = false;
192 bool alertRegenerateSignal = false;
193 bool alertClearContours = false;
194 bool alertRegenerateSplineAxe = false;
196 wxMessageDialog *wxdiag;
199 if ( _bak_edtMaskSize_String.CompareTo( edtMaskSize->GetValue().GetData() )!=0 ) {
200 alertRegenerateSignal=true;
201 strcpy(tmp , marDict.GetString(605) ); strcat(tmp,"\n");
202 wxtext=wxString(tmp, wxConvUTF8); //"The mask size was modified. \n"
204 if ( _bak_edtThresholdIsoContours_String.CompareTo( edtThresholdIsoContours->GetValue().GetData() )!=0 ) {
205 alertClearContours=true;
206 strcpy(tmp , marDict.GetString(610) ); strcat(tmp,"\n");
207 wxtext=wxString(tmp, wxConvUTF8); //"The threshold was modified. \n"
209 if ( _bak_edtFlexionCoef_String.CompareTo( edtFlexionCoef->GetValue().GetData() )!=0 ) {
210 alertRegenerateAll=true;
211 strcpy(tmp , marDict.GetString(615) ); strcat(tmp,"\n");
212 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The flexion coeficient was modified.\n"
214 if ( _bak_edtTensionCoef_String.CompareTo( edtTensionCoef->GetValue().GetData() )!=0 ) {
215 alertRegenerateAll=true;
216 strcpy(tmp , marDict.GetString(620) ); strcat(tmp,"\n");
217 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The tension coeficient was modified.\n"
219 if ( _bak_edtDiscreetStep_String.CompareTo( edtDiscreetStep->GetValue().GetData() )!=0 ) {
220 alertRegenerateSplineAxe=true;
221 strcpy(tmp , marDict.GetString(625) ); strcat(tmp,"\n");
222 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"The discret step of the axis was modified.\n"
225 if ((alertRegenerateAll==true) ||(alertRegenerateSplineAxe==true) ) {
226 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(630) ); strcat(tmp,"\n");
227 wxtext=wxtext+wxString(tmp, wxConvUTF8);//"\n The axe will be regenereted and the contours will be eresed. \n"
229 if ((alertRegenerateAll==true) ||(alertRegenerateSplineAxe==true) ) {
230 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(635) ); strcat(tmp,"\n");
231 wxtext=wxtext+wxString(tmp, wxConvUTF8); //"\n All contours will be erase. \n"
235 if ( (alertRegenerateAll==true) ||
236 (alertClearContours==true) ||
237 (alertRegenerateSignal==true) ||
238 (alertRegenerateSplineAxe==true) ) {
239 strcpy(tmp,"\n"); strcat(tmp , marDict.GetString(640) );
240 wxdiag= new wxMessageDialog(this, wxtext + wxString(tmp, wxConvUTF8), wxString(marDict.GetString(645), wxConvUTF8), wxOK | wxCANCEL);//"\n Do you want to continue?" "Alert"
241 if ( wxdiag->ShowModal() != wxID_OK ) {
248 // PS -> // wxColour col;
253 // General parameters
255 // PS -> // _mar->_parameters->setStringParam( marParameters::e_installation_directory, edtWorkDir->GetValue( ) );
256 // PS -> _mar->_parameters->setStringParam( marParameters::e_dicom_images_directory, edtDICOMDir->GetValue( ) );
258 // PS -> _mar->_parameters->setBoolParam( marParameters::e_calculate_mip_default, chkMIP->GetValue( ) );
259 // PS -> _mar->_parameters->setBoolParam( marParameters::e_choose_all_slices_default, chkSlices->GetValue( ) );
260 // PS -> _mar->_parameters->setBoolParam( marParameters::e_debug_window_visible, chkDebugWindow->GetValue( ) );
261 // PS -> _mar->_parameters->setBoolParam( marParameters::e_debug_console_visible, chkConsole->GetValue( ) );
263 // PS -> // col = btn3DBackColor->GetBackgroundColour( );
264 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_r, col.Red( ) );
265 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_g, col.Green( ) );
266 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_back_color_3D_b, col.Blue( ) );
268 // PS -> // Axis parameters
269 // PS -> // if (!edtDistanceCdg->GetValue( ).ToDouble( &td ))
270 // PS -> // return false;
271 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_gravity_distance, td );
273 if (!edtFlexionCoef->GetValue( ).ToDouble( &td ))
275 _mar->_parameters->setDoubleParam( marParameters::e_flexion_coeficient, td );
277 if (!edtTensionCoef->GetValue( ).ToDouble( &td ))
279 _mar->_parameters->setDoubleParam( marParameters::e_tension_coeficient, td );
281 if (!edtDiscreetStep->GetValue( ).ToDouble( &td ))
283 _mar->_parameters->setDoubleParam( marParameters::e_axis_discret_step, td );
285 // PS -> // if (!edtVoxelX->GetValue( ).ToDouble( &td ))
286 // PS -> // return false;
287 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, td );
289 // PS -> // if (!edtVoxelY->GetValue( ).ToDouble( &td ))
290 // PS -> // return false;
291 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, td );
293 // PS -> // if (!edtVoxelZ->GetValue( ).ToDouble( &td ))
294 // PS -> // return false;
295 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, td );
297 // PS -> if (!edtDistanceInt->GetValue( ).ToDouble( &td ))
298 // PS -> return false;
299 // PS -> _mar->_parameters->setDoubleParam( marParameters::e_distance_to_maximum_intensity, td );
301 // PS -> if (!edtCellCoef->GetValue( ).ToDouble( &td ))
302 // PS -> return false;
303 // PS -> _mar->_parameters->setDoubleParam( marParameters::e_cell_coeficient, td );
305 if (!edtMaskSize->GetValue( ).ToLong( &tl ))
307 _mar->_parameters->setIntParam( marParameters::e_mask_size, ( int )tl * 2 +1);
309 // PS -> if (!edtCellMaxIntCoef->GetValue( ).ToLong( &tl ))
310 // PS -> return false;
311 // PS -> _mar->_parameters->setIntParam( marParameters::e_coef_cell_max_int, ( int )tl );
313 // PS -> if (!edtStepCoef->GetValue( ).ToLong( &tl ))
314 // PS -> return false;
315 // PS -> _mar->_parameters->setIntParam( marParameters::e_step_coeficient, ( int )tl );
317 // PS -> if (!edtMassPower->GetValue( ).ToLong( &tl ))
318 // PS -> return false;
319 // PS -> _mar->_parameters->setIntParam( marParameters::e_mass_power, ( int )tl );
321 // PS -> if (!edtROIDimension->GetValue( ).ToLong( &tl ))
322 // PS -> return false;
323 // PS -> _mar->_parameters->setIntParam( marParameters::e_roi_dimension, ( int )tl );
325 // PS -> if (!edtStep->GetValue( ).ToLong( &tl ))
326 // PS -> return false;
327 // PS -> _mar->_parameters->setIntParam( marParameters::e_step, ( int )tl );
329 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_show_cell, chkShowCell->GetValue( ) );
330 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_show_int_cell, chkShowIntCell->GetValue( ) );
332 // PS -> // _mar->_parameters->setIntParam( marParameters::e_voxel_type, radNormal->GetValue( ) ? marParameters::VOX_TYPE_NORMAL: marParameters::VOX_TYPE_MINIMUM );
334 // PS -> // wxColour col2 = btnAxisColor->GetBackgroundColour( );
335 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_r, col2.Red( ) );
336 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_g, col2.Green( ) );
337 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_axis_color_b, col2.Blue( ) );
339 // Contour parameters
340 if (!edtThresholdIsoContours->GetValue( ).ToDouble( &td ))
342 _mar->_parameters->setDoubleParam( marParameters::e_threshold_isocontour, td );
344 // PS -> // if (!edtThresholdSnake->GetValue( ).ToDouble( &td ))
345 // PS -> // return false;
346 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_threshold_snake_isocontour, td );
348 // PS -> // if (!edtExternCoefSnake->GetValue( ).ToDouble( &td ))
349 // PS -> // return false;
350 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_extern_coeficient, td );
352 // PS -> // if (!edtBallonCoefDeriche->GetValue( ).ToDouble( &td ))
353 // PS -> // return false;
354 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_ballon_coeficient, td );
356 // PS -> // if (!edtGradientCoefDeriche->GetValue( ).ToDouble( &td ))
357 // PS -> // return false;
358 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_gradient_coeficient, td );
360 // PS -> // if (!edtSigmaDeriche->GetValue( ).ToDouble( &td ))
361 // PS -> // return false;
362 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_sigma, td );
364 // PS -> // if (!edtScale->GetValue( ).ToDouble( &td ))
365 // PS -> // return false;
366 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_scale, td );
368 // PS -> // if (!edtSample->GetValue( ).ToDouble( &td ))
369 // PS -> // return false;
370 // PS -> // _mar->_parameters->setDoubleParam( marParameters::e_sampling, td );
372 // PS -> // if (!edtIterationsSnake->GetValue( ).ToLong( &tl ))
373 // PS -> // return false;
374 // PS -> // _mar->_parameters->setIntParam( marParameters::e_number_of_iterations_snake_isocontour, ( int )tl );
376 // PS -> // if (!edtIterationsDeriche->GetValue( ).ToLong( &tl ))
377 // PS -> // return false;
378 // PS -> // _mar->_parameters->setIntParam( marParameters::e_number_of_iterations_snake_deriche, ( int )tl );
380 //EED _mar->_parameters->setBoolParam( marParameters::e_debug_isocontour, chkIsoContoursVis->GetValue( ) );
381 //EED _mar->_parameters->setBoolParam( marParameters::e_debug_diameters, chkDiametersVis->GetValue( ) );
382 //EED _mar->_parameters->setBoolParam( marParameters::e_invest_slice_order, chkInvertSliceOrder->GetValue( ) );
383 // PS -> // _mar->_parameters->setBoolParam( marParameters::e_debug_fill_area, chkFillContours->GetValue( ) );
385 // PS -> // ti = radIsoContours->GetValue( ) ? marParameters::ISOCONTOURS: ti;
386 // PS -> // ti = radSnake->GetValue( ) ? marParameters::SNAKE: ti;
387 // PS -> // ti = radDeriche->GetValue( ) ? marParameters::DERICHE: ti;
388 ti = marParameters::ISOCONTOURS;
389 _mar->_parameters->setIntParam( marParameters::e_algorithm_type, ti );
392 // Quantification parameters
394 ti |= chkArea->GetValue( ) ? marParameters::TYPE_AREA: 0;
395 ti |= chkPerimeter->GetValue( ) ? marParameters::TYPE_PERIMETER: 0;
396 ti |= chkDiameterFromArea->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_AREA: 0;
397 ti |= chkDiameterFromPerimeter->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_PERIMETER: 0;
398 ti |= chkMinimumDiameter->GetValue( ) ? marParameters::TYPE_MINIMUM_DIAMETER: 0;
399 ti |= chkMaximumDiameter->GetValue( ) ? marParameters::TYPE_MAXIMUM_DIAMETER: 0;
400 ti |= chkAverageDiameter->GetValue( ) ? marParameters::TYPE_AVERAGE_DIAMETER: 0;
401 _mar->_parameters->setIntParam( marParameters::e_quantification_type, ti );
403 ti = radArea->GetValue( ) ? marParameters::TYPE_AREA: ti;
404 ti = radPerimeter->GetValue( ) ? marParameters::TYPE_PERIMETER: ti;
405 ti = radDiameterFromArea->GetValue( ) ? marParameters::TYPE_DIAMETER_FROM_AREA: ti;
406 ti = radDiameterFromPerimeter->GetValue( )? marParameters::TYPE_DIAMETER_FROM_PERIMETER: ti;
407 ti = radMinimumDiameter->GetValue( ) ? marParameters::TYPE_MINIMUM_DIAMETER: ti;
408 ti = radMaximumDiameter->GetValue( ) ? marParameters::TYPE_MAXIMUM_DIAMETER: ti;
409 ti = radAverageDiameter->GetValue( ) ? marParameters::TYPE_AVERAGE_DIAMETER: ti;
410 _mar->_parameters->setIntParam( marParameters::e_stenosis_type, ti );
415 if (alertRegenerateAll==true){
416 wxCommandEvent ev19999(wxEVT_COMMAND_MENU_SELECTED,19999);
417 _parent->ProcessEvent( ev19999 );
421 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(true); }
422 if ( wxwin3DBrowser!=NULL ) { wxwin3DBrowser->Clean3D(); }
423 // Model Regeneration
424 _mar->_experiment->RegenerateAxis();
426 if ( wxwinquan!=NULL ) {
427 wxwinquan->AddAxisActors();
428 wxwinquan->RefreshAxis();
430 if ( wxwin3DBrowser!=NULL ) {
431 wxwin3DBrowser->AddAxisActors();
432 wxwin3DBrowser->RefreshAxis();
437 if (alertRegenerateSplineAxe==true){
438 wxCommandEvent ev19998(wxEVT_COMMAND_MENU_SELECTED,19998);
439 _parent->ProcessEvent( ev19998 );
442 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(true); }
443 if ( wxwin3DBrowser!=NULL ) { wxwin3DBrowser->Clean3D(); }
444 // Model Regeneration
445 _mar->_experiment->RecalculateAxis();
447 if ( wxwinquan!=NULL ) {
448 wxwinquan->AddAxisActors();
449 wxwinquan->RefreshAxis();
451 if ( wxwin3DBrowser!=NULL ) {
452 wxwin3DBrowser->AddAxisActors();
453 wxwin3DBrowser->RefreshAxis();
459 if (alertClearContours==true) {
460 wxCommandEvent ev19997(wxEVT_COMMAND_MENU_SELECTED,19997);
461 _parent->ProcessEvent( ev19997 );
464 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(false); }
465 // Model Regeneration
466 _mar->_experiment->ClearContours();
468 if ( wxwinquan!=NULL ) { wxwinquan->RefreshAxis(); }
472 if (alertRegenerateSignal==true) {
473 wxCommandEvent ev19996(wxEVT_COMMAND_MENU_SELECTED,19996);
474 _parent->ProcessEvent( ev19996 );
477 if ( wxwinquan!=NULL ) { wxwinquan->Clean3D(false); }
478 // Model Regeneration
479 _mar->_experiment->RegenerateSignal();
481 if ( wxwinquan!=NULL ) { wxwinquan->RefreshAxis(); }
489 if (!_mar->saveParameters( ))
496 // ----------------------------------------------------------------------------
497 void wxMaracasParametersDialog::SetBakEdit(){
498 _bak_edtThresholdIsoContours_String = edtThresholdIsoContours->GetValue();
499 _bak_edtFlexionCoef_String = edtFlexionCoef->GetValue();
500 _bak_edtTensionCoef_String = edtTensionCoef->GetValue();
501 _bak_edtMaskSize_String = edtMaskSize->GetValue();
502 _bak_edtDiscreetStep_String = edtDiscreetStep->GetValue();
504 // ----------------------------------------------------------------------------
505 void wxMaracasParametersDialog::OnOk( wxCommandEvent& WXUNUSED( event ) )
510 wxMessageDialog(this,_T("Error : Bad Parameters"),_T("Error"),wxOK|wxICON_ERROR).ShowModal();
513 // ----------------------------------------------------------------------------
514 void wxMaracasParametersDialog::OnCancel( wxCommandEvent& WXUNUSED( event ) )
516 EndModal( wxID_CANCEL );
518 // ----------------------------------------------------------------------------
519 void wxMaracasParametersDialog::OnReset( wxCommandEvent& WXUNUSED( event ) )
524 // ----------------------------------------------------------------------------
525 void wxMaracasParametersDialog::OnDefault( wxCommandEvent& WXUNUSED( event ) )
527 _mar->_parameters->reset();
531 // ----------------------------------------------------------------------------
532 void wxMaracasParametersDialog::OnApply( wxCommandEvent& WXUNUSED( event ) )
536 wxMessageDialog(this,_T("Error : Bad Parameters"),_T("Error"),wxOK|wxICON_ERROR).ShowModal();
540 // ----------------------------------------------------------------------------
541 // PS -> void wxMaracasParametersDialog::OnBrowseWorkDir( wxCommandEvent& WXUNUSED( event ) )
543 // PS -> // wxString dirHome = edtWorkDir->GetValue( );
544 // PS -> // wxDirDialog dialog( this, "Choose a work directory...", ( !dirHome.IsEmpty( ) )? dirHome: wxGetHomeDir( ) );
546 // PS -> // if( dialog.ShowModal( ) == wxID_OK ) {
547 // PS -> // edtWorkDir->SetValue( dialog.GetPath( ) );
548 // PS -> //! \todo if dir has change ... should update marGdcm
552 // ----------------------------------------------------------------------------
553 // PS -> void wxMaracasParametersDialog::OnBrowseDICOMDir( wxCommandEvent& WXUNUSED( event ) )
555 // PS -> wxString dirHome = edtDICOMDir->GetValue( );
556 // PS -> wxDirDialog dialog( this, "Choose a DICOM directory...", ( !dirHome.IsEmpty( ) )? dirHome: wxGetHomeDir( ) );
558 // PS -> if( dialog.ShowModal( ) == wxID_OK )
559 // PS -> edtDICOMDir->SetValue( dialog.GetPath( ) );
561 // ----------------------------------------------------------------------------
562 // PS -> void wxMaracasParametersDialog::OnChoose3DColor( wxCommandEvent& WXUNUSED( event ) )
564 // PS -> // wxColourData data;
565 // PS -> // data.SetChooseFull( true );
566 // PS -> // for( int i = 0; i < 16; i++ )
568 // PS -> // wxColour colour( i * 16, i * 16, i * 16 );
569 // PS -> // data.SetCustomColour( i, colour );
572 // PS -> // wxColourDialog dialog ( this, &data );
573 // PS -> // dialog.SetTitle( "Choose a 3D background color" );
574 // PS -> // if( dialog.ShowModal( ) == wxID_OK )
576 // PS -> // wxColourData retData = dialog.GetColourData( );
577 // PS -> // wxColour col = retData.GetColour( );
578 // PS -> // btn3DBackColor->SetBackgroundColour( col );
582 // ----------------------------------------------------------------------------
583 // PS -> void wxMaracasParametersDialog::OnChooseAxisColor( wxCommandEvent& WXUNUSED( event ) )
585 // PS -> // wxColourData data;
586 // PS -> // data.SetChooseFull( true );
587 // PS -> // for( int i = 0; i < 16; i++ )
589 // PS -> // wxColour colour( i * 16, i * 16, i * 16 );
590 // PS -> // data.SetCustomColour( i, colour );
593 // PS -> // wxColourDialog dialog ( this, &data );
594 // PS -> // dialog.SetTitle( "Choose an axis color" );
595 // PS -> // if( dialog.ShowModal( ) == wxID_OK )
597 // PS -> // wxColourData retData = dialog.GetColourData( );
598 // PS -> // wxColour col = retData.GetColour( );
599 // PS -> // btnAxisColor->SetBackgroundColour( col );
603 // EOF - wxGeneralParametersDialog.cxx