#include <itkIndex.h>
Represent a n-dimensional index in a n-dimensional image.
Index is a templated class to represent a multi-dimensional index, i.e. (i,j,k,...). Index is templated over the dimension of the index. ITK assumes the first element of an index is the fastest moving index.
For efficiency sake, Index does not define a default constructor, a copy constructor, or an operator=. We rely on the compiler to provide efficient bitwise copies.
Index is an "aggregate" class. Its data is public (m_InternalArray) allowing for fast and convenient instantiations/assignments.
The following syntax for assigning an aggregate type like this is allowed/suggested:
Index<3> var{{ 256, 256, 20 }}; // Also prevent narrowing conversions Index<3> var = {{ 256, 256, 20 }};
The doubled braces {{ and }} are required to prevent ‘gcc -Wall’ (and perhaps other compilers) from complaining about a partly bracketed initializer.
As an aggregate type that is intended to provide highest performance characteristics, this class is not appropriate to inherit from, so setting this struct as final.
Definition at line 68 of file itkIndex.h.
Public Types | |
using | const_iterator = const value_type * |
using | const_reference = const value_type & |
using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
using | difference_type = ptrdiff_t |
using | IndexType = Index<VDimension> |
using | IndexValueType = itk::IndexValueType |
using | iterator = value_type * |
using | OffsetType = Offset<VDimension> |
using | OffsetValueType = itk::OffsetValueType |
using | reference = value_type & |
using | reverse_iterator = std::reverse_iterator<iterator> |
using | Self = Index |
using | size_type = unsigned int |
using | SizeType = Size<VDimension> |
using | value_type = itk::IndexValueType |
Public Member Functions | |
void | assign (const value_type &newValue) |
reference | at (size_type pos) |
const_reference | at (size_type pos) const |
constexpr reference | back () |
constexpr const_reference | back () const |
constexpr iterator | begin () |
constexpr const_iterator | begin () const |
constexpr const_iterator | cbegin () const |
constexpr const_iterator | cend () const |
template<typename TCoordinate> | |
void | CopyWithCast (const FixedArray< TCoordinate, VDimension > &point) |
template<typename TCoordinate> | |
void | CopyWithRound (const FixedArray< TCoordinate, VDimension > &point) |
IndexValueType * | data () |
const IndexValueType * | data () const |
constexpr bool | empty () const |
constexpr iterator | end () |
constexpr const_iterator | end () const |
void | Fill (IndexValueType value) |
constexpr reference | front () |
constexpr const_reference | front () const |
IndexValueType | GetElement (unsigned int element) const |
const IndexValueType * | GetIndex () const |
constexpr size_type | max_size () const |
const Self | operator* (const SizeType &vec) const |
const Self | operator+ (const OffsetType &offset) const |
const Self | operator+ (const SizeType &sz) const |
const Self & | operator+= (const OffsetType &offset) |
const Self & | operator+= (const SizeType &sz) |
const Self | operator- (const OffsetType &off) const |
const OffsetType | operator- (const Self &vec) const |
const Self | operator- (const SizeType &sz) const |
const Self & | operator-= (const OffsetType &offset) |
const Self & | operator-= (const SizeType &sz) |
constexpr reference | operator[] (size_type pos) |
constexpr const_reference | operator[] (size_type pos) const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
void | SetElement (unsigned int element, IndexValueType val) |
void | SetIndex (const IndexValueType val[VDimension]) |
constexpr size_type | size () const |
void | swap (Index &other) noexcept |
Static Public Member Functions | |
static constexpr Self | Filled (const IndexValueType value) |
static Self | GetBasisIndex (unsigned int dim) |
static constexpr unsigned int | GetIndexDimension () |
Public Attributes | |
IndexValueType | m_InternalArray [VDimension] |
Static Public Attributes | |
static constexpr unsigned int | Dimension = VDimension |
Private Member Functions | |
void | ExceptionThrowingBoundsCheck (size_type pos) const |
using itk::Index< VDimension >::const_iterator = const value_type * |
Definition at line 330 of file itkIndex.h.
using itk::Index< VDimension >::const_reference = const value_type & |
Definition at line 328 of file itkIndex.h.
using itk::Index< VDimension >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 334 of file itkIndex.h.
using itk::Index< VDimension >::difference_type = ptrdiff_t |
Definition at line 332 of file itkIndex.h.
using itk::Index< VDimension >::IndexType = Index<VDimension> |
Compatible Index and value type alias
Definition at line 78 of file itkIndex.h.
using itk::Index< VDimension >::IndexValueType = itk::IndexValueType |
Definition at line 79 of file itkIndex.h.
using itk::Index< VDimension >::iterator = value_type * |
Definition at line 329 of file itkIndex.h.
using itk::Index< VDimension >::OffsetType = Offset<VDimension> |
Compatible Offset and Offset value type alias.
Definition at line 85 of file itkIndex.h.
using itk::Index< VDimension >::OffsetValueType = itk::OffsetValueType |
Definition at line 86 of file itkIndex.h.
using itk::Index< VDimension >::reference = value_type & |
Definition at line 327 of file itkIndex.h.
using itk::Index< VDimension >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 333 of file itkIndex.h.
using itk::Index< VDimension >::Self = Index |
Standard class type aliases.
Definition at line 75 of file itkIndex.h.
using itk::Index< VDimension >::size_type = unsigned int |
Definition at line 331 of file itkIndex.h.
using itk::Index< VDimension >::SizeType = Size<VDimension> |
Compatible Size type alias.
Definition at line 82 of file itkIndex.h.
using itk::Index< VDimension >::value_type = itk::IndexValueType |
Mirror the std::array type aliases and member function so that the Index class can be treated as a container class in a way that is similar to the std::array.
Definition at line 326 of file itkIndex.h.
|
inline |
Mirror behavior of the std::array manipulations See std::array for documentation on these methods
Definition at line 341 of file itkIndex.h.
|
inline |
Definition at line 443 of file itkIndex.h.
|
inline |
Definition at line 450 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 469 of file itkIndex.h.
Referenced by itk::IndexRange< VDimension, false >< InputImageType::ImageDimension >::end().
|
inlineconstexpr |
Definition at line 475 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 359 of file itkIndex.h.
Referenced by itk::operator<(), and itk::operator==().
|
inlineconstexpr |
Definition at line 365 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 353 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 371 of file itkIndex.h.
|
inline |
Copy values from a FixedArray by casting each one of the components
Definition at line 305 of file itkIndex.h.
|
inline |
Copy values from a FixedArray by rounding each one of the components
Definition at line 294 of file itkIndex.h.
|
inline |
Definition at line 481 of file itkIndex.h.
|
inline |
Definition at line 487 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 425 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 377 of file itkIndex.h.
Referenced by itk::operator<(), and itk::operator==().
|
inlineconstexpr |
Definition at line 383 of file itkIndex.h.
|
inlineprivate |
Definition at line 504 of file itkIndex.h.
|
inline |
Set one value for the index in all dimensions. Useful for initializing an offset to zero.
Definition at line 269 of file itkIndex.h.
|
inlinestaticconstexpr |
Returns an Index object, filled with the specified value for each element.
Definition at line 496 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 457 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 463 of file itkIndex.h.
|
static |
Return a basis vector of the form [0, ..., 0, 1, 0, ... 0] where the "1" is positioned in the location specified by the parameter "dim". Valid values of "dim" are 0, ..., VDimension-1.
Definition at line 516 of file itkIndex.h.
|
inline |
Gets the value of one of the elements. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
Definition at line 261 of file itkIndex.h.
|
inline |
Get the index. This provides a read only pointer to the index.
Definition at line 227 of file itkIndex.h.
Referenced by itk::BoxMeanCalculatorFunction(), and itk::BoxSigmaCalculatorFunction().
|
inlinestaticconstexpr |
Get the dimension.
Definition at line 93 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 419 of file itkIndex.h.
|
inline |
Multiply an index by a size (elementwise product).
Definition at line 213 of file itkIndex.h.
|
inline |
Add an offset to an index.
Definition at line 150 of file itkIndex.h.
|
inline |
Add a size to an index.
Definition at line 101 of file itkIndex.h.
|
inline |
Increment index by an offset.
Definition at line 163 of file itkIndex.h.
|
inline |
Increment index by a size.
Definition at line 114 of file itkIndex.h.
|
inline |
Subtract an offset from an index.
Definition at line 185 of file itkIndex.h.
|
inline |
Subtract two indices.
Definition at line 198 of file itkIndex.h.
|
inline |
Subtract a size from an index.
Definition at line 126 of file itkIndex.h.
|
inline |
Decrement index by an offset.
Definition at line 174 of file itkIndex.h.
|
inline |
Decrement index by a size.
Definition at line 139 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 431 of file itkIndex.h.
|
inlineconstexpr |
Definition at line 437 of file itkIndex.h.
|
inline |
Definition at line 389 of file itkIndex.h.
|
inline |
Definition at line 395 of file itkIndex.h.
|
inline |
Definition at line 401 of file itkIndex.h.
|
inline |
Definition at line 407 of file itkIndex.h.
|
inline |
Sets the value of one of the elements. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
Definition at line 249 of file itkIndex.h.
|
inline |
Set the index. Try to prototype this function so that val has to point to a block of memory that is the appropriate size.
Definition at line 237 of file itkIndex.h.
Referenced by itk::BoxMeanCalculatorFunction(), and itk::BoxSigmaCalculatorFunction().
|
inlineconstexpr |
Definition at line 413 of file itkIndex.h.
|
inlinenoexcept |
Definition at line 347 of file itkIndex.h.
|
staticconstexpr |
Dimension constant
Definition at line 89 of file itkIndex.h.
IndexValueType itk::Index< VDimension >::m_InternalArray[VDimension] |
Index is an "aggregate" class. Its data is public (m_InternalArray) allowing for fast and convenient instantiations/assignments. ( See main class documentation for an example of initialization)
Definition at line 289 of file itkIndex.h.
Referenced by itk::ImageRegionSplitterBase::GetNumberOfSplits(), itk::ImageRegionSplitterBase::GetSplit(), operator-(), and itk::MultiThreaderBase::ParallelizeImageRegion().