Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::CovariantVector< T, NVectorDimension > Class Template Reference
[Geometry Representation ObjectsData Representation Objects]

#include <itkCovariantVector.h>

Inheritance diagram for itk::CovariantVector< T, NVectorDimension >:

Inheritance graph
[legend]
Collaboration diagram for itk::CovariantVector< T, NVectorDimension >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T, unsigned int NVectorDimension = 3>
class itk::CovariantVector< T, NVectorDimension >

A templated class holding a n-Dimensional covariant vector.

CovariantVector is a templated class that holds a single vector (i.e., an array of values). CovariantVector 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.

CovariantVector 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 ScalarCovariantVector, 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.)

CovariantVector is the type that should be used for representing normals to surfaces and gradients of functions. AffineTransform transform covariant vectors different than vectors.

See also:
Image

Mesh

Point

Vector

Matrix

Examples:

DataRepresentation/Mesh/PointSetWithCovariantVectors.cxx.

Definition at line 64 of file itkCovariantVector.h.

Public Types

typedef FixedArray< T, NVectorDimension > BaseArray
typedef ValueType CArray [VLength]
typedef const ValueTypeconst_pointer
typedef const ValueTypeconst_reference
typedef const ValueTypeConstIterator
typedef Self CovariantVectorType
typedef ValueTypeIterator
typedef ValueTypepointer
typedef NumericTraits< ValueType
>::RealType 
RealValueType
typedef ValueTypereference
typedef CovariantVector Self
typedef unsigned int SizeType
typedef FixedArray< T, NVectorDimension > Superclass
typedef T ValueType

Public Member Functions

ConstIterator Begin () const
Iterator Begin ()
 CovariantVector (const ValueType &r)
 CovariantVector ()
ConstIterator End () const
Iterator End ()
void Fill (const ValueType &)
vnl_vector< T > Get_vnl_vector (void) const
vnl_vector_ref< T > Get_vnl_vector (void)
const ValueTypeGetDataPointer () const
ValueTypeGetDataPointer ()
const_reference GetElement (unsigned short index) const
RealValueType GetNorm (void) const
RealValueType GetSquaredNorm (void) const
vnl_vector< T > GetVnlVector (void) const
vnl_vector_ref< T > GetVnlVector (void)
 itkStaticConstMacro (Dimension, unsigned int, VLength)
 itkStaticConstMacro (Length, unsigned int, VLength)
 itkStaticConstMacro (Dimension, unsigned int, NVectorDimension)
void Normalize (void)
ValueType operator * (const Vector< T, NVectorDimension > &vec) const
ValueType operator * (const Self &vec) const
bool operator!= (const FixedArray &r) const
Self operator+ (const Self &vec) const
const Selfoperator+= (const Self &vec)
Self operator- (const Self &vec) const
Self operator- () const
const Selfoperator-= (const Self &vec)
bool operator== (const FixedArray &r) const
const_reference operator[] (unsigned long index) const
reference operator[] (unsigned long index)
const_reference operator[] (long index) const
reference operator[] (long index)
const_reference operator[] (unsigned int index) const
reference operator[] (unsigned int index)
const_reference operator[] (int index) const
reference operator[] (int index)
const_reference operator[] (unsigned short index) const
reference operator[] (unsigned short index)
const_reference operator[] (short index) const
reference operator[] (short index)
ConstReverseIterator rBegin () const
ReverseIterator rBegin ()
ConstReverseIterator rEnd () const
ReverseIterator rEnd ()
void Set_vnl_vector (const vnl_vector< T > &)
void SetElement (unsigned short index, const_reference value)
void SetVnlVector (const vnl_vector< T > &)
SizeType Size () const
template<typename TCoordRepB>
void CastFrom (const CovariantVector< TCoordRepB, NVectorDimension > &pa)
Self operator * (const ValueType &val) const
template<class Tt>
const Selfoperator *= (const Tt &value)
template<class Tt>
Self operator/ (const Tt &val) const
template<class Tt>
const Selfoperator/= (const Tt &value)
CovariantVectoroperator= (const ValueType r[NVectorDimension])
CovariantVectoroperator= (const Self &r)
template<class Tt>
Selfoperator= (const Tt &v)

Static Public Member Functions

