#include <itkIndex.h>
template<unsigned int VDimension = 2>
struct itk::Index< VDimension >
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.
- ITK Sphinx Examples:
-
- Examples
- SphinxExamples/src/Core/Common/BresenhamLine/Code.cxx, SphinxExamples/src/Core/Common/CreateAIndex/Code.cxx, SphinxExamples/src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx, SphinxExamples/src/Core/Common/FilterImage/Code.cxx, SphinxExamples/src/Core/Common/FilterImageWithoutCopying/Code.cxx, SphinxExamples/src/Core/Common/ImageBufferAndIndexRange/Code.cxx, SphinxExamples/src/Core/Common/IterateImageStartingAtSeed/Code.cxx, SphinxExamples/src/Core/Common/NeighborhoodIteratorOnVectorImage/Code.cxx, SphinxExamples/src/Core/Common/PassImageToFunction/Code.cxx, SphinxExamples/src/Core/Common/ReturnObjectFromFunction/Code.cxx, SphinxExamples/src/Core/Common/SortITKIndex/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx, SphinxExamples/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx, SphinxExamples/src/Core/Transform/TranslateAVectorImage/Code.cxx, SphinxExamples/src/Developer/ImageFilter.cxx, SphinxExamples/src/Developer/InplaceImageFilter.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ClosingBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/OpeningBinaryImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MeanDistanceBetweenAllPointsOnTwoCurves/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/FFT/ComputeInverseFFTOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompose/JoinImages/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/ApplyAFilterOnlyToASpecifiedImageRegion/Code.cxx, SphinxExamples/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixelInNonZeroImage/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageGradient/GradientOfVectorImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx, SphinxExamples/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx, SphinxExamples/src/Filtering/Path/ExtractContoursFromImage/Code.cxx, SphinxExamples/src/Numerics/Statistics/ComputeTextureFeatures/Code.cxx, SphinxExamples/src/Registration/Common/MatchFeaturePoints/Code.cxx, and SphinxExamples/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx.
Definition at line 68 of file itkIndex.h.
|
static constexpr unsigned int | Dimension = VDimension |
|
◆ const_iterator
template<unsigned int VDimension = 2>
◆ const_reference
template<unsigned int VDimension = 2>
◆ const_reverse_iterator
template<unsigned int VDimension = 2>
◆ difference_type
template<unsigned int VDimension = 2>
◆ IndexType
template<unsigned int VDimension = 2>
◆ IndexValueType
template<unsigned int VDimension = 2>
◆ iterator
template<unsigned int VDimension = 2>
◆ OffsetType
template<unsigned int VDimension = 2>
◆ OffsetValueType
template<unsigned int VDimension = 2>
◆ reference
template<unsigned int VDimension = 2>
◆ reverse_iterator
template<unsigned int VDimension = 2>
◆ Self
template<unsigned int VDimension = 2>
Standard class type aliases.
Definition at line 75 of file itkIndex.h.
◆ size_type
template<unsigned int VDimension = 2>
◆ SizeType
template<unsigned int VDimension = 2>
◆ value_type
template<unsigned int VDimension = 2>
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 333 of file itkIndex.h.
◆ assign()
template<unsigned int VDimension = 2>
Mirror behavior of the std::array manipulations See std::array for documentation on these methods
Definition at line 348 of file itkIndex.h.
◆ at() [1/2]
template<unsigned int VDimension = 2>
◆ at() [2/2]
template<unsigned int VDimension = 2>
◆ back() [1/2]
template<unsigned int VDimension = 2>
◆ back() [2/2]
template<unsigned int VDimension = 2>
◆ begin() [1/2]
template<unsigned int VDimension = 2>
◆ begin() [2/2]
template<unsigned int VDimension = 2>
◆ cbegin()
template<unsigned int VDimension = 2>
◆ cend()
template<unsigned int VDimension = 2>
◆ CopyWithCast()
template<unsigned int VDimension = 2>
template<typename TCoordinate >
◆ CopyWithRound()
template<unsigned int VDimension = 2>
template<typename TCoordinate >
◆ data() [1/2]
template<unsigned int VDimension = 2>
◆ data() [2/2]
template<unsigned int VDimension = 2>
◆ empty()
template<unsigned int VDimension = 2>
constexpr bool itk::Index< VDimension >::empty |
( |
| ) |
const |
|
inlineconstexpr |
◆ end() [1/2]
template<unsigned int VDimension = 2>
◆ end() [2/2]
template<unsigned int VDimension = 2>
◆ ExceptionThrowingBoundsCheck()
template<unsigned int VDimension = 2>
◆ Fill()
template<unsigned int VDimension = 2>
◆ Filled()
template<unsigned int VDimension = 2>
Returns an Index object, filled with the specified value for each element.
- Examples
- SphinxExamples/src/Core/Common/AddOffsetToIndex/Code.cxx, SphinxExamples/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx, SphinxExamples/src/Core/Common/DistanceBetweenIndices/Code.cxx, SphinxExamples/src/Core/Common/IterateImageStartingAtSeed/Code.cxx, SphinxExamples/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx, SphinxExamples/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx, SphinxExamples/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx, and SphinxExamples/src/Filtering/Path/ExtractContoursFromImage/Code.cxx.
Definition at line 503 of file itkIndex.h.
◆ front() [1/2]
template<unsigned int VDimension = 2>
◆ front() [2/2]
template<unsigned int VDimension = 2>
◆ GetBasisIndex()
template<unsigned int VDimension>
Index< VDimension > itk::Index< VDimension >::GetBasisIndex |
( |
unsigned int |
dim | ) |
|
|
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 523 of file itkIndex.h.
◆ GetElement()
template<unsigned int VDimension = 2>
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.
- Warning
- No bound checking is performed
- See also
- GetIndex()
-
SetElement()
Definition at line 265 of file itkIndex.h.
◆ GetIndex()
template<unsigned int VDimension = 2>
◆ GetIndexDimension()
template<unsigned int VDimension = 2>
static constexpr unsigned int itk::Index< VDimension >::GetIndexDimension |
( |
| ) |
|
|
inlinestaticconstexpr |
Get the dimension.
Definition at line 93 of file itkIndex.h.
◆ max_size()
template<unsigned int VDimension = 2>
◆ operator*()
template<unsigned int VDimension = 2>
Multiply an index by a size (elementwise product).
Definition at line 217 of file itkIndex.h.
◆ operator+() [1/2]
template<unsigned int VDimension = 2>
Add an offset to an index.
Definition at line 152 of file itkIndex.h.
◆ operator+() [2/2]
template<unsigned int VDimension = 2>
Add a size to an index.
Definition at line 101 of file itkIndex.h.
◆ operator+=() [1/2]
template<unsigned int VDimension = 2>
Increment index by an offset.
Definition at line 165 of file itkIndex.h.
◆ operator+=() [2/2]
template<unsigned int VDimension = 2>
Increment index by a size.
Definition at line 114 of file itkIndex.h.
◆ operator-() [1/3]
template<unsigned int VDimension = 2>
Subtract an offset from an index.
Definition at line 189 of file itkIndex.h.
◆ operator-() [2/3]
template<unsigned int VDimension = 2>
◆ operator-() [3/3]
template<unsigned int VDimension = 2>
Subtract a size from an index.
Definition at line 127 of file itkIndex.h.
◆ operator-=() [1/2]
template<unsigned int VDimension = 2>
Decrement index by an offset.
Definition at line 177 of file itkIndex.h.
◆ operator-=() [2/2]
template<unsigned int VDimension = 2>
Decrement index by a size.
Definition at line 140 of file itkIndex.h.
◆ operator[]() [1/2]
template<unsigned int VDimension = 2>
◆ operator[]() [2/2]
template<unsigned int VDimension = 2>
◆ rbegin() [1/2]
template<unsigned int VDimension = 2>
◆ rbegin() [2/2]
template<unsigned int VDimension = 2>
◆ rend() [1/2]
template<unsigned int VDimension = 2>
◆ rend() [2/2]
template<unsigned int VDimension = 2>
◆ SetElement()
template<unsigned int VDimension = 2>
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.
- Warning
- No bound checking is performed.
- See also
- SetIndex()
-
GetElement()
Definition at line 253 of file itkIndex.h.
◆ SetIndex()
template<unsigned int VDimension = 2>
◆ size()
template<unsigned int VDimension = 2>
◆ swap()
template<unsigned int VDimension = 2>
◆ Dimension
template<unsigned int VDimension = 2>
constexpr unsigned int itk::Index< VDimension >::Dimension = VDimension |
|
staticconstexpr |
Dimension constant
Definition at line 89 of file itkIndex.h.
◆ m_InternalArray
template<unsigned int VDimension = 2>
The documentation for this struct was generated from the following file: