|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
25 #include "vnl/vnl_vector_ref.h"
52 template <
typename TCoordinate,
unsigned int VPo
intDimension = 3>
65 #ifndef ITK_FUTURE_LEGACY_REMOVE
66 using CoordRepType ITK_FUTURE_DEPRECATED(
67 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
73 static constexpr
unsigned int PointDimension = VPointDimension;
84 return VPointDimension;
95 template <
typename TPo
intValueType>
101 template <
typename TPo
intValueType>
102 Point(
const TPointValueType r[VPointDimension])
110 #if defined(ITK_LEGACY_REMOVE)
112 Point(std::nullptr_t) =
delete;
115 template <
typename TPo
intValueType>
116 explicit Point(
const TPointValueType & v)
126 template <
typename TPo
intValueType>
127 Point(
const TPointValueType & v)
130 Point(
const ValueType & v)
137 explicit Point(
const std::array<ValueType, VPointDimension> & stdArray)
143 operator=(
const ValueType r[VPointDimension]);
152 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(
Self);
176 GetVectorFromOrigin()
const;
179 vnl_vector_ref<TCoordinate>
183 vnl_vector<TCoordinate>
184 GetVnlVector()
const;
198 SetToMidPoint(
const Self &,
const Self &);
227 SetToBarycentricCombination(
const Self & A,
const Self & B,
double alpha);
246 SetToBarycentricCombination(
const Self & A,
const Self & B,
const Self & C,
double weightForA,
double weightForB);
262 SetToBarycentricCombination(
const Self * P,
const double * weights,
unsigned int N);
267 template <
typename TCoordinateB>
271 for (
unsigned int i = 0; i < VPointDimension; ++i)
273 (*this)[i] = static_cast<TCoordinate>(pa[i]);
282 template <
typename TCoordinateB>
288 for (
unsigned int i = 0; i < VPointDimension; ++i)
290 const auto component = static_cast<RealType>(pa[i]);
291 const RealType difference = static_cast<RealType>((*
this)[i]) - component;
292 sum += difference * difference;
300 template <
typename TCoordinateB>
304 const double distance = std::sqrt(static_cast<double>(this->SquaredEuclideanDistanceTo(pa)));
306 return static_cast<RealType>(distance);
310 template <
typename T,
unsigned int VPo
intDimension>
312 operator<<(std::ostream & os,
const Point<T, VPointDimension> & vct);
314 template <
typename T,
unsigned int VPo
intDimension>
316 operator>>(std::istream & is, Point<T, VPointDimension> & vct);
344 template <
typename TPo
intContainer,
typename TWeightContainer>
360 template <
typename TCoordinate,
unsigned int VPo
intDimension>
369 template <
typename TValue,
typename... TVariadic>
371 MakePoint(
const TValue firstValue,
const TVariadic... otherValues)
373 static_assert(std::conjunction_v<std::is_same<TVariadic, TValue>...>,
374 "The other values should have the same type as the first value.");
376 constexpr
unsigned int dimension{ 1 +
sizeof...(TVariadic) };
377 const std::array<TValue, dimension> stdArray{ { firstValue, otherValues... } };
383 #ifndef ITK_MANUAL_INSTANTIATION
384 # include "itkPoint.hxx"
SmartPointer< Self > Pointer
auto MakePoint(const TValue firstValue, const TVariadic... otherValues)
Point(const Point< TPointValueType, VPointDimension > &r)
Computes the barycentric combination of an array of N points.
TWeightContainer WeightContainerType
typename NumericTraits< ValueType >::RealType RealType
RealType EuclideanDistanceTo(const Point< TCoordinateB, VPointDimension > &pa) const
Point(const ValueType &v)
ImageBaseType::SpacingType VectorType
A templated class holding a n-Dimensional vector.
void CastFrom(const Point< TCoordinateB, VPointDimension > &pa)
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Point(const ValueType r[VPointDimension])
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
const ValueType * ConstIterator
Point(const std::array< ValueType, VPointDimension > &stdArray)
RealType SquaredEuclideanDistanceTo(const Point< TCoordinateB, VPointDimension > &pa) const
Point(const TPointValueType &v)
bool operator==(const Self &pt) const
typename PointContainerType::Element PointType
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
Simulate a standard C array with copy semantics.
Point(const TPointValueType r[VPointDimension])
static unsigned int GetPointDimension()
void swap(Array< T > &a, Array< T > &b) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
typename PointContainerType::Pointer PointContainerPointer
void swap(FixedArray &other)
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
A templated class holding a geometric point in n-Dimensional space.
TPointContainer PointContainerType
std::istream & operator>>(std::istream &is, Point< T, VPointDimension > &vct)