ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkCovariantVector.h>
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.
Definition at line 67 of file itkCovariantVector.h.
Public Types | |
using | BaseArray = FixedArray< T, NVectorDimension > |
using | ComponentType = T |
using | CovariantVectorType = Self |
using | RealValueType = typename NumericTraits< ValueType >::RealType |
using | Self = CovariantVector |
using | Superclass = FixedArray< T, NVectorDimension > |
using | ValueType = T |
Public Types inherited from itk::FixedArray< T, NVectorDimension > | |
typedef ValueType | CArray [VLength] |
using | const_pointer = const ValueType * |
using | const_reference = const ValueType & |
using | ConstIterator = const ValueType * |
using | Iterator = ValueType * |
using | pointer = ValueType * |
using | reference = ValueType & |
using | SizeType = unsigned int |
using | ValueType = T |
Public Member Functions | |
CovariantVector (const ValueType &r) | |
RealValueType | GetNorm () const |
RealValueType | GetSquaredNorm () const |
vnl_vector_ref< T > | GetVnlVector () |
vnl_vector< T > | GetVnlVector () const |
RealValueType | Normalize () |
ValueType | operator* (const Self &vec) const |
ValueType | operator* (const Vector< T, NVectorDimension > &vec) const |
Self | operator* (const ValueType &val) 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) |
template<typename Tt > | |
Self | operator/ (const Tt &val) const |
CovariantVector & | operator= (const ValueType r[NVectorDimension]) |
void | SetVnlVector (const vnl_vector< T > &) |
CovariantVector ()=default | |
CovariantVector (const CovariantVector &)=default | |
CovariantVector (CovariantVector &&)=default | |
CovariantVector & | operator= (const CovariantVector &)=default |
CovariantVector & | operator= (CovariantVector &&)=default |
~CovariantVector ()=default | |
template<typename TVectorValueType > | |
CovariantVector (const CovariantVector< TVectorValueType, NVectorDimension > &r) | |
CovariantVector (const ValueType r[Dimension]) | |
template<typename TCovariantVectorValueType > | |
Self & | operator= (const CovariantVector< TCovariantVectorValueType, NVectorDimension > &r) |
template<typename Tt > | |
const Self & | operator*= (const Tt &value) |
template<typename Tt > | |
const Self & | operator/= (const Tt &value) |
template<typename TCoordRepB > | |
void | CastFrom (const CovariantVector< TCoordRepB, NVectorDimension > &pa) |
Public Member Functions inherited from itk::FixedArray< T, NVectorDimension > | |
Iterator | Begin () |
ConstIterator | Begin () const |
Iterator | End () |
ConstIterator | End () const |
void | Fill (const ValueType &) |
FixedArray (const TScalarValue *r) | |
ValueType * | GetDataPointer () |
const ValueType * | GetDataPointer () const |
bool | operator!= (const FixedArray &r) const |
FixedArray & | operator= (const ValueType r[VLength]) |
bool | operator== (const FixedArray &r) const |
ReverseIterator | rBegin () |
ConstReverseIterator | rBegin () const |
ReverseIterator | rEnd () |
ConstReverseIterator | rEnd () const |
SizeType | Size () const |
void | swap (FixedArray &other) |
FixedArray ()=default | |
FixedArray (const FixedArray &)=default | |
FixedArray (FixedArray &&)=default | |
FixedArray & | operator= (const FixedArray &)=default |
FixedArray & | operator= (FixedArray &&)=default |
~FixedArray ()=default | |
FixedArray (const ValueType r[VLength]) | |
FixedArray (const ValueType &) | |
FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r) | |
FixedArray & | operator= (const FixedArray< TFixedArrayValueType, VLength > &r) |
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 |
reference | operator[] (long long index) |
const_reference | operator[] (long long index) const |
reference | operator[] (unsigned long long index) |
const_reference | operator[] (unsigned long long index) const |
void | SetElement (unsigned short index, const_reference value) |
const_reference | GetElement (unsigned short index) const |
Static Public Member Functions | |
static unsigned int | GetCovariantVectorDimension () |
static unsigned int | GetNumberOfComponents () |
Static Public Member Functions inherited from itk::FixedArray< T, NVectorDimension > | |
static FixedArray | Filled (const ValueType &) |
Static Public Attributes | |
static constexpr unsigned int | Dimension = NVectorDimension |
Static Public Attributes inherited from itk::FixedArray< T, NVectorDimension > | |
static constexpr unsigned int | Dimension |
static constexpr unsigned int | Length |
using itk::CovariantVector< T, NVectorDimension >::BaseArray = FixedArray< T, NVectorDimension > |
The Array type from which this CovariantVector is derived.
Definition at line 89 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::ComponentType = T |
Component value type
Definition at line 80 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::CovariantVectorType = Self |
I am a covariant vector.
Definition at line 86 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::RealValueType = typename NumericTraits< ValueType >::RealType |
Definition at line 77 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::Self = CovariantVector |
Standard class type aliases.
Definition at line 71 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::Superclass = FixedArray< T, NVectorDimension > |
Definition at line 72 of file itkCovariantVector.h.
using itk::CovariantVector< T, NVectorDimension >::ValueType = T |
ValueType can be used to declare a variable that is the same type as a data element held in an CovariantVector.
Definition at line 76 of file itkCovariantVector.h.
|
default |
Default constructor.
|
default |
Default constructor.
|
default |
Default constructor.
|
default |
Default constructor.
|
explicit |
Constructor to initialize entire vector to one value.
|
inline |
Pass-through constructor for the Array base class. Implicit casting is performed to initialize constructor from any another one of datatype.
Definition at line 121 of file itkCovariantVector.h.
|
inline |
Pass-through constructor for the Array base class. Implicit casting is performed to initialize constructor from any another one of datatype.
Definition at line 123 of file itkCovariantVector.h.
|
inline |
Copy from another CovariantVector with a different representation type. Casting is done with C-Like rules
Definition at line 230 of file itkCovariantVector.h.
|
inlinestatic |
Get the dimension (size) of the vector.
Definition at line 92 of file itkCovariantVector.h.
RealValueType itk::CovariantVector< T, NVectorDimension >::GetNorm | ( | ) | const |
Returns the Euclidean Norm of the vector
|
inlinestatic |
Returns the number of components in this vector type
Definition at line 219 of file itkCovariantVector.h.
RealValueType itk::CovariantVector< T, NVectorDimension >::GetSquaredNorm | ( | ) | const |
Returns vector's Squared Euclidean Norm
vnl_vector_ref< T > itk::CovariantVector< T, NVectorDimension >::GetVnlVector | ( | ) |
Get a vnl_vector_ref referencing the same memory block.
vnl_vector< T > itk::CovariantVector< T, NVectorDimension >::GetVnlVector | ( | ) | const |
Get a vnl_vector with a copy of the internal memory block.
RealValueType itk::CovariantVector< T, NVectorDimension >::Normalize | ( | ) |
Divides the covariant vector componets by the norm and return the norm
ValueType itk::CovariantVector< T, NVectorDimension >::operator* | ( | const Self & | vec | ) | const |
CovariantVector operator*. Performs the inner product of two covariant vectors.
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
|
inline |
Scalar operator*. Scale the elements of a vector by a scalar. Return a new vector.
Definition at line 190 of file itkCovariantVector.h.
|
inline |
Scalar operator*=. Scales elements by a scalar.
Definition at line 140 of file itkCovariantVector.h.
Self itk::CovariantVector< T, NVectorDimension >::operator+ | ( | const Self & | vec | ) | const |
CovariantVector addition. Add two vectors. Return a new vector.
const Self& itk::CovariantVector< T, NVectorDimension >::operator+= | ( | const Self & | vec | ) |
CovariantVector operator+=. Adds a vectors to the current vector.
Self itk::CovariantVector< T, NVectorDimension >::operator- | ( | ) | const |
CovariantVector negation. Negate all the elements of a vector. Return a new vector
Self itk::CovariantVector< T, NVectorDimension >::operator- | ( | const Self & | vec | ) | const |
CovariantVector subtraction. Subtract two vectors. Return a new vector.
const Self& itk::CovariantVector< T, NVectorDimension >::operator-= | ( | const Self & | vec | ) |
CovariantVector operator-=. Subtracts a vector from a current vector.
|
inline |
Scalar operator/. Scale (divide) the elements of a vector by a scalar. Return a new vector.
Definition at line 204 of file itkCovariantVector.h.
|
inline |
Scalar operator/=. Scales (divides) elements by a scalar.
Definition at line 152 of file itkCovariantVector.h.
|
default |
Default constructor.
|
default |
Default constructor.
|
inline |
Assignment operator with implicit casting from another data type
Definition at line 128 of file itkCovariantVector.h.
CovariantVector& itk::CovariantVector< T, NVectorDimension >::operator= | ( | const ValueType | r[NVectorDimension] | ) |
Pass-through assignment operator for the Array base class.
void itk::CovariantVector< T, NVectorDimension >::SetVnlVector | ( | const vnl_vector< T > & | ) |
Set a vnl_vector_ref referencing the same memory block.
|
static |
Dimension of the Space
Definition at line 83 of file itkCovariantVector.h.