 |
ITK
5.4.0
Insight Toolkit
|
Go to the documentation of this file.
68 template <
unsigned int VDimension = 2>
69 struct ITK_TEMPLATE_EXPORT
Offset final
83 static constexpr
unsigned int Dimension = VDimension;
86 static constexpr
unsigned int
99 for (
unsigned int i = 0; i < VDimension; ++i)
112 for (
unsigned int i = 0; i < VDimension; ++i)
114 result[i] = m_InternalArray[i] + sz[i];
123 for (
unsigned int i = 0; i < VDimension; ++i)
125 m_InternalArray[i] += sz[i];
135 for (
unsigned int i = 0; i < VDimension; ++i)
137 m_InternalArray[i] -= sz[i];
149 for (
unsigned int i = 0; i < VDimension; ++i)
160 for (
unsigned int i = 0; i < VDimension; ++i)
172 for (
unsigned int i = 0; i < VDimension; ++i)
186 return m_InternalArray;
196 std::copy_n(val, VDimension, m_InternalArray);
208 m_InternalArray[element] = val;
220 return m_InternalArray[element];
228 std::fill_n(begin(), size(), value);
245 static_assert(VDimension > 0,
"Error: Only positive value sized VDimension allowed");
250 template <
typename TCoordRep>
254 for (
unsigned int i = 0; i < VDimension; ++i)
256 m_InternalArray[i] = Math::Round<OffsetValueType>(
point[i]);
262 template <
typename TCoordRep>
266 for (
unsigned int i = 0; i < VDimension; ++i)
268 m_InternalArray[i] = static_cast<OffsetValueType>(
point[i]);
277 GetBasisOffset(
unsigned int dim);
303 std::fill_n(begin(), size(), newValue);
312 constexpr const_iterator
315 return &m_InternalArray[0];
321 return &m_InternalArray[0];
324 constexpr const_iterator
327 return &m_InternalArray[0];
330 constexpr const_iterator
333 return &m_InternalArray[VDimension];
339 return &m_InternalArray[VDimension];
342 constexpr const_iterator
345 return &m_InternalArray[VDimension];
354 const_reverse_iterator
366 const_reverse_iterator
397 ExceptionThrowingBoundsCheck(pos);
398 return m_InternalArray[pos];
404 ExceptionThrowingBoundsCheck(pos);
405 return m_InternalArray[pos];
423 return VDimension ? *(end() - 1) : *end();
429 return VDimension ? *(end() - 1) : *end();
435 return &m_InternalArray[0];
441 return &m_InternalArray[0];
448 if (pos >= VDimension)
450 throw std::out_of_range(
"array::ExceptionThrowingBoundsCheck");
456 template <
unsigned int VDimension>
467 template <
unsigned int VDimension>
472 unsigned int dimlim = VDimension - 1;
473 for (
unsigned int i = 0; i < dimlim; ++i)
475 os << ind[i] <<
", ";
479 os << ind[VDimension - 1];
487 template <
unsigned int VDimension>
494 template <
unsigned int VDimension>
498 return !(one == two);
501 template <
unsigned int VDimension>
505 return std::lexicographical_compare(one.
begin(), one.
end(), two.
begin(), two.
end());
508 template <
unsigned int VDimension>
515 template <
unsigned int VDimension>
522 template <
unsigned int VDimension>
530 template <
unsigned int VDimension>
538 template <
unsigned int VDimension>
const Self & operator-=(const Self &vec)
void CopyWithRound(const FixedArray< TCoordRep, VDimension > &point)
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)
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
Represent a n-dimensional size (bounds) of a n-dimensional image.
constexpr iterator begin()
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
void SetOffset(const OffsetValueType val[VDimension])
reverse_iterator rbegin()
const_reference operator[](size_type pos) const
std::reverse_iterator< const_iterator > const_reverse_iterator
void swap(Array< T > &a, Array< T > &b)
static Self GetBasisOffset(unsigned int dim)
constexpr bool empty() const
const value_type & const_reference
const_reverse_iterator rend() const
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
const_reference back() 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)
const Self & operator+=(const Size< VDimension > &sz)
static constexpr unsigned int Dimension
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.
void CopyWithCast(const FixedArray< TCoordRep, VDimension > &point)
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)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
const_reverse_iterator rbegin() const
const_reference front() const
reference at(size_type pos)
OffsetValueType GetElement(unsigned long element) const
void ExceptionThrowingBoundsCheck(size_type pos) const
const_reference at(size_type pos) const
constexpr unsigned int Dimension
constexpr const_iterator end() const
const value_type * const_iterator
void SetElement(unsigned long element, OffsetValueType val)