X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkDelaunay3D.cxx;h=baeb1f1a8b90a9620a17d78c3b15abb860f88c72;hb=b146797e0ad985788de697dcb3e6a48f4a2a488a;hp=02a26e735024e8cb59469b211495efa0b3327b36;hpb=05400a294e401b74b2e7a3058f6a4ee3decfc62d;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx index 02a26e7..baeb1f1 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx @@ -48,8 +48,6 @@ void Delaunay3D::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < lstX=bbGetInputLstPointsX(); std::vector lstY=bbGetInputLstPointsY(); std::vector lstZ=bbGetInputLstPointsZ(); @@ -72,150 +70,15 @@ printf("EED Delaunay3D::Process Start\n"); delaunay->SetAlpha( bbGetInputAlpha() ); //0.2 delaunay->BoundingTriangulationOff(); delaunay->Update(); - vtkGeometryFilter *geometry = vtkGeometryFilter::New(); geometry->SetInputData( delaunay->GetOutput() ); geometry->Update(); - bbSetOutputOut( geometry->GetOutput() ); - - -/* vtkExtractSurface - double bounds[6]; - inputpolydata->GetBounds(bounds); - double range[3]; - for (int i = 0; i < 3; ++i) - { - range[i] = bounds[2*i + 1] - bounds[2*i]; - } - - int sampleSize = inputpolydata->GetNumberOfPoints() * .00005; - if (sampleSize < 10) - { - sampleSize = 10; - } - std::cout << "Sample size is: " << sampleSize << std::endl; - // Do we need to estimate normals? - vtkSmartPointer distance = - vtkSmartPointer::New(); - if (inputpolydata->GetPointData()->GetNormals()) - { - std::cout << "Using normals from input file" << std::endl; - distance->SetInputData (inputpolydata); - } else{ - std::cout << "Estimating normals using PCANormalEstimation" << std::endl; - vtkSmartPointer normals = - vtkSmartPointer::New(); - normals->SetInputData (inputpolydata); - normals->SetSampleSize(sampleSize); - normals->SetNormalOrientationToGraphTraversal(); - normals->FlipNormalsOn(); - distance->SetInputConnection (normals->GetOutputPort()); - } - std::cout << "Range: " - << range[0] << ", " - << range[1] << ", " - << range[2] << std::endl; - int dimension = 256; - double radius; - - radius = std::max(std::max(range[0], range[1]), range[2]) - / static_cast(dimension) * 4; // ~4 voxels - -//EED - radius = bbGetInputTolerance(); - - - std::cout << "Radius: " << radius << std::endl; - - distance->SetRadius(radius); - distance->SetDimensions(dimension, dimension, dimension); - distance->SetBounds( - bounds[0] - range[0] * .1, - bounds[1] + range[0] * .1, - bounds[2] - range[1] * .1, - bounds[3] + range[1] * .1, - bounds[4] - range[2] * .1, - bounds[5] + range[2] * .1); - - - vtkExtractSurface *surface = vtkExtractSurface::New(); - surface->SetInputConnection (distance->GetOutputPort()); - surface->SetRadius(radius * .99 ); // - surface->Update(); - bbSetOutputOut( surface->GetOutput() ); -*/ - -/*vtkPoissonReconstruction - vtkPolyData *polyData=inputpolydata; - - vtkSmartPointer surface = - vtkSmartPointer::New(); - surface->SetDepth(12); - - int sampleSize = polyData->GetNumberOfPoints() * .00005; - if (sampleSize < 10) - { - sampleSize = 10; - } - if (polyData->GetPointData()->GetNormals()) - { - std::cout << "Using normals from input file" << std::endl; - surface->SetInputData (polyData); - } - else - { - std::cout << "Estimating normals using PCANormalEstimation" << std::endl; - vtkSmartPointer normals = - vtkSmartPointer::New(); - normals->SetInputData (polyData); - normals->SetSampleSize(sampleSize); - normals->SetNormalOrientationToGraphTraversal(); - normals->FlipNormalsOff(); - surface->SetInputConnection(normals->GetOutputPort()); - } - - surface->Update(); - bbSetOutputOut( surface->GetOutput() ); - -*/ - - - -/*SurfaceReconstructionFilter - - vtkPolyData *polydata=inputpolydata; - - // Construct the surface and create isosurface. - vtkSmartPointer surf = - vtkSmartPointer::New(); - surf->SetInputData(polydata); - - vtkSmartPointer cf = - vtkSmartPointer::New(); - cf->SetInputConnection(surf->GetOutputPort()); - cf->SetValue(0, 0.0); - - // Sometimes the contouring algorithm can create a volume whose gradient - // vector and ordering of polygon (using the right hand rule) are - // inconsistent. vtkReverseSense cures this problem. - vtkSmartPointer reverse = - vtkSmartPointer::New(); - reverse->SetInputConnection(cf->GetOutputPort()); - reverse->ReverseCellsOn(); - reverse->ReverseNormalsOn(); - - bbSetOutputOut( reverse->GetOutput() ); - -*/ - } else { printf("Warnning! Delaunay3D::Process: list of points empty. \n"); } // if lstX.size - -printf("EED Delaunay3D::Process End\n"); - } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== @@ -224,10 +87,8 @@ void Delaunay3D::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 - bbSetInputTolerance( 0.01 ); - bbSetInputAlpha( 0.2 ); - bbSetInputShrinkFactor( 0.9 ); - + bbSetInputTolerance( 0 ); + bbSetInputAlpha( 0 ); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)