]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
use wx2std
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index d21f9a58b0c0b202d6768a10989a83f9407f3518..3070d426e1bf0325c8ae1fa9655246512d548af6 100644 (file)
@@ -225,6 +225,20 @@ void wxContourMainFrame::setVectImages( std::vector<vtkImageData*> images ){
                return configured;
        }
 
+
+       bool wxContourMainFrame::addNewPanel(wxPanel* panel)
+               {
+               bool configured = panel!=NULL;
+               configured &= panel!=NULL;
+               
+               if( configured )
+               {
+                       notebook->AddPage( panel, wxT("       Viewer       "), true );
+                       m_mgr.Update();
+               }
+               return configured;
+       }
+
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
@@ -1011,23 +1025,23 @@ void wxContourMainFrame::SegmentationOneSliceITK(int x, int y, int z, wxString d
                               InternalImageType, 
                               InternalImageType >    ZeroCrossingFilterType;
 ZeroCrossingFilterType::Pointer zeroCrossing =
-                                                                       ZeroCrossingFilterType::New();
+                                               ZeroCrossingFilterType::New();
 
-const double propagationScaling = atof( prop );
+const double propagationScaling = atof( crea::wx2std(prop).c_str() );
 
   geodesicActiveContour->SetPropagationScaling( propagationScaling );
   geodesicActiveContour->SetCurvatureScaling( 1.0 );
   geodesicActiveContour->SetAdvectionScaling( 1.0 );
 
   geodesicActiveContour->SetMaximumRMSError( 0.02 );
-  int it=atoi( iter );
+  int it=atoi(  crea::wx2std(iter).c_str() );
   geodesicActiveContour->SetNumberOfIterations( it );
 
   smoothing->SetInput( filter2->GetOutput() );
   gradientMagnitude->SetInput( smoothing->GetOutput() );
   sigmoid->SetInput( gradientMagnitude->GetOutput() );
   fastMarching->SetInput( sigmoid->GetOutput() );
-  geodesicActiveContour->SetInput(  fastMarching->GetOutput() );
+  geodesicActiveContour->SetInput( fastMarching->GetOutput() );
   geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() );
   
   zeroCrossing->SetInput( geodesicActiveContour->GetOutput() );
@@ -1041,11 +1055,11 @@ const double propagationScaling = atof( prop );
   smoothing->SetConductanceParameter( 9.0 );
 
 
-  const double sigma = atof( sigm );
+  const double sigma = atof(  crea::wx2std(sigm).c_str() );
   gradientMagnitude->SetSigma(  sigma  );
 
-  const double alpha =  atof( alf );
-  const double beta  =  atof( bet );
+  const double alpha =  atof(  crea::wx2std(alf).c_str() );
+  const double beta  =  atof(  crea::wx2std(bet).c_str() );
 
   sigmoid->SetAlpha( alpha );
   sigmoid->SetBeta(  beta  );
@@ -1059,7 +1073,7 @@ const double propagationScaling = atof( prop );
   seedPosition[0] = x;
   seedPosition[1] = y;
 
-  const double initialDistance = atof( distanc );
+  const double initialDistance = atof( crea::wx2std(distanc).c_str() );
 
   NodeType node;
 
@@ -1071,7 +1085,7 @@ const double propagationScaling = atof( prop );
   seeds->Initialize();
   seeds->InsertElement( 0, node );
 
-  fastMarching->SetTrialPoints(  seeds  );
+  fastMarching->SetTrialPoints( seeds );
 
   fastMarching->SetSpeedConstant( 1.0 );
   
@@ -1705,8 +1719,6 @@ void wxContourMainFrame::onThreshold(int minVal, int maxVal)
        //Assign a fake color for the upper image, and set the white as transparent
        for(int i = range[0]; i < range[1]; i++)
        {
-               //std::cout<<"Int equal: " << i << std::endl;
-               
                if( i >= minVal && i <= maxVal )
                {
                        lookup->SetTableValue(i, 1.0, 0.0, 0.0, 1);
@@ -1739,30 +1751,10 @@ void wxContourMainFrame::onThreshold(int minVal, int maxVal)
                viewer->GetRenderer()->AddActor( upperImageActor );
                viewer->Render();
 
-               //wxThresholdPanel * panel = new wxThresholdPanel( viewer, notebook );
-
-               //onThresholdPanel(panel);
-
                RefreshInterface();
-
-               //baseImageActor = vtkImageActor::New( );
-               //baseImageActor->SetInput( mBox->bbGetInputImage1() );
 }
 
 
-bool wxContourMainFrame::onThresholdPanel(wxPanel* panel)
-       {
-       bool configured = panel!=NULL;
-       configured &= panel!=NULL;
-       
-       if( configured )
-       {
-               notebook->AddPage( panel, wxT("       Threshold       "), true );
-               m_mgr.Update();
-       }
-       return configured;
-}
-
 void wxContourMainFrame::showAxis(bool show)
 {
        _theViewPanel->SetVisibleAxis(show);
@@ -2446,4 +2438,5 @@ void wxContourMainFrame::saveFileWithContoursAutomatique(){
        }else{
                onSave();
        }
-}
\ No newline at end of file
+}
+