]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
#3320creaContours Bug NewNormal - Segmentation PolyData Cells
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index 33db75f8652b799e2e366ebc8186d9058709bb5e..b3016751b1236497c2ca80c87f35646a5dc85885 100644 (file)
@@ -863,7 +863,6 @@ void wxContourMainFrame ::loadState(std::string filename)
        onLoadContours(filename,false);
 }
 
-
 void wxContourMainFrame::onLoad()
 {
        std::string fileNameContourROI = GetFileLocation();
@@ -880,20 +879,17 @@ void wxContourMainFrame::onLoad()
                if (dialog.ShowModal() == wxID_OK)
                {
                        fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
-               }
-       }
-
+               } // if dialog
+       } // if FileLocation
        onLoadContours(fileNameContourROI,true);
 }
 
-
 void  wxContourMainFrame::SetZForAllContours(int pz)
 {
        //-- Normal Contours
        std::vector< std::string > lstNameThings;       
        int i,sizeLstNameThings;
-       int ii,sizeLstPoints;
-       
+       int ii,sizeLstPoints;   
        lstNameThings           = kernelManager->GetLstNameThings();
        sizeLstNameThings       = lstNameThings.size(); 
        for (i=0 ; i<sizeLstNameThings ; i++)
@@ -965,27 +961,18 @@ void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool int
                        readDimSpc(pFile,false);                // DimSpc interactive OFF
                        openContours(pFile,pFileData,true);     // Load StaticContours
                        SetZForAllContours(-900);
-               }
-               //AD:02-06-09
-               else if (version=="1.0.1")
-               {
+               } else if (version=="1.0.1") { //AD:02-06-09
                        openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
                        openContours(pFile,pFileData,true); //Load StaticContours, skips ImageDimensions and ImageSpacing
-               }
-
-               //AD:02-06-09
-               else if (version=="1.0.0")
-               {
+               } else if (version=="1.0.0") { //AD:02-06-09
                        openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
                }
-
                fclose(pFile);
-
                if(pFileData != NULL)
                {
                        fclose(pFileData);
                } // if
-       }
+       } // pFile
        _theViewPanel->getSceneManager()->removeSceneContours();
        changeInstant();
 }
@@ -1005,7 +992,8 @@ void wxContourMainFrame::onImport()
                filename = dialog.GetPath().mb_str();
                filenamecontours = kernelManager->parseOsirixFile(filename);
 
-               if(filenamecontours.compare("") != 0){
+               if(filenamecontours.compare("") != 0)
+               {
                        onLoadContours(filenamecontours,true);
                } // if
        } // if
@@ -1020,7 +1008,6 @@ void wxContourMainFrame::onTest()
 #else
        wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
 #endif
-
        if (dialog.ShowModal() == wxID_OK)
        {
                filename = dialog.GetPath().mb_str();
@@ -1028,9 +1015,9 @@ void wxContourMainFrame::onTest()
        } // if
 }
 
-
 //AD: 29-05-09
-void wxContourMainFrame::onSave(){
+void wxContourMainFrame::onSave()
+{
 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
        if(GetFileLocation().empty())
        {
@@ -1047,10 +1034,7 @@ void wxContourMainFrame::onSave(){
                        kernelManager->setCurrentFileName(fileNameContourROI);
                        saveFileWithContours( fileNameContourROI );
                }
-       }
-//CMRU 03-09-09-----------------------------------------------------------------------------------------------
-       else
-       {
+       } else {//CMRU 03-09-09-----------------------------------------------------------------------------------------------
                std::cout<<"Nombre del archivo: "<<GetFileLocation()<<std::endl;
                std::string fileNameContourROI = GetFileLocation();
                std::cout<<"Nombre del archivo: "<<fileNameContourROI<<std::endl;
@@ -1899,6 +1883,10 @@ void wxContourMainFrame::onSegmentationOneSlice(int isovalue,int sampling,int me
 
 void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
 {
+
+printf("EED wxContourMainFrame::SegmentationOneSlice Start=%d  %d\n",sampling,method );
+printf("EED wxContourMainFrame::SegmentationOneSlice %d %d %d  \n",x,y,z );
+
        int typeofcontour = 1;
        //--Extracting Contour
        vtkImageData    *imagedata      = getImageData();
@@ -2072,7 +2060,7 @@ polyDataResult->PrintSelf( std::cout, vtkIndent(0) );
                int ii,size=vtkcell->GetNumberOfPoints();
        printf("EED wxContourMainFrame::SegmentationOneSlice C \n");
                int id;
-               for (ii=1;ii<=size;ii++)
+               for (ii=0;ii<size;ii++)
                {
        //              id      = polyDataResult->GetLines()->GetData()->GetValue(ii);
        //              p       = polyDataResult->GetPoint(id);