31 #include <itkPolyLineParametricPath.h>
32 #include <itkFiniteDifferenceFunction.h>
46 template<
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;
142 template<
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
This virtual function is reimplemented from ListBase, where it returns 0 in any case (also in ListTem...
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Class to provide a number of get/set functions for often used templated objects, for example function...
FiniteDifferenceFunctionImg2OfVoxInt8Type ::Pointer GetFiniteDifferenceFunction(FiniteDifferenceFunctionImg2OfVoxInt8Type *)
virtual T * getList()
Get pointer to the active list object Use this pointer for list access after testing that it is !...
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
Base object class XMarkerListContainer (derived from ListContainerTemplate) for XMarkerList objects.
Base object class XMarkerList (derived from BaseListTemplate) specialized for XMarker items.
Base object class XMarker (derived form baseItem) with 6D pos, 3D vec and type int.
#define ML_BASE_IS_A(base, type)
This file defines macros that are inserted in classes to declare and implement additional class membe...
#define ML_BAD_DIMENSION
The image or data structure has wrong extent or dimensions.
#define ML_PRINT_WARNING(FUNC_NAME, REASON, HANDLING)
Like ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped...
POLYLINEPATHTYPE::Pointer ITKPolylineFromBasePointer(Base *baseVal, bool emptyDefaultToOneZeroVal=true)
Reads a base field and looks for point like data structures (XMarkerLists, XMarkerListContainers,...
FINITE_DIFFERENCE_FUNCTION_TYPE::Pointer ITKDifferenceFunctionFromBasePointer(Base *baseVal)
Checks a base input connector for a base object containing a ITKFiniteDifferenceFunctionWrapper.