A templated class holding a n-Dimensional vector. More...
#include <itkVector.h>
Public Types | |
typedef FixedArray< T, NVectorDimension > | BaseArray |
typedef ValueType | CArray [VLength] |
typedef T | ComponentType |
typedef const ValueType * | const_pointer |
typedef const ValueType & | const_reference |
typedef const ValueType * | ConstIterator |
typedef ValueType * | Iterator |
typedef ValueType * | pointer |
typedef NumericTraits < ValueType >::RealType | RealValueType |
typedef ValueType & | reference |
typedef Vector | Self |
typedef unsigned int | SizeType |
typedef FixedArray< T, NVectorDimension > | Superclass |
typedef T | ValueType |
typedef Self | VectorType |
Public Member Functions | |
vnl_vector_ref< T > | Get_vnl_vector (void) |
vnl_vector< T > | Get_vnl_vector (void) const |
RealValueType | GetNorm (void) const |
RealValueType | GetSquaredNorm (void) const |
vnl_vector_ref< T > | GetVnlVector (void) |
vnl_vector< T > | GetVnlVector (void) const |
void | Normalize (void) |
ValueType | operator* (const Self &vec) const |
Self | operator+ (const Self &vec) const |
const Self & | operator+= (const Self &vec) |
Self | operator- () const |
Self | operator- (const Self &vec) const |
const Self & | operator-= (const Self &vec) |
Vector & | operator= (const ValueType r[NVectorDimension]) |
void | Set_vnl_vector (const vnl_vector< T > &) |
void | SetNthComponent (int c, const ComponentType &v) |
void | SetVnlVector (const vnl_vector< T > &) |
Vector () | |
Vector (const ValueType &r) | |
template<class TVectorValueType > | |
Vector (const Vector< TVectorValueType, NVectorDimension > &r) | |
Vector (const ValueType r[Dimension]) | |
template<class TVectorValueType > | |
Vector & | operator= (const Vector< TVectorValueType, NVectorDimension > &r) |
template<class Tt > | |
const Self & | operator*= (const Tt &value) |
template<class Tt > | |
const Self & | operator/= (const Tt &value) |
Self | operator* (const ValueType &value) const |
template<class Tt > | |
Self | operator/ (const Tt &value) const |
bool | operator== (const Self &v) const |
bool | operator!= (const Self &v) const |
template<typename TCoordRepB > | |
void | CastFrom (const Vector< TCoordRepB, NVectorDimension > &pa) |
bool | operator== (const FixedArray &r) const |
bool | operator!= (const FixedArray &r) const |
reference | operator[] (short index) |
const_reference | operator[] (short index) const |
reference | operator[] (unsigned short index) |
const_reference | operator[] (unsigned short index) const |
reference | operator[] (int index) |
const_reference | operator[] (int index) const |
reference | operator[] (unsigned int index) |
const_reference | operator[] (unsigned int index) const |
reference | operator[] (long index) |
const_reference | operator[] (long index) const |
reference | operator[] (unsigned long index) |
const_reference | operator[] (unsigned long index) const |
void | SetElement (unsigned short index, const_reference value) |
const_reference | GetElement (unsigned short index) const |
ValueType * | GetDataPointer () |
const ValueType * | GetDataPointer () const |
Iterator | Begin () |
ConstIterator | Begin () const |
Iterator | End () |
ConstIterator | End () const |
ReverseIterator | rBegin () |
ConstReverseIterator | rBegin () const |
ReverseIterator | rEnd () |
ConstReverseIterator | rEnd () const |
SizeType | Size () const |
void | Fill (const ValueType &) |
Static Public Member Functions | |
static FixedArray | Filled (const ValueType &) |
static unsigned int | GetNumberOfComponents () |
static unsigned int | GetVectorDimension () |
Static Public Attributes | |
static const unsigned int | Dimension = NVectorDimension |
static const unsigned int | Length |
A templated class holding a n-Dimensional vector.
Vector is a templated class that holds a single vector (i.e., an array of values). Vector can be used as the data type held at each pixel in an Image or at each vertex of an Mesh. The template parameter T can be any data type that behaves like a primitive (or atomic) data type (int, short, float, complex). The NVectorDimension defines the number of components in the vector array.
Vector is not a dynamically extendible array like std::vector. It is intended to be used like a mathematical vector.
If you wish a simpler pixel types, you can use Scalar, which represents a single data value at a pixel. There is also the more complex type ScalarVector, which supports (for a given pixel) a single scalar value plus an array of vector values. (The scalar and vectors can be of different data type.)
DataRepresentation/Image/VectorImage.cxx, DataRepresentation/Mesh/PointSetWithVectors.cxx, and Testing/Code/Common/itkVectorImageTest.cxx.
Definition at line 58 of file itkVector.h.
typedef FixedArray<T, NVectorDimension> itk::Vector< T, NVectorDimension >::BaseArray |
The Array type from which this vector is derived.
Definition at line 80 of file itkVector.h.
typedef ValueType itk::FixedArray< T , VLength >::CArray[VLength] [inherited] |
A type representing the C-array version of this FixedArray.
Definition at line 77 of file itkFixedArray.h.
typedef T itk::Vector< T, NVectorDimension >::ComponentType |
Component value type
Definition at line 77 of file itkVector.h.
typedef const ValueType* itk::FixedArray< T , VLength >::const_pointer [inherited] |
A const pointer to the ValueType.
Definition at line 129 of file itkFixedArray.h.
typedef const ValueType& itk::FixedArray< T , VLength >::const_reference [inherited] |
A const reference to the ValueType.
Definition at line 135 of file itkFixedArray.h.
typedef const ValueType* itk::FixedArray< T , VLength >::ConstIterator [inherited] |
A const iterator through the array.
Definition at line 83 of file itkFixedArray.h.
typedef ValueType* itk::FixedArray< T , VLength >::Iterator [inherited] |
An iterator through the array.
Definition at line 80 of file itkFixedArray.h.
typedef ValueType* itk::FixedArray< T , VLength >::pointer [inherited] |
A pointer to the ValueType.
Definition at line 126 of file itkFixedArray.h.
typedef NumericTraits< ValueType >::RealType itk::Vector< T, NVectorDimension >::RealValueType |
Definition at line 68 of file itkVector.h.
typedef ValueType& itk::FixedArray< T , VLength >::reference [inherited] |
A reference to the ValueType.
Definition at line 132 of file itkFixedArray.h.
typedef Vector itk::Vector< T, NVectorDimension >::Self |
Standard class typedefs.
Definition at line 62 of file itkVector.h.
typedef unsigned int itk::FixedArray< T , VLength >::SizeType [inherited] |
Definition at line 137 of file itkFixedArray.h.
typedef FixedArray<T,NVectorDimension> itk::Vector< T, NVectorDimension >::Superclass |
Definition at line 63 of file itkVector.h.
typedef T itk::Vector< T, NVectorDimension >::ValueType |
ValueType can be used to declare a variable that is the same type as a data element held in an Vector.
Reimplemented from itk::FixedArray< T, NVectorDimension >.
Definition at line 67 of file itkVector.h.
typedef Self itk::Vector< T, NVectorDimension >::VectorType |
I am a vector type.
Definition at line 74 of file itkVector.h.
itk::Vector< T, NVectorDimension >::Vector | ( | ) | [inline] |
Default constructor and copy constructors.
Definition at line 109 of file itkVector.h.
itk::Vector< T, NVectorDimension >::Vector | ( | const ValueType & | r | ) |
itk::Vector< T, NVectorDimension >::Vector | ( | const Vector< TVectorValueType, NVectorDimension > & | r | ) | [inline] |
Pass-through constructor for the Array base class.
Definition at line 114 of file itkVector.h.
itk::Vector< T, NVectorDimension >::Vector | ( | const ValueType | r[Dimension] | ) | [inline] |
Pass-through constructor for the Array base class.
Definition at line 115 of file itkVector.h.
Iterator itk::FixedArray< T , VLength >::Begin | ( | void | ) | [inherited] |
Get various iterators to the array.
ConstIterator itk::FixedArray< T , VLength >::Begin | ( | void | ) | const [inherited] |
Get various iterators to the array.
void itk::Vector< T, NVectorDimension >::CastFrom | ( | const Vector< TCoordRepB, NVectorDimension > & | pa | ) | [inline] |
Copy from another Vector with a different representation type. Casting is done with C-Like rules
Definition at line 225 of file itkVector.h.
Iterator itk::FixedArray< T , VLength >::End | ( | void | ) | [inherited] |
Get various iterators to the array.
ConstIterator itk::FixedArray< T , VLength >::End | ( | void | ) | const [inherited] |
Get various iterators to the array.
void itk::FixedArray< T , VLength >::Fill | ( | const ValueType & | ) | [inherited] |
Get various iterators to the array.
static FixedArray itk::FixedArray< T , VLength >::Filled | ( | const ValueType & | ) | [static, inherited] |
vnl_vector_ref<T> itk::Vector< T, NVectorDimension >::Get_vnl_vector | ( | void | ) |
Get a vnl_vector_ref referencing the same memory block.
vnl_vector<T> itk::Vector< T, NVectorDimension >::Get_vnl_vector | ( | void | ) | const |
Get a vnl_vector with a copy of the internal memory block.
ValueType* itk::FixedArray< T , VLength >::GetDataPointer | ( | ) | [inline, inherited] |
Return a pointer to the data.
Definition at line 222 of file itkFixedArray.h.
Referenced by itk::MetaArrayWriter::SetInput().
const ValueType* itk::FixedArray< T , VLength >::GetDataPointer | ( | ) | const [inline, inherited] |
Return a pointer to the data.
Definition at line 223 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::GetElement | ( | unsigned short | index | ) | const [inline, inherited] |
Set/Get element methods are more convenient in wrapping languages
Definition at line 218 of file itkFixedArray.h.
RealValueType itk::Vector< T, NVectorDimension >::GetNorm | ( | void | ) | const |
Returns the Euclidean Norm of the vector
static unsigned int itk::Vector< T, NVectorDimension >::GetNumberOfComponents | ( | ) | [inline, static] |
Returns the number of components in this vector type
Definition at line 214 of file itkVector.h.
RealValueType itk::Vector< T, NVectorDimension >::GetSquaredNorm | ( | void | ) | const |
Returns vector's Squared Euclidean Norm
static unsigned int itk::Vector< T, NVectorDimension >::GetVectorDimension | ( | ) | [inline, static] |
Get the dimension (size) of the vector.
Definition at line 83 of file itkVector.h.
vnl_vector<T> itk::Vector< T, NVectorDimension >::GetVnlVector | ( | void | ) | const |
Get a vnl_vector with a copy of the internal memory block.
vnl_vector_ref<T> itk::Vector< T, NVectorDimension >::GetVnlVector | ( | void | ) |
Get a vnl_vector_ref referencing the same memory block.
void itk::Vector< T, NVectorDimension >::Normalize | ( | void | ) |
Divides the vector componets by the vector norm
bool itk::Vector< T, NVectorDimension >::operator!= | ( | const Self & | v | ) | const [inline] |
Operators == and != compare a vector component by component. All components must be equal for two vectors to be equal. (Of course compile-time constraints on the template parameters length and type prevent comparisons between vectors of different type and length.)
Definition at line 203 of file itkVector.h.
bool itk::FixedArray< T , VLength >::operator!= | ( | const FixedArray< T, NVectorDimension > & | r | ) | const [inline, inherited] |
Operators == and != are used to compare whether two arrays are equal. Note that arrays are equal when the number of components (size) is the same, and each component value is equal.
Definition at line 194 of file itkFixedArray.h.
ValueType itk::Vector< T, NVectorDimension >::operator* | ( | const Self & | vec | ) | const |
Vector operator*. Performs the inner product of two vectors. this is also known as the scalar product.
Self itk::Vector< T, NVectorDimension >::operator* | ( | const ValueType & | value | ) | const [inline] |
Scalar operator*. Scale the elements of a vector by a scalar. Return a new vector.
Definition at line 173 of file itkVector.h.
const Self& itk::Vector< T, NVectorDimension >::operator*= | ( | const Tt & | value | ) | [inline] |
Scalar operator*=. Scales elements by a scalar.
Definition at line 130 of file itkVector.h.
Self itk::Vector< T, NVectorDimension >::operator+ | ( | const Self & | vec | ) | const |
Vector addition. Add two vectors. Return a new vector.
const Self& itk::Vector< T, NVectorDimension >::operator+= | ( | const Self & | vec | ) |
Vector operator+=. Adds a vectors to the current vector.
Self itk::Vector< T, NVectorDimension >::operator- | ( | const Self & | vec | ) | const |
Vector subtraction. Subtract two vectors. Return a new vector.
Self itk::Vector< T, NVectorDimension >::operator- | ( | ) | const |
Vector negation. Negate all the elements of a vector. Return a new vector
const Self& itk::Vector< T, NVectorDimension >::operator-= | ( | const Self & | vec | ) |
Vector operator-=. Subtracts a vector from a current vector.
Self itk::Vector< T, NVectorDimension >::operator/ | ( | const Tt & | value | ) | const [inline] |
Scalar operator/. Scale (divide) the elements of a vector by a scalar. Return a new vector.
Definition at line 186 of file itkVector.h.
const Self& itk::Vector< T, NVectorDimension >::operator/= | ( | const Tt & | value | ) | [inline] |
Scalar operator/=. Scales (divides) elements by a scalar.
Definition at line 141 of file itkVector.h.
Vector& itk::Vector< T, NVectorDimension >::operator= | ( | const Vector< TVectorValueType, NVectorDimension > & | r | ) | [inline] |
Pass-through assignment operator for the Array base class.
Definition at line 120 of file itkVector.h.
Vector& itk::Vector< T, NVectorDimension >::operator= | ( | const ValueType | r[NVectorDimension] | ) |
bool itk::Vector< T, NVectorDimension >::operator== | ( | const Self & | v | ) | const [inline] |
Operators == and != compare a vector component by component. All components must be equal for two vectors to be equal. (Of course compile-time constraints on the template parameters length and type prevent comparisons between vectors of different type and length.)
Definition at line 201 of file itkVector.h.
Referenced by itk::Vector< CoordRepType, itkGetStaticConstMacro(SpaceDimension)>::operator!=().
bool itk::FixedArray< T , VLength >::operator== | ( | const FixedArray< T, NVectorDimension > & | r | ) | const [inherited] |
Operators == and != are used to compare whether two arrays are equal. Note that arrays are equal when the number of components (size) is the same, and each component value is equal.
Referenced by itk::Vector< CoordRepType, itkGetStaticConstMacro(SpaceDimension)>::operator==().
reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned short | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 203 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned long | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 212 of file itkFixedArray.h.
reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned int | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 207 of file itkFixedArray.h.
reference itk::FixedArray< T , VLength >::operator[] | ( | int | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 205 of file itkFixedArray.h.
reference itk::FixedArray< T , VLength >::operator[] | ( | long | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 209 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | int | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 206 of file itkFixedArray.h.
reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned long | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 211 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | long | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 210 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned int | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 208 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | short | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 202 of file itkFixedArray.h.
const_reference itk::FixedArray< T , VLength >::operator[] | ( | unsigned short | index | ) | const [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 204 of file itkFixedArray.h.
reference itk::FixedArray< T , VLength >::operator[] | ( | short | index | ) | [inline, inherited] |
Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.
Definition at line 201 of file itkFixedArray.h.
Referenced by itk::Vector< CoordRepType, itkGetStaticConstMacro(SpaceDimension)>::SetNthComponent().
ReverseIterator itk::FixedArray< T , VLength >::rBegin | ( | ) | [inherited] |
Get various iterators to the array.
ConstReverseIterator itk::FixedArray< T , VLength >::rBegin | ( | ) | const [inherited] |
Get various iterators to the array.
ReverseIterator itk::FixedArray< T , VLength >::rEnd | ( | ) | [inherited] |
Get various iterators to the array.
ConstReverseIterator itk::FixedArray< T , VLength >::rEnd | ( | ) | const [inherited] |
Get various iterators to the array.
void itk::Vector< T, NVectorDimension >::Set_vnl_vector | ( | const vnl_vector< T > & | ) |
Set a vnl_vector_ref referencing the same memory block.
void itk::FixedArray< T , VLength >::SetElement | ( | unsigned short | index, | |
const_reference | value | |||
) | [inline, inherited] |
Set/Get element methods are more convenient in wrapping languages
Definition at line 216 of file itkFixedArray.h.
void itk::Vector< T, NVectorDimension >::SetNthComponent | ( | int | c, | |
const ComponentType & | v | |||
) | [inline] |
Definition at line 219 of file itkVector.h.
void itk::Vector< T, NVectorDimension >::SetVnlVector | ( | const vnl_vector< T > & | ) |
Set a vnl_vector_ref referencing the same memory block.
SizeType itk::FixedArray< T , VLength >::Size | ( | void | ) | const [inherited] |
Get various iterators to the array.
const unsigned int itk::Vector< T, NVectorDimension >::Dimension = NVectorDimension [static] |
Dimension of the vector space.
Reimplemented from itk::FixedArray< T, NVectorDimension >.
Definition at line 71 of file itkVector.h.
const unsigned int itk::FixedArray< T , VLength >::Length [static, inherited] |
Length constant
Definition at line 68 of file itkFixedArray.h.