31#include <itkPolyLineParametricPath.h>
32#include <itkFiniteDifferenceFunction.h>
46template<
class POLYLINEPATHTYPE>
65 size_t numVals = (xmlc ? xmlc->
getList()->size() :
67 (pl ?
static_cast<size_t>(pl->
getNum()) :
68 (vl ?
static_cast<size_t>(vl->
getNum()) : 0))));
72 int maxDim = POLYLINEPATHTYPE::VertexType::IndexDimension;
81 typename POLYLINEPATHTYPE::Pointer outputPolyline = POLYLINEPATHTYPE::New();
84 typename POLYLINEPATHTYPE::VertexType point;
87 for (
size_t c=0; c < numVals; ++c){
91 float px=0, py=0, pz=0;
102 float px=0, py=0, pz=0;
103 vl->
getPoint(c, vecType, px, py, pz);
116 for (
int j=0;j< maxDim ;j++){ point[j] = mlVec[j]; }
117 outputPolyline->AddVertex(point);
120 return outputPolyline;
124 typename POLYLINEPATHTYPE::Pointer outputPolyline = POLYLINEPATHTYPE::New();
125 if (emptyDefaultToOneZeroVal){
127 typename POLYLINEPATHTYPE::VertexType point;
128 outputPolyline->AddVertex(point);
130 return outputPolyline;
142template<
class FINITE_DIFFERENCE_FUNCTION_TYPE>
146 typename FINITE_DIFFERENCE_FUNCTION_TYPE::Pointer defaultFunction =
nullptr;
150 if (functionObject) {
159 return defaultFunction;
BaseItem * getItemAt(MLssize_t index) override
FiniteDifferenceFunctionImg2OfVoxInt8Type::Pointer GetFiniteDifferenceFunction(FiniteDifferenceFunctionImg2OfVoxInt8Type *)
Base object class PointList managing a list of points.
void getValue(MLssize_t index, Vector3 &vec) const
get point at given index
MLssize_t getNum() const
returns the number of contained points
Base object representing a list of vectors given as Vector4's.
void getPoint(MLssize_t index, int &type, float &x1, float &y1, float &z1) const
returns point of vectors at given point index (NOTE: (0,1 = first vector , 2,3 = second vector))
MLssize_t getNum() const
returns the number of contained points
#define ML_BASE_IS_A(base, type)
#define ML_BAD_DIMENSION
The image or data structure has wrong extent or dimensions.
#define ML_PRINT_WARNING(FUNC_NAME, REASON, HANDLING)
ToTypePtr mlbase_cast(ml::Base *from)
Template function to allow type-safe casting of a base object to a derived object.
POLYLINEPATHTYPE::Pointer ITKPolylineFromBasePointer(Base *baseVal, bool emptyDefaultToOneZeroVal=true)
Tvec6< MLdouble > Vector6
A vector with six components of type double.
FINITE_DIFFERENCE_FUNCTION_TYPE::Pointer ITKDifferenceFunctionFromBasePointer(Base *baseVal)