diff --git a/Isodose/Logic/vtkSlicerIsodoseModuleLogic.cxx b/Isodose/Logic/vtkSlicerIsodoseModuleLogic.cxx index 5e1c715a8..2b4f3fda7 100644 --- a/Isodose/Logic/vtkSlicerIsodoseModuleLogic.cxx +++ b/Isodose/Logic/vtkSlicerIsodoseModuleLogic.cxx @@ -51,6 +51,7 @@ #include #include #include +#include // STD includes #include @@ -335,6 +336,9 @@ int vtkSlicerIsodoseModuleLogic::ComputeIsodose() marchingCubes->SetInput(changeInfo->GetOutput()); marchingCubes->SetNumberOfContours(1); marchingCubes->SetValue(0, isoLevel); + marchingCubes->ComputeScalarsOff(); + marchingCubes->ComputeGradientsOff(); + marchingCubes->ComputeNormalsOff(); marchingCubes->Update(); vtkSmartPointer isoPolyData= marchingCubes->GetOutput(); @@ -346,13 +350,25 @@ int vtkSlicerIsodoseModuleLogic::ComputeIsodose() vtkSmartPointer decimate = vtkSmartPointer::New(); decimate->SetInput(triangleFilter->GetOutput()); - decimate->SetTargetReduction(0.9); + decimate->SetTargetReduction(0.6); + decimate->SetFeatureAngle(60); + decimate->SplittingOff(); decimate->PreserveTopologyOn(); + decimate->SetMaximumError(1); decimate->Update(); + vtkSmartPointer smootherSinc = vtkSmartPointer::New(); + smootherSinc->SetPassBand(0.1); + smootherSinc->SetInput(decimate->GetOutput() ); + smootherSinc->SetNumberOfIterations(2); + smootherSinc->FeatureEdgeSmoothingOff(); + smootherSinc->BoundarySmoothingOff(); + smootherSinc->Update(); + vtkSmartPointer normals = vtkSmartPointer::New(); - normals->SetInput(decimate->GetOutput()); - normals->SetFeatureAngle(45); + normals->SetInput(smootherSinc->GetOutput()); + normals->ComputePointNormalsOn(); + normals->SetFeatureAngle(60); normals->Update(); vtkSmartPointer displayNode = vtkSmartPointer::New();