|
ITK
5.2.0
Insight Toolkit
|
Go to the documentation of this file.
23 #include "vnl/vnl_vector_ref.h"
61 template <
typename T,
unsigned int NVectorDimension = 3>
75 static constexpr
unsigned int Dimension = NVectorDimension;
90 return NVectorDimension;
95 SetVnlVector(
const vnl_vector<T> &);
103 GetVnlVector()
const;
110 operator=(
const Vector &) =
default;
112 operator=(
Vector &&) =
default;
116 #if !defined(ITK_LEGACY_FUTURE_REMOVE)
121 Vector(
const ValueType & r);
126 explicit Vector(
const ValueType & r);
130 template <
typename TVectorValueType>
137 template <
typename TVectorValueType>
144 template <
typename TVectorValueType>
148 BaseArray::operator=(r);
154 operator=(
const ValueType r[NVectorDimension]);
157 template <
typename Tt>
161 for (
unsigned int i = 0; i < NVectorDimension; i++)
163 (*this)[i] = static_cast<ValueType>((*
this)[i] * value);
170 template <
typename Tt>
174 for (
unsigned int i = 0; i < NVectorDimension; i++)
176 (*this)[i] = static_cast<ValueType>((*
this)[i] / value);
184 operator+=(
const Self & vec);
188 operator-=(
const Self & vec);
205 ValueType
operator*(
const Self & other)
const;
213 for (
unsigned int i = 0; i < NVectorDimension; i++)
215 result[i] = static_cast<ValueType>((*
this)[i] * value);
222 template <
typename Tt>
228 for (
unsigned int i = 0; i < NVectorDimension; i++)
230 result[i] = static_cast<ValueType>((*
this)[i] / value);
257 GetSquaredNorm()
const;
263 return NVectorDimension;
274 this->operator[](c) = v;
279 template <
typename TCoordRepB>
283 for (
unsigned int i = 0; i < NVectorDimension; i++)
285 (*this)[i] = static_cast<T>(pa[i]);
290 template <
typename TCoordRepB>
294 for (
unsigned int i = 0; i < NVectorDimension; i++)
296 r[i] = static_cast<TCoordRepB>((*
this)[i]);
304 template <
typename T,
unsigned int NVectorDimension>
307 return v.operator*(scalar);
311 template <
typename T,
unsigned int NVectorDimension>
313 operator<<(std::ostream & os,
const Vector<T, NVectorDimension> & vct);
316 template <
typename T,
unsigned int NVectorDimension>
318 operator>>(std::istream & is, Vector<T, NVectorDimension> & vct);
320 ITKCommon_EXPORT Vector<double, 3>
321 CrossProduct(
const Vector<double, 3> &,
const Vector<double, 3> &);
323 ITKCommon_EXPORT Vector<float, 3>
324 CrossProduct(
const Vector<float, 3> &,
const Vector<float, 3> &);
326 ITKCommon_EXPORT Vector<int, 3>
327 CrossProduct(
const Vector<int, 3> &,
const Vector<int, 3> &);
330 template <
typename T,
unsigned int NVectorDimension>
339 #ifndef ITK_MANUAL_INSTANTIATION
340 # include "itkVector.hxx"
Vector(const Vector< TVectorValueType, NVectorDimension > &r)
Self operator/(const Tt &value) const
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
void swap(Array< T > &a, Array< T > &b)
A templated class holding a n-Dimensional vector.
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Self operator*(const ValueType &value) const
Vector(const ValueType r[Dimension])
const Self & operator*=(const Tt &value)
Vector(const TVectorValueType r[Dimension])
static unsigned int GetNumberOfComponents()
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &vct)
ITKCommon_EXPORT void CrossProduct(CovariantVector< double, 3 > &, const Vector< double, 3 > &, const Vector< double, 3 > &)
Vector & operator=(const Vector< TVectorValueType, NVectorDimension > &r)
void CastFrom(const Vector< TCoordRepB, NVectorDimension > &pa)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
Simulate a standard C array with copy semantics.
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
void SetNthComponent(int c, const ComponentType &v)
typename NumericTraits< ValueType >::RealType RealValueType
static unsigned int GetVectorDimension()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
bool operator==(const Self &v) const
void swap(FixedArray &other)
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
bool operator!=(const Self &v) const
const Self & operator/=(const Tt &value)
constexpr unsigned int Dimension