12 #ifndef __itkFiber_hxx 13 #define __itkFiber_hxx 21 template<
class TValue >
22 typename LightObject::Pointer
26 typename LightObject::Pointer loPtr = Superclass::InternalClone();
31 itkExceptionMacro(<<
"downcast to type " << this->GetNameOfClass()<<
" failed.");
34 rval->m_Tract = m_Tract;
35 rval->m_Properties = m_Properties;
36 rval->m_Scalars = m_Scalars;
40 template<
class TValue >
46 *out->m_Scalars = *m_Scalars;
47 *out->m_Properties = *m_Properties;
49 auto tract = out->GetTract();
50 auto vertexList = m_Tract->GetVertexList();
51 int numPoints = GetNumberOfPoints();
53 for (
int i = 0; i < numPoints; ++i )
55 vertex = (*vertexList)[i];
56 tract->AddVertex(vertex);
62 template<
class TValue >
70 for (
int i = 0; i < GetNumberOfPoints(); ++i )
76 d2 = dx*dx+dy*dy+dz*dz;
80 return std::sqrt(d2Min);
83 template<
class TValue >
88 std::vector<double> distVec;
90 for (
int i = 1; i < GetNumberOfPoints(); ++i )
94 distVec.push_back(p0.EuclideanDistanceTo(p1));
99 template<
class TValue >
104 int numPoints = GetNumberOfPoints();
105 for (
int i = 0; i < numPoints; ++i )
111 template<
class TValue >
119 template<
class TValue >
126 int dim_s = GetDimensionOfScalarsPerPoint();
128 PrintVar(
true, os<<indent, dim_s, dim_p);
131 auto points = m_Tract->GetVertexList();
132 os << indent <<
"points (" << (points) <<
"): (numberOfPoints: "<< points->size() <<
") [";
133 for (
int i = 0; i < points->Size(); ++i )
135 os << points->GetElement(i);
136 os << ((i==points->Size()-1) ?
"]\n" :
", ");
143 os << indent <<
"m_Scalars : [";
144 for (
int i = 0; i < m_Scalars->size(); ++i )
146 os << (*m_Scalars)[i];
147 os << ((i==m_Scalars->size()-1) ?
"]\n" :
", ");
double DistanceToPoint(double x, double y, double z) const
LightObject::Pointer InternalClone() const ITK_OVERRIDE
TractType::VertexType VertexType
std::vector< double > GetContainerStats(IteratorType v1, IteratorType v2)
void RemoveScalarsByName(std::vector< T > &vec, const std::vector< std::string > &nameVec, const std::string &name)
const T & max(const T &a, const T &b)
Return the maximum between a and b.
std::vector< double > GetPointDistanceStats() const
void RemoveScalarsByName(const std::string &name, const std::vector< std::string > &nameVec)
void RemovePropertiesByName(const std::string &name, const std::vector< std::string > &nameVec)
SmartPointer< Self > Pointer
#define PrintVar(cond, os,...)
void PrintVector(const std::vector< T > &vec, const std::string &str="", const char *separate=" ", std::ostream &os=std::cout, bool showStats=true)
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
int GetDimensionOfProperties(const TrackVisHeaderType &header)
Fiber< TValue >::Pointer DeepClone() const