]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfSegmentationPanels.cxx
Added ITK Segmentation Algorithm
[creaContours.git] / lib / Interface_Icons_NDimensions / interfSegmentationPanels.cxx
index a9cd147d0ccfdc3ee9ca3ea7bc02dd9b524796ea..306370d4af8a886afb2a5c9b38ca86135413d645 100644 (file)
@@ -139,55 +139,38 @@ interfSegmentationPanelITK::interfSegmentationPanelITK(wxWindow * parent)
        double range[2];
        //_theViewPanel->getSceneManager()->GetImageDataRange(range);
        interfMainPanel::getInstance()->GetImageDataRange(range);
+       
+       //The labels
+       wxStaticText * distance = new wxStaticText(this, wxID_ANY, wxT("Initial Distance"), wxPoint(5, 5));
+       wxStaticText * sigma = new wxStaticText(this, wxID_ANY, wxT("Sigma"),wxPoint(5, 30));
+       wxStaticText * alfa = new wxStaticText(this, wxID_ANY, wxT("Sigmoid Alfa"), wxPoint(5, 55));
+       wxStaticText * beta = new wxStaticText(this, wxID_ANY, wxT("Sigmoid Beta"), wxPoint(5, 80));
+       wxStaticText * propagation = new wxStaticText(this, wxID_ANY, wxT("Propagation Scaling"),wxPoint(5, 105));
+       wxStaticText * iterations = new wxStaticText(this, wxID_ANY, wxT("Iterations"), wxPoint(5, 130));
+       wxStaticText * infStrength = new wxStaticText(this, wxID_ANY, wxT("Inflation Strength"), wxPoint(5, 155));
 
-       wxButton *segmentationOneSliceBtn       = new wxButton(this,-1,_T("Current slice"), wxDefaultPosition, wxSize(200,35) );
-       wxButton *segmentationAllSliceBtn       = new wxButton(this,-1,_T("All slices") ,wxDefaultPosition, wxSize(200,35) );
-
-       Connect( segmentationOneSliceBtn->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice); 
-       Connect( segmentationAllSliceBtn->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationAllSlice); 
-
-       _isovalue                                                       = new wxSlider(this, -1, 40 , (int)(range[0]), (int)(range[1]), wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
-       _sampling                                                       = new wxSlider(this, -1, 20 , 4, 50, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
-       wxString lstOptions[3];
-       lstOptions[0]=_T("A");
-       lstOptions[1]=_T("B");
-       lstOptions[2]=_T("C");
-       methodRadiobox                                          = new wxRadioBox(this, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions,  3, wxRA_SPECIFY_COLS);
-       methodRadiobox->SetSelection(2);
-       _staticTextSegmentation                         = new wxStaticText(this,-1,_T("    "));
-
-       _mbarrange                                      =  new mBarRange(this,70, 65);
-       _mbarrange->SetMin(0);
-       _mbarrange->SetStart(0);
+       //Text Controls
 
-       _mbarrange-> SetOrientation( true );
-       _mbarrange-> setActiveStateTo(true);
-       _mbarrange-> setVisibleLabels( true );
-       _mbarrange-> setDeviceEndMargin(10);
-       _mbarrange-> setRepresentedValues( 0 , sizeZ );
-       _mbarrange-> setDeviceBlitStart(10,10); 
-       _mbarrange-> setIfWithActualDrawed( false );
-       _mbarrange-> SetStart( 0 );
-       _mbarrange-> SetEnd( sizeZ );  
+       _distance= new wxTextCtrl(this, wxID_ANY, "5.0", wxPoint(98,5), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
 
+       _sigma= new wxTextCtrl(this, wxID_ANY, "1.2", wxPoint(98,30), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
 
-       wxFlexGridSizer * sizer                         = new wxFlexGridSizer(1);
-       sizer -> Add( new wxStaticText(this,-1,_T("Isovalue (Gray level)"))  , 1, wxGROW );
-       sizer -> Add( _isovalue , 1, wxGROW );
-       sizer -> Add( methodRadiobox , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1,_T("Sampling (%)"))  , 1, wxGROW );
-       sizer -> Add( _sampling , 1, wxGROW );
-       sizer -> Add( segmentationOneSliceBtn , 1, wxGROW );
-       sizer -> Add( new wxStaticText(this,-1,_T(" "))  , 1, wxGROW );
-       sizer -> Add( _staticTextSegmentation  , 1, wxGROW );
-       sizer -> Add( segmentationAllSliceBtn , 1, wxGROW );
-       sizer -> Add( _mbarrange  , 1, wxGROW );
+       _alfa= new wxTextCtrl(this, wxID_ANY, "-1.0", wxPoint(98,55), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+       
+       _beta= new wxTextCtrl(this, wxID_ANY, "5.0", wxPoint(98,80), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+       
+       _propagation= new wxTextCtrl(this, wxID_ANY, "6.0", wxPoint(98,105), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+       
+       _iterations= new wxTextCtrl(this, wxID_ANY, "800", wxPoint(98,130), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+       
+       _infStrength= new wxTextCtrl(this, wxID_ANY, "3.0", wxPoint(98,155), wxSize(80, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
+       
+       //El boton
+       wxButton * bot= new wxButton(this, 6, wxT("One Slice"), wxPoint(98, 180), wxSize(70, 25), 0, wxDefaultValidator, "button");
 
-       this->SetSizer( sizer );
-//             panel->SetSize( sizePanel );
-       this->SetSize( wxDefaultSize );
-       this->SetAutoLayout( true );
-       this->Layout();
+       //Conexion del boton con su respectivo manejador
+       Connect(6, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfSegmentationPanelITK::onSegmentationOneSlice);
+       
        
 }
 interfSegmentationPanelITK::~interfSegmentationPanelITK(){
@@ -196,12 +179,15 @@ interfSegmentationPanelITK::~interfSegmentationPanelITK(){
 
 void interfSegmentationPanelITK::onSegmentationOneSlice( wxCommandEvent& event )
 {
-
-
-       /*int                           isovalue        = _isovalue->GetValue();
-       int                             sampling        = _sampling->GetValue();
-       int method = methodRadiobox->GetSelection();
-       interfMainPanel::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);*/
+       wxString distanc=_distance->GetValue();
+       wxString sigm=_sigma->GetValue();
+       wxString alf=_alfa->GetValue();
+       wxString bet=_beta->GetValue();
+       wxString prop=_propagation->GetValue();
+       wxString iter=_iterations->GetValue();
+       wxString infS=_infStrength->GetValue();
+       
+       interfMainPanel::getInstance()->onSegmentationOneSliceITK(distanc, sigm, alf, bet, prop, iter, infS);
        
 }
 void interfSegmentationPanelITK::onSegmentationAllSlice( wxCommandEvent& event )