static FixedArray Filled (const ValueType &)
static unsigned int GetCovariantVectorDimension ()
static unsigned int GetNumberOfComponents ()


Member Typedef Documentation

template<class T, unsigned int NVectorDimension = 3>
typedef FixedArray<T, NVectorDimension> itk::CovariantVector< T, NVectorDimension >::BaseArray

The Array type from which this CovariantVector is derived.

Definition at line 84 of file itkCovariantVector.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 const ValueType* itk::FixedArray< T , VLength >::const_pointer [inherited]

A const pointer to the ValueType.

Definition at line 123 of file itkFixedArray.h.

typedef const ValueType& itk::FixedArray< T , VLength >::const_reference [inherited]

A const reference to the ValueType.

Definition at line 129 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.

template<class T, unsigned int NVectorDimension = 3>
typedef Self itk::CovariantVector< T, NVectorDimension >::CovariantVectorType

I am a covariant vector.

Definition at line 81 of file itkCovariantVector.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 120 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
typedef NumericTraits< ValueType >::RealType itk::CovariantVector< T, NVectorDimension >::RealValueType

Definition at line 75 of file itkCovariantVector.h.

typedef ValueType& itk::FixedArray< T , VLength >::reference [inherited]

A reference to the ValueType.

Definition at line 126 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
typedef CovariantVector itk::CovariantVector< T, NVectorDimension >::Self

Standard class typedefs.

Definition at line 69 of file itkCovariantVector.h.

typedef unsigned int itk::FixedArray< T , VLength >::SizeType [inherited]

Definition at line 131 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
typedef FixedArray<T,NVectorDimension> itk::CovariantVector< T, NVectorDimension >::Superclass

Definition at line 70 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
typedef T itk::CovariantVector< T, NVectorDimension >::ValueType

ValueType can be used to declare a variable that is the same type as a data element held in an CovariantVector.

Reimplemented from itk::FixedArray< T, NVectorDimension >.

Definition at line 74 of file itkCovariantVector.h.


Constructor & Destructor Documentation

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector (  )  [inline]

Default constructor has nothing to do.

Definition at line 114 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector ( const ValueType r  ) 

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector ( const Self r  )  [inline]

Pass-through constructor for the Array base class.

Definition at line 118 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector ( const ValueType  r[Dimension]  )  [inline]

Definition at line 119 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector ( const ValueType  r[Dimension]  )  [inline]

Definition at line 119 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::CovariantVector ( const Self r  )  [inline]

Pass-through constructor for the Array base class.

Definition at line 118 of file itkCovariantVector.h.


Member Function Documentation

ConstIterator itk::FixedArray< T , VLength >::Begin ( void   )  const [inherited]

Iterator itk::FixedArray< T , VLength >::Begin ( void   )  [inherited]

Get various iterators to the array.

template<class T, unsigned int NVectorDimension = 3>
template<typename TCoordRepB>
void itk::CovariantVector< T, NVectorDimension >::CastFrom ( const CovariantVector< TCoordRepB, NVectorDimension > &  pa  )  [inline]

Copy from another CovariantVector with a different representation type. Casting is done with C-Like rules

Definition at line 225 of file itkCovariantVector.h.

ConstIterator itk::FixedArray< T , VLength >::End ( void   )  const [inherited]

Iterator itk::FixedArray< T , VLength >::End ( void   )  [inherited]

void itk::FixedArray< T , VLength >::Fill ( const ValueType  )  [inherited]

static FixedArray itk::FixedArray< T , VLength >::Filled ( const ValueType  )  [static, inherited]

template<class T, unsigned int NVectorDimension = 3>
vnl_vector<T> itk::CovariantVector< T, NVectorDimension >::Get_vnl_vector ( void   )  const

Get a vnl_vector with a copy of the internal memory block.

Deprecated:
Use GetVnlVector() instead.

template<class T, unsigned int NVectorDimension = 3>
vnl_vector_ref<T> itk::CovariantVector< T, NVectorDimension >::Get_vnl_vector ( void   ) 

Get a vnl_vector_ref referencing the same memory block.

Deprecated:
Use GetVnlVector() instead.

template<class T, unsigned int NVectorDimension = 3>
static unsigned int itk::CovariantVector< T, NVectorDimension >::GetCovariantVectorDimension (  )  [inline, static]

