65template <
unsigned int VDimension = 2>
66struct ITK_TEMPLATE_EXPORT
Offset final
80 static constexpr unsigned int Dimension = VDimension;
83 static constexpr unsigned int
96 for (
unsigned int i = 0; i < VDimension; ++i)
109 for (
unsigned int i = 0; i < VDimension; ++i)
120 for (
unsigned int i = 0; i < VDimension; ++i)
131 for (
unsigned int i = 0; i < VDimension; ++i)
144 for (
unsigned int i = 0; i < VDimension; ++i)
155 for (
unsigned int i = 0; i < VDimension; ++i)
166 for (
unsigned int i = 0; i < VDimension; ++i)
237 static_assert(VDimension > 0,
"Error: Only positive value sized VDimension allowed");
241 template <
typename TCoordinate>
245 for (
unsigned int i = 0; i < VDimension; ++i)
252 template <
typename TCoordinate>
256 for (
unsigned int i = 0; i < VDimension; ++i)
301 constexpr const_iterator
313 constexpr const_iterator
319 constexpr const_iterator
331 constexpr const_iterator
343 const_reverse_iterator
355 const_reverse_iterator
411 constexpr const_reference
420 return VDimension ? *(
end() - 1) : *
end();
423 constexpr const_reference
426 return VDimension ? *(
end() - 1) : *
end();
445 if (pos >= VDimension)
447 throw std::out_of_range(
"array::ExceptionThrowingBoundsCheck");
453template <
unsigned int VDimension>
458 ind.m_InternalArray[dim] = 1;
462template <
unsigned int VDimension>
467 const unsigned int dimlim = VDimension - 1;
468 for (
unsigned int i = 0; i < dimlim; ++i)
470 os << ind[i] <<
", ";
472 if constexpr (VDimension >= 1)
474 os << ind[VDimension - 1];
482template <
unsigned int VDimension>
489template <
unsigned int VDimension>
493 return !(one == two);
496template <
unsigned int VDimension>
500 return std::lexicographical_compare(one.
begin(), one.
end(), two.
begin(), two.
end());
503template <
unsigned int VDimension>
510template <
unsigned int VDimension>
517template <
unsigned int VDimension>
525template <
unsigned int VDimension>
529 std::swap(one.m_InternalArray, two.m_InternalArray);
Simulate a standard C array with copy semantics.
TInput TInput TReturn Round(TInput x)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void swap(Array< T > &a, Array< T > &b) noexcept
bool operator>(const Index< VDimension > &one, const Index< VDimension > &two)
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator>=(const Index< VDimension > &one, const Index< VDimension > &two)
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
ptrdiff_t difference_type
constexpr reference back()
const Self operator-(const Self &vec) const
constexpr const_reference back() const
const value_type & const_reference
void CopyWithCast(const FixedArray< TCoordinate, VDimension > &point)
reverse_iterator rbegin()
constexpr bool empty() const
constexpr iterator begin()
static constexpr unsigned int GetOffsetDimension()
const Self & operator+=(const Self &vec)
std::reverse_iterator< const_iterator > const_reverse_iterator
constexpr reference front()
void SetElement(unsigned long element, OffsetValueType val)
const_reference operator[](size_type pos) const
const Self operator+(const Size< VDimension > &sz) const
const_reverse_iterator rbegin() const
static Self GetBasisOffset(unsigned int dim)
void SetOffset(const OffsetValueType val[VDimension])
itk::OffsetValueType OffsetValueType
const_reference at(size_type pos) const
const Self & operator-=(const Self &vec)
const value_type * const_iterator
constexpr const_reference front() const
constexpr const_iterator end() const
constexpr size_type max_size() const
void assign(const value_type &newValue)
void swap(Offset &other) noexcept
const Self operator+(const Self &vec) const
void ExceptionThrowingBoundsCheck(size_type pos) const
constexpr const_iterator cbegin() const
const OffsetValueType * data() const
Offset< VDimension > OffsetType
const Self & operator-=(const Size< VDimension > &sz)
void Fill(OffsetValueType value)
itk::OffsetValueType value_type
const_reverse_iterator rend() const
reference operator[](size_type pos)
reference at(size_type pos)
constexpr size_type size() const
OffsetValueType m_InternalArray[VDimension]
const OffsetValueType * GetOffset() const
constexpr const_iterator begin() const
static constexpr unsigned int Dimension
constexpr const_iterator cend() const
OffsetValueType GetElement(unsigned long element) const
std::reverse_iterator< iterator > reverse_iterator
void CopyWithRound(const FixedArray< TCoordinate, VDimension > &point)
const Self & operator+=(const Size< VDimension > &sz)
Represent a n-dimensional size (bounds) of a n-dimensional image.