|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
65 template <
unsigned int VDimension = 2>
66 struct 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)
111 result[i] = m_InternalArray[i] + sz[i];
120 for (
unsigned int i = 0; i < VDimension; ++i)
122 m_InternalArray[i] += sz[i];
132 for (
unsigned int i = 0; i < VDimension; ++i)
134 m_InternalArray[i] -= sz[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)
183 return m_InternalArray;
193 std::copy_n(val, VDimension, m_InternalArray);
205 m_InternalArray[element] = val;
217 return m_InternalArray[element];
225 std::fill_n(begin(), size(), value);
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)
253 m_InternalArray[i] = Math::Round<OffsetValueType>(
point[i]);
259 template <
typename TCoordinate>
263 for (
unsigned int i = 0; i < VDimension; ++i)
265 m_InternalArray[i] = static_cast<OffsetValueType>(
point[i]);
274 GetBasisOffset(
unsigned int dim);
300 std::fill_n(begin(), size(), newValue);
309 constexpr const_iterator
312 return &m_InternalArray[0];
318 return &m_InternalArray[0];
321 constexpr const_iterator
324 return &m_InternalArray[0];
327 constexpr const_iterator
330 return &m_InternalArray[VDimension];
336 return &m_InternalArray[VDimension];
339 constexpr const_iterator
342 return &m_InternalArray[VDimension];
351 const_reverse_iterator
363 const_reverse_iterator
394 ExceptionThrowingBoundsCheck(pos);
395 return m_InternalArray[pos];
401 ExceptionThrowingBoundsCheck(pos);
402 return m_InternalArray[pos];
411 constexpr const_reference
420 return VDimension ? *(end() - 1) : *end();
423 constexpr const_reference
426 return VDimension ? *(end() - 1) : *end();
432 return &m_InternalArray[0];
438 return &m_InternalArray[0];
445 if (pos >= VDimension)
447 throw std::out_of_range(
"array::ExceptionThrowingBoundsCheck");
453 template <
unsigned int VDimension>
462 template <
unsigned int VDimension>
467 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];
482 template <
unsigned int VDimension>
489 template <
unsigned int VDimension>
493 return !(one == two);
496 template <
unsigned int VDimension>
500 return std::lexicographical_compare(one.
begin(), one.
end(), two.
begin(), two.
end());
503 template <
unsigned int VDimension>
510 template <
unsigned int VDimension>
517 template <
unsigned int VDimension>
525 template <
unsigned int VDimension>
const Self & operator-=(const Self &vec)
const OffsetValueType * GetOffset() const
void Fill(OffsetValueType value)
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
void swap(Offset< VDimension > &one, Offset< VDimension > &two)
constexpr const_reference back() const
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
Represent a n-dimensional size (bounds) of a n-dimensional image.
constexpr iterator begin()
void SetOffset(const OffsetValueType val[VDimension])
reverse_iterator rbegin()
const_reference operator[](size_type pos) const
std::reverse_iterator< const_iterator > const_reverse_iterator
static Self GetBasisOffset(unsigned int dim)
constexpr bool empty() const
constexpr reference front()
const value_type & const_reference
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
const_reverse_iterator rend() const
void CopyWithCast(const FixedArray< TCoordinate, VDimension > &point)
itk::OffsetValueType value_type
reference operator[](size_type pos)
static constexpr unsigned int GetOffsetDimension()
const Self & operator-=(const Size< VDimension > &sz)
std::reverse_iterator< iterator > reverse_iterator
const OffsetValueType * data() const
constexpr const_iterator begin() const
constexpr const_iterator cbegin() const
ptrdiff_t difference_type
*par Constraints *The filter requires an 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
constexpr size_type size() const
const Self & operator+=(const Self &vec)
void CopyWithRound(const FixedArray< TCoordinate, VDimension > &point)
const Self & operator+=(const Size< VDimension > &sz)
void assign(const value_type &newValue)
bool operator>=(const Index< VDimension > &one, const Index< VDimension > &two)
constexpr const_iterator cend() const
constexpr size_type max_size() const
OffsetValueType m_InternalArray[VDimension]
bool operator>(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
Simulate a standard C array with copy semantics.
const Self operator-(const Self &vec) const
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
itk::OffsetValueType OffsetValueType
const Self operator+(const Size< VDimension > &sz) const
const Self operator+(const Self &vec) const
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
void swap(Array< T > &a, Array< T > &b) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
const_reverse_iterator rbegin() const
reference at(size_type pos)
constexpr reference back()
OffsetValueType GetElement(unsigned long element) const
void ExceptionThrowingBoundsCheck(size_type pos) const
const_reference at(size_type pos) const
constexpr const_reference front() const
constexpr unsigned int Dimension
constexpr const_iterator end() const
const value_type * const_iterator
void SetElement(unsigned long element, OffsetValueType val)