Get the dimension (size) of the vector.

Definition at line 87 of file itkCovariantVector.h.

const ValueType* itk::FixedArray< T , VLength >::GetDataPointer (  )  const [inline, inherited]

Definition at line 201 of file itkFixedArray.h.

ValueType* itk::FixedArray< T , VLength >::GetDataPointer (  )  [inline, inherited]

Return a pointer to the data.

Definition at line 200 of file itkFixedArray.h.

Referenced by itk::MetaArrayWriter::SetInput().

const_reference itk::FixedArray< T , VLength >::GetElement ( unsigned short  index  )  const [inline, inherited]

Definition at line 196 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
RealValueType itk::CovariantVector< T, NVectorDimension >::GetNorm ( void   )  const

Returns the Euclidean Norm of the vector

template<class T, unsigned int NVectorDimension = 3>
static unsigned int itk::CovariantVector< T, NVectorDimension >::GetNumberOfComponents (  )  [inline, static]

Returns the number of components in this vector type

Definition at line 214 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
RealValueType itk::CovariantVector< T, NVectorDimension >::GetSquaredNorm ( void   )  const

Returns vector's Squared Euclidean Norm

template<class T, unsigned int NVectorDimension = 3>
vnl_vector<T> itk::CovariantVector< T, NVectorDimension >::GetVnlVector ( void   )  const

Get a vnl_vector with a copy of the internal memory block.

template<class T, unsigned int NVectorDimension = 3>
vnl_vector_ref<T> itk::CovariantVector< T, NVectorDimension >::GetVnlVector ( void   ) 

Get a vnl_vector_ref referencing the same memory block.

itk::FixedArray< T , VLength >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
VLength   
) [inherited]

Dimension constant

itk::FixedArray< T , VLength >::itkStaticConstMacro ( Length  ,
unsigned  int,
VLength   
) [inherited]

Length constant

template<class T, unsigned int NVectorDimension = 3>
itk::CovariantVector< T, NVectorDimension >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
NVectorDimension   
)

Dimension of the Space

template<class T, unsigned int NVectorDimension = 3>
void itk::CovariantVector< T, NVectorDimension >::Normalize ( void   ) 

Divides the covariant vector componets by the norm

template<class T, unsigned int NVectorDimension = 3>
Self itk::CovariantVector< T, NVectorDimension >::operator * ( const ValueType val  )  const [inline]

Scalar operator*. Scale the elements of a vector by a scalar. Return a new vector.

Definition at line 186 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
ValueType itk::CovariantVector< T, NVectorDimension >::operator * ( const Vector< T, NVectorDimension > &  vec  )  const

operator*. Performs the scalar product with a vector (contravariant). This scalar product is invariant under affine transformations

template<class T, unsigned int NVectorDimension = 3>
ValueType itk::CovariantVector< T, NVectorDimension >::operator * ( const Self vec  )  const

CovariantVector operator*. Performs the inner product of two covariant vectors.

Warning:
This is equivalent to the scalar product only if the reference system has orthogonal axis and equal scales.

template<class T, unsigned int NVectorDimension = 3>
template<class Tt>
const Self& itk::CovariantVector< T, NVectorDimension >::operator *= ( const Tt &  value  )  [inline]

Scalar operator*=. Scales elements by a scalar.

Definition at line 137 of file itkCovariantVector.h.

bool itk::FixedArray< T , VLength >::operator!= ( const FixedArray< T, NVectorDimension > &  r  )  const [inline, inherited]

Definition at line 172 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
Self itk::CovariantVector< T, NVectorDimension >::operator+ ( const Self vec  )  const

CovariantVector addition. Add two vectors. Return a new vector.

template<class T, unsigned int NVectorDimension = 3>
const Self& itk::CovariantVector< T, NVectorDimension >::operator+= ( const Self vec  ) 

CovariantVector operator+=. Adds a vectors to the current vector.

template<class T, unsigned int NVectorDimension = 3>
Self itk::CovariantVector< T, NVectorDimension >::operator- ( const Self vec  )  const

CovariantVector subtraction. Subtract two vectors. Return a new vector.

template<class T, unsigned int NVectorDimension = 3>
Self itk::CovariantVector< T, NVectorDimension >::operator- (  )  const

