18 #define _USE_MATH_DEFINES
20 #include <vtkDoubleArray.h>
21 #include <vtkPointData.h>
22 #include <boost/progress.hpp>
27 : m_AngularDeviation(30)
29 , m_RemoveFibers(false)
45 MITK_INFO <<
"Applying curvature threshold";
46 boost::progress_display disp(inputPoly->GetNumberOfCells());
47 for (
int i=0; i<inputPoly->GetNumberOfCells(); i++)
50 vtkCell* cell = inputPoly->GetCell(i);
51 int numPoints = cell->GetNumberOfPoints();
52 vtkPoints* points = cell->GetPoints();
56 for (
int j=0; j<numPoints; j++)
60 std::vector< vnl_vector_fixed< float, 3 > > vectors;
61 vnl_vector_fixed< float, 3 > meanV; meanV.fill(0.0);
62 while(dist<m_Distance/2 && c>1)
65 points->GetPoint(c-1, p1);
67 points->GetPoint(c, p2);
69 vnl_vector_fixed< float, 3 > v;
73 dist += v.magnitude();
85 points->GetPoint(c, p1);
87 points->GetPoint(c+1, p2);
89 vnl_vector_fixed< float, 3 > v;
93 dist += v.magnitude();
103 for (
auto vec : vectors)
105 double angle = dot_product(meanV, vec);
110 dev += acos(angle)*180/
M_PI;
112 if (vectors.size()>0)
113 dev /= vectors.size();
118 points->GetPoint(j, p);
119 vtkIdType
id = vtkNewPoints->InsertNextPoint(p);
120 container->GetPointIds()->InsertNextId(
id);
130 if (container->GetNumberOfPoints()>0)
131 vtkNewCells->InsertNextCell(container);
135 if (container->GetNumberOfPoints()>0)
136 vtkNewCells->InsertNextCell(container);
140 outputPoly->SetPoints(vtkNewPoints);
141 outputPoly->SetLines(vtkNewCells);
double m_AngularDeviation
FiberBundle::Pointer m_InputFiberBundle
FiberBundle::Pointer m_OutputFiberBundle
void GenerateData() override
virtual ~FiberCurvatureFilter()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.