]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkSegmentationConnectivity.cxx
Clean code
[bbtk.git] / packages / vtk / src / bbvtkSegmentationConnectivity.cxx
index 1f2758ead003fea3faa4a506297d3f0e9a154968..215516ea3e47765ef6b33f8400661685f2bf48e5 100644 (file)
@@ -67,7 +67,7 @@ namespace bbvtk
          bbSetInputPositionXYZ(position);
          std::vector<int> threshold;
          threshold.push_back(0);
-         threshold.push_back(0);
+         threshold.push_back(1);
          bbSetInputThresholdMinMax(threshold);
          bbSetOutputOut(NULL);
          bbSetInputOutputFormat("SAME");
@@ -133,7 +133,9 @@ namespace bbvtk
        int verif = (bbGetInputPositionXYZ().size()-1) % 3;
        if (( numPoints>=1) && (verif==2) && (bbGetInputIn()!=NULL)) 
        {
+//EED 2020-01-18
                int outputformat = bbtkStaticLecture::GetTypeFormat( bbGetInputOutputFormat() , bbGetInputIn() );
+//        int outputformat=4;
                vtkImageData *imagedata = bbGetInputIn();
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
@@ -160,9 +162,9 @@ namespace bbvtk
                int maxZ = ext[5]-ext[4]+1;
                for (i=0;i<numPoints;i++)
                {
-                       x=bbGetInputPositionXYZ()[i*3+0];
-                       y=bbGetInputPositionXYZ()[i*3+1];
-                       z=bbGetInputPositionXYZ()[i*3+2];
+                       x = bbGetInputPositionXYZ()[i*3+0];
+                       y = bbGetInputPositionXYZ()[i*3+1];
+                       z = bbGetInputPositionXYZ()[i*3+2];
                        if ( (x>=0) || (x<maxX) || (y>=0) || (y<maxY) || (z>=0) || (z<maxZ) )
                        {
                                connect2->AddSeed( x,y,z );
@@ -174,8 +176,8 @@ namespace bbvtk
                cast4->SetOutputScalarType( outputformat );
                connect2->Modified();
                connect2->Update();
-               cast4->Update();                        
-               bbSetOutputOut(cast4->GetOutput() );
+               cast4->Update();
+    bbSetOutputOut(cast4->GetOutput() );
        }  else {
                printf("EED WARNNIG! In box: SegmentationConnectivity List of points are not coherent. \n");
                bbSetOutputOut( NULL );