Main Page
Groups
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File
List
Namespace Members
Compound Members
File Members
Concepts
Represent a n-dimensional index in a n-dimensional image.
More...
#include <itkIndex.h>
List of all members.
Detailed Description
template<unsigned int VIndexDimension = 2>
class itk::Index< VIndexDimension >
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_Index) allowing for fast and convenient instantiations/assignments.
The following syntax for assigning an index is allowed/suggested:
Index<3> index = {{5, 2, 7}};
The double braces {{ and }} are needed to prevent a compiler warning about a partly bracketed initializer.
- Remarks:
- Should there be an itkBoundedIndex to handle bounds checking? Or should there be an API to perform bounded increments in the iterator.
Definition at line 62 of file itkIndex.h.
Member Typedef Documentation
|
Standard class typedefs. Definition at line 65 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
typedef Size<VIndexDimension> itk::Index< VIndexDimension >::SizeType |
|
Member Function Documentation
|
Set one value for the index in all dimensions. Useful for initializing an offset to zero. Definition at line 236 of file itkIndex.h. |
template<unsigned int VIndexDimension> |
Index< VIndexDimension > itk::Index< VIndexDimension >::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, ..., VIndexDimension-1. Definition at line 252 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
IndexValueType itk::Index< VIndexDimension >::GetElement |
( |
unsigned long |
element |
) |
[inline] |
|
|
Gets the value of one of the elements in the index. 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 226 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const IndexValueType* itk::Index< VIndexDimension >::GetIndex |
( |
void |
|
) |
const [inline] |
|
|
Get the index. This provides a read only reference to the index. - See also:
- SetIndex()
Definition at line 202 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
unsigned int itk::Index< VIndexDimension >::GetIndexDimension |
( |
|
) |
[inline, static] |
|
|
Get the dimension (size) of the index. Definition at line 72 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self itk::Index< VIndexDimension >::operator * |
( |
const SizeType & |
vec |
) |
const [inline] |
|
|
Multiply an index by a size (elementwise product). This method models a random access Index. Definition at line 158 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
bool itk::Index< VIndexDimension >::operator!= |
( |
const Self & |
vec |
) |
const [inline] |
|
template<unsigned int VIndexDimension = 2> |
const Self itk::Index< VIndexDimension >::operator+ |
( |
const OffsetType & |
offset |
) |
const [inline] |
|
|
Add an offset to an index. Definition at line 104 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self itk::Index< VIndexDimension >::operator+ |
( |
const SizeType & |
size |
) |
const [inline] |
|
|
Add a size to an index. This method models a random access Index. Definition at line 83 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self& itk::Index< VIndexDimension >::operator+= |
( |
const OffsetType & |
offset |
) |
[inline] |
|
|
Increment index by an offset. This method models a random access Index. Definition at line 115 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self& itk::Index< VIndexDimension >::operator+= |
( |
const SizeType & |
size |
) |
[inline] |
|
|
Increment index by a size. This method models a random access Index. Definition at line 94 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const OffsetType itk::Index< VIndexDimension >::operator- |
( |
const Self & |
vec |
) |
const [inline] |
|
|
Subtract two indices. This method models a random access Index. Definition at line 146 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self itk::Index< VIndexDimension >::operator- |
( |
const OffsetType & |
off |
) |
const [inline] |
|
|
Subtract an offset from an index. Definition at line 135 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
const Self& itk::Index< VIndexDimension >::operator-= |
( |
const OffsetType & |
offset |
) |
[inline] |
|
|
Decrement index by an offset. This method models a random access Index. Definition at line 125 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
bool itk::Index< VIndexDimension >::operator== |
( |
const Self & |
vec |
) |
const [inline] |
|
template<unsigned int VIndexDimension = 2> |
IndexValueType itk::Index< VIndexDimension >::operator[] |
( |
unsigned int |
dim |
) |
const [inline] |
|
|
Access an element of the index. Elements are numbered 0, ..., VIndexDimension-1. This version can only be an rvalue. No bounds checking is performed. Definition at line 197 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
IndexValueType& itk::Index< VIndexDimension >::operator[] |
( |
unsigned int |
dim |
) |
[inline] |
|
|
Access an element of the index. Elements are numbered 0, ..., VIndexDimension-1. No bounds checking is performed. Definition at line 191 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
void itk::Index< VIndexDimension >::SetElement |
( |
unsigned long |
element, |
|
|
IndexValueType |
val |
|
) |
[inline] |
|
|
Sets the value of one of the elements in the index. 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 217 of file itkIndex.h. |
template<unsigned int VIndexDimension = 2> |
void itk::Index< VIndexDimension >::SetIndex |
( |
const IndexValueType |
val[VIndexDimension] |
) |
[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. - See also:
- GetIndex()
Definition at line 208 of file itkIndex.h. |
Member Data Documentation
|
Index is an "aggregate" class. Its data is public (m_Index) allowing for fast and convienent instantiations/assignments.
The following syntax for assigning an index is allowed/suggested: Index<3> index = {5, 2, 7}; Definition at line 244 of file itkIndex.h.
Referenced by itk::Index< VSetDimension >::operator *(). |
The documentation for this class was generated from the following file:
Generated at Sat Mar 31 02:57:10 2007 for ITK by
1.3.8 written by Dimitri van Heesch,
© 1997-2000