22 #include <nlohmann/json.hpp>
37 template <
class TCoordRep,
unsigned int NPo
intDimension = 3>
38 class Point :
public itk::Point<TCoordRep, NPointDimension>
44 template <
typename TPo
intValueType>
49 template <
typename TPo
intValueType>
50 explicit Point(
const TPointValueType r[NPointDimension]) :
itk::
Point<TCoordRep, NPointDimension>(r)
54 template <
typename TPo
intValueType>
55 explicit Point(
const TPointValueType &v) :
itk::
Point<TCoordRep, NPointDimension>(v)
60 :
itk::
Point<TCoordRep, NPointDimension>(r)
66 :
itk::
Point<TCoordRep, NPointDimension>(p)
70 template <
typename... Args,
71 typename = std::enable_if_t<(
sizeof...(Args) == NPointDimension)>>
75 ((this->GetDataPointer()[i++] =
static_cast<TCoordRep
>(args)), ...);
84 template <
typename ArrayType>
87 itk::FixedArray<TCoordRep, NPointDimension> *thisP =
88 dynamic_cast<itk::FixedArray<TCoordRep, NPointDimension> *
>(
this);
89 mitk::FillArray<ArrayType, TCoordRep, NPointDimension>(*thisP, array);
97 template <
typename ArrayType>
100 mitk::ToArray<ArrayType, TCoordRep, NPointDimension>(array, *
this);
104 template <
class TCoordRep,
unsigned int NPo
intDimension>
107 j = nlohmann::json::array();
109 for (
size_t i = 0; i < NPointDimension; ++i)
113 template <
class TCoordRep,
unsigned int NPo
intDimension>
116 for (
size_t i = 0; i < NPointDimension; ++i)
117 j.at(i).get_to(p[i]);
137 template <
typename TCoordRep,
unsigned int NPo
intDimension>
138 inline bool Equal(
const itk::Point<TCoordRep, NPointDimension> &point1,
139 const itk::Point<TCoordRep, NPointDimension> &point2,
141 bool verbose =
false)
144 typename itk::Point<TCoordRep, NPointDimension>::VectorType diff = point1 - point2;
145 for (
unsigned int i = 0; i < NPointDimension; i++)