67template <
unsigned int VDimension = 2>
68struct ITK_TEMPLATE_EXPORT
Index final
89 static constexpr unsigned int Dimension = VDimension;
92 static constexpr unsigned int
105 for (
unsigned int i = 0; i < VDimension; ++i)
116 for (
unsigned int i = 0; i < VDimension; ++i)
131 for (
unsigned int i = 0; i < VDimension; ++i)
142 for (
unsigned int i = 0; i < VDimension; ++i)
156 for (
unsigned int i = 0; i < VDimension; ++i)
167 for (
unsigned int i = 0; i < VDimension; ++i)
179 for (
unsigned int i = 0; i < VDimension; ++i)
193 for (
unsigned int i = 0; i < VDimension; ++i)
206 for (
unsigned int i = 0; i < VDimension; ++i)
221 for (
unsigned int i = 0; i < VDimension; ++i)
292 static_assert(VDimension > 0,
"Error: Only positive value sized VDimension allowed");
297 template <
typename TCoordinate>
301 for (
unsigned int i = 0; i < VDimension; ++i)
309 template <
typename TCoordinate>
313 for (
unsigned int i = 0; i < VDimension; ++i)
359 constexpr const_iterator
371 constexpr const_iterator
377 constexpr const_iterator
389 constexpr const_iterator
401 const_reverse_iterator
413 const_reverse_iterator
443 constexpr const_reference
469 constexpr const_reference
478 return VDimension ? *(
end() - 1) : *
end();
481 constexpr const_reference
484 return VDimension ? *(
end() - 1) : *
end();
502 static constexpr Self
513 if (pos >= VDimension)
515 throw std::out_of_range(
"array::ExceptionThrowingBoundsCheck");
521template <
unsigned int VDimension>
527 ind.m_InternalArray[dim] = 1;
531template <
unsigned int VDimension>
536 for (
unsigned int i = 0; i + 1 < VDimension; ++i)
538 os << obj[i] <<
", ";
540 if constexpr (VDimension >= 1)
542 os << obj[VDimension - 1];
550template <
unsigned int VDimension>
557template <
unsigned int VDimension>
561 return !(one == two);
564template <
unsigned int VDimension>
568 return std::lexicographical_compare(one.
begin(), one.
end(), two.
begin(), two.
end());
571template <
unsigned int VDimension>
578template <
unsigned int VDimension>
585template <
unsigned int VDimension>
593template <
unsigned int VDimension>
597 std::swap(one.m_InternalArray, two.m_InternalArray);
602template <
typename... T>
606 const auto toValueType = [](
const auto value) {
607 static_assert(std::is_integral_v<
decltype(value)>,
"Each value must have an integral type!");
610 return Index<
sizeof...(T)>{ { toValueType(values)... } };
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....
constexpr TContainer MakeFilled(typename TContainer::const_reference value)
void swap(Array< T > &a, Array< T > &b) noexcept
auto MakeIndex(const T... values)
*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 index in a n-dimensional image.
constexpr const_reference operator[](size_type pos) const
const Self operator*(const SizeType &vec) const
const OffsetType operator-(const Self &vec) const
const Self & operator+=(const OffsetType &offset)
const value_type * const_iterator
Size< VDimension > SizeType
constexpr reference front()
const Self & operator-=(const SizeType &sz)
const_reverse_iterator rbegin() const
static constexpr Self Filled(const IndexValueType value)
void assign(const value_type &newValue)
constexpr size_type max_size() const
reverse_iterator rbegin()
const_reverse_iterator rend() const
void ExceptionThrowingBoundsCheck(size_type pos) const
IndexValueType m_InternalArray[VDimension]
constexpr bool empty() const
constexpr size_type size() const
Index< VDimension > IndexType
const IndexValueType * GetIndex() const
constexpr const_iterator begin() const
const Self operator-(const OffsetType &off) const
static Self GetBasisIndex(unsigned int dim)
itk::IndexValueType IndexValueType
reference at(size_type pos)
const Self operator+(const SizeType &sz) const
std::reverse_iterator< iterator > reverse_iterator
itk::IndexValueType value_type
const value_type & const_reference
std::reverse_iterator< const_iterator > const_reverse_iterator
constexpr reference operator[](size_type pos)
constexpr const_iterator end() const
constexpr reference back()
const Self operator-(const SizeType &sz) const
void Fill(IndexValueType value)
Offset< VDimension > OffsetType
void CopyWithCast(const FixedArray< TCoordinate, VDimension > &point)
void CopyWithRound(const FixedArray< TCoordinate, VDimension > &point)
constexpr const_reference back() const
const IndexValueType * data() const
void SetElement(unsigned int element, IndexValueType val)
static constexpr unsigned int Dimension
const Self & operator+=(const SizeType &sz)
constexpr iterator begin()
const Self operator+(const OffsetType &offset) const
IndexValueType GetElement(unsigned int element) const
ptrdiff_t difference_type
constexpr const_iterator cend() const
constexpr const_reference front() const
itk::OffsetValueType OffsetValueType
constexpr const_iterator cbegin() const
static constexpr unsigned int GetIndexDimension()
void swap(Index &other) noexcept
void SetIndex(const IndexValueType val[VDimension])
const Self & operator-=(const OffsetType &offset)
const_reference at(size_type pos) const
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
OffsetValueType m_InternalArray[VDimension]
Represent a n-dimensional size (bounds) of a n-dimensional image.
SizeValueType m_InternalArray[VDimension]