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)
132 for (
unsigned int i = 0; i < VDimension; ++i)
146 for (
unsigned int i = 0; i < VDimension; ++i)
157 for (
unsigned int i = 0; i < VDimension; ++i)
169 for (
unsigned int i = 0; i < VDimension; ++i)
242 static_assert(VDimension > 0,
"Error: Only positive value sized VDimension allowed");
247 template <
typename TCoordinate>
251 for (
unsigned int i = 0; i < VDimension; ++i)
259 template <
typename TCoordinate>
263 for (
unsigned int i = 0; i < VDimension; ++i)
309 constexpr const_iterator
321 constexpr const_iterator
327 constexpr const_iterator
339 constexpr const_iterator
351 const_reverse_iterator
363 const_reverse_iterator
419 constexpr const_reference
428 return VDimension ? *(
end() - 1) : *
end();
431 constexpr const_reference
434 return VDimension ? *(
end() - 1) : *
end();
453 if (pos >= VDimension)
455 throw std::out_of_range(
"array::ExceptionThrowingBoundsCheck");
461template <
unsigned int VDimension>
466 ind.m_InternalArray[dim] = 1;
470template <
unsigned int VDimension>
475 const unsigned int dimlim = VDimension - 1;
476 for (
unsigned int i = 0; i < dimlim; ++i)
478 os << ind[i] <<
", ";
480 if constexpr (VDimension >= 1)
482 os << ind[VDimension - 1];
490template <
unsigned int VDimension>
497template <
unsigned int VDimension>
501 return !(one == two);
504template <
unsigned int VDimension>
508 return std::lexicographical_compare(one.
begin(), one.
end(), two.
begin(), two.
end());
511template <
unsigned int VDimension>
518template <
unsigned int VDimension>
525template <
unsigned int VDimension>
533template <
unsigned int VDimension>
537 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
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
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.