CovariantVector negation. Negate all the elements of a vector. Return a new vector

template<class T, unsigned int NVectorDimension = 3>
const Self& itk::CovariantVector< T, NVectorDimension >::operator-= ( const Self vec  ) 

CovariantVector operator-=. Subtracts a vector from a current vector.

template<class T, unsigned int NVectorDimension = 3>
template<class Tt>
Self itk::CovariantVector< T, NVectorDimension >::operator/ ( const Tt &  val  )  const [inline]

Scalar operator/. Scale (divide) the elements of a vector by a scalar. Return a new vector.

Definition at line 199 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
template<class Tt>
const Self& itk::CovariantVector< T, NVectorDimension >::operator/= ( const Tt &  value  )  [inline]

Scalar operator/=. Scales (divides) elements by a scalar.

Definition at line 148 of file itkCovariantVector.h.

template<class T, unsigned int NVectorDimension = 3>
CovariantVector& itk::CovariantVector< T, NVectorDimension >::operator= ( const ValueType  r[NVectorDimension]  ) 

template<class T, unsigned int NVectorDimension = 3>
CovariantVector& itk::CovariantVector< T, NVectorDimension >::operator= ( const Self r  ) 

Pass-through assignment operator for the Array base class.

template<class T, unsigned int NVectorDimension = 3>
template<class Tt>
Self& itk::CovariantVector< T, NVectorDimension >::operator= ( const Tt &  v  )  [inline]

Assignment operator with implicit casting from another data type

Definition at line 124 of file itkCovariantVector.h.

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.

const_reference itk::FixedArray< T , VLength >::operator[] ( unsigned long  index  )  const [inline, inherited]

Definition at line 190 of file itkFixedArray.h.

reference itk::FixedArray< T , VLength >::operator[] ( unsigned long  index  )  [inline, inherited]

Definition at line 189 of file itkFixedArray.h.

const_reference itk::FixedArray< T , VLength >::operator[] ( long  index  )  const [inline, inherited]

Definition at line 188 of file itkFixedArray.h.

reference itk::FixedArray< T , VLength >::operator[] ( long  index  )  [inline, inherited]

Definition at line 187 of file itkFixedArray.h.

const_reference itk::FixedArray< T , VLength >::operator[] ( unsigned int  index  )  const [inline, inherited]

Definition at line 186 of file itkFixedArray.h.

reference itk::FixedArray< T , VLength >::operator[] ( unsigned int  index  )  [inline, inherited]

Definition at line 185 of file itkFixedArray.h.

const_reference itk::FixedArray< T , VLength >::operator[] ( int  index  )  const [inline, inherited]

Definition at line 184 of file itkFixedArray.h.

reference itk::FixedArray< T , VLength >::operator[] ( int  index  )  [inline, inherited]

Definition at line 183 of file itkFixedArray.h.

const_reference itk::FixedArray< T , VLength >::operator[] ( unsigned short  index  )  const [inline, inherited]

Definition at line 182 of file itkFixedArray.h.

reference itk::FixedArray< T , VLength >::operator[] ( unsigned short  index  )  [inline, inherited]

Definition at line 181 of file itkFixedArray.h.

const_reference itk::FixedArray< T , VLength >::operator[] ( short  index  )  const [inline, inherited]

Definition at line 180 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 179 of file itkFixedArray.h.

Referenced by itk::Vector< double, VDimension >::SetNthComponent().

ConstReverseIterator itk::FixedArray< T , VLength >::rBegin (  )  const [inherited]

ReverseIterator itk::FixedArray< T , VLength >::rBegin (  )  [inherited]

ConstReverseIterator itk::FixedArray< T , VLength >::rEnd (  )  const [inherited]

ReverseIterator itk::FixedArray< T , VLength >::rEnd (  )  [inherited]

template<class T, unsigned int NVectorDimension = 3>
void itk::CovariantVector< T, NVectorDimension >::Set_vnl_vector ( const vnl_vector< T > &   ) 

Set a vnl_vector_ref referencing the same memory block.

Deprecated:
Use SetVnlVector() instead.

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 194 of file itkFixedArray.h.

template<class T, unsigned int NVectorDimension = 3>
void itk::CovariantVector< 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]


The documentation for this class was generated from the following file:
Generated at Mon Mar 12 05:52:57